libpath-ruby 0.2.2 → 0.2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +33 -0
- data/README.md +25 -8
- data/examples/path_from_arg0.md +43 -43
- data/examples/path_from_arg0.rb +25 -23
- data/lib/libpath/constants/unix.rb +74 -74
- data/lib/libpath/constants/windows.rb +75 -75
- data/lib/libpath/constants.rb +20 -20
- data/lib/libpath/diagnostics/parameter_checking.rb +27 -26
- data/lib/libpath/diagnostics.rb +1 -1
- data/lib/libpath/exceptions/libpath_base_exception.rb +20 -21
- data/lib/libpath/exceptions/malformed_name_exception.rb +27 -27
- data/lib/libpath/exceptions.rb +1 -1
- data/lib/libpath/form/unix.rb +118 -118
- data/lib/libpath/form/windows.rb +228 -214
- data/lib/libpath/form.rb +20 -21
- data/lib/libpath/internal_/array.rb +57 -57
- data/lib/libpath/internal_/platform.rb +30 -31
- data/lib/libpath/internal_/string.rb +25 -20
- data/lib/libpath/internal_/unix/form.rb +124 -119
- data/lib/libpath/internal_/windows/drive.rb +80 -75
- data/lib/libpath/internal_/windows/form.rb +205 -194
- data/lib/libpath/libpath.rb +4 -1
- data/lib/libpath/path/unix.rb +120 -118
- data/lib/libpath/path/windows.rb +126 -124
- data/lib/libpath/path.rb +21 -21
- data/lib/libpath/util/unix.rb +261 -261
- data/lib/libpath/util/windows.rb +403 -403
- data/lib/libpath/util.rb +20 -20
- data/lib/libpath/version.rb +25 -26
- data/lib/libpath.rb +1 -1
- data/test/performance/benchmark_drive_letter.rb +50 -10
- data/test/performance/benchmark_gsub_string_or_regex.rb +27 -23
- data/test/performance/benchmark_rindex2.rb +56 -48
- data/test/performance/benchmark_split.rb +16 -10
- data/test/unit/compare/ts_all.rb +4 -4
- data/test/unit/equate/ts_all.rb +4 -4
- data/test/unit/equate/unix/ts_all.rb +4 -4
- data/test/unit/equate/windows/ts_all.rb +4 -4
- data/test/unit/exceptions/tc_libpath_base_exception.rb +10 -8
- data/test/unit/exceptions/tc_malformed_name_exception.rb +14 -12
- data/test/unit/exceptions/ts_all.rb +4 -4
- data/test/unit/form/tc_absolute_functions.rb +242 -240
- data/test/unit/form/ts_all.rb +4 -4
- data/test/unit/form/unix/tc_absolute_functions.rb +158 -155
- data/test/unit/form/unix/ts_all.rb +4 -4
- data/test/unit/form/windows/tc_absolute_functions.rb +628 -625
- data/test/unit/form/windows/ts_all.rb +4 -4
- data/test/unit/internal_/tc_array.rb +36 -32
- data/test/unit/internal_/ts_all.rb +4 -4
- data/test/unit/internal_/unix/form/tc_slash_functions.rb +38 -35
- data/test/unit/internal_/unix/form/ts_all.rb +4 -4
- data/test/unit/internal_/unix/tc_split_path.rb +387 -384
- data/test/unit/internal_/unix/ts_all.rb +4 -4
- data/test/unit/internal_/windows/form/tc_get_windows_volume.rb +157 -153
- data/test/unit/internal_/windows/form/tc_slash_functions.rb +39 -35
- data/test/unit/internal_/windows/form/ts_all.rb +4 -4
- data/test/unit/internal_/windows/tc_split_path.rb +874 -869
- data/test/unit/internal_/windows/ts_all.rb +4 -4
- data/test/unit/parse/ts_all.rb +4 -4
- data/test/unit/path/tc_path.rb +732 -732
- data/test/unit/path/ts_all.rb +4 -4
- data/test/unit/path/unix/tc_path.rb +544 -540
- data/test/unit/path/unix/ts_all.rb +4 -4
- data/test/unit/path/windows/tc_path.rb +608 -603
- data/test/unit/path/windows/ts_all.rb +4 -4
- data/test/unit/tc_version.rb +25 -22
- data/test/unit/ts_all.rb +4 -4
- data/test/unit/util/tc_combine_paths.rb +110 -105
- data/test/unit/util/tc_derive_relative_path.rb +8 -3
- data/test/unit/util/tc_make_path_canonical.rb +142 -138
- data/test/unit/util/ts_all.rb +4 -4
- data/test/unit/util/unix/tc_combine_paths.rb +38 -34
- data/test/unit/util/unix/tc_derive_relative_path.rb +80 -75
- data/test/unit/util/unix/tc_make_path_absolute.rb +74 -70
- data/test/unit/util/unix/tc_make_path_canonical.rb +95 -90
- data/test/unit/util/unix/ts_all.rb +4 -4
- data/test/unit/util/windows/tc_combine_paths.rb +82 -77
- data/test/unit/util/windows/tc_derive_relative_path.rb +98 -93
- data/test/unit/util/windows/tc_make_path_absolute.rb +105 -101
- data/test/unit/util/windows/tc_make_path_canonical.rb +158 -153
- data/test/unit/util/windows/ts_all.rb +4 -4
- metadata +9 -8
@@ -1,87 +1,92 @@
|
|
1
1
|
|
2
|
-
|
2
|
+
# :stopdoc:
|
3
|
+
|
4
|
+
|
5
|
+
module LibPath
|
3
6
|
# @!visibility private
|
4
7
|
module Internal_ # :nodoc: all
|
5
8
|
# @!visibility private
|
6
9
|
module Windows # :nodoc:
|
7
|
-
# @!visibility private
|
8
|
-
module Drive # :nodoc:
|
9
10
|
|
10
|
-
# @!visibility private
|
11
|
-
module
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
end
|
11
|
+
# @!visibility private
|
12
|
+
module Drive # :nodoc:
|
13
|
+
|
14
|
+
# @!visibility private
|
15
|
+
module Constants # :nodoc:
|
16
|
+
|
17
|
+
DRIVE_LETTERS = [
|
18
|
+
|
19
|
+
'C',
|
20
|
+
'D',
|
21
|
+
'E',
|
22
|
+
'F',
|
23
|
+
'G',
|
24
|
+
'H',
|
25
|
+
'I',
|
26
|
+
'J',
|
27
|
+
'K',
|
28
|
+
'L',
|
29
|
+
'M',
|
30
|
+
'N',
|
31
|
+
'P',
|
32
|
+
'Q',
|
33
|
+
'R',
|
34
|
+
'S',
|
35
|
+
'T',
|
36
|
+
'U',
|
37
|
+
'V',
|
38
|
+
'W',
|
39
|
+
'I',
|
40
|
+
'X',
|
41
|
+
'Y',
|
42
|
+
'Z',
|
43
|
+
|
44
|
+
'c',
|
45
|
+
'd',
|
46
|
+
'e',
|
47
|
+
'f',
|
48
|
+
'g',
|
49
|
+
'h',
|
50
|
+
'i',
|
51
|
+
'j',
|
52
|
+
'k',
|
53
|
+
'l',
|
54
|
+
'm',
|
55
|
+
'n',
|
56
|
+
'p',
|
57
|
+
'q',
|
58
|
+
'r',
|
59
|
+
's',
|
60
|
+
't',
|
61
|
+
'u',
|
62
|
+
'v',
|
63
|
+
'w',
|
64
|
+
'i',
|
65
|
+
'x',
|
66
|
+
'y',
|
67
|
+
'z',
|
68
|
+
|
69
|
+
'A',
|
70
|
+
'B',
|
71
|
+
|
72
|
+
'a',
|
73
|
+
'b',
|
74
|
+
]
|
75
|
+
end # module Constants
|
76
|
+
|
77
|
+
# @!visibility private
|
78
|
+
def self.character_is_drive_letter? ch # :nodoc:
|
79
|
+
|
80
|
+
::LibPath::Internal_::Windows::Drive::Constants::DRIVE_LETTERS.include? ch
|
81
|
+
end
|
82
|
+
end # module Drive
|
81
83
|
end # module Windows
|
82
84
|
end # module Internal_
|
83
85
|
end # module LibPath
|
84
86
|
|
85
|
-
# ############################## end of file ############################# #
|
86
87
|
|
88
|
+
# :startdoc:
|
89
|
+
|
90
|
+
|
91
|
+
# ############################## end of file ############################# #
|
87
92
|
|
@@ -1,286 +1,297 @@
|
|
1
1
|
|
2
|
+
# :stopdoc:
|
3
|
+
|
4
|
+
|
2
5
|
require 'libpath/internal_/string'
|
3
6
|
require 'libpath/internal_/windows/drive'
|
4
7
|
|
5
|
-
|
8
|
+
|
9
|
+
module LibPath
|
6
10
|
# @!visibility private
|
7
11
|
module Internal_ # :nodoc: all
|
8
12
|
# @!visibility private
|
9
13
|
module Windows # :nodoc:
|
10
14
|
|
11
|
-
# @!visibility private
|
12
|
-
module Form # :nodoc:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
# @!visibility private
|
16
|
+
module Form # :nodoc:
|
17
|
+
|
18
|
+
# [INTERNAL] This function is undocumented, and subject to change at any
|
19
|
+
# time
|
20
|
+
#
|
21
|
+
# @!visibility private
|
22
|
+
def self.char_is_path_name_separator? c # :nodoc:
|
23
|
+
|
24
|
+
'/' == c || '\\' == c
|
25
|
+
end
|
19
26
|
|
20
|
-
|
21
|
-
|
27
|
+
# [INTERNAL] This function is undocumented, and subject to change at any
|
28
|
+
# time
|
29
|
+
#
|
30
|
+
# @!visibility private
|
31
|
+
def self.append_trailing_slash s # :nodoc:
|
22
32
|
|
23
|
-
|
24
|
-
# time
|
25
|
-
#
|
26
|
-
# @!visibility private
|
27
|
-
def self.append_trailing_slash s # :nodoc:
|
33
|
+
return s if self.char_is_path_name_separator?(s[-1])
|
28
34
|
|
29
|
-
|
35
|
+
s + '\\'
|
36
|
+
end
|
30
37
|
|
31
|
-
|
32
|
-
|
38
|
+
# [INTERNAL] This function is undocumented, and subject to change at any
|
39
|
+
# time
|
40
|
+
#
|
41
|
+
# @!visibility private
|
42
|
+
def self.get_trailing_slash s # :nodoc:
|
33
43
|
|
34
|
-
|
35
|
-
# time
|
36
|
-
#
|
37
|
-
# @!visibility private
|
38
|
-
def self.get_trailing_slash s # :nodoc:
|
44
|
+
last = s[-1]
|
39
45
|
|
40
|
-
|
46
|
+
self.char_is_path_name_separator?(last) ? last : nil
|
47
|
+
end
|
41
48
|
|
42
|
-
|
43
|
-
|
49
|
+
# [INTERNAL] This function is undocumented, and subject to change at any
|
50
|
+
# time
|
51
|
+
#
|
52
|
+
# @!visibility private
|
53
|
+
def self.has_trailing_slash? s # :nodoc:
|
44
54
|
|
45
|
-
|
46
|
-
|
47
|
-
#
|
48
|
-
# @!visibility private
|
49
|
-
def self.has_trailing_slash? s # :nodoc:
|
55
|
+
self.char_is_path_name_separator?(s[-1])
|
56
|
+
end
|
50
57
|
|
51
|
-
|
52
|
-
|
58
|
+
# [INTERNAL] This function is undocumented, and subject to change at any
|
59
|
+
# time
|
60
|
+
#
|
61
|
+
# @!visibility private
|
62
|
+
def self.trim_trailing_slash s # :nodoc:
|
53
63
|
|
54
|
-
|
55
|
-
# time
|
56
|
-
#
|
57
|
-
# @!visibility private
|
58
|
-
def self.trim_trailing_slash s # :nodoc:
|
64
|
+
return s unless self.char_is_path_name_separator?(s[-1])
|
59
65
|
|
60
|
-
|
66
|
+
s.chop
|
67
|
+
end
|
61
68
|
|
62
|
-
|
63
|
-
|
69
|
+
# [INTERNAL] This function is undocumented, and subject to change at any
|
70
|
+
# time
|
71
|
+
#
|
72
|
+
# @!visibility private
|
73
|
+
def self.elide_redundant_path_name_separators s # :nodoc:
|
64
74
|
|
65
|
-
|
66
|
-
|
67
|
-
#
|
68
|
-
# @!visibility private
|
69
|
-
def self.elide_redundant_path_name_separators s # :nodoc:
|
75
|
+
s.gsub(/[\\\/]{2,}/, '\\')
|
76
|
+
end
|
70
77
|
|
71
|
-
|
72
|
-
|
78
|
+
# [INTERNAL] This function is undocumented, and subject to change at any
|
79
|
+
# time
|
80
|
+
#
|
81
|
+
# @!visibility private
|
82
|
+
def self.elide_redundant_path_name_separators! s # :nodoc:
|
73
83
|
|
74
|
-
|
75
|
-
# time
|
76
|
-
#
|
77
|
-
# @!visibility private
|
78
|
-
def self.elide_redundant_path_name_separators! s # :nodoc:
|
84
|
+
s.gsub!(/[\\\/]{2,}/, '\\')
|
79
85
|
|
80
|
-
|
86
|
+
s
|
87
|
+
end
|
81
88
|
|
82
|
-
|
83
|
-
|
89
|
+
# [INTERNAL] This function is undocumented, and subject to change at any
|
90
|
+
# time
|
91
|
+
#
|
92
|
+
# === Signature
|
93
|
+
#
|
94
|
+
# * *Parameters:*
|
95
|
+
# - +s+ (String)
|
96
|
+
#
|
97
|
+
# === Return
|
98
|
+
# A 3-element array, consisting of [ volume, remainder, form ]
|
99
|
+
#
|
100
|
+
# @!visibility private
|
101
|
+
def self.get_windows_volume s # :nodoc:
|
84
102
|
|
85
|
-
|
86
|
-
|
87
|
-
#
|
88
|
-
# === Signature
|
89
|
-
#
|
90
|
-
# * *Parameters:*
|
91
|
-
# - +s+ (String)
|
92
|
-
#
|
93
|
-
# === Return
|
94
|
-
# A 3-element array, consisting of [ volume, remainder, form ]
|
95
|
-
#
|
96
|
-
# @!visibility private
|
97
|
-
def self.get_windows_volume s # :nodoc:
|
103
|
+
_Drive = ::LibPath::Internal_::Windows::Drive
|
104
|
+
_Form = ::LibPath::Internal_::Windows::Form
|
98
105
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
+
# 0. not matched
|
107
|
+
# 1. X:
|
108
|
+
# 2. \\server\share
|
109
|
+
# 3. \\?\X:
|
110
|
+
# 4. \\?\server\share
|
111
|
+
# 5. \\?\UNC\server\share
|
112
|
+
# 6. \\.\device
|
106
113
|
|
107
|
-
|
114
|
+
if '\\' == s[0]
|
108
115
|
|
109
|
-
|
116
|
+
if '\\' == s[1]
|
110
117
|
|
111
|
-
|
112
|
-
|
118
|
+
case s[2]
|
119
|
+
when '?'
|
113
120
|
|
114
|
-
|
121
|
+
if '\\' == s[3]
|
115
122
|
|
116
|
-
|
123
|
+
if ':' == s[5] && _Drive.character_is_drive_letter?(s[4])
|
117
124
|
|
118
|
-
|
125
|
+
# 3. \\?\X:
|
119
126
|
|
120
|
-
|
121
|
-
|
127
|
+
return [ s[0..5], s[6..-1], :form_3 ]
|
128
|
+
end
|
122
129
|
|
123
|
-
|
130
|
+
if 'U' == s[4] && 'N' == s[5] && 'C' == s[6]
|
124
131
|
|
125
|
-
|
132
|
+
# 5. \\?\UNC\server\share
|
126
133
|
|
127
|
-
|
134
|
+
if s =~ /^\\\\\?\\UNC\\[^\\]+\\[^\\\/]+/
|
128
135
|
|
129
|
-
|
130
|
-
|
131
|
-
|
136
|
+
return [ $&, $', :form_5 ]
|
137
|
+
end
|
138
|
+
else
|
132
139
|
|
133
|
-
|
140
|
+
if s =~ /^\\\\\?\\[^\\]+\\[^\\\/]+/
|
134
141
|
|
135
|
-
|
142
|
+
# 4. \\?\server\share
|
136
143
|
|
137
|
-
|
138
|
-
|
139
|
-
|
144
|
+
return [ $&, $', :form_4 ]
|
145
|
+
end
|
146
|
+
end
|
140
147
|
|
141
|
-
|
142
|
-
|
143
|
-
|
148
|
+
return [ s, '', :malformed ]
|
149
|
+
end
|
150
|
+
when '.'
|
144
151
|
|
145
|
-
|
152
|
+
if s =~ /^\\\\\.\\[^\\]+/
|
146
153
|
|
147
|
-
|
154
|
+
# 6. \\.\device
|
148
155
|
|
149
|
-
|
150
|
-
|
151
|
-
|
156
|
+
return [ $&, $', :form_6 ]
|
157
|
+
end
|
158
|
+
else
|
152
159
|
|
153
|
-
|
160
|
+
if s =~ /^\\\\[^\\]+\\[^\\\/]+/
|
154
161
|
|
155
|
-
|
162
|
+
# 2. \\server\share
|
156
163
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
164
|
+
return [ $&, $', :form_2 ]
|
165
|
+
end
|
166
|
+
end
|
167
|
+
else
|
161
168
|
|
162
|
-
|
163
|
-
|
169
|
+
end
|
170
|
+
elsif ':' == s[1] && _Drive.character_is_drive_letter?(s[0])
|
164
171
|
|
165
|
-
|
172
|
+
# 1. X:
|
166
173
|
|
167
|
-
|
168
|
-
|
174
|
+
return [ s[0..1], s[2..-1], :form_1 ]
|
175
|
+
end
|
169
176
|
|
170
|
-
|
177
|
+
# 0. not matched
|
171
178
|
|
172
|
-
|
173
|
-
|
179
|
+
[ nil, s, :form_0 ]
|
180
|
+
end
|
174
181
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
182
|
+
# [INTERNAL] This function is undocumented, and subject to change at any
|
183
|
+
# time
|
184
|
+
#
|
185
|
+
# Returns tuple of:
|
186
|
+
#
|
187
|
+
# 0. source path (with redundant path name separators elided)
|
188
|
+
# 1. Windows volume (which is always nil)
|
189
|
+
# 2. Directory
|
190
|
+
# 3. Basename
|
191
|
+
# 4. Stem
|
192
|
+
# 5. Extension
|
193
|
+
# 6. Directory parts
|
194
|
+
# 7. Directory path parts
|
195
|
+
#
|
196
|
+
# @!visibility private
|
197
|
+
def self.split_path s # :nodoc:
|
191
198
|
|
192
|
-
|
193
|
-
f2_directory = nil
|
194
|
-
f3_basename = nil
|
195
|
-
f4_stem = nil
|
196
|
-
f5_extension = nil
|
197
|
-
f6_dir_parts = []
|
198
|
-
f7_all_parts = []
|
199
|
+
_String = ::LibPath::Internal_::String
|
199
200
|
|
200
|
-
|
201
|
+
f1_volume = nil
|
202
|
+
f2_directory = nil
|
203
|
+
f3_basename = nil
|
204
|
+
f4_stem = nil
|
205
|
+
f5_extension = nil
|
206
|
+
f6_dir_parts = []
|
207
|
+
f7_all_parts = []
|
201
208
|
|
202
|
-
|
209
|
+
f1_volume, rem, frm = self.get_windows_volume s
|
203
210
|
|
204
|
-
|
211
|
+
self.elide_redundant_path_name_separators! rem
|
205
212
|
|
206
|
-
|
213
|
+
f1_volume.define_singleton_method(:form) { frm } if f1_volume
|
207
214
|
|
208
|
-
|
209
|
-
end
|
215
|
+
if :malformed == frm
|
210
216
|
|
211
|
-
|
217
|
+
return [ s, f1_volume, nil, nil, nil, nil, [], [] ]
|
218
|
+
end
|
212
219
|
|
213
|
-
|
220
|
+
unless rem.empty?
|
214
221
|
|
215
|
-
|
222
|
+
ri_slash = _String.rindex2(rem, '/', '\\')
|
216
223
|
|
217
|
-
|
218
|
-
f3_basename = rem[(1 + ri_slash)..-1]
|
219
|
-
else
|
224
|
+
if ri_slash
|
220
225
|
|
221
|
-
|
222
|
-
|
223
|
-
|
226
|
+
f2_directory = rem[0..ri_slash]
|
227
|
+
f3_basename = rem[(1 + ri_slash)..-1]
|
228
|
+
else
|
224
229
|
|
225
|
-
|
226
|
-
|
230
|
+
f2_directory = nil
|
231
|
+
f3_basename = rem
|
232
|
+
end
|
227
233
|
|
228
|
-
|
229
|
-
|
230
|
-
else
|
234
|
+
case f3_basename
|
235
|
+
when '.', '..'
|
231
236
|
|
232
|
-
|
237
|
+
f4_stem = f3_basename
|
238
|
+
f5_extension = nil
|
239
|
+
else
|
233
240
|
|
234
|
-
|
241
|
+
ri_dot = f3_basename.rindex('.')
|
235
242
|
|
236
|
-
|
237
|
-
f5_extension = f3_basename[ri_dot..-1]
|
238
|
-
else
|
243
|
+
if ri_dot
|
239
244
|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
end
|
245
|
+
f4_stem = f3_basename[0...ri_dot]
|
246
|
+
f5_extension = f3_basename[ri_dot..-1]
|
247
|
+
else
|
244
248
|
|
245
|
-
|
246
|
-
|
249
|
+
f4_stem = f3_basename
|
250
|
+
f5_extension = nil
|
251
|
+
end
|
252
|
+
end
|
247
253
|
|
248
|
-
|
249
|
-
|
254
|
+
case f2_directory
|
255
|
+
when nil
|
250
256
|
|
251
|
-
|
252
|
-
|
257
|
+
;
|
258
|
+
when '\\', '/'
|
253
259
|
|
254
|
-
|
260
|
+
f6_dir_parts = [ f2_directory ]
|
261
|
+
else
|
255
262
|
|
256
|
-
|
263
|
+
parts = f2_directory.split(/([\\\/])/)
|
257
264
|
|
258
|
-
|
265
|
+
f6_dir_parts = []
|
259
266
|
|
260
|
-
|
261
|
-
end
|
262
|
-
end
|
267
|
+
(0...(parts.size / 2)).each do |ix|
|
263
268
|
|
264
|
-
|
269
|
+
f6_dir_parts << parts[2 * ix + 0] + parts[2 * ix + 1]
|
270
|
+
end
|
271
|
+
end
|
265
272
|
|
266
|
-
|
273
|
+
if f1_volume
|
267
274
|
|
268
|
-
|
269
|
-
else
|
275
|
+
f7_all_parts = f6_dir_parts.dup
|
270
276
|
|
271
|
-
|
272
|
-
|
273
|
-
end
|
277
|
+
f7_all_parts[0] = f1_volume + f7_all_parts[0].to_s
|
278
|
+
else
|
274
279
|
|
280
|
+
f7_all_parts = f6_dir_parts
|
281
|
+
end
|
282
|
+
end
|
275
283
|
|
276
|
-
[ "#{f1_volume}#{rem}", f1_volume, f2_directory, f3_basename, f4_stem, f5_extension, f6_dir_parts, f7_all_parts ].map { |v| ::String === v && v.empty? ? nil : v }
|
277
|
-
end
|
278
|
-
end # module Form
|
279
284
|
|
285
|
+
[ "#{f1_volume}#{rem}", f1_volume, f2_directory, f3_basename, f4_stem, f5_extension, f6_dir_parts, f7_all_parts ].map { |v| ::String === v && v.empty? ? nil : v }
|
286
|
+
end
|
287
|
+
end # module Form
|
280
288
|
end # module Windows
|
281
289
|
end # module Internal_
|
282
290
|
end # module LibPath
|
283
291
|
|
284
|
-
# ############################## end of file ############################# #
|
285
292
|
|
293
|
+
# :startdoc:
|
294
|
+
|
295
|
+
|
296
|
+
# ############################## end of file ############################# #
|
286
297
|
|