ruby-units 3.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +3 -1
- data/.rubocop.yml +2 -0
- data/.ruby-version +1 -1
- data/.tool-versions +1 -2
- data/Gemfile +16 -1
- data/Gemfile.lock +88 -64
- data/README.md +2 -0
- data/lib/ruby_units/unit.rb +260 -179
- data/lib/ruby_units/version.rb +1 -1
- data/ruby-units.gemspec +2 -14
- metadata +7 -175
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 572cf98377411ff41dd490f784564f3b50401a7342552a7999688ea0763eec5b
|
4
|
+
data.tar.gz: 735696cb4410be7d1d7a1d03fabaa4fa734a2dc6f5c4a8a37648dcd88a461168
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0d994f5f9a10375fad35fa00905dc23ae5227e08157f10f27c85955e1d0df98500bb6d1174298b9f95f02a4f568a6d363af21204f6564e1c28f8b19c44a229f
|
7
|
+
data.tar.gz: 491e25dbb90dc0e7f5829b46c4973b178a49119ed3343fc6fe9931131d08525b0e8655079a6321bbbfef4f3624c0746dbbfde5b9dc866828fbe1a97d691b9569
|
data/.github/workflows/tests.yml
CHANGED
@@ -15,7 +15,9 @@ jobs:
|
|
15
15
|
strategy:
|
16
16
|
fail-fast: false
|
17
17
|
matrix:
|
18
|
-
ruby: ['
|
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
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.6
|
data/.tool-versions
CHANGED
data/Gemfile
CHANGED
@@ -1,10 +1,25 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
|
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,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby-units (
|
4
|
+
ruby-units (4.0.0)
|
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
|
-
|
11
|
+
base64 (0.1.1)
|
12
|
+
benchmark (0.2.1)
|
12
13
|
coderay (1.1.3)
|
13
|
-
debug (1.
|
14
|
-
irb (>= 1.
|
14
|
+
debug (1.8.0)
|
15
|
+
irb (>= 1.5.0)
|
15
16
|
reline (>= 0.3.1)
|
16
17
|
diff-lcs (1.5.0)
|
17
18
|
docile (1.4.0)
|
18
19
|
e2mmap (0.1.0)
|
19
|
-
ffi (1.
|
20
|
-
ffi (1.
|
20
|
+
ffi (1.16.1)
|
21
|
+
ffi (1.16.1-java)
|
21
22
|
formatador (1.1.0)
|
22
|
-
guard (2.18.
|
23
|
+
guard (2.18.1)
|
23
24
|
formatador (>= 0.2.4)
|
24
25
|
listen (>= 2.7, < 4.0)
|
25
26
|
lumberjack (>= 1.0.12, < 2.0)
|
@@ -33,131 +34,154 @@ GEM
|
|
33
34
|
guard (~> 2.1)
|
34
35
|
guard-compat (~> 1.1)
|
35
36
|
rspec (>= 2.99.0, < 4.0)
|
36
|
-
io-console (0.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
io-console (0.6.0)
|
38
|
+
io-console (0.6.0-java)
|
39
|
+
irb (1.8.1)
|
40
|
+
rdoc
|
41
|
+
reline (>= 0.3.8)
|
42
|
+
jar-dependencies (0.4.1)
|
43
|
+
jaro_winkler (1.5.6)
|
44
|
+
jaro_winkler (1.5.6-java)
|
45
|
+
json (2.6.3)
|
46
|
+
json (2.6.3-java)
|
43
47
|
kramdown (2.4.0)
|
44
48
|
rexml
|
45
49
|
kramdown-parser-gfm (1.1.0)
|
46
50
|
kramdown (~> 2.0)
|
47
|
-
|
51
|
+
language_server-protocol (3.17.0.3)
|
52
|
+
listen (3.8.0)
|
48
53
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
49
54
|
rb-inotify (~> 0.9, >= 0.9.10)
|
50
|
-
lumberjack (1.2.
|
55
|
+
lumberjack (1.2.9)
|
51
56
|
method_source (1.0.0)
|
52
|
-
mini_portile2 (2.8.0)
|
53
57
|
nenv (0.3.0)
|
54
|
-
nokogiri (1.
|
55
|
-
mini_portile2 (~> 2.8.0)
|
58
|
+
nokogiri (1.15.4-arm64-darwin)
|
56
59
|
racc (~> 1.4)
|
57
|
-
nokogiri (1.
|
60
|
+
nokogiri (1.15.4-java)
|
58
61
|
racc (~> 1.4)
|
59
|
-
nokogiri (1.
|
62
|
+
nokogiri (1.15.4-x86_64-darwin)
|
63
|
+
racc (~> 1.4)
|
64
|
+
nokogiri (1.15.4-x86_64-linux)
|
60
65
|
racc (~> 1.4)
|
61
66
|
notiffany (0.1.3)
|
62
67
|
nenv (~> 0.1)
|
63
68
|
shellany (~> 0.0)
|
64
|
-
parallel (1.
|
65
|
-
parser (3.
|
69
|
+
parallel (1.23.0)
|
70
|
+
parser (3.2.2.3)
|
66
71
|
ast (~> 2.4.1)
|
67
|
-
|
72
|
+
racc
|
73
|
+
pry (0.14.2)
|
68
74
|
coderay (~> 1.1)
|
69
75
|
method_source (~> 1.0)
|
70
|
-
pry (0.14.
|
76
|
+
pry (0.14.2-java)
|
71
77
|
coderay (~> 1.1)
|
72
78
|
method_source (~> 1.0)
|
73
79
|
spoon (~> 0.0)
|
74
|
-
|
75
|
-
|
80
|
+
psych (5.1.0)
|
81
|
+
stringio
|
82
|
+
psych (5.1.0-java)
|
83
|
+
jar-dependencies (>= 0.1.7)
|
84
|
+
racc (1.7.1)
|
85
|
+
racc (1.7.1-java)
|
76
86
|
rainbow (3.1.1)
|
77
87
|
rake (13.0.6)
|
78
88
|
rb-fsevent (0.11.2)
|
79
89
|
rb-inotify (0.10.1)
|
80
90
|
ffi (~> 1.0)
|
81
|
-
|
82
|
-
|
83
|
-
|
91
|
+
rbs (2.8.4)
|
92
|
+
rdoc (6.5.0)
|
93
|
+
psych (>= 4.0.0)
|
94
|
+
redcarpet (3.6.0)
|
95
|
+
regexp_parser (2.8.1)
|
96
|
+
reline (0.3.8)
|
84
97
|
io-console (~> 0.5)
|
85
98
|
reverse_markdown (2.1.1)
|
86
99
|
nokogiri
|
87
|
-
rexml (3.2.
|
88
|
-
rspec (3.
|
89
|
-
rspec-core (~> 3.
|
90
|
-
rspec-expectations (~> 3.
|
91
|
-
rspec-mocks (~> 3.
|
92
|
-
rspec-core (3.
|
93
|
-
rspec-support (~> 3.
|
94
|
-
rspec-expectations (3.
|
100
|
+
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)
|
95
108
|
diff-lcs (>= 1.2.0, < 2.0)
|
96
|
-
rspec-support (~> 3.
|
97
|
-
rspec-mocks (3.
|
109
|
+
rspec-support (~> 3.12.0)
|
110
|
+
rspec-mocks (3.12.6)
|
98
111
|
diff-lcs (>= 1.2.0, < 2.0)
|
99
|
-
rspec-support (~> 3.
|
100
|
-
rspec-support (3.
|
101
|
-
rubocop (1.
|
112
|
+
rspec-support (~> 3.12.0)
|
113
|
+
rspec-support (3.12.1)
|
114
|
+
rubocop (1.56.4)
|
115
|
+
base64 (~> 0.1.1)
|
102
116
|
json (~> 2.3)
|
117
|
+
language_server-protocol (>= 3.17.0)
|
103
118
|
parallel (~> 1.10)
|
104
|
-
parser (>= 3.
|
119
|
+
parser (>= 3.2.2.3)
|
105
120
|
rainbow (>= 2.2.2, < 4.0)
|
106
121
|
regexp_parser (>= 1.8, < 3.0)
|
107
122
|
rexml (>= 3.2.5, < 4.0)
|
108
|
-
rubocop-ast (>= 1.
|
123
|
+
rubocop-ast (>= 1.28.1, < 2.0)
|
109
124
|
ruby-progressbar (~> 1.7)
|
110
|
-
unicode-display_width (>=
|
111
|
-
rubocop-ast (1.
|
112
|
-
parser (>= 3.
|
125
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
126
|
+
rubocop-ast (1.29.0)
|
127
|
+
parser (>= 3.2.1.0)
|
128
|
+
rubocop-capybara (2.19.0)
|
129
|
+
rubocop (~> 1.41)
|
130
|
+
rubocop-factory_bot (2.24.0)
|
131
|
+
rubocop (~> 1.33)
|
113
132
|
rubocop-rake (0.6.0)
|
114
133
|
rubocop (~> 1.0)
|
115
|
-
rubocop-rspec (2.
|
134
|
+
rubocop-rspec (2.24.1)
|
116
135
|
rubocop (~> 1.33)
|
136
|
+
rubocop-capybara (~> 2.17)
|
137
|
+
rubocop-factory_bot (~> 2.22)
|
117
138
|
ruby-maven (3.3.13)
|
118
139
|
ruby-maven-libs (~> 3.3.9)
|
119
140
|
ruby-maven-libs (3.3.9)
|
120
|
-
ruby-prof (1.
|
121
|
-
ruby-progressbar (1.
|
141
|
+
ruby-prof (1.6.3)
|
142
|
+
ruby-progressbar (1.13.0)
|
122
143
|
shellany (0.0.1)
|
123
|
-
simplecov (0.
|
144
|
+
simplecov (0.22.0)
|
124
145
|
docile (~> 1.1)
|
125
146
|
simplecov-html (~> 0.11)
|
126
147
|
simplecov_json_formatter (~> 0.1)
|
127
148
|
simplecov-html (0.12.3)
|
128
149
|
simplecov_json_formatter (0.1.4)
|
129
|
-
solargraph (0.
|
150
|
+
solargraph (0.49.0)
|
130
151
|
backport (~> 1.2)
|
131
152
|
benchmark
|
132
|
-
bundler (
|
153
|
+
bundler (~> 2.0)
|
133
154
|
diff-lcs (~> 1.4)
|
134
155
|
e2mmap
|
135
156
|
jaro_winkler (~> 1.5)
|
136
157
|
kramdown (~> 2.3)
|
137
158
|
kramdown-parser-gfm (~> 1.1)
|
138
159
|
parser (~> 3.0)
|
139
|
-
|
140
|
-
|
160
|
+
rbs (~> 2.0)
|
161
|
+
reverse_markdown (~> 2.0)
|
162
|
+
rubocop (~> 1.38)
|
141
163
|
thor (~> 1.0)
|
142
164
|
tilt (~> 2.0)
|
143
165
|
yard (~> 0.9, >= 0.9.24)
|
144
166
|
spoon (0.0.6)
|
145
167
|
ffi
|
168
|
+
stringio (3.0.8)
|
146
169
|
terminal-notifier (2.0.0)
|
147
170
|
terminal-notifier-guard (1.7.0)
|
148
|
-
thor (1.2.
|
149
|
-
tilt (2.0
|
150
|
-
unicode-display_width (2.
|
151
|
-
webrick (1.
|
152
|
-
yard (0.9.
|
153
|
-
webrick (~> 1.7.0)
|
171
|
+
thor (1.2.2)
|
172
|
+
tilt (2.3.0)
|
173
|
+
unicode-display_width (2.5.0)
|
174
|
+
webrick (1.8.1)
|
175
|
+
yard (0.9.34)
|
154
176
|
|
155
177
|
PLATFORMS
|
178
|
+
arm64-darwin-21
|
179
|
+
arm64-darwin-22
|
156
180
|
java
|
157
|
-
ruby
|
158
181
|
universal-java-11
|
159
182
|
universal-java-18
|
160
183
|
x86_64-darwin-19
|
184
|
+
x86_64-linux
|
161
185
|
|
162
186
|
DEPENDENCIES
|
163
187
|
debug (>= 1.0.0)
|
@@ -181,4 +205,4 @@ DEPENDENCIES
|
|
181
205
|
yard
|
182
206
|
|
183
207
|
BUNDLED WITH
|
184
|
-
2.
|
208
|
+
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
|