ruby-units 3.0.0 → 4.0.1

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: 9e423976ff1953c233f4085f282b9431d9dc8f7fa840403221eb42d363384809
4
- data.tar.gz: 22c656c48317d6af891eb3e3e1fbfcecc48fd113a9fff76004c829417b4ed305
3
+ metadata.gz: ab979845681df4808b65ce563da009fb7f85a959d5aaab8d34da777e4e8023cf
4
+ data.tar.gz: 6505e1967cd97df4a80dc708e69f22031b6be1fc7b776568a9c65c7c276f798a
5
5
  SHA512:
6
- metadata.gz: '096f48bed8904c0e450151e1df844493826b665ffaad305b08c3315c215e97b82643ee450b8e6208930aa936128b835d62a661bc9823302442311da16a02bca9'
7
- data.tar.gz: 51814f9dc8b31fea8a4bb789a8f7e474a453737d4e9f6eba7ed2548285d99d21608ec14111ec024017abc04e57ea50556be1b597f6cb3688d4d7cd0ba665dfcc
6
+ metadata.gz: 579256ed6966a612661b3a677dcb5c991a39498b1b9789a48e501c68ad0d39b8937bb9c57ed4c47bc9ec5028c32752645d52b269a38cf6cf12a1062a4d52b27f
7
+ data.tar.gz: 708818f3a5311a0322c3b8afffdfb72dba0a9ba64892f403579abb16a76c0f7257a5602a66d02123a2a01afa02fdf4baf38ab94af0d0503d4c5923f489965f09
@@ -15,7 +15,9 @@ jobs:
15
15
  strategy:
16
16
  fail-fast: false
17
17
  matrix:
18
- ruby: ['2.6', '2.7', '3.0', '3.1', 'jruby-9.3']
18
+ ruby: ['3.0', '3.1', '3.2', '3.3', 'jruby-9.4']
19
+ env:
20
+ BUNDLE_WITHOUT: optional
19
21
  steps:
20
22
  - uses: actions/checkout@v2
21
23
  - uses: ruby/setup-ruby@v1
data/.rubocop.yml CHANGED
@@ -18,6 +18,8 @@ Style/SingleLineBlockParams:
18
18
  Naming/FileName:
19
19
  Exclude:
20
20
  - 'lib/ruby-units.rb'
21
+ Naming/MethodParameterName:
22
+ Enabled: false
21
23
  Style/FormatString:
22
24
  Enabled: false
23
25
  Style/DateTime:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.10
1
+ 3.0.6
data/.tool-versions CHANGED
@@ -1,3 +1,2 @@
1
- # ruby jruby-9.3.8.0
2
- # uncomment this to use jruby
3
1
  java adoptopenjdk-18.0.1+10
2
+ ruby 3.0.6
data/Gemfile CHANGED
@@ -1,10 +1,25 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- group :development do
3
+ # These are gems that are only used for local development and don't need to be included at runtime or for running tests.
4
+ # The CI process will not install them.
5
+ group :optional do
4
6
  gem 'debug', '>= 1.0.0', platform: :mri
7
+ gem 'guard-rspec'
8
+ gem 'pry'
5
9
  gem 'redcarpet', platform: :mri # redcarpet doesn't support jruby
10
+ gem 'rubocop'
11
+ gem 'rubocop-rake'
12
+ gem 'rubocop-rspec'
6
13
  gem 'ruby-maven', platform: :jruby
7
14
  gem 'ruby-prof', platform: :mri
15
+ gem 'simplecov-html'
16
+ gem 'solargraph'
17
+ gem 'terminal-notifier'
18
+ gem 'terminal-notifier-guard'
19
+ gem 'webrick'
20
+ gem 'yard'
8
21
  end
9
22
 
23
+ gem 'simplecov'
24
+
10
25
  gemspec
data/Gemfile.lock CHANGED
@@ -1,25 +1,25 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-units (3.0.0)
4
+ ruby-units (4.0.1)
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
- benchmark (0.2.0)
11
+ benchmark (0.2.1)
12
12
  coderay (1.1.3)
13
- debug (1.6.2)
14
- irb (>= 1.3.6)
13
+ debug (1.8.0)
14
+ irb (>= 1.5.0)
15
15
  reline (>= 0.3.1)
16
16
  diff-lcs (1.5.0)
17
17
  docile (1.4.0)
18
18
  e2mmap (0.1.0)
19
- ffi (1.15.5)
20
- ffi (1.15.5-java)
19
+ ffi (1.16.3)
20
+ ffi (1.16.3-java)
21
21
  formatador (1.1.0)
22
- guard (2.18.0)
22
+ guard (2.18.1)
23
23
  formatador (>= 0.2.4)
24
24
  listen (>= 2.7, < 4.0)
25
25
  lumberjack (>= 1.0.12, < 2.0)
@@ -33,131 +33,153 @@ GEM
33
33
  guard (~> 2.1)
34
34
  guard-compat (~> 1.1)
35
35
  rspec (>= 2.99.0, < 4.0)
36
- io-console (0.5.11)
37
- irb (1.4.1)
38
- reline (>= 0.3.0)
39
- jaro_winkler (1.5.4)
40
- jaro_winkler (1.5.4-java)
41
- json (2.6.2)
42
- json (2.6.2-java)
36
+ io-console (0.6.0)
37
+ io-console (0.6.0-java)
38
+ irb (1.8.3)
39
+ rdoc
40
+ reline (>= 0.3.8)
41
+ jar-dependencies (0.4.1)
42
+ jaro_winkler (1.5.6)
43
+ jaro_winkler (1.5.6-java)
44
+ json (2.6.3)
45
+ json (2.6.3-java)
43
46
  kramdown (2.4.0)
44
47
  rexml
45
48
  kramdown-parser-gfm (1.1.0)
46
49
  kramdown (~> 2.0)
47
- listen (3.7.1)
50
+ language_server-protocol (3.17.0.3)
51
+ listen (3.8.0)
48
52
  rb-fsevent (~> 0.10, >= 0.10.3)
49
53
  rb-inotify (~> 0.9, >= 0.9.10)
50
- lumberjack (1.2.8)
54
+ lumberjack (1.2.9)
51
55
  method_source (1.0.0)
52
- mini_portile2 (2.8.0)
53
56
  nenv (0.3.0)
54
- nokogiri (1.13.8)
55
- mini_portile2 (~> 2.8.0)
57
+ nokogiri (1.15.4-arm64-darwin)
56
58
  racc (~> 1.4)
57
- nokogiri (1.13.8-java)
59
+ nokogiri (1.15.4-java)
58
60
  racc (~> 1.4)
59
- nokogiri (1.13.8-x86_64-darwin)
61
+ nokogiri (1.15.4-x86_64-darwin)
62
+ racc (~> 1.4)
63
+ nokogiri (1.15.4-x86_64-linux)
60
64
  racc (~> 1.4)
61
65
  notiffany (0.1.3)
62
66
  nenv (~> 0.1)
63
67
  shellany (~> 0.0)
64
- parallel (1.22.1)
65
- parser (3.1.2.1)
68
+ parallel (1.23.0)
69
+ parser (3.2.2.4)
66
70
  ast (~> 2.4.1)
67
- pry (0.14.1)
71
+ racc
72
+ pry (0.14.2)
68
73
  coderay (~> 1.1)
69
74
  method_source (~> 1.0)
70
- pry (0.14.1-java)
75
+ pry (0.14.2-java)
71
76
  coderay (~> 1.1)
72
77
  method_source (~> 1.0)
73
78
  spoon (~> 0.0)
74
- racc (1.6.0)
75
- racc (1.6.0-java)
79
+ psych (5.1.1.1)
80
+ stringio
81
+ psych (5.1.1.1-java)
82
+ jar-dependencies (>= 0.1.7)
83
+ racc (1.7.2)
84
+ racc (1.7.2-java)
76
85
  rainbow (3.1.1)
77
- rake (13.0.6)
86
+ rake (13.1.0)
78
87
  rb-fsevent (0.11.2)
79
88
  rb-inotify (0.10.1)
80
89
  ffi (~> 1.0)
81
- redcarpet (3.5.1)
82
- regexp_parser (2.6.0)
83
- reline (0.3.1)
90
+ rbs (2.8.4)
91
+ rdoc (6.5.0)
92
+ psych (>= 4.0.0)
93
+ redcarpet (3.6.0)
94
+ regexp_parser (2.8.2)
95
+ reline (0.3.9)
84
96
  io-console (~> 0.5)
85
97
  reverse_markdown (2.1.1)
86
98
  nokogiri
87
- rexml (3.2.5)
88
- rspec (3.11.0)
89
- rspec-core (~> 3.11.0)
90
- rspec-expectations (~> 3.11.0)
91
- rspec-mocks (~> 3.11.0)
92
- rspec-core (3.11.0)
93
- rspec-support (~> 3.11.0)
94
- rspec-expectations (3.11.1)
99
+ rexml (3.2.6)
100
+ rspec (3.12.0)
101
+ rspec-core (~> 3.12.0)
102
+ rspec-expectations (~> 3.12.0)
103
+ rspec-mocks (~> 3.12.0)
104
+ rspec-core (3.12.2)
105
+ rspec-support (~> 3.12.0)
106
+ rspec-expectations (3.12.3)
95
107
  diff-lcs (>= 1.2.0, < 2.0)
96
- rspec-support (~> 3.11.0)
97
- rspec-mocks (3.11.1)
108
+ rspec-support (~> 3.12.0)
109
+ rspec-mocks (3.12.6)
98
110
  diff-lcs (>= 1.2.0, < 2.0)
99
- rspec-support (~> 3.11.0)
100
- rspec-support (3.11.1)
101
- rubocop (1.36.0)
111
+ rspec-support (~> 3.12.0)
112
+ rspec-support (3.12.1)
113
+ rubocop (1.57.2)
102
114
  json (~> 2.3)
115
+ language_server-protocol (>= 3.17.0)
103
116
  parallel (~> 1.10)
104
- parser (>= 3.1.2.1)
117
+ parser (>= 3.2.2.4)
105
118
  rainbow (>= 2.2.2, < 4.0)
106
119
  regexp_parser (>= 1.8, < 3.0)
107
120
  rexml (>= 3.2.5, < 4.0)
108
- rubocop-ast (>= 1.20.1, < 2.0)
121
+ rubocop-ast (>= 1.28.1, < 2.0)
109
122
  ruby-progressbar (~> 1.7)
110
- unicode-display_width (>= 1.4.0, < 3.0)
111
- rubocop-ast (1.21.0)
112
- parser (>= 3.1.1.0)
123
+ unicode-display_width (>= 2.4.0, < 3.0)
124
+ rubocop-ast (1.30.0)
125
+ parser (>= 3.2.1.0)
126
+ rubocop-capybara (2.19.0)
127
+ rubocop (~> 1.41)
128
+ rubocop-factory_bot (2.24.0)
129
+ rubocop (~> 1.33)
113
130
  rubocop-rake (0.6.0)
114
131
  rubocop (~> 1.0)
115
- rubocop-rspec (2.13.2)
116
- rubocop (~> 1.33)
132
+ rubocop-rspec (2.25.0)
133
+ rubocop (~> 1.40)
134
+ rubocop-capybara (~> 2.17)
135
+ rubocop-factory_bot (~> 2.22)
117
136
  ruby-maven (3.3.13)
118
137
  ruby-maven-libs (~> 3.3.9)
119
138
  ruby-maven-libs (3.3.9)
120
- ruby-prof (1.4.3)
121
- ruby-progressbar (1.11.0)
139
+ ruby-prof (1.6.3)
140
+ ruby-progressbar (1.13.0)
122
141
  shellany (0.0.1)
123
- simplecov (0.21.2)
142
+ simplecov (0.22.0)
124
143
  docile (~> 1.1)
125
144
  simplecov-html (~> 0.11)
126
145
  simplecov_json_formatter (~> 0.1)
127
146
  simplecov-html (0.12.3)
128
147
  simplecov_json_formatter (0.1.4)
129
- solargraph (0.47.2)
148
+ solargraph (0.49.0)
130
149
  backport (~> 1.2)
131
150
  benchmark
132
- bundler (>= 1.17.2)
151
+ bundler (~> 2.0)
133
152
  diff-lcs (~> 1.4)
134
153
  e2mmap
135
154
  jaro_winkler (~> 1.5)
136
155
  kramdown (~> 2.3)
137
156
  kramdown-parser-gfm (~> 1.1)
138
157
  parser (~> 3.0)
139
- reverse_markdown (>= 1.0.5, < 3)
140
- rubocop (>= 0.52)
158
+ rbs (~> 2.0)
159
+ reverse_markdown (~> 2.0)
160
+ rubocop (~> 1.38)
141
161
  thor (~> 1.0)
142
162
  tilt (~> 2.0)
143
163
  yard (~> 0.9, >= 0.9.24)
144
164
  spoon (0.0.6)
145
165
  ffi
166
+ stringio (3.0.8)
146
167
  terminal-notifier (2.0.0)
147
168
  terminal-notifier-guard (1.7.0)
148
- thor (1.2.1)
149
- tilt (2.0.11)
150
- unicode-display_width (2.3.0)
151
- webrick (1.7.0)
152
- yard (0.9.28)
153
- webrick (~> 1.7.0)
169
+ thor (1.3.0)
170
+ tilt (2.3.0)
171
+ unicode-display_width (2.5.0)
172
+ webrick (1.8.1)
173
+ yard (0.9.34)
154
174
 
155
175
  PLATFORMS
176
+ arm64-darwin-21
177
+ arm64-darwin-22
156
178
  java
157
- ruby
158
179
  universal-java-11
159
180
  universal-java-18
160
181
  x86_64-darwin-19
182
+ x86_64-linux
161
183
 
162
184
  DEPENDENCIES
163
185
  debug (>= 1.0.0)
@@ -181,4 +203,4 @@ DEPENDENCIES
181
203
  yard
182
204
 
183
205
  BUNDLED WITH
184
- 2.3.13
206
+ 2.4.19
data/README.md CHANGED
@@ -131,6 +131,8 @@ The `to_s` also accepts some options.
131
131
  ```ruby
132
132
  Unit.new('1.5 mm').to_s("%0.2f") # "1.50 mm". Enter any valid format
133
133
  # string. Also accepts strftime format
134
+ Unit.new('10 mm').to_s("%0.2f in")# "0.39 in". can also format and convert in
135
+ # the same time.
134
136
  Unit.new('1.5 mm').to_s("in") # converts to inches before printing
135
137
  Unit.new("2 m").to_s(:ft) # returns 6'7"
136
138
  Unit.new("100 kg").to_s(:lbs) # returns 220 lbs, 7 oz