libpath-ruby 0.2.2.1 → 0.2.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@
5
5
  # Purpose: LibPath::Path::Unix module
6
6
  #
7
7
  # Created: 21st January 2019
8
- # Updated: 6th April 2024
8
+ # Updated: 13th April 2024
9
9
  #
10
10
  # Home: http://github.com/synesissoftware/libpath.Ruby
11
11
  #
@@ -45,125 +45,125 @@
45
45
  # ######################################################################## #
46
46
 
47
47
 
48
- =begin
49
- =end
50
-
51
48
  require 'libpath/diagnostics'
52
49
  require 'libpath/internal_/unix/form'
53
50
  require 'libpath/util/unix'
54
51
 
55
52
 
56
- module LibPath # :nodoc:
57
- module Path # :nodoc:
58
- module Unix # :nodoc:
59
-
60
- # Class representing a parsed path (for UNIX)
61
- class ParsedPath
62
-
63
- # @!visibility private
64
- module ParsedPath_Constants # :nodoc: all
65
-
66
- INIT_VALID_OPTIONS = %i{ home locator pwd }
67
- INIT_MPA_COMMON_OPTIONS = %i{ home locator pwd }
68
- INIT_DRP_COMMON_OPTIONS = %i{ home locator pwd }
69
- end
70
-
71
- # Initialises an instance from the given +path+, optional
72
- # +search_directory+ and options
73
- #
74
- # === Signature
75
- #
76
- # * *Parameters:*
77
- # - +path+ (String) The path. May not be +nil+
78
- # - +search_directory+ (String) The search_directory, from which the relative attributes are calculated for the path. May be +nil+
79
- # - +options+ (Hash) Options
80
- #
81
- # * *Options:*
82
- # - +????+
83
- #
84
- # * *Exceptions:*
85
- # - +ArgumentError+ Raised if +path+ is +nil+
86
- def initialize path, search_directory = nil, **options
87
-
88
- raise ::ArgumentError, "path may not be nil or empty" if path.nil? || path.empty?
89
-
90
- _Diagnostics = ::LibPath::Diagnostics
91
- _Internal_Form = ::LibPath::Internal_::Unix::Form
92
- _Util = ::LibPath::Util::Unix
93
- _C = ::LibPath::Path::Unix::ParsedPath::ParsedPath_Constants
94
-
95
- _Diagnostics.check_options(options, known: _C::INIT_VALID_OPTIONS)
96
-
97
-
98
- abs_path = _Util.make_path_absolute(path, make_canonical: true, **options.select { |k| _C::INIT_MPA_COMMON_OPTIONS.include?(k) })
99
-
100
- _, _, f2_dir, f3_basename, f4_stem, f5_ext, f6_dir_parts, _ = _Internal_Form.split_path(abs_path)
53
+ =begin
54
+ =end
101
55
 
102
- @given_path = path
103
- @absolute_path = abs_path
104
- @compare_path = _Util.make_compare_path abs_path
105
- @directory = f2_dir
106
- @directory_path = f2_dir
107
- @directory_parts = f6_dir_parts
56
+ module LibPath
57
+ module Path
108
58
 
109
- @file_full_name = f3_basename
110
- @file_name_only = f4_stem
111
- @file_extension = f5_ext
59
+ module Unix
112
60
 
113
- if search_directory
61
+ # Class representing a parsed path (for UNIX)
62
+ class ParsedPath
114
63
 
115
- drp_options = options.select { |k| _C::INIT_DRP_COMMON_OPTIONS.include?(k) }
64
+ # @!visibility private
65
+ module ParsedPath_Constants # :nodoc: all
116
66
 
117
- search_directory = _Util.make_path_absolute(search_directory, make_canonical: true, **options.select { |k| _C::INIT_MPA_COMMON_OPTIONS.include?(k) })
118
- search_directory = _Internal_Form.append_trailing_slash search_directory
67
+ INIT_VALID_OPTIONS = %i{ home locator pwd }
68
+ INIT_MPA_COMMON_OPTIONS = %i{ home locator pwd }
69
+ INIT_DRP_COMMON_OPTIONS = %i{ home locator pwd }
70
+ end
119
71
 
120
- @search_directory = search_directory
121
- @search_relative_path = _Util.derive_relative_path(search_directory, abs_path, **drp_options)
122
- @search_relative_path = _Internal_Form.append_trailing_slash(@search_relative_path) if _Internal_Form.char_is_path_name_separator?(abs_path[-1])
123
- @search_relative_directory_path = _Internal_Form.append_trailing_slash _Util.derive_relative_path(search_directory, f2_dir, **drp_options)
124
- @search_relative_directory_parts = @search_relative_directory_path.split('/').map { |v| v + '/' }
72
+ # Initialises an instance from the given +path+, optional
73
+ # +search_directory+ and options
74
+ #
75
+ # === Signature
76
+ #
77
+ # * *Parameters:*
78
+ # - +path+ (String) The path. May not be +nil+
79
+ # - +search_directory+ (String) The search_directory, from which the relative attributes are calculated for the path. May be +nil+
80
+ # - +options+ (Hash) Options
81
+ #
82
+ # * *Options:*
83
+ # - +????+
84
+ #
85
+ # * *Exceptions:*
86
+ # - +ArgumentError+ Raised if +path+ is +nil+
87
+ def initialize path, search_directory = nil, **options
88
+
89
+ raise ::ArgumentError, "path may not be nil or empty" if path.nil? || path.empty?
90
+
91
+ _Diagnostics = ::LibPath::Diagnostics
92
+ _Internal_Form = ::LibPath::Internal_::Unix::Form
93
+ _Util = ::LibPath::Util::Unix
94
+ _C = ::LibPath::Path::Unix::ParsedPath::ParsedPath_Constants
95
+
96
+ _Diagnostics.check_options(options, known: _C::INIT_VALID_OPTIONS)
97
+
98
+
99
+ abs_path = _Util.make_path_absolute(path, make_canonical: true, **options.select { |k| _C::INIT_MPA_COMMON_OPTIONS.include?(k) })
100
+
101
+ _, _, f2_dir, f3_basename, f4_stem, f5_ext, f6_dir_parts, _ = _Internal_Form.split_path(abs_path)
102
+
103
+ @given_path = path
104
+ @absolute_path = abs_path
105
+ @compare_path = _Util.make_compare_path abs_path
106
+ @directory = f2_dir
107
+ @directory_path = f2_dir
108
+ @directory_parts = f6_dir_parts
109
+
110
+ @file_full_name = f3_basename
111
+ @file_name_only = f4_stem
112
+ @file_extension = f5_ext
113
+
114
+ if search_directory
115
+
116
+ drp_options = options.select { |k| _C::INIT_DRP_COMMON_OPTIONS.include?(k) }
117
+
118
+ search_directory = _Util.make_path_absolute(search_directory, make_canonical: true, **options.select { |k| _C::INIT_MPA_COMMON_OPTIONS.include?(k) })
119
+ search_directory = _Internal_Form.append_trailing_slash search_directory
120
+
121
+ @search_directory = search_directory
122
+ @search_relative_path = _Util.derive_relative_path(search_directory, abs_path, **drp_options)
123
+ @search_relative_path = _Internal_Form.append_trailing_slash(@search_relative_path) if _Internal_Form.char_is_path_name_separator?(abs_path[-1])
124
+ @search_relative_directory_path = _Internal_Form.append_trailing_slash _Util.derive_relative_path(search_directory, f2_dir, **drp_options)
125
+ @search_relative_directory_parts = @search_relative_directory_path.split('/').map { |v| v + '/' }
126
+ end
125
127
  end
126
- end
127
128
 
128
- # (String) The path given to initialise the instance
129
- attr_reader :given_path
130
- # (String) The full-path of the instance
131
- attr_reader :absolute_path
132
- # (String) A normalised form of #path that can be used in comparisons
133
- attr_reader :compare_path
134
- # (String) The entry's directory (excluding the #drive if on Windows)
135
- attr_reader :directory
136
- # (String) The full path of the entry's directory
137
- attr_reader :directory_path
138
- alias_method :dirname, :directory_path
139
- # ([String]) An array of directory parts, where each part ends in the path name separator
140
- attr_reader :directory_parts
141
- # (String) The entry's file name (combination of #stem + #extension)
142
- attr_reader :file_full_name
143
- alias_method :basename, :file_full_name
144
- # (String) The entry's file stem
145
- attr_reader :file_name_only
146
- alias_method :stem, :file_name_only
147
- # (String) The entry's file extension
148
- attr_reader :file_extension
149
- alias_method :extension, :file_extension
150
- # (String) The search directory if specified; +nil+ otherwise
151
- attr_reader :search_directory
152
- # (String) The #path relative to #search_directory; +nil+ if no search directory specified
153
- attr_reader :search_relative_path
154
- # (String) The #directory_path relative to #search_directory; +nil+ if no search directory specified
155
- attr_reader :search_relative_directory_path
156
- # ([String]) The #directory_parts relative to #search_directory; +nil+ if no search directory specified
157
- attr_reader :search_relative_directory_parts
158
-
159
- # (String) String form of path
160
- def to_s
161
-
162
- absolute_path
129
+ # (String) The path given to initialise the instance
130
+ attr_reader :given_path
131
+ # (String) The full-path of the instance
132
+ attr_reader :absolute_path
133
+ # (String) A normalised form of #path that can be used in comparisons
134
+ attr_reader :compare_path
135
+ # (String) The entry's directory (excluding the #drive if on Windows)
136
+ attr_reader :directory
137
+ # (String) The full path of the entry's directory
138
+ attr_reader :directory_path
139
+ alias_method :dirname, :directory_path
140
+ # ([String]) An array of directory parts, where each part ends in the path name separator
141
+ attr_reader :directory_parts
142
+ # (String) The entry's file name (combination of #stem + #extension)
143
+ attr_reader :file_full_name
144
+ alias_method :basename, :file_full_name
145
+ # (String) The entry's file stem
146
+ attr_reader :file_name_only
147
+ alias_method :stem, :file_name_only
148
+ # (String) The entry's file extension
149
+ attr_reader :file_extension
150
+ alias_method :extension, :file_extension
151
+ # (String) The search directory if specified; +nil+ otherwise
152
+ attr_reader :search_directory
153
+ # (String) The #path relative to #search_directory; +nil+ if no search directory specified
154
+ attr_reader :search_relative_path
155
+ # (String) The #directory_path relative to #search_directory; +nil+ if no search directory specified
156
+ attr_reader :search_relative_directory_path
157
+ # ([String]) The #directory_parts relative to #search_directory; +nil+ if no search directory specified
158
+ attr_reader :search_relative_directory_parts
159
+
160
+ # (String) String form of path
161
+ def to_s
162
+
163
+ absolute_path
164
+ end
163
165
  end
164
- end
165
-
166
- end # module Unix
166
+ end # module Unix
167
167
  end # module Path
168
168
  end # module LibPath
169
169
 
@@ -5,7 +5,7 @@
5
5
  # Purpose: LibPath::Path::Windows module
6
6
  #
7
7
  # Created: 21st January 2019
8
- # Updated: 6th April 2024
8
+ # Updated: 13th April 2024
9
9
  #
10
10
  # Home: http://github.com/synesissoftware/libpath.Ruby
11
11
  #
@@ -45,131 +45,131 @@
45
45
  # ######################################################################## #
46
46
 
47
47
 
48
- =begin
49
- =end
50
-
51
48
  require 'libpath/diagnostics'
52
49
  require 'libpath/internal_/windows/form'
53
50
  require 'libpath/util/windows'
54
51
 
55
52
 
56
- module LibPath # :nodoc:
57
- module Path # :nodoc:
58
- module Windows # :nodoc:
53
+ =begin
54
+ =end
59
55
 
60
- # Class representing a parsed path (for Windows)
61
- class ParsedPath
56
+ module LibPath
57
+ module Path
62
58
 
63
- # @!visibility private
64
- module ParsedPath_Constants # :nodoc: all
59
+ module Windows
65
60
 
66
- INIT_VALID_OPTIONS = %i{ home locator pwd }
67
- INIT_MPA_COMMON_OPTIONS = %i{ home locator pwd }
68
- INIT_DRP_COMMON_OPTIONS = %i{ home locator pwd }
69
- end
61
+ # Class representing a parsed path (for Windows)
62
+ class ParsedPath
70
63
 
71
- # Initialises an instance from the given +path+, optional
72
- # +search_directory+ and options
73
- #
74
- # === Signature
75
- #
76
- # * *Parameters:*
77
- # - +path+ (String) The path. May not be +nil+
78
- # - +search_directory+ (String) The search_directory, from which the relative attributes are calculated for the path. May be +nil+
79
- # - +options+ (Hash) Options
80
- #
81
- # * *Options:*
82
- # - +????+
83
- #
84
- # * *Exceptions:*
85
- # - +ArgumentError+ Raised if +path+ is +nil+
86
- def initialize path, search_directory = nil, **options
64
+ # @!visibility private
65
+ module ParsedPath_Constants # :nodoc: all
87
66
 
88
- raise ::ArgumentError, "path may not be nil or empty" if path.nil? || path.empty?
67
+ INIT_VALID_OPTIONS = %i{ home locator pwd }
68
+ INIT_MPA_COMMON_OPTIONS = %i{ home locator pwd }
69
+ INIT_DRP_COMMON_OPTIONS = %i{ home locator pwd }
70
+ end
71
+
72
+ # Initialises an instance from the given +path+, optional
73
+ # +search_directory+ and options
74
+ #
75
+ # === Signature
76
+ #
77
+ # * *Parameters:*
78
+ # - +path+ (String) The path. May not be +nil+
79
+ # - +search_directory+ (String) The search_directory, from which the relative attributes are calculated for the path. May be +nil+
80
+ # - +options+ (Hash) Options
81
+ #
82
+ # * *Options:*
83
+ # - +????+
84
+ #
85
+ # * *Exceptions:*
86
+ # - +ArgumentError+ Raised if +path+ is +nil+
87
+ def initialize path, search_directory = nil, **options
88
+
89
+ raise ::ArgumentError, "path may not be nil or empty" if path.nil? || path.empty?
89
90
 
90
- _Diagnostics = ::LibPath::Diagnostics
91
- _Internal_Form = ::LibPath::Internal_::Windows::Form
92
- _Util = ::LibPath::Util::Windows
93
- _C = ::LibPath::Path::Windows::ParsedPath::ParsedPath_Constants
91
+ _Diagnostics = ::LibPath::Diagnostics
92
+ _Internal_Form = ::LibPath::Internal_::Windows::Form
93
+ _Util = ::LibPath::Util::Windows
94
+ _C = ::LibPath::Path::Windows::ParsedPath::ParsedPath_Constants
94
95
 
95
- _Diagnostics.check_options(options, known: _C::INIT_VALID_OPTIONS)
96
+ _Diagnostics.check_options(options, known: _C::INIT_VALID_OPTIONS)
96
97
 
97
98
 
98
- abs_path = _Util.make_path_absolute(path, make_canonical: true, **options.select { |k| _C::INIT_MPA_COMMON_OPTIONS.include?(k) })
99
+ abs_path = _Util.make_path_absolute(path, make_canonical: true, **options.select { |k| _C::INIT_MPA_COMMON_OPTIONS.include?(k) })
99
100
 
100
- splits = _Internal_Form.split_path(abs_path)
101
+ splits = _Internal_Form.split_path(abs_path)
101
102
 
102
- _, f1_vol, f2_dir, f3_basename, f4_stem, f5_ext, f6_dir_parts, f7_abs_parts = *splits
103
+ _, f1_vol, f2_dir, f3_basename, f4_stem, f5_ext, f6_dir_parts, _f7_abs_parts = *splits
103
104
 
104
- @given_path = path
105
- @absolute_path = abs_path
106
- @compare_path = _Util.make_compare_path abs_path, splits: splits
107
- @volume = f1_vol
108
- @directory = f2_dir
109
- @directory_path = "#{f1_vol}#{f2_dir}"
110
- @directory_parts = f6_dir_parts
105
+ @given_path = path
106
+ @absolute_path = abs_path
107
+ @compare_path = _Util.make_compare_path abs_path, splits: splits
108
+ @volume = f1_vol
109
+ @directory = f2_dir
110
+ @directory_path = "#{f1_vol}#{f2_dir}"
111
+ @directory_parts = f6_dir_parts
111
112
 
112
- @file_full_name = f3_basename
113
- @file_name_only = f4_stem
114
- @file_extension = f5_ext
113
+ @file_full_name = f3_basename
114
+ @file_name_only = f4_stem
115
+ @file_extension = f5_ext
115
116
 
116
- if search_directory
117
+ if search_directory
117
118
 
118
- drp_options = options.select { |k| _C::INIT_DRP_COMMON_OPTIONS.include?(k) }
119
+ drp_options = options.select { |k| _C::INIT_DRP_COMMON_OPTIONS.include?(k) }
119
120
 
120
- search_directory = _Util.make_path_canonical search_directory, make_slashes_canonical: true
121
- search_directory = _Internal_Form.append_trailing_slash search_directory
121
+ search_directory = _Util.make_path_canonical search_directory, make_slashes_canonical: true
122
+ search_directory = _Internal_Form.append_trailing_slash search_directory
122
123
 
123
- @search_directory = search_directory
124
- @search_relative_path = _Util.derive_relative_path(search_directory, abs_path, **drp_options)
125
- @search_relative_path = _Internal_Form.append_trailing_slash(@search_relative_path) if _Internal_Form.char_is_path_name_separator?(abs_path[-1])
126
- @search_relative_directory_path = _Internal_Form.append_trailing_slash _Util.derive_relative_path(search_directory, "#{f1_vol}#{f2_dir}", **drp_options)
127
- @search_relative_directory_parts = @search_relative_directory_path.split('\\').map { |v| v + '\\' }
124
+ @search_directory = search_directory
125
+ @search_relative_path = _Util.derive_relative_path(search_directory, abs_path, **drp_options)
126
+ @search_relative_path = _Internal_Form.append_trailing_slash(@search_relative_path) if _Internal_Form.char_is_path_name_separator?(abs_path[-1])
127
+ @search_relative_directory_path = _Internal_Form.append_trailing_slash _Util.derive_relative_path(search_directory, "#{f1_vol}#{f2_dir}", **drp_options)
128
+ @search_relative_directory_parts = @search_relative_directory_path.split('\\').map { |v| v + '\\' }
129
+ end
128
130
  end
129
- end
130
131
 
131
- # (String) The path given to initialise the instance
132
- attr_reader :given_path
133
- # (String) The full-path of the instance
134
- attr_reader :absolute_path
135
- # (String) A normalised form of #path that can be used in comparisons
136
- attr_reader :compare_path
137
- # (String) The Windows volume, which may be a drive, or a UNC specification
138
- attr_reader :volume
139
- # (String) The entry's directory (excluding the #drive if on Windows)
140
- attr_reader :directory
141
- # (String) The full path of the entry's directory (taking into account the
142
- # #drive if on Windows)
143
- attr_reader :directory_path
144
- alias_method :dirname, :directory_path
145
- # ([String]) An array of directory parts, where each part ends in the path name separator
146
- attr_reader :directory_parts
147
- # (String) The entry's file name (combination of #stem + #extension)
148
- attr_reader :file_full_name
149
- alias_method :basename, :file_full_name
150
- # (String) The entry's file stem
151
- attr_reader :file_name_only
152
- alias_method :stem, :file_name_only
153
- # (String) The entry's file extension
154
- attr_reader :file_extension
155
- alias_method :extension, :file_extension
156
- # (String) The search directory if specified; +nil+ otherwise
157
- attr_reader :search_directory
158
- # (String) The #path relative to #search_directory; +nil+ if no search directory specified
159
- attr_reader :search_relative_path
160
- # (String) The #directory_path relative to #search_directory; +nil+ if no search directory specified
161
- attr_reader :search_relative_directory_path
162
- # ([String]) The #directory_parts relative to #search_directory; +nil+ if no search directory specified
163
- attr_reader :search_relative_directory_parts
164
-
165
- # (String) String form of path
166
- def to_s
167
-
168
- absolute_path
132
+ # (String) The path given to initialise the instance
133
+ attr_reader :given_path
134
+ # (String) The full-path of the instance
135
+ attr_reader :absolute_path
136
+ # (String) A normalised form of #path that can be used in comparisons
137
+ attr_reader :compare_path
138
+ # (String) The Windows volume, which may be a drive, or a UNC specification
139
+ attr_reader :volume
140
+ # (String) The entry's directory (excluding the #drive if on Windows)
141
+ attr_reader :directory
142
+ # (String) The full path of the entry's directory (taking into account the
143
+ # #drive if on Windows)
144
+ attr_reader :directory_path
145
+ alias_method :dirname, :directory_path
146
+ # ([String]) An array of directory parts, where each part ends in the path name separator
147
+ attr_reader :directory_parts
148
+ # (String) The entry's file name (combination of #stem + #extension)
149
+ attr_reader :file_full_name
150
+ alias_method :basename, :file_full_name
151
+ # (String) The entry's file stem
152
+ attr_reader :file_name_only
153
+ alias_method :stem, :file_name_only
154
+ # (String) The entry's file extension
155
+ attr_reader :file_extension
156
+ alias_method :extension, :file_extension
157
+ # (String) The search directory if specified; +nil+ otherwise
158
+ attr_reader :search_directory
159
+ # (String) The #path relative to #search_directory; +nil+ if no search directory specified
160
+ attr_reader :search_relative_path
161
+ # (String) The #directory_path relative to #search_directory; +nil+ if no search directory specified
162
+ attr_reader :search_relative_directory_path
163
+ # ([String]) The #directory_parts relative to #search_directory; +nil+ if no search directory specified
164
+ attr_reader :search_relative_directory_parts
165
+
166
+ # (String) String form of path
167
+ def to_s
168
+
169
+ absolute_path
170
+ end
169
171
  end
170
- end
171
-
172
- end # module Windows
172
+ end # module Windows
173
173
  end # module Path
174
174
  end # module LibPath
175
175
 
data/lib/libpath/path.rb CHANGED
@@ -9,7 +9,9 @@ else
9
9
  require 'libpath/path/unix'
10
10
  end
11
11
 
12
- module LibPath # :nodoc:
12
+
13
+ module LibPath
14
+ # @!visibility private
13
15
  module Path # :nodoc:
14
16
 
15
17
  if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
@@ -5,7 +5,7 @@
5
5
  # Purpose: LibPath::Util::Unix module
6
6
  #
7
7
  # Created: 14th January 2019
8
- # Updated: 6th April 2024
8
+ # Updated: 13th April 2024
9
9
  #
10
10
  # Home: http://github.com/synesissoftware/libpath.Ruby
11
11
  #
@@ -45,18 +45,18 @@
45
45
  # ######################################################################## #
46
46
 
47
47
 
48
- =begin
49
- =end
50
-
51
48
  require 'libpath/diagnostics'
52
49
  require 'libpath/form/unix'
53
50
  require 'libpath/internal_/array'
54
51
  require 'libpath/internal_/unix/form'
55
52
 
56
53
 
57
- module LibPath # :nodoc:
58
- module Util # :nodoc:
59
- module Unix # :nodoc:
54
+ =begin
55
+ =end
56
+
57
+ module LibPath
58
+ module Util
59
+ module Unix
60
60
 
61
61
  # Module defining instance functions that will be included and extended into
62
62
  # any class or module including/extending module LibPath::Util::Unix
@@ -5,7 +5,7 @@
5
5
  # Purpose: LibPath::Util::Windows module
6
6
  #
7
7
  # Created: 10th January 2019
8
- # Updated: 6th April 2024
8
+ # Updated: 13th April 2024
9
9
  #
10
10
  # Home: http://github.com/synesissoftware/libpath.Ruby
11
11
  #
@@ -45,18 +45,18 @@
45
45
  # ######################################################################## #
46
46
 
47
47
 
48
- =begin
49
- =end
50
-
51
48
  require 'libpath/diagnostics'
52
49
  require 'libpath/form/windows'
53
50
  require 'libpath/internal_/array'
54
51
  require 'libpath/internal_/windows/form'
55
52
 
56
53
 
57
- module LibPath # :nodoc:
58
- module Util # :nodoc:
59
- module Windows # :nodoc:
54
+ =begin
55
+ =end
56
+
57
+ module LibPath
58
+ module Util
59
+ module Windows
60
60
 
61
61
  # Module defining instance functions that will be included and extended into
62
62
  # any class or module including/extending module LibPath::Util::Windows
data/lib/libpath/util.rb CHANGED
@@ -9,8 +9,9 @@ else
9
9
  require 'libpath/util/unix'
10
10
  end
11
11
 
12
- module LibPath # :nodoc:
13
- module Util # :nodoc:
12
+
13
+ module LibPath
14
+ module Util
14
15
 
15
16
  if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
16
17
 
@@ -4,7 +4,7 @@
4
4
  # Purpose: Version for libpath.Ruby library
5
5
  #
6
6
  # Created: 8th January 2019
7
- # Updated: 6th April 2024
7
+ # Updated: 13th April 2024
8
8
  #
9
9
  # Home: http://github.com/synesissoftware/libpath.Ruby
10
10
  #
@@ -47,25 +47,25 @@
47
47
  =begin
48
48
  =end
49
49
 
50
- module LibPath # :nodoc:
50
+ module LibPath
51
51
 
52
52
  # Current version of the libpath.Ruby library
53
- VERSION = '0.2.2.1'
53
+ VERSION = '0.2.2.3'
54
54
 
55
55
  private
56
+ # @!visibility private
56
57
  VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
57
58
  public
58
59
  # Major version of the libpath.Ruby library
59
- VERSION_MAJOR = VERSION_PARTS_[0] # :nodoc:
60
+ VERSION_MAJOR = VERSION_PARTS_[0]
60
61
  # Minor version of the libpath.Ruby library
61
- VERSION_MINOR = VERSION_PARTS_[1] # :nodoc:
62
+ VERSION_MINOR = VERSION_PARTS_[1]
62
63
  # Patch version of the libpath.Ruby library
63
- VERSION_PATCH = VERSION_PARTS_[2] # :nodoc:
64
+ VERSION_PATCH = VERSION_PARTS_[2]
64
65
  # Revision version of the libpath.Ruby library
65
- VERSION_REVISION = VERSION_PATCH # :nodoc:
66
+ VERSION_REVISION = VERSION_PATCH
66
67
  # Sub-patch version of the libpath.Ruby library
67
- VERSION_SUBPATCH = VERSION_PARTS_[3] # :nodoc:
68
-
68
+ VERSION_SUBPATCH = VERSION_PARTS_[3]
69
69
  end # module LibPath
70
70
 
71
71
 
@@ -22,13 +22,6 @@ require 'benchmark'
22
22
 
23
23
  ITERATIONS = 100000
24
24
 
25
- SMALL_STRINGS = [
26
-
27
- 'C:\dir0\dir1/dir2',
28
- 'C:\dir0\dir1/dir2\dir3\dir4/',
29
- 'C:/dir0/dir1\dir2',
30
- ]
31
-
32
25
  LONG_STRINGS = [
33
26
 
34
27
  'C:' + '\dir' * 1000,
@@ -36,6 +29,13 @@ LONG_STRINGS = [
36
29
  'C:' + '\dir/dir' * 500,
37
30
  ]
38
31
 
32
+ SMALL_STRINGS = [
33
+
34
+ 'C:\dir0\dir1/dir2',
35
+ 'C:\dir0\dir1/dir2\dir3\dir4/',
36
+ 'C:/dir0/dir1\dir2',
37
+ ]
38
+
39
39
 
40
40
  def by_two_calls(s)
41
41
 
@@ -23,8 +23,8 @@ class Test_MalformedNameException < Test::Unit::TestCase
23
23
 
24
24
  assert_not_nil mnx
25
25
  assert_not_nil mnx.name
26
- assert_match /abc.*def/, mnx.name
27
- assert_match /malformed name 'abc.*def'/, mnx.message
26
+ assert_match(/abc.*def/, mnx.name)
27
+ assert_match(/malformed name 'abc.*def'/, mnx.message)
28
28
  end
29
29
  end
30
30