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
data/lib/libpath/form/windows.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
|
2
2
|
# ######################################################################## #
|
3
|
-
# File:
|
3
|
+
# File: libpath/form/windows.rb
|
4
4
|
#
|
5
|
-
# Purpose:
|
5
|
+
# Purpose: LibPath::Form::Windows module
|
6
6
|
#
|
7
|
-
# Created:
|
8
|
-
# Updated:
|
7
|
+
# Created: 8th January 2019
|
8
|
+
# Updated: 7th April 2024
|
9
9
|
#
|
10
|
-
# Home:
|
10
|
+
# Home: http://github.com/synesissoftware/libpath.Ruby
|
11
11
|
#
|
12
|
-
# Author:
|
12
|
+
# Author: Matthew Wilson
|
13
13
|
#
|
14
|
+
# Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
|
14
15
|
# Copyright (c) 2019, Matthew Wilson and Synesis Software
|
15
16
|
# All rights reserved.
|
16
17
|
#
|
@@ -44,7 +45,6 @@
|
|
44
45
|
# ######################################################################## #
|
45
46
|
|
46
47
|
|
47
|
-
|
48
48
|
=begin
|
49
49
|
=end
|
50
50
|
|
@@ -53,306 +53,320 @@ require 'libpath/diagnostics'
|
|
53
53
|
require 'libpath/internal_/windows/drive'
|
54
54
|
require 'libpath/internal_/windows/form'
|
55
55
|
|
56
|
-
module LibPath # :nodoc:
|
57
|
-
module Form # :nodoc:
|
58
|
-
module Windows # :nodoc:
|
59
56
|
|
60
|
-
|
61
|
-
|
62
|
-
module
|
57
|
+
module LibPath
|
58
|
+
module Form
|
59
|
+
module Windows
|
60
|
+
|
61
|
+
# Module defining instance functions that will be included and extended into
|
62
|
+
# any class or module including/extending module LibPath::Form::Windows
|
63
|
+
module LibPath_Form_Windows_Methods
|
64
|
+
|
65
|
+
# Classifies a path
|
66
|
+
#
|
67
|
+
# === Return
|
68
|
+
#
|
69
|
+
# One of +:absolute+, +:drived+, +:homed+, +:relative+, +:rooted+, for
|
70
|
+
# any paths that match precisely those classifications, or +nil+ if the
|
71
|
+
# path is empty
|
72
|
+
def classify_path path
|
73
|
+
|
74
|
+
_Form = Internal_::Windows::Form
|
75
|
+
|
76
|
+
Diagnostics.check_string_parameter(path, "path") if $DEBUG
|
63
77
|
|
64
|
-
|
65
|
-
#
|
66
|
-
# === Return
|
67
|
-
#
|
68
|
-
# One of +:absolute+, +:drived+, +:homed+, +:relative+, +:rooted+, for
|
69
|
-
# any paths that match precisely those classifications, or +nil+ if the
|
70
|
-
# path is empty
|
71
|
-
def classify_path path
|
78
|
+
return nil if path.nil? || path.empty?
|
72
79
|
|
73
|
-
|
80
|
+
return :homed if path_is_homed? path
|
74
81
|
|
75
|
-
|
82
|
+
vol, rem, _ = _Form.get_windows_volume(path)
|
76
83
|
|
77
|
-
|
84
|
+
rooted = _Form.char_is_path_name_separator? rem[0]
|
78
85
|
|
79
|
-
|
86
|
+
if rooted
|
80
87
|
|
81
|
-
|
88
|
+
if vol
|
82
89
|
|
83
|
-
|
90
|
+
return :absolute
|
91
|
+
else
|
84
92
|
|
85
|
-
|
93
|
+
return :rooted
|
94
|
+
end
|
95
|
+
else
|
86
96
|
|
87
|
-
|
88
|
-
else
|
97
|
+
if vol
|
89
98
|
|
90
|
-
|
91
|
-
|
92
|
-
else
|
99
|
+
return :drived
|
100
|
+
else
|
93
101
|
|
94
|
-
|
102
|
+
return :relative
|
103
|
+
end
|
104
|
+
end
|
95
105
|
|
96
|
-
|
97
|
-
else
|
106
|
+
end
|
98
107
|
|
99
|
-
|
100
|
-
|
101
|
-
|
108
|
+
# Evaluates whether the given name is malformed, according to the given
|
109
|
+
# options.
|
110
|
+
#
|
111
|
+
# If no options are specified, the only invalid character(s) are: +'\0'+
|
112
|
+
#
|
113
|
+
# === Signature
|
114
|
+
#
|
115
|
+
# * *Options:*
|
116
|
+
# - +:reject_path_name_separators+:: (boolean) Reject the path
|
117
|
+
# separator character(s): +'\\'+ and +'/'+
|
118
|
+
# - +:reject_path_separators+:: (boolean) Reject the path separator
|
119
|
+
# character(s): +';'+
|
120
|
+
# - +:reject_shell_characters+:: (boolean) Reject the shell
|
121
|
+
# character(s): +'*'+, +'?'+, +'|'+
|
122
|
+
def name_is_malformed? name, **options
|
102
123
|
|
103
|
-
|
124
|
+
_Constants = ::LibPath::Constants::Windows
|
104
125
|
|
105
|
-
|
106
|
-
# options.
|
107
|
-
#
|
108
|
-
# If no options are specified, the only invalid character(s) are: +'\0'+
|
109
|
-
#
|
110
|
-
# === Signature
|
111
|
-
#
|
112
|
-
# * *Options:*
|
113
|
-
# - +:reject_path_name_separators+:: (boolean) Reject the path
|
114
|
-
# separator character(s): +'\\'+ and +'/'+
|
115
|
-
# - +:reject_path_separators+:: (boolean) Reject the path separator
|
116
|
-
# character(s): +';'+
|
117
|
-
# - +:reject_shell_characters+:: (boolean) Reject the shell
|
118
|
-
# character(s): +'*'+, +'?'+, +'|'+
|
119
|
-
def name_is_malformed? name, **options
|
126
|
+
if name
|
120
127
|
|
121
|
-
|
128
|
+
if options[:reject_shell_characters]
|
122
129
|
|
123
|
-
|
130
|
+
return true if name =~ _Constants::InvalidCharacters::Shell::RE
|
131
|
+
end
|
124
132
|
|
125
|
-
|
133
|
+
if options[:reject_path_separators]
|
126
134
|
|
127
|
-
|
128
|
-
|
135
|
+
return true if name =~ _Constants::InvalidCharacters::PathSeparators::RE
|
136
|
+
end
|
129
137
|
|
130
|
-
|
138
|
+
if options[:reject_path_name_separators]
|
131
139
|
|
132
|
-
|
133
|
-
|
140
|
+
return true if name =~ _Constants::InvalidCharacters::PathNameSeparators::RE
|
141
|
+
end
|
134
142
|
|
135
|
-
|
143
|
+
return true if name =~ _Constants::InvalidCharacters::Innate::RE
|
136
144
|
|
137
|
-
|
138
|
-
end
|
145
|
+
if '\\' == name[0] && '\\' == name[1]
|
139
146
|
|
140
|
-
|
147
|
+
return true if name !~ /^\\\\[^\\]+\\[^\\]+/
|
148
|
+
end
|
141
149
|
|
142
|
-
|
150
|
+
false
|
151
|
+
else
|
143
152
|
|
144
|
-
|
145
|
-
|
153
|
+
true
|
154
|
+
end
|
155
|
+
end
|
146
156
|
|
147
|
-
|
148
|
-
|
157
|
+
# Evaluates whether the given path is absolute, which means it is either
|
158
|
+
# rooted (begins with '/') or is homed (is '~' or begins with '~/')
|
159
|
+
#
|
160
|
+
# === Signature
|
161
|
+
#
|
162
|
+
# * *Parameters:*
|
163
|
+
# - +path+:: (String) The path to be evaluated. May not be +nil+
|
164
|
+
def path_is_absolute? path
|
149
165
|
|
150
|
-
|
151
|
-
end
|
152
|
-
end
|
166
|
+
_Form = Internal_::Windows::Form
|
153
167
|
|
154
|
-
|
155
|
-
# rooted (begins with '/') or is homed (is '~' or begins with '~/')
|
156
|
-
#
|
157
|
-
# === Signature
|
158
|
-
#
|
159
|
-
# * *Parameters:*
|
160
|
-
# - +path+:: (String) The path to be evaluated. May not be +nil+
|
161
|
-
def path_is_absolute? path
|
168
|
+
Diagnostics.check_string_parameter(path, "path") if $DEBUG
|
162
169
|
|
163
|
-
|
170
|
+
return true if path_is_homed? path
|
164
171
|
|
165
|
-
|
172
|
+
vol, rem, _ = _Form.get_windows_volume(path)
|
166
173
|
|
167
|
-
|
174
|
+
return false unless vol
|
175
|
+
return false unless rem
|
168
176
|
|
169
|
-
|
170
|
-
|
177
|
+
_Form.char_is_path_name_separator? rem[0]
|
178
|
+
end
|
171
179
|
|
172
|
-
|
173
|
-
|
180
|
+
# Evaluates whether the given path is "letter drived", which means that
|
181
|
+
# it contains a drive specification. Given the two letter sequence 'X:'
|
182
|
+
# representing any ASCII letter (a-zA-Z) and a colon, this function
|
183
|
+
# recognises six sequences: +'X:'+, +'X:\'+, +'X:/'+, +'\\?\X:'+,
|
184
|
+
# +'\\?\X:\'+, +'\\?\X:/'+
|
185
|
+
#
|
186
|
+
# === Return
|
187
|
+
# - +nil+:: if it is not "drived";
|
188
|
+
# - 2:: it begins with the form +'X:'+
|
189
|
+
# - 3:: it begins with the form +'X:\'+ or +'X:/'+
|
190
|
+
# - 6:: it begins with the form +'\\?\X:'+
|
191
|
+
# - 7:: it begins with the form +'\\?\X:\'+ or +'\\?\X:/'+
|
192
|
+
def path_is_letter_drived? path
|
174
193
|
|
175
|
-
|
176
|
-
|
177
|
-
# representing any ASCII letter (a-zA-Z) and a colon, this function
|
178
|
-
# recognises six sequences: +'X:'+, +'X:\'+, +'X:/'+, +'\\?\X:'+,
|
179
|
-
# +'\\?\X:\'+, +'\\?\X:/'+
|
180
|
-
#
|
181
|
-
# === Return
|
182
|
-
# - +nil+:: if it is not "drived";
|
183
|
-
# - 2:: it begins with the form +'X:'+
|
184
|
-
# - 3:: it begins with the form +'X:\'+ or +'X:/'+
|
185
|
-
# - 6:: it begins with the form +'\\?\X:'+
|
186
|
-
# - 7:: it begins with the form +'\\?\X:\'+ or +'\\?\X:/'+
|
187
|
-
def path_is_letter_drived? path
|
194
|
+
_Drive = Internal_::Windows::Drive
|
195
|
+
_Form = Internal_::Windows::Form
|
188
196
|
|
189
|
-
|
197
|
+
Diagnostics.check_string_parameter(path, "path") if $DEBUG
|
190
198
|
|
191
|
-
|
199
|
+
if path.size >= 2
|
192
200
|
|
193
|
-
|
201
|
+
base_index = 0
|
194
202
|
|
195
|
-
|
203
|
+
if '\\' == path[0]
|
196
204
|
|
197
|
-
|
205
|
+
if '\\' == path[1]
|
198
206
|
|
199
|
-
|
207
|
+
if '?' == path[2]
|
200
208
|
|
201
|
-
|
209
|
+
if '\\' == path[3]
|
202
210
|
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
211
|
+
base_index = 4
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
208
216
|
|
209
|
-
|
217
|
+
if ':' == path[base_index + 1]
|
210
218
|
|
211
|
-
|
219
|
+
if _Drive.character_is_drive_letter? path[base_index + 0]
|
212
220
|
|
213
|
-
|
221
|
+
if _Form.char_is_path_name_separator? path[base_index + 2]
|
214
222
|
|
215
|
-
|
216
|
-
|
223
|
+
return 4 == base_index ? 7 : 3
|
224
|
+
else
|
217
225
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
226
|
+
return 4 == base_index ? 6 : 2
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
223
231
|
|
224
|
-
|
225
|
-
|
232
|
+
nil
|
233
|
+
end
|
226
234
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
+
# Evaluates whether the given path is homed, which means it is '~' or
|
236
|
+
# begins with '~/' or '~\'
|
237
|
+
#
|
238
|
+
# === Signature
|
239
|
+
#
|
240
|
+
# * *Parameters:*
|
241
|
+
# - +path+:: (String) The path to be evaluated. May not be +nil+
|
242
|
+
def path_is_homed? path
|
235
243
|
|
236
|
-
|
244
|
+
_Form = Internal_::Windows::Form
|
237
245
|
|
238
|
-
|
246
|
+
Diagnostics.check_string_parameter(path, "path") if $DEBUG
|
239
247
|
|
240
|
-
|
248
|
+
return false unless '~' == path[0]
|
241
249
|
|
242
|
-
|
243
|
-
end
|
250
|
+
if path.size > 1
|
244
251
|
|
245
|
-
|
246
|
-
|
252
|
+
return _Form.char_is_path_name_separator? path[1]
|
253
|
+
end
|
247
254
|
|
248
|
-
|
249
|
-
|
250
|
-
#
|
251
|
-
# === Signature
|
252
|
-
#
|
253
|
-
# * *Parameters:*
|
254
|
-
# - +path+:: (String) The path to be evaluated. May not be +nil+
|
255
|
-
def path_is_rooted? path
|
255
|
+
true
|
256
|
+
end
|
256
257
|
|
257
|
-
|
258
|
+
# Evalutes whether the given path is rooted, which means it begins with
|
259
|
+
# '/'
|
260
|
+
#
|
261
|
+
# === Signature
|
262
|
+
#
|
263
|
+
# * *Parameters:*
|
264
|
+
# - +path+:: (String) The path to be evaluated. May not be +nil+
|
265
|
+
def path_is_rooted? path
|
258
266
|
|
259
|
-
|
260
|
-
|
267
|
+
_Drive = Internal_::Windows::Drive
|
268
|
+
_Form = Internal_::Windows::Form
|
261
269
|
|
262
|
-
|
263
|
-
when '\\'
|
270
|
+
Diagnostics.check_string_parameter(path, "path") if $DEBUG
|
264
271
|
|
265
|
-
|
266
|
-
|
272
|
+
case path[0]
|
273
|
+
when '/'
|
267
274
|
|
268
|
-
|
275
|
+
true
|
276
|
+
when '\\'
|
269
277
|
|
270
|
-
|
278
|
+
case path[1]
|
279
|
+
when '\\'
|
271
280
|
|
272
|
-
|
281
|
+
vol, rem, _ = _Form.get_windows_volume(path)
|
273
282
|
|
274
|
-
|
275
|
-
else
|
283
|
+
return false unless vol
|
276
284
|
|
277
|
-
|
278
|
-
end
|
279
|
-
else
|
285
|
+
if rem && _Form.char_is_path_name_separator?(rem[0])
|
280
286
|
|
281
|
-
|
282
|
-
|
283
|
-
else
|
287
|
+
true
|
288
|
+
else
|
284
289
|
|
285
|
-
|
290
|
+
false
|
291
|
+
end
|
292
|
+
else
|
286
293
|
|
287
|
-
|
294
|
+
true
|
295
|
+
end
|
296
|
+
else
|
288
297
|
|
289
|
-
|
298
|
+
if path.size > 2
|
290
299
|
|
291
|
-
|
292
|
-
end
|
293
|
-
end
|
294
|
-
end
|
300
|
+
if ':' == path[1]
|
295
301
|
|
296
|
-
|
297
|
-
end
|
298
|
-
end
|
302
|
+
if _Drive.character_is_drive_letter? path[0]
|
299
303
|
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
# * *Parameters:*
|
305
|
-
# - +path+:: (String) The path to be evaluated. May not be +nil+
|
306
|
-
def path_is_UNC? path
|
304
|
+
return _Form.char_is_path_name_separator? path[2]
|
305
|
+
end
|
306
|
+
end
|
307
|
+
end
|
307
308
|
|
308
|
-
|
309
|
+
false
|
310
|
+
end
|
311
|
+
end
|
309
312
|
|
310
|
-
|
311
|
-
|
313
|
+
# Evalutes whether the given path is UNC
|
314
|
+
#
|
315
|
+
# === Signature
|
316
|
+
#
|
317
|
+
# * *Parameters:*
|
318
|
+
# - +path+:: (String) The path to be evaluated. May not be +nil+
|
319
|
+
def path_is_UNC? path
|
312
320
|
|
313
|
-
|
321
|
+
_Form = Internal_::Windows::Form
|
314
322
|
|
315
|
-
|
316
|
-
when :form_2, :form_3, :form_4, :form_5, :form_6
|
323
|
+
Diagnostics.check_string_parameter(path, "path") if $DEBUG
|
317
324
|
|
318
|
-
|
319
|
-
|
325
|
+
return false unless '\\' == path[0]
|
326
|
+
return false unless '\\' == path[1]
|
320
327
|
|
321
|
-
|
322
|
-
end
|
323
|
-
end
|
328
|
+
_, _, frm = _Form.get_windows_volume(path)
|
324
329
|
|
325
|
-
|
330
|
+
case frm
|
331
|
+
when :form_2, :form_3, :form_4, :form_5, :form_6
|
326
332
|
|
327
|
-
|
328
|
-
|
333
|
+
true
|
334
|
+
else
|
329
335
|
|
330
|
-
|
336
|
+
false
|
337
|
+
end
|
338
|
+
end
|
339
|
+
end # module LibPath_Form_Windows_Methods
|
331
340
|
|
332
|
-
|
333
|
-
|
341
|
+
# @!visibility private
|
342
|
+
def self.extended receiver # :nodoc:
|
334
343
|
|
335
|
-
|
336
|
-
end
|
344
|
+
receiver.class_eval do
|
337
345
|
|
338
|
-
|
339
|
-
|
346
|
+
extend LibPath_Form_Windows_Methods
|
347
|
+
end
|
340
348
|
|
341
|
-
|
349
|
+
$stderr.puts "#{receiver} extended by #{LibPath_Form_Windows_Methods}" if $DEBUG
|
350
|
+
end
|
342
351
|
|
343
|
-
|
344
|
-
|
352
|
+
# @!visibility private
|
353
|
+
def self.included receiver # :nodoc:
|
345
354
|
|
346
|
-
|
347
|
-
end
|
355
|
+
receiver.class_eval do
|
348
356
|
|
349
|
-
|
350
|
-
|
357
|
+
include LibPath_Form_Windows_Methods
|
358
|
+
end
|
359
|
+
|
360
|
+
$stderr.puts "#{receiver} included #{LibPath_Form_Windows_Methods}" if $DEBUG
|
361
|
+
end
|
362
|
+
|
363
|
+
extend LibPath_Form_Windows_Methods
|
364
|
+
include LibPath_Form_Windows_Methods
|
351
365
|
|
352
366
|
end # module Windows
|
353
367
|
end # module Form
|
354
368
|
end # module LibPath
|
355
369
|
|
356
|
-
# ############################## end of file ############################# #
|
357
370
|
|
371
|
+
# ############################## end of file ############################# #
|
358
372
|
|
data/lib/libpath/form.rb
CHANGED
@@ -3,40 +3,39 @@ require 'libpath/internal_/platform'
|
|
3
3
|
|
4
4
|
if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
|
5
5
|
|
6
|
-
|
6
|
+
require 'libpath/form/windows'
|
7
7
|
else
|
8
8
|
|
9
|
-
|
9
|
+
require 'libpath/form/unix'
|
10
10
|
end
|
11
11
|
|
12
|
-
module LibPath
|
13
|
-
module Form
|
12
|
+
module LibPath
|
13
|
+
module Form
|
14
14
|
|
15
|
-
|
15
|
+
if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
extend ::LibPath::Form::Windows
|
18
|
+
include ::LibPath::Form::Windows
|
19
|
+
else
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
extend ::LibPath::Form::Unix
|
22
|
+
include ::LibPath::Form::Unix
|
23
|
+
end
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
# @!visibility private
|
26
|
+
def self.extended receiver # :nodoc:
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
$stderr.puts "#{receiver} extended by #{self}" if $DEBUG
|
29
|
+
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
$stderr.puts "#{receiver} included #{self}" if $DEBUG
|
35
|
-
end
|
31
|
+
# @!visibility private
|
32
|
+
def self.included receiver # :nodoc:
|
36
33
|
|
34
|
+
$stderr.puts "#{receiver} included #{self}" if $DEBUG
|
35
|
+
end
|
37
36
|
end # module Form
|
38
37
|
end # module LibPath
|
39
38
|
|
40
|
-
# ############################## end of file ############################# #
|
41
39
|
|
40
|
+
# ############################## end of file ############################# #
|
42
41
|
|