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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +33 -0
  3. data/README.md +25 -8
  4. data/examples/path_from_arg0.md +43 -43
  5. data/examples/path_from_arg0.rb +25 -23
  6. data/lib/libpath/constants/unix.rb +74 -74
  7. data/lib/libpath/constants/windows.rb +75 -75
  8. data/lib/libpath/constants.rb +20 -20
  9. data/lib/libpath/diagnostics/parameter_checking.rb +27 -26
  10. data/lib/libpath/diagnostics.rb +1 -1
  11. data/lib/libpath/exceptions/libpath_base_exception.rb +20 -21
  12. data/lib/libpath/exceptions/malformed_name_exception.rb +27 -27
  13. data/lib/libpath/exceptions.rb +1 -1
  14. data/lib/libpath/form/unix.rb +118 -118
  15. data/lib/libpath/form/windows.rb +228 -214
  16. data/lib/libpath/form.rb +20 -21
  17. data/lib/libpath/internal_/array.rb +57 -57
  18. data/lib/libpath/internal_/platform.rb +30 -31
  19. data/lib/libpath/internal_/string.rb +25 -20
  20. data/lib/libpath/internal_/unix/form.rb +124 -119
  21. data/lib/libpath/internal_/windows/drive.rb +80 -75
  22. data/lib/libpath/internal_/windows/form.rb +205 -194
  23. data/lib/libpath/libpath.rb +4 -1
  24. data/lib/libpath/path/unix.rb +120 -118
  25. data/lib/libpath/path/windows.rb +126 -124
  26. data/lib/libpath/path.rb +21 -21
  27. data/lib/libpath/util/unix.rb +261 -261
  28. data/lib/libpath/util/windows.rb +403 -403
  29. data/lib/libpath/util.rb +20 -20
  30. data/lib/libpath/version.rb +25 -26
  31. data/lib/libpath.rb +1 -1
  32. data/test/performance/benchmark_drive_letter.rb +50 -10
  33. data/test/performance/benchmark_gsub_string_or_regex.rb +27 -23
  34. data/test/performance/benchmark_rindex2.rb +56 -48
  35. data/test/performance/benchmark_split.rb +16 -10
  36. data/test/unit/compare/ts_all.rb +4 -4
  37. data/test/unit/equate/ts_all.rb +4 -4
  38. data/test/unit/equate/unix/ts_all.rb +4 -4
  39. data/test/unit/equate/windows/ts_all.rb +4 -4
  40. data/test/unit/exceptions/tc_libpath_base_exception.rb +10 -8
  41. data/test/unit/exceptions/tc_malformed_name_exception.rb +14 -12
  42. data/test/unit/exceptions/ts_all.rb +4 -4
  43. data/test/unit/form/tc_absolute_functions.rb +242 -240
  44. data/test/unit/form/ts_all.rb +4 -4
  45. data/test/unit/form/unix/tc_absolute_functions.rb +158 -155
  46. data/test/unit/form/unix/ts_all.rb +4 -4
  47. data/test/unit/form/windows/tc_absolute_functions.rb +628 -625
  48. data/test/unit/form/windows/ts_all.rb +4 -4
  49. data/test/unit/internal_/tc_array.rb +36 -32
  50. data/test/unit/internal_/ts_all.rb +4 -4
  51. data/test/unit/internal_/unix/form/tc_slash_functions.rb +38 -35
  52. data/test/unit/internal_/unix/form/ts_all.rb +4 -4
  53. data/test/unit/internal_/unix/tc_split_path.rb +387 -384
  54. data/test/unit/internal_/unix/ts_all.rb +4 -4
  55. data/test/unit/internal_/windows/form/tc_get_windows_volume.rb +157 -153
  56. data/test/unit/internal_/windows/form/tc_slash_functions.rb +39 -35
  57. data/test/unit/internal_/windows/form/ts_all.rb +4 -4
  58. data/test/unit/internal_/windows/tc_split_path.rb +874 -869
  59. data/test/unit/internal_/windows/ts_all.rb +4 -4
  60. data/test/unit/parse/ts_all.rb +4 -4
  61. data/test/unit/path/tc_path.rb +732 -732
  62. data/test/unit/path/ts_all.rb +4 -4
  63. data/test/unit/path/unix/tc_path.rb +544 -540
  64. data/test/unit/path/unix/ts_all.rb +4 -4
  65. data/test/unit/path/windows/tc_path.rb +608 -603
  66. data/test/unit/path/windows/ts_all.rb +4 -4
  67. data/test/unit/tc_version.rb +25 -22
  68. data/test/unit/ts_all.rb +4 -4
  69. data/test/unit/util/tc_combine_paths.rb +110 -105
  70. data/test/unit/util/tc_derive_relative_path.rb +8 -3
  71. data/test/unit/util/tc_make_path_canonical.rb +142 -138
  72. data/test/unit/util/ts_all.rb +4 -4
  73. data/test/unit/util/unix/tc_combine_paths.rb +38 -34
  74. data/test/unit/util/unix/tc_derive_relative_path.rb +80 -75
  75. data/test/unit/util/unix/tc_make_path_absolute.rb +74 -70
  76. data/test/unit/util/unix/tc_make_path_canonical.rb +95 -90
  77. data/test/unit/util/unix/ts_all.rb +4 -4
  78. data/test/unit/util/windows/tc_combine_paths.rb +82 -77
  79. data/test/unit/util/windows/tc_derive_relative_path.rb +98 -93
  80. data/test/unit/util/windows/tc_make_path_absolute.rb +105 -101
  81. data/test/unit/util/windows/tc_make_path_canonical.rb +158 -153
  82. data/test/unit/util/windows/ts_all.rb +4 -4
  83. metadata +9 -8
@@ -1,16 +1,17 @@
1
1
 
2
2
  # ######################################################################## #
3
- # File: libpath/form/windows.rb
3
+ # File: libpath/form/windows.rb
4
4
  #
5
- # Purpose: LibPath::Form::Windows module
5
+ # Purpose: LibPath::Form::Windows module
6
6
  #
7
- # Created: 8th January 2019
8
- # Updated: 16th April 2019
7
+ # Created: 8th January 2019
8
+ # Updated: 7th April 2024
9
9
  #
10
- # Home: http://github.com/synesissoftware/libpath.Ruby
10
+ # Home: http://github.com/synesissoftware/libpath.Ruby
11
11
  #
12
- # Author: Matthew Wilson
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
- # Module defining instance functions that will be included and extended into
61
- # any class or module including/extending module LibPath::Form::Windows
62
- module LibPath_Form_Windows_Methods
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
- # Classifies a path
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
- Diagnostics.check_string_parameter(path, "path") if $DEBUG
80
+ return :homed if path_is_homed? path
74
81
 
75
- return nil if path.nil? || path.empty?
82
+ vol, rem, _ = _Form.get_windows_volume(path)
76
83
 
77
- return :homed if path_is_homed? path
84
+ rooted = _Form.char_is_path_name_separator? rem[0]
78
85
 
79
- vol, rem, _ = Internal_::Windows::Form.get_windows_volume(path)
86
+ if rooted
80
87
 
81
- rooted = Internal_::Windows::Form.char_is_path_name_separator? rem[0]
88
+ if vol
82
89
 
83
- if rooted
90
+ return :absolute
91
+ else
84
92
 
85
- if vol
93
+ return :rooted
94
+ end
95
+ else
86
96
 
87
- return :absolute
88
- else
97
+ if vol
89
98
 
90
- return :rooted
91
- end
92
- else
99
+ return :drived
100
+ else
93
101
 
94
- if vol
102
+ return :relative
103
+ end
104
+ end
95
105
 
96
- return :drived
97
- else
106
+ end
98
107
 
99
- return :relative
100
- end
101
- end
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
- end
124
+ _Constants = ::LibPath::Constants::Windows
104
125
 
105
- # Evaluates whether the given name is malformed, according to the given
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
- _Constants = ::LibPath::Constants::Windows
128
+ if options[:reject_shell_characters]
122
129
 
123
- if name
130
+ return true if name =~ _Constants::InvalidCharacters::Shell::RE
131
+ end
124
132
 
125
- if options[:reject_shell_characters]
133
+ if options[:reject_path_separators]
126
134
 
127
- return true if name =~ _Constants::InvalidCharacters::Shell::RE
128
- end
135
+ return true if name =~ _Constants::InvalidCharacters::PathSeparators::RE
136
+ end
129
137
 
130
- if options[:reject_path_separators]
138
+ if options[:reject_path_name_separators]
131
139
 
132
- return true if name =~ _Constants::InvalidCharacters::PathSeparators::RE
133
- end
140
+ return true if name =~ _Constants::InvalidCharacters::PathNameSeparators::RE
141
+ end
134
142
 
135
- if options[:reject_path_name_separators]
143
+ return true if name =~ _Constants::InvalidCharacters::Innate::RE
136
144
 
137
- return true if name =~ _Constants::InvalidCharacters::PathNameSeparators::RE
138
- end
145
+ if '\\' == name[0] && '\\' == name[1]
139
146
 
140
- return true if name =~ _Constants::InvalidCharacters::Innate::RE
147
+ return true if name !~ /^\\\\[^\\]+\\[^\\]+/
148
+ end
141
149
 
142
- if '\\' == name[0] && '\\' == name[1]
150
+ false
151
+ else
143
152
 
144
- return true if name !~ /^\\\\[^\\]+\\[^\\]+/
145
- end
153
+ true
154
+ end
155
+ end
146
156
 
147
- false
148
- else
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
- true
151
- end
152
- end
166
+ _Form = Internal_::Windows::Form
153
167
 
154
- # Evaluates whether the given path is absolute, which means it is either
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
- Diagnostics.check_string_parameter(path, "path") if $DEBUG
170
+ return true if path_is_homed? path
164
171
 
165
- return true if path_is_homed? path
172
+ vol, rem, _ = _Form.get_windows_volume(path)
166
173
 
167
- vol, rem, _ = Internal_::Windows::Form.get_windows_volume(path)
174
+ return false unless vol
175
+ return false unless rem
168
176
 
169
- return false unless vol
170
- return false unless rem
177
+ _Form.char_is_path_name_separator? rem[0]
178
+ end
171
179
 
172
- Internal_::Windows::Form.char_is_path_name_separator? rem[0]
173
- end
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
- # Evaluates whether the given path is "letter drived", which means that
176
- # it contains a drive specification. Given the two letter sequence 'X:'
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
- Diagnostics.check_string_parameter(path, "path") if $DEBUG
197
+ Diagnostics.check_string_parameter(path, "path") if $DEBUG
190
198
 
191
- if path.size >= 2
199
+ if path.size >= 2
192
200
 
193
- base_index = 0
201
+ base_index = 0
194
202
 
195
- if '\\' == path[0]
203
+ if '\\' == path[0]
196
204
 
197
- if '\\' == path[1]
205
+ if '\\' == path[1]
198
206
 
199
- if '?' == path[2]
207
+ if '?' == path[2]
200
208
 
201
- if '\\' == path[3]
209
+ if '\\' == path[3]
202
210
 
203
- base_index = 4
204
- end
205
- end
206
- end
207
- end
211
+ base_index = 4
212
+ end
213
+ end
214
+ end
215
+ end
208
216
 
209
- if ':' == path[base_index + 1]
217
+ if ':' == path[base_index + 1]
210
218
 
211
- if Internal_::Windows::Drive.character_is_drive_letter? path[base_index + 0]
219
+ if _Drive.character_is_drive_letter? path[base_index + 0]
212
220
 
213
- if Internal_::Windows::Form.char_is_path_name_separator? path[base_index + 2]
221
+ if _Form.char_is_path_name_separator? path[base_index + 2]
214
222
 
215
- return 4 == base_index ? 7 : 3
216
- else
223
+ return 4 == base_index ? 7 : 3
224
+ else
217
225
 
218
- return 4 == base_index ? 6 : 2
219
- end
220
- end
221
- end
222
- end
226
+ return 4 == base_index ? 6 : 2
227
+ end
228
+ end
229
+ end
230
+ end
223
231
 
224
- nil
225
- end
232
+ nil
233
+ end
226
234
 
227
- # Evaluates whether the given path is homed, which means it is '~' or
228
- # begins with '~/' or '~\'
229
- #
230
- # === Signature
231
- #
232
- # * *Parameters:*
233
- # - +path+:: (String) The path to be evaluated. May not be +nil+
234
- def path_is_homed? path
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
- Diagnostics.check_string_parameter(path, "path") if $DEBUG
244
+ _Form = Internal_::Windows::Form
237
245
 
238
- return false unless '~' == path[0]
246
+ Diagnostics.check_string_parameter(path, "path") if $DEBUG
239
247
 
240
- if path.size > 1
248
+ return false unless '~' == path[0]
241
249
 
242
- return Internal_::Windows::Form.char_is_path_name_separator? path[1]
243
- end
250
+ if path.size > 1
244
251
 
245
- true
246
- end
252
+ return _Form.char_is_path_name_separator? path[1]
253
+ end
247
254
 
248
- # Evalutes whether the given path is rooted, which means it begins with
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
- Diagnostics.check_string_parameter(path, "path") if $DEBUG
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
- case path[0]
260
- when '/'
267
+ _Drive = Internal_::Windows::Drive
268
+ _Form = Internal_::Windows::Form
261
269
 
262
- true
263
- when '\\'
270
+ Diagnostics.check_string_parameter(path, "path") if $DEBUG
264
271
 
265
- case path[1]
266
- when '\\'
272
+ case path[0]
273
+ when '/'
267
274
 
268
- vol, rem, _ = Internal_::Windows::Form.get_windows_volume(path)
275
+ true
276
+ when '\\'
269
277
 
270
- return false unless vol
278
+ case path[1]
279
+ when '\\'
271
280
 
272
- if rem && Internal_::Windows::Form.char_is_path_name_separator?(rem[0])
281
+ vol, rem, _ = _Form.get_windows_volume(path)
273
282
 
274
- true
275
- else
283
+ return false unless vol
276
284
 
277
- false
278
- end
279
- else
285
+ if rem && _Form.char_is_path_name_separator?(rem[0])
280
286
 
281
- true
282
- end
283
- else
287
+ true
288
+ else
284
289
 
285
- if path.size > 2
290
+ false
291
+ end
292
+ else
286
293
 
287
- if ':' == path[1]
294
+ true
295
+ end
296
+ else
288
297
 
289
- if Internal_::Windows::Drive.character_is_drive_letter? path[0]
298
+ if path.size > 2
290
299
 
291
- return Internal_::Windows::Form.char_is_path_name_separator? path[2]
292
- end
293
- end
294
- end
300
+ if ':' == path[1]
295
301
 
296
- false
297
- end
298
- end
302
+ if _Drive.character_is_drive_letter? path[0]
299
303
 
300
- # Evalutes whether the given path is UNC
301
- #
302
- # === Signature
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
- Diagnostics.check_string_parameter(path, "path") if $DEBUG
309
+ false
310
+ end
311
+ end
309
312
 
310
- return false unless '\\' == path[0]
311
- return false unless '\\' == path[1]
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
- _, _, frm = Internal_::Windows::Form.get_windows_volume(path)
321
+ _Form = Internal_::Windows::Form
314
322
 
315
- case frm
316
- when :form_2, :form_3, :form_4, :form_5, :form_6
323
+ Diagnostics.check_string_parameter(path, "path") if $DEBUG
317
324
 
318
- true
319
- else
325
+ return false unless '\\' == path[0]
326
+ return false unless '\\' == path[1]
320
327
 
321
- false
322
- end
323
- end
328
+ _, _, frm = _Form.get_windows_volume(path)
324
329
 
325
- end # module LibPath_Form_Windows_Methods
330
+ case frm
331
+ when :form_2, :form_3, :form_4, :form_5, :form_6
326
332
 
327
- # @!visibility private
328
- def self.extended receiver # :nodoc:
333
+ true
334
+ else
329
335
 
330
- receiver.class_eval do
336
+ false
337
+ end
338
+ end
339
+ end # module LibPath_Form_Windows_Methods
331
340
 
332
- extend LibPath_Form_Windows_Methods
333
- end
341
+ # @!visibility private
342
+ def self.extended receiver # :nodoc:
334
343
 
335
- $stderr.puts "#{receiver} extended by #{LibPath_Form_Windows_Methods}" if $DEBUG
336
- end
344
+ receiver.class_eval do
337
345
 
338
- # @!visibility private
339
- def self.included receiver # :nodoc:
346
+ extend LibPath_Form_Windows_Methods
347
+ end
340
348
 
341
- receiver.class_eval do
349
+ $stderr.puts "#{receiver} extended by #{LibPath_Form_Windows_Methods}" if $DEBUG
350
+ end
342
351
 
343
- include LibPath_Form_Windows_Methods
344
- end
352
+ # @!visibility private
353
+ def self.included receiver # :nodoc:
345
354
 
346
- $stderr.puts "#{receiver} included #{LibPath_Form_Windows_Methods}" if $DEBUG
347
- end
355
+ receiver.class_eval do
348
356
 
349
- extend LibPath_Form_Windows_Methods
350
- include LibPath_Form_Windows_Methods
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
- require 'libpath/form/windows'
6
+ require 'libpath/form/windows'
7
7
  else
8
8
 
9
- require 'libpath/form/unix'
9
+ require 'libpath/form/unix'
10
10
  end
11
11
 
12
- module LibPath # :nodoc:
13
- module Form # :nodoc:
12
+ module LibPath
13
+ module Form
14
14
 
15
- if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
15
+ if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
16
16
 
17
- extend ::LibPath::Form::Windows
18
- include ::LibPath::Form::Windows
19
- else
17
+ extend ::LibPath::Form::Windows
18
+ include ::LibPath::Form::Windows
19
+ else
20
20
 
21
- extend ::LibPath::Form::Unix
22
- include ::LibPath::Form::Unix
23
- end
21
+ extend ::LibPath::Form::Unix
22
+ include ::LibPath::Form::Unix
23
+ end
24
24
 
25
- # @!visibility private
26
- def self.extended receiver # :nodoc:
25
+ # @!visibility private
26
+ def self.extended receiver # :nodoc:
27
27
 
28
- $stderr.puts "#{receiver} extended by #{self}" if $DEBUG
29
- end
28
+ $stderr.puts "#{receiver} extended by #{self}" if $DEBUG
29
+ end
30
30
 
31
- # @!visibility private
32
- def self.included receiver # :nodoc:
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