@@ -1,5 +1,5 | |||||
1 |
# |
|
1 | # RedMine - project management software | |
2 |
# Copyright (C) 2006-20 |
|
2 | # Copyright (C) 2006-2011 Jean-Philippe Lang | |
3 | # |
|
3 | # | |
4 | # FileSystem adapter |
|
4 | # FileSystem adapter | |
5 | # File written by Paul Rivier, at Demotera. |
|
5 | # File written by Paul Rivier, at Demotera. | |
@@ -8,12 +8,12 | |||||
8 | # modify it under the terms of the GNU General Public License |
|
8 | # modify it under the terms of the GNU General Public License | |
9 | # as published by the Free Software Foundation; either version 2 |
|
9 | # as published by the Free Software Foundation; either version 2 | |
10 | # of the License, or (at your option) any later version. |
|
10 | # of the License, or (at your option) any later version. | |
11 |
# |
|
11 | # | |
12 | # This program is distributed in the hope that it will be useful, |
|
12 | # This program is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | # GNU General Public License for more details. |
|
15 | # GNU General Public License for more details. | |
16 |
# |
|
16 | # | |
17 | # You should have received a copy of the GNU General Public License |
|
17 | # You should have received a copy of the GNU General Public License | |
18 | # along with this program; if not, write to the Free Software |
|
18 | # along with this program; if not, write to the Free Software | |
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
@@ -39,10 +39,10 module Redmine | |||||
39 | end |
|
39 | end | |
40 |
|
40 | |||
41 | def format_path_ends(path, leading=true, trailling=true) |
|
41 | def format_path_ends(path, leading=true, trailling=true) | |
42 |
path = leading ? with_leading_slash(path) : |
|
42 | path = leading ? with_leading_slash(path) : | |
43 | without_leading_slash(path) |
|
43 | without_leading_slash(path) | |
44 |
trailling ? with_trailling_slash(path) : |
|
44 | trailling ? with_trailling_slash(path) : | |
45 |
without_trailling_slash(path) |
|
45 | without_trailling_slash(path) | |
46 | end |
|
46 | end | |
47 |
|
47 | |||
48 | def info |
|
48 | def info | |
@@ -60,7 +60,7 module Redmine | |||||
60 | trgt = scm_iconv(@path_encoding, 'UTF-8', trgt_utf8) |
|
60 | trgt = scm_iconv(@path_encoding, 'UTF-8', trgt_utf8) | |
61 | Dir.new(trgt).each do |e1| |
|
61 | Dir.new(trgt).each do |e1| | |
62 | e_utf8 = scm_iconv('UTF-8', @path_encoding, e1) |
|
62 | e_utf8 = scm_iconv('UTF-8', @path_encoding, e1) | |
63 |
next if e_utf8.blank? |
|
63 | next if e_utf8.blank? | |
64 | relative_path_utf8 = format_path_ends( |
|
64 | relative_path_utf8 = format_path_ends( | |
65 | (format_path_ends(path,false,true) + e_utf8),false,false) |
|
65 | (format_path_ends(path,false,true) + e_utf8),false,false) | |
66 | t1_utf8 = target(relative_path_utf8) |
|
66 | t1_utf8 = target(relative_path_utf8) | |
@@ -78,7 +78,7 module Redmine | |||||
78 | :path => utf_8_path, |
|
78 | :path => utf_8_path, | |
79 | :kind => (File.directory?(t1) ? 'dir' : 'file'), |
|
79 | :kind => (File.directory?(t1) ? 'dir' : 'file'), | |
80 | :size => (File.directory?(t1) ? nil : [File.size(t1)].pack('l').unpack('L').first), |
|
80 | :size => (File.directory?(t1) ? nil : [File.size(t1)].pack('l').unpack('L').first), | |
81 |
:lastrev => |
|
81 | :lastrev => | |
82 | Revision.new({:time => (File.mtime(t1)) }) |
|
82 | Revision.new({:time => (File.mtime(t1)) }) | |
83 | }) |
|
83 | }) | |
84 | end |
|
84 | end |
General Comments 0
You need to be logged in to leave comments.
Login now