ruby-units 4.0.0 → 4.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 572cf98377411ff41dd490f784564f3b50401a7342552a7999688ea0763eec5b
4
- data.tar.gz: 735696cb4410be7d1d7a1d03fabaa4fa734a2dc6f5c4a8a37648dcd88a461168
3
+ metadata.gz: 515d78b788c31cefd79643b9a145f4cecf0448ac9e0df785453a2b19d31268d5
4
+ data.tar.gz: b10b08bf4d1d23d94603a9e0c5ca0d6c4962587225f9b04b6f74bac5ae521816
5
5
  SHA512:
6
- metadata.gz: d0d994f5f9a10375fad35fa00905dc23ae5227e08157f10f27c85955e1d0df98500bb6d1174298b9f95f02a4f568a6d363af21204f6564e1c28f8b19c44a229f
7
- data.tar.gz: 491e25dbb90dc0e7f5829b46c4973b178a49119ed3343fc6fe9931131d08525b0e8655079a6321bbbfef4f3624c0746dbbfde5b9dc866828fbe1a97d691b9569
6
+ metadata.gz: 86df302207791952b19f06923111cb9305cf0e3cfeffab1869db061748925aa164b0f5d0eec453b546869b4895c0e1b41f38e2bfc4cb5f0b16986fdd41d5d576
7
+ data.tar.gz: 5f5c690e1dbb1f222fa95f8e0050cac04d1431dfb2ee0517921c819961ec3c3b1f57b3ab97807d3ccf04f00e13f8aac91577d21aedfba2b8c2d98b0703449782
data/.rubocop.yml CHANGED
@@ -24,3 +24,5 @@ Style/FormatString:
24
24
  Enabled: false
25
25
  Style/DateTime:
26
26
  Enabled: false
27
+ Metrics/ClassLength:
28
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,24 +1,23 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-units (4.0.0)
4
+ ruby-units (4.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.2)
10
10
  backport (1.2.0)
11
- base64 (0.1.1)
12
- benchmark (0.2.1)
11
+ benchmark (0.3.0)
13
12
  coderay (1.1.3)
14
- debug (1.8.0)
15
- irb (>= 1.5.0)
16
- reline (>= 0.3.1)
17
- diff-lcs (1.5.0)
13
+ debug (1.9.1)
14
+ irb (~> 1.10)
15
+ reline (>= 0.3.8)
16
+ diff-lcs (1.5.1)
18
17
  docile (1.4.0)
19
18
  e2mmap (0.1.0)
20
- ffi (1.16.1)
21
- ffi (1.16.1-java)
19
+ ffi (1.16.3)
20
+ ffi (1.16.3-java)
22
21
  formatador (1.1.0)
23
22
  guard (2.18.1)
24
23
  formatador (>= 0.2.4)
@@ -34,16 +33,16 @@ GEM
34
33
  guard (~> 2.1)
35
34
  guard-compat (~> 1.1)
36
35
  rspec (>= 2.99.0, < 4.0)
37
- io-console (0.6.0)
38
- io-console (0.6.0-java)
39
- irb (1.8.1)
36
+ io-console (0.7.2)
37
+ io-console (0.7.2-java)
38
+ irb (1.11.1)
40
39
  rdoc
41
- reline (>= 0.3.8)
40
+ reline (>= 0.4.2)
42
41
  jar-dependencies (0.4.1)
43
42
  jaro_winkler (1.5.6)
44
43
  jaro_winkler (1.5.6-java)
45
- json (2.6.3)
46
- json (2.6.3-java)
44
+ json (2.7.1)
45
+ json (2.7.1-java)
47
46
  kramdown (2.4.0)
48
47
  rexml
49
48
  kramdown-parser-gfm (1.1.0)
@@ -52,22 +51,22 @@ GEM
52
51
  listen (3.8.0)
53
52
  rb-fsevent (~> 0.10, >= 0.10.3)
54
53
  rb-inotify (~> 0.9, >= 0.9.10)
55
- lumberjack (1.2.9)
54
+ lumberjack (1.2.10)
56
55
  method_source (1.0.0)
57
56
  nenv (0.3.0)
58
- nokogiri (1.15.4-arm64-darwin)
57
+ nokogiri (1.16.2-arm64-darwin)
59
58
  racc (~> 1.4)
60
- nokogiri (1.15.4-java)
59
+ nokogiri (1.16.2-java)
61
60
  racc (~> 1.4)
62
- nokogiri (1.15.4-x86_64-darwin)
61
+ nokogiri (1.16.2-x86_64-darwin)
63
62
  racc (~> 1.4)
64
- nokogiri (1.15.4-x86_64-linux)
63
+ nokogiri (1.16.2-x86_64-linux)
65
64
  racc (~> 1.4)
66
65
  notiffany (0.1.3)
67
66
  nenv (~> 0.1)
68
67
  shellany (~> 0.0)
69
- parallel (1.23.0)
70
- parser (3.2.2.3)
68
+ parallel (1.24.0)
69
+ parser (3.3.0.5)
71
70
  ast (~> 2.4.1)
72
71
  racc
73
72
  pry (0.14.2)
@@ -77,68 +76,67 @@ GEM
77
76
  coderay (~> 1.1)
78
77
  method_source (~> 1.0)
79
78
  spoon (~> 0.0)
80
- psych (5.1.0)
79
+ psych (5.1.2)
81
80
  stringio
82
- psych (5.1.0-java)
81
+ psych (5.1.2-java)
83
82
  jar-dependencies (>= 0.1.7)
84
- racc (1.7.1)
85
- racc (1.7.1-java)
83
+ racc (1.7.3)
84
+ racc (1.7.3-java)
86
85
  rainbow (3.1.1)
87
- rake (13.0.6)
86
+ rake (13.1.0)
88
87
  rb-fsevent (0.11.2)
89
88
  rb-inotify (0.10.1)
90
89
  ffi (~> 1.0)
91
90
  rbs (2.8.4)
92
- rdoc (6.5.0)
91
+ rdoc (6.6.2)
93
92
  psych (>= 4.0.0)
94
93
  redcarpet (3.6.0)
95
- regexp_parser (2.8.1)
96
- reline (0.3.8)
94
+ regexp_parser (2.9.0)
95
+ reline (0.4.2)
97
96
  io-console (~> 0.5)
98
97
  reverse_markdown (2.1.1)
99
98
  nokogiri
100
99
  rexml (3.2.6)
101
- rspec (3.12.0)
102
- rspec-core (~> 3.12.0)
103
- rspec-expectations (~> 3.12.0)
104
- rspec-mocks (~> 3.12.0)
105
- rspec-core (3.12.2)
106
- rspec-support (~> 3.12.0)
107
- rspec-expectations (3.12.3)
100
+ rspec (3.13.0)
101
+ rspec-core (~> 3.13.0)
102
+ rspec-expectations (~> 3.13.0)
103
+ rspec-mocks (~> 3.13.0)
104
+ rspec-core (3.13.0)
105
+ rspec-support (~> 3.13.0)
106
+ rspec-expectations (3.13.0)
108
107
  diff-lcs (>= 1.2.0, < 2.0)
109
- rspec-support (~> 3.12.0)
110
- rspec-mocks (3.12.6)
108
+ rspec-support (~> 3.13.0)
109
+ rspec-mocks (3.13.0)
111
110
  diff-lcs (>= 1.2.0, < 2.0)
112
- rspec-support (~> 3.12.0)
113
- rspec-support (3.12.1)
114
- rubocop (1.56.4)
115
- base64 (~> 0.1.1)
111
+ rspec-support (~> 3.13.0)
112
+ rspec-support (3.13.0)
113
+ rubocop (1.60.2)
116
114
  json (~> 2.3)
117
115
  language_server-protocol (>= 3.17.0)
118
116
  parallel (~> 1.10)
119
- parser (>= 3.2.2.3)
117
+ parser (>= 3.3.0.2)
120
118
  rainbow (>= 2.2.2, < 4.0)
121
119
  regexp_parser (>= 1.8, < 3.0)
122
120
  rexml (>= 3.2.5, < 4.0)
123
- rubocop-ast (>= 1.28.1, < 2.0)
121
+ rubocop-ast (>= 1.30.0, < 2.0)
124
122
  ruby-progressbar (~> 1.7)
125
123
  unicode-display_width (>= 2.4.0, < 3.0)
126
- rubocop-ast (1.29.0)
124
+ rubocop-ast (1.30.0)
127
125
  parser (>= 3.2.1.0)
128
- rubocop-capybara (2.19.0)
126
+ rubocop-capybara (2.20.0)
127
+ rubocop (~> 1.41)
128
+ rubocop-factory_bot (2.25.1)
129
129
  rubocop (~> 1.41)
130
- rubocop-factory_bot (2.24.0)
131
- rubocop (~> 1.33)
132
130
  rubocop-rake (0.6.0)
133
131
  rubocop (~> 1.0)
134
- rubocop-rspec (2.24.1)
135
- rubocop (~> 1.33)
132
+ rubocop-rspec (2.26.1)
133
+ rubocop (~> 1.40)
136
134
  rubocop-capybara (~> 2.17)
137
135
  rubocop-factory_bot (~> 2.22)
138
136
  ruby-maven (3.3.13)
139
137
  ruby-maven-libs (~> 3.3.9)
140
138
  ruby-maven-libs (3.3.9)
141
- ruby-prof (1.6.3)
139
+ ruby-prof (1.7.0)
142
140
  ruby-progressbar (1.13.0)
143
141
  shellany (0.0.1)
144
142
  simplecov (0.22.0)
@@ -147,7 +145,7 @@ GEM
147
145
  simplecov_json_formatter (~> 0.1)
148
146
  simplecov-html (0.12.3)
149
147
  simplecov_json_formatter (0.1.4)
150
- solargraph (0.49.0)
148
+ solargraph (0.50.0)
151
149
  backport (~> 1.2)
152
150
  benchmark
153
151
  bundler (~> 2.0)
@@ -165,10 +163,10 @@ GEM
165
163
  yard (~> 0.9, >= 0.9.24)
166
164
  spoon (0.0.6)
167
165
  ffi
168
- stringio (3.0.8)
166
+ stringio (3.1.0)
169
167
  terminal-notifier (2.0.0)
170
168
  terminal-notifier-guard (1.7.0)
171
- thor (1.2.2)
169
+ thor (1.3.0)
172
170
  tilt (2.3.0)
173
171
  unicode-display_width (2.5.0)
174
172
  webrick (1.8.1)
@@ -177,6 +175,7 @@ GEM
177
175
  PLATFORMS
178
176
  arm64-darwin-21
179
177
  arm64-darwin-22
178
+ arm64-darwin-23
180
179
  java
181
180
  universal-java-11
182
181
  universal-java-18
@@ -205,4 +204,4 @@ DEPENDENCIES
205
204
  yard
206
205
 
207
206
  BUNDLED WITH
208
- 2.4.19
207
+ 2.5.3
@@ -1,6 +1,6 @@
1
1
  require 'date'
2
2
  module RubyUnits
3
- # Copyright 2006-2023
3
+ # Copyright 2006-2024
4
4
  # @author Kevin C. Olbrich, Ph.D.
5
5
  # @see https://github.com/olbrich/ruby-units
6
6
  #
@@ -165,6 +165,17 @@ module RubyUnits
165
165
 
166
166
  # Class Methods
167
167
 
168
+ # Callback triggered when a subclass is created. This properly sets up the internal variables, and copies
169
+ # definitions from the parent class.
170
+ #
171
+ # @param [Class] subclass
172
+ def self.inherited(subclass)
173
+ super
174
+ subclass.definitions = definitions.dup
175
+ subclass.instance_variable_set(:@kinds, @kinds.dup)
176
+ subclass.setup
177
+ end
178
+
168
179
  # setup internal arrays and hashes
169
180
  # @return [Boolean]
170
181
  def self.setup
@@ -1581,7 +1592,9 @@ module RubyUnits
1581
1592
  unit_string = "#{Regexp.last_match(1)} USD" if unit_string =~ /\$\s*(#{NUMBER_REGEX})/
1582
1593
  unit_string.gsub!("\u00b0".force_encoding('utf-8'), 'deg') if unit_string.encoding == Encoding::UTF_8
1583
1594
 
1584
- unit_string.gsub!(/[%'"#_,]/, '%' => 'percent', "'" => 'feet', '"' => 'inch', '#' => 'pound', '_' => '', ',' => '')
1595
+ unit_string.gsub!(/(\d)[_,](\d)/, '\1\2') # remove underscores and commas in numbers
1596
+
1597
+ unit_string.gsub!(/[%'"#]/, '%' => 'percent', "'" => 'feet', '"' => 'inch', '#' => 'pound')
1585
1598
  if unit_string.start_with?(COMPLEX_NUMBER)
1586
1599
  match = unit_string.match(COMPLEX_REGEX)
1587
1600
  real = Float(match[:real]) if match[:real]
@@ -1,5 +1,5 @@
1
1
  module RubyUnits
2
2
  class Unit < Numeric
3
- VERSION = '4.0.0'.freeze
3
+ VERSION = '4.0.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-units
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Olbrich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-04 00:00:00.000000000 Z
11
+ date: 2024-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  - !ruby/object:Gem::Version
107
107
  version: '2.0'
108
108
  requirements: []
109
- rubygems_version: 3.4.19
109
+ rubygems_version: 3.2.33
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Provides classes and methods to perform unit math and conversions