ruby-units 4.0.2 → 4.1.0

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: 515d78b788c31cefd79643b9a145f4cecf0448ac9e0df785453a2b19d31268d5
4
- data.tar.gz: b10b08bf4d1d23d94603a9e0c5ca0d6c4962587225f9b04b6f74bac5ae521816
3
+ metadata.gz: 498cbfa626e9e9620fe35cf426b6616564445a91111000bb34bf7d9ed7145251
4
+ data.tar.gz: 01db463b77e1b90cfe9307ee80d3ffac4232ba15baa0a8828176058b09e8ef1d
5
5
  SHA512:
6
- metadata.gz: 86df302207791952b19f06923111cb9305cf0e3cfeffab1869db061748925aa164b0f5d0eec453b546869b4895c0e1b41f38e2bfc4cb5f0b16986fdd41d5d576
7
- data.tar.gz: 5f5c690e1dbb1f222fa95f8e0050cac04d1431dfb2ee0517921c819961ec3c3b1f57b3ab97807d3ccf04f00e13f8aac91577d21aedfba2b8c2d98b0703449782
6
+ metadata.gz: 9152a60487f32e3f3191667430ce82eeb13bfa5764ec4ab9e1aaa9a95178445d7b430364743ab430d2d9c5190d11284b814dcd483b53f65e18edea9d4d7a0add
7
+ data.tar.gz: 770749d72b82a1b80ce2a4c58e5dc9d7633ded01091088841b30138591ef524ec5b3e60df70565013950f70b4847764340cd4ea67ad296f8ff20ca43bf1ff1ea
@@ -15,11 +15,11 @@ jobs:
15
15
  strategy:
16
16
  fail-fast: false
17
17
  matrix:
18
- ruby: ['3.0', '3.1', '3.2', '3.3', 'jruby-9.4']
18
+ ruby: ['3.1', '3.2', '3.3', 'jruby-9.4']
19
19
  env:
20
20
  BUNDLE_WITHOUT: optional
21
21
  steps:
22
- - uses: actions/checkout@v2
22
+ - uses: actions/checkout@v4
23
23
  - uses: ruby/setup-ruby@v1
24
24
  with:
25
25
  ruby-version: ${{ matrix.ruby }}
@@ -29,21 +29,25 @@ jobs:
29
29
  coverage:
30
30
  needs: test
31
31
  runs-on: ubuntu-latest
32
+ env:
33
+ BUNDLE_WITHOUT: optional
32
34
  steps:
33
- - uses: actions/checkout@v2
35
+ - uses: actions/checkout@v4
34
36
  - uses: ruby/setup-ruby@v1
35
37
  with:
36
38
  bundler-cache: true
37
39
  - name: Publish code coverage
38
- uses: paambaati/codeclimate-action@v2.7.5
40
+ uses: paambaati/codeclimate-action@v9
39
41
  env:
40
42
  CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
41
43
  with:
42
44
  coverageCommand: bundle exec rake
43
45
  yard:
44
46
  runs-on: ubuntu-latest
47
+ env:
48
+ BUNDLE_WITHOUT: optional
45
49
  steps:
46
- - uses: actions/checkout@v2
50
+ - uses: actions/checkout@v4
47
51
  - uses: ruby/setup-ruby@v1
48
52
  with:
49
53
  bundler-cache: true
data/.rubocop.yml CHANGED
@@ -1,3 +1,5 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
1
3
  require:
2
4
  - rubocop-rake
3
5
  - rubocop-rspec
@@ -7,14 +9,10 @@ AllCops:
7
9
  Exclude:
8
10
  - ruby-units.gemspec
9
11
  - bin/*
10
- Style/CaseEquality:
11
- Enabled: false
12
- Style/FrozenStringLiteralComment:
13
- Enabled: false
12
+ Style/StringLiterals:
13
+ EnforcedStyle: double_quotes
14
14
  Layout/LineLength:
15
15
  Enabled: false
16
- Style/SingleLineBlockParams:
17
- Enabled: false
18
16
  Naming/FileName:
19
17
  Exclude:
20
18
  - 'lib/ruby-units.rb'
@@ -22,7 +20,13 @@ Naming/MethodParameterName:
22
20
  Enabled: false
23
21
  Style/FormatString:
24
22
  Enabled: false
25
- Style/DateTime:
26
- Enabled: false
27
23
  Metrics/ClassLength:
28
24
  Enabled: false
25
+ Metrics/MethodLength:
26
+ Enabled: false
27
+ Metrics/CyclomaticComplexity:
28
+ Enabled: false
29
+ Metrics/PerceivedComplexity:
30
+ Enabled: false
31
+ Metrics/AbcSize:
32
+ Enabled: false
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,193 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2024-09-01 18:40:26 UTC using RuboCop version 1.66.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 2
10
+ Lint/BinaryOperatorWithIdenticalOperands:
11
+ Exclude:
12
+ - 'spec/ruby_units/unit_spec.rb'
13
+
14
+ # Offense count: 2
15
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
16
+ # SupportedStyles: snake_case, normalcase, non_integer
17
+ # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
18
+ Naming/VariableNumber:
19
+ Exclude:
20
+ - 'spec/ruby_units/unit_spec.rb'
21
+
22
+ # Offense count: 3
23
+ # This cop supports unsafe autocorrection (--autocorrect-all).
24
+ RSpec/BeEq:
25
+ Exclude:
26
+ - 'spec/ruby_units/unit_spec.rb'
27
+
28
+ # Offense count: 2
29
+ RSpec/BeforeAfterAll:
30
+ Exclude:
31
+ - '**/spec/spec_helper.rb'
32
+ - '**/spec/rails_helper.rb'
33
+ - '**/spec/support/**/*.rb'
34
+ - 'spec/ruby_units/temperature_spec.rb'
35
+
36
+ # Offense count: 95
37
+ # Configuration parameters: Prefixes, AllowedPatterns.
38
+ # Prefixes: when, with, without
39
+ RSpec/ContextWording:
40
+ Exclude:
41
+ - 'spec/ruby_units/temperature_spec.rb'
42
+ - 'spec/ruby_units/unit_spec.rb'
43
+ - 'spec/ruby_units/utf-8/unit_spec.rb'
44
+
45
+ # Offense count: 12
46
+ # Configuration parameters: IgnoredMetadata.
47
+ RSpec/DescribeClass:
48
+ Exclude:
49
+ - '**/spec/features/**/*'
50
+ - '**/spec/requests/**/*'
51
+ - '**/spec/routing/**/*'
52
+ - '**/spec/system/**/*'
53
+ - '**/spec/views/**/*'
54
+ - 'spec/ruby_units/bugs_spec.rb'
55
+ - 'spec/ruby_units/definition_spec.rb'
56
+ - 'spec/ruby_units/temperature_spec.rb'
57
+ - 'spec/ruby_units/unit_spec.rb'
58
+
59
+ # Offense count: 1
60
+ RSpec/DescribeMethod:
61
+ Exclude:
62
+ - 'spec/ruby_units/utf-8/unit_spec.rb'
63
+
64
+ # Offense count: 22
65
+ # This cop supports unsafe autocorrection (--autocorrect-all).
66
+ # Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
67
+ # SupportedStyles: described_class, explicit
68
+ RSpec/DescribedClass:
69
+ Exclude:
70
+ - 'spec/ruby_units/complex_spec.rb'
71
+ - 'spec/ruby_units/unit_spec.rb'
72
+
73
+ # Offense count: 8
74
+ # Configuration parameters: CountAsOne.
75
+ RSpec/ExampleLength:
76
+ Max: 7
77
+
78
+ # Offense count: 2
79
+ # Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
80
+ RSpec/IndexedLet:
81
+ Exclude:
82
+ - 'spec/ruby_units/unit_spec.rb'
83
+
84
+ # Offense count: 11
85
+ # Configuration parameters: AssignmentOnly.
86
+ RSpec/InstanceVariable:
87
+ Exclude:
88
+ - 'spec/ruby_units/unit_spec.rb'
89
+
90
+ # Offense count: 1
91
+ RSpec/MultipleDescribes:
92
+ Exclude:
93
+ - 'spec/ruby_units/unit_spec.rb'
94
+
95
+ # Offense count: 10
96
+ RSpec/MultipleExpectations:
97
+ Max: 6
98
+
99
+ # Offense count: 59
100
+ # Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
101
+ # SupportedStyles: always, named_only
102
+ RSpec/NamedSubject:
103
+ Exclude:
104
+ - 'spec/ruby_units/complex_spec.rb'
105
+ - 'spec/ruby_units/range_spec.rb'
106
+ - 'spec/ruby_units/unit_spec.rb'
107
+
108
+ # Offense count: 50
109
+ # Configuration parameters: AllowedGroups.
110
+ RSpec/NestedGroups:
111
+ Max: 5
112
+
113
+ # Offense count: 6
114
+ # This cop supports unsafe autocorrection (--autocorrect-all).
115
+ # Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
116
+ # SupportedStyles: inflected, explicit
117
+ RSpec/PredicateMatcher:
118
+ Exclude:
119
+ - 'spec/ruby_units/unit_spec.rb'
120
+
121
+ # Offense count: 2
122
+ RSpec/RepeatedExample:
123
+ Exclude:
124
+ - 'spec/ruby_units/unit_spec.rb'
125
+
126
+ # Offense count: 8
127
+ RSpec/RepeatedExampleGroupBody:
128
+ Exclude:
129
+ - 'spec/ruby_units/unit_spec.rb'
130
+
131
+ # Offense count: 8
132
+ RSpec/RepeatedExampleGroupDescription:
133
+ Exclude:
134
+ - 'spec/ruby_units/unit_spec.rb'
135
+
136
+ # Offense count: 1
137
+ # Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
138
+ # Include: **/*_spec.rb
139
+ RSpec/SpecFilePathFormat:
140
+ Exclude:
141
+ - '**/spec/routing/**/*'
142
+ - 'spec/ruby_units/utf-8/unit_spec.rb'
143
+
144
+ # Offense count: 1
145
+ # This cop supports unsafe autocorrection (--autocorrect-all).
146
+ # Configuration parameters: EnforcedStyle.
147
+ # SupportedStyles: nested, compact
148
+ Style/ClassAndModuleChildren:
149
+ Exclude:
150
+ - 'lib/ruby_units/definition.rb'
151
+
152
+ # Offense count: 1
153
+ # Configuration parameters: AllowedConstants.
154
+ Style/Documentation:
155
+ Exclude:
156
+ - 'spec/**/*'
157
+ - 'test/**/*'
158
+ - 'lib/ruby_units/configuration.rb'
159
+
160
+ # Offense count: 5
161
+ # This cop supports unsafe autocorrection (--autocorrect-all).
162
+ Style/GlobalStdStream:
163
+ Exclude:
164
+ - 'spec/benchmarks/bigdecimal.rb'
165
+ - 'spec/ruby_units/unit_spec.rb'
166
+
167
+ # Offense count: 1
168
+ Style/OpenStructUse:
169
+ Exclude:
170
+ - 'Guardfile'
171
+
172
+ # Offense count: 1
173
+ # Configuration parameters: AllowedMethods.
174
+ # AllowedMethods: respond_to_missing?
175
+ Style/OptionalBooleanParameter:
176
+ Exclude:
177
+ - 'lib/ruby_units/date.rb'
178
+
179
+ # Offense count: 1
180
+ # This cop supports unsafe autocorrection (--autocorrect-all).
181
+ # Configuration parameters: AllowSend.
182
+ Style/SendWithLiteralMethodName:
183
+ Exclude:
184
+ - 'lib/ruby_units/time.rb'
185
+
186
+ # Offense count: 3
187
+ # This cop supports unsafe autocorrection (--autocorrect-all).
188
+ # Configuration parameters: Mode.
189
+ Style/StringConcatenation:
190
+ Exclude:
191
+ - 'spec/ruby_units/bugs_spec.rb'
192
+ - 'spec/ruby_units/unit_spec.rb'
193
+ - 'spec/ruby_units/utf-8/unit_spec.rb'
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.6
1
+ 3.1.6
data/.tool-versions CHANGED
@@ -1,2 +1,2 @@
1
1
  java adoptopenjdk-18.0.1+10
2
- ruby 3.0.6
2
+ ruby 3.1.6
data/Gemfile CHANGED
@@ -1,25 +1,27 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
2
4
 
3
5
  # These are gems that are only used for local development and don't need to be included at runtime or for running tests.
4
6
  # The CI process will not install them.
5
7
  group :optional do
6
- gem 'debug', '>= 1.0.0', platform: :mri
7
- gem 'guard-rspec'
8
- gem 'pry'
9
- gem 'redcarpet', platform: :mri # redcarpet doesn't support jruby
10
- gem 'rubocop'
11
- gem 'rubocop-rake'
12
- gem 'rubocop-rspec'
13
- gem 'ruby-maven', platform: :jruby
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
+ gem "debug", ">= 1.0.0", platform: :mri
9
+ gem "guard-rspec"
10
+ gem "pry"
11
+ gem "redcarpet", platform: :mri # redcarpet doesn't support jruby
12
+ gem "rubocop"
13
+ gem "rubocop-rake"
14
+ gem "rubocop-rspec"
15
+ gem "ruby-maven", platform: :jruby
16
+ gem "ruby-prof", platform: :mri
17
+ gem "simplecov-html"
18
+ gem "solargraph"
19
+ gem "terminal-notifier"
20
+ gem "terminal-notifier-guard"
21
+ gem "webrick"
21
22
  end
22
23
 
23
- gem 'simplecov'
24
+ gem "simplecov"
25
+ gem "yard"
24
26
 
25
27
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-units (4.0.2)
4
+ ruby-units (4.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -10,14 +10,16 @@ GEM
10
10
  backport (1.2.0)
11
11
  benchmark (0.3.0)
12
12
  coderay (1.1.3)
13
- debug (1.9.1)
13
+ debug (1.9.2)
14
14
  irb (~> 1.10)
15
15
  reline (>= 0.3.8)
16
16
  diff-lcs (1.5.1)
17
- docile (1.4.0)
17
+ docile (1.4.1)
18
18
  e2mmap (0.1.0)
19
- ffi (1.16.3)
20
- ffi (1.16.3-java)
19
+ ffi (1.17.0-arm64-darwin)
20
+ ffi (1.17.0-java)
21
+ ffi (1.17.0-x86_64-darwin)
22
+ ffi (1.17.0-x86_64-linux-gnu)
21
23
  formatador (1.1.0)
22
24
  guard (2.18.1)
23
25
  formatador (>= 0.2.4)
@@ -35,38 +37,38 @@ GEM
35
37
  rspec (>= 2.99.0, < 4.0)
36
38
  io-console (0.7.2)
37
39
  io-console (0.7.2-java)
38
- irb (1.11.1)
39
- rdoc
40
+ irb (1.14.0)
41
+ rdoc (>= 4.0.0)
40
42
  reline (>= 0.4.2)
41
43
  jar-dependencies (0.4.1)
42
- jaro_winkler (1.5.6)
43
- jaro_winkler (1.5.6-java)
44
- json (2.7.1)
45
- json (2.7.1-java)
44
+ jaro_winkler (1.6.0)
45
+ jaro_winkler (1.6.0-java)
46
+ json (2.7.2)
47
+ json (2.7.2-java)
46
48
  kramdown (2.4.0)
47
49
  rexml
48
50
  kramdown-parser-gfm (1.1.0)
49
51
  kramdown (~> 2.0)
50
52
  language_server-protocol (3.17.0.3)
51
- listen (3.8.0)
53
+ listen (3.9.0)
52
54
  rb-fsevent (~> 0.10, >= 0.10.3)
53
55
  rb-inotify (~> 0.9, >= 0.9.10)
54
56
  lumberjack (1.2.10)
55
- method_source (1.0.0)
57
+ method_source (1.1.0)
56
58
  nenv (0.3.0)
57
- nokogiri (1.16.2-arm64-darwin)
59
+ nokogiri (1.16.7-arm64-darwin)
58
60
  racc (~> 1.4)
59
- nokogiri (1.16.2-java)
61
+ nokogiri (1.16.7-java)
60
62
  racc (~> 1.4)
61
- nokogiri (1.16.2-x86_64-darwin)
63
+ nokogiri (1.16.7-x86_64-darwin)
62
64
  racc (~> 1.4)
63
- nokogiri (1.16.2-x86_64-linux)
65
+ nokogiri (1.16.7-x86_64-linux)
64
66
  racc (~> 1.4)
65
67
  notiffany (0.1.3)
66
68
  nenv (~> 0.1)
67
69
  shellany (~> 0.0)
68
- parallel (1.24.0)
69
- parser (3.3.0.5)
70
+ parallel (1.26.3)
71
+ parser (3.3.4.2)
70
72
  ast (~> 2.4.1)
71
73
  racc
72
74
  pry (0.14.2)
@@ -80,59 +82,53 @@ GEM
80
82
  stringio
81
83
  psych (5.1.2-java)
82
84
  jar-dependencies (>= 0.1.7)
83
- racc (1.7.3)
84
- racc (1.7.3-java)
85
+ racc (1.8.1)
86
+ racc (1.8.1-java)
85
87
  rainbow (3.1.1)
86
- rake (13.1.0)
88
+ rake (13.2.1)
87
89
  rb-fsevent (0.11.2)
88
- rb-inotify (0.10.1)
90
+ rb-inotify (0.11.1)
89
91
  ffi (~> 1.0)
90
92
  rbs (2.8.4)
91
- rdoc (6.6.2)
93
+ rdoc (6.7.0)
92
94
  psych (>= 4.0.0)
93
95
  redcarpet (3.6.0)
94
- regexp_parser (2.9.0)
95
- reline (0.4.2)
96
+ regexp_parser (2.9.2)
97
+ reline (0.5.9)
96
98
  io-console (~> 0.5)
97
99
  reverse_markdown (2.1.1)
98
100
  nokogiri
99
- rexml (3.2.6)
101
+ rexml (3.3.6)
102
+ strscan
100
103
  rspec (3.13.0)
101
104
  rspec-core (~> 3.13.0)
102
105
  rspec-expectations (~> 3.13.0)
103
106
  rspec-mocks (~> 3.13.0)
104
107
  rspec-core (3.13.0)
105
108
  rspec-support (~> 3.13.0)
106
- rspec-expectations (3.13.0)
109
+ rspec-expectations (3.13.2)
107
110
  diff-lcs (>= 1.2.0, < 2.0)
108
111
  rspec-support (~> 3.13.0)
109
- rspec-mocks (3.13.0)
112
+ rspec-mocks (3.13.1)
110
113
  diff-lcs (>= 1.2.0, < 2.0)
111
114
  rspec-support (~> 3.13.0)
112
- rspec-support (3.13.0)
113
- rubocop (1.60.2)
115
+ rspec-support (3.13.1)
116
+ rubocop (1.66.0)
114
117
  json (~> 2.3)
115
118
  language_server-protocol (>= 3.17.0)
116
119
  parallel (~> 1.10)
117
120
  parser (>= 3.3.0.2)
118
121
  rainbow (>= 2.2.2, < 4.0)
119
- regexp_parser (>= 1.8, < 3.0)
120
- rexml (>= 3.2.5, < 4.0)
121
- rubocop-ast (>= 1.30.0, < 2.0)
122
+ regexp_parser (>= 2.4, < 3.0)
123
+ rubocop-ast (>= 1.32.1, < 2.0)
122
124
  ruby-progressbar (~> 1.7)
123
125
  unicode-display_width (>= 2.4.0, < 3.0)
124
- rubocop-ast (1.30.0)
125
- parser (>= 3.2.1.0)
126
- rubocop-capybara (2.20.0)
127
- rubocop (~> 1.41)
128
- rubocop-factory_bot (2.25.1)
129
- rubocop (~> 1.41)
126
+ rubocop-ast (1.32.1)
127
+ parser (>= 3.3.1.0)
130
128
  rubocop-rake (0.6.0)
131
129
  rubocop (~> 1.0)
132
- rubocop-rspec (2.26.1)
133
- rubocop (~> 1.40)
134
- rubocop-capybara (~> 2.17)
135
- rubocop-factory_bot (~> 2.22)
130
+ rubocop-rspec (3.0.4)
131
+ rubocop (~> 1.61)
136
132
  ruby-maven (3.3.13)
137
133
  ruby-maven-libs (~> 3.3.9)
138
134
  ruby-maven-libs (3.3.9)
@@ -163,14 +159,16 @@ GEM
163
159
  yard (~> 0.9, >= 0.9.24)
164
160
  spoon (0.0.6)
165
161
  ffi
166
- stringio (3.1.0)
162
+ stringio (3.1.1)
163
+ strscan (3.1.0)
164
+ strscan (3.1.0-java)
167
165
  terminal-notifier (2.0.0)
168
166
  terminal-notifier-guard (1.7.0)
169
- thor (1.3.0)
170
- tilt (2.3.0)
167
+ thor (1.3.2)
168
+ tilt (2.4.0)
171
169
  unicode-display_width (2.5.0)
172
170
  webrick (1.8.1)
173
- yard (0.9.34)
171
+ yard (0.9.36)
174
172
 
175
173
  PLATFORMS
176
174
  arm64-darwin-21
@@ -204,4 +202,4 @@ DEPENDENCIES
204
202
  yard
205
203
 
206
204
  BUNDLED WITH
207
- 2.5.3
205
+ 2.5.18
data/Guardfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # A sample Guardfile
2
4
  # More info at https://github.com/guard/guard#readme
3
5
 
@@ -7,7 +9,7 @@ directories %w[lib spec]
7
9
  ## Uncomment to clear the screen before every task
8
10
  clearing :on
9
11
 
10
- # Note: The cmd option is now required due to the increasing number of ways
12
+ # NOTE: The cmd option is now required due to the increasing number of ways
11
13
  # rspec may be run, below are examples of the most common uses.
12
14
  # * bundler: 'bundle exec rspec'
13
15
  # * bundler binstubs: 'bin/rspec'
@@ -16,14 +18,14 @@ clearing :on
16
18
  # * zeus: 'zeus rspec' (requires the server to be started separately)
17
19
  # * 'just' rspec: 'rspec'
18
20
 
19
- guard :rspec, cmd: 'bundle exec rspec' do
20
- require 'ostruct'
21
+ guard :rspec, cmd: "bundle exec rspec" do
22
+ require "ostruct"
21
23
 
22
24
  # Generic Ruby apps
23
25
  rspec = OpenStruct.new
24
26
  rspec.spec = ->(m) { "spec/#{m}_spec.rb" }
25
- rspec.spec_dir = 'spec'
26
- rspec.spec_helper = 'spec/spec_helper.rb'
27
+ rspec.spec_dir = "spec"
28
+ rspec.spec_helper = "spec/spec_helper.rb"
27
29
 
28
30
  watch(%r{^spec/.+_spec\.rb$})
29
31
  watch(%r{^lib/(.+)\.rb$}) { |m| rspec.spec.call(m[1]) }
data/README.md CHANGED
@@ -296,14 +296,15 @@ Configuration options can be set like:
296
296
 
297
297
  ```ruby
298
298
  RubyUnits.configure do |config|
299
+ config.format = :rational
299
300
  config.separator = false
300
301
  end
301
302
  ```
302
303
 
303
- Currently there is only one configuration you can set:
304
-
305
- 1. separator (true/false): should a space be used to separate the scalar from
306
- the unit part during output.
304
+ | Option | Description | Valid Values | Default |
305
+ |-----------|------------------------------------------------------------------------------------------------------------------------|---------------------------|-------------|
306
+ | format | Only used for output formatting. `:rational` is formatted like `3 m/s^2`. `:exponential` is formatted like `3 m*s^-2`. | `:rational, :exponential` | `:rational` |
307
+ | separator | Use a space separator for output. `true` is formatted like `3 m/s`, `false` is like `3m/s`. | `true, false` | `true` |
307
308
 
308
309
  ### NOTES
309
310
 
@@ -316,6 +317,10 @@ calculations. This in turn can have a negative impact on performance. The design
316
317
  of ruby-units has emphasized accuracy over speed. YMMV if you are doing a lot of
317
318
  math involving units.
318
319
 
320
+ ## Support Policy
321
+
322
+ Only currently maintained versions of ruby and jruby are supported.
323
+
319
324
  ## License
320
325
 
321
326
  [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Folbrich%2Fruby-units.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Folbrich%2Fruby-units?ref=badge_large)
data/Rakefile CHANGED
@@ -1,5 +1,7 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
data/lib/ruby-units.rb CHANGED
@@ -1,2 +1,4 @@
1
- require_relative 'ruby_units/namespaced'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "ruby_units/namespaced"
2
4
  Unit = RubyUnits::Unit
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RubyUnits
2
4
  # Extra methods for [::Array] to support conversion to [RubyUnits::Unit]
3
5
  module Array
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RubyUnits
2
4
  # Performance optimizations to avoid creating units unnecessarily
3
5
  class Cache