unitwise 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/ruby.yml +42 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +27 -0
- data/Gemfile +2 -6
- data/README.md +3 -7
- data/data/derived_unit.yaml +303 -303
- data/data/prefix.yaml +24 -24
- data/lib/unitwise/atom.rb +9 -3
- data/lib/unitwise/functional.rb +8 -0
- data/lib/unitwise/measurement.rb +1 -5
- data/lib/unitwise/number.rb +62 -0
- data/lib/unitwise/prefix.rb +2 -7
- data/lib/unitwise/scale.rb +2 -16
- data/lib/unitwise/standard/function.rb +2 -2
- data/lib/unitwise/standard/prefix.rb +4 -3
- data/lib/unitwise/standard/scale.rb +2 -2
- data/lib/unitwise/term.rb +2 -2
- data/lib/unitwise/unit.rb +3 -3
- data/lib/unitwise/version.rb +1 -1
- data/lib/unitwise.rb +1 -0
- data/test/support/scale_tests.rb +16 -22
- data/test/test_helper.rb +1 -5
- data/test/unitwise/functional_test.rb +1 -1
- data/test/unitwise/measurement_test.rb +8 -1
- data/test/unitwise/number_test.rb +52 -0
- data/unitwise.gemspec +6 -6
- metadata +23 -20
- data/.travis.yml +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0b30819c084e209df80a01852db2ab40a8e915af15321de9cd8e7181a4a7f622
|
4
|
+
data.tar.gz: 259f79ef2e7578d279f1c82adf861bc33166668fa39d20c2b5f906bd1b6fbfcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58310aa10271d1f864418bfb50641b102fa3227be68016ee97321c5f12054a48b4e8c76af02447b3dbe49f60aa5013d87c61b8fb7d17c67330d4c319b58fb1e7
|
7
|
+
data.tar.gz: 5422e3694fa60e13004221a3c5e75fdc633cc29b47142959e11712c0813f0112c86b6b59c6cf9828baaefc6bcafded450099d5929fa9b02f3da6a1df18768f58
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on: [push, pull_request]
|
11
|
+
|
12
|
+
permissions:
|
13
|
+
contents: read
|
14
|
+
|
15
|
+
jobs:
|
16
|
+
test:
|
17
|
+
strategy:
|
18
|
+
fail-fast: false
|
19
|
+
matrix:
|
20
|
+
ruby-version:
|
21
|
+
- '2.6'
|
22
|
+
- '2.7'
|
23
|
+
- '3.0'
|
24
|
+
- '3.1'
|
25
|
+
- 'jruby'
|
26
|
+
- 'truffleruby'
|
27
|
+
|
28
|
+
name: ${{ format('Tests (Ruby {0})', matrix.ruby-version) }}
|
29
|
+
runs-on: ubuntu-latest
|
30
|
+
env:
|
31
|
+
BUNDLE_WITHOUT: 'yard pry'
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@v3
|
34
|
+
|
35
|
+
- name: Set up Ruby
|
36
|
+
uses: ruby/setup-ruby@v1
|
37
|
+
with:
|
38
|
+
ruby-version: ${{ matrix.ruby-version }}
|
39
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
40
|
+
|
41
|
+
- name: Run tests
|
42
|
+
run: bundle exec rake
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.1.1
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,33 @@ Unitwise uses semantic versioning.
|
|
7
7
|
|
8
8
|
## Unreleased
|
9
9
|
|
10
|
+
## 2.3.0 - 2022-10-19
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
- Support for newer Rubies (2.6+) & drops support for older ones (2.6 is EOL but will continue to support for now)
|
15
|
+
- Support for Psych 4. Note: unit data YAML files in the gem are loaded using `unsafe_load`
|
16
|
+
|
17
|
+
## 2.2.0 - 2017-07-14
|
18
|
+
|
19
|
+
### Fixed
|
20
|
+
|
21
|
+
- Default units now stored as BigDecimal or Integer to reduce floating point
|
22
|
+
accuracy loss.
|
23
|
+
- Added missing conversion for Degree Réaumur.
|
24
|
+
|
25
|
+
### Changed
|
26
|
+
|
27
|
+
- Performing mathematical operations or converting units will now use Rational
|
28
|
+
math to prevent accuracy loss. In most cases, this means converted/operated
|
29
|
+
on `Measurement`s will have a `Rational` `#value`. If you have an explicit
|
30
|
+
dependency on the exact `Numeric` type that `Measurement#value` returns,
|
31
|
+
consider using `#to_f` or `#to_i` instead.
|
32
|
+
|
33
|
+
### Removed
|
34
|
+
|
35
|
+
- Support for MRI 2.1
|
36
|
+
|
10
37
|
## 2.1.0 - 2017-04-28
|
11
38
|
|
12
39
|
### Removed
|
data/Gemfile
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem '
|
4
|
-
|
5
|
-
gem 'bigdecimal', '>= 1.2.6', :platform => :mri
|
6
|
-
else
|
7
|
-
gem 'bigdecimal', '<= 1.2.5', :platform => :mri
|
8
|
-
end
|
3
|
+
gem 'covered'
|
4
|
+
gem 'bigdecimal', '>= 2', :platform => :mri
|
9
5
|
|
10
6
|
gemspec
|
data/README.md
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
# [Unitwise](//github.com/joshwlewis/unitwise)
|
2
2
|
|
3
3
|
[](https://rubygems.org/gems/unitwise)
|
4
|
-
[](https://gemnasium.com/joshwlewis/unitwise)
|
4
|
+
[](https://github.com/joshwlewis/unitwise/actions/workflows/ruby.yml)
|
6
5
|
[](https://coveralls.io/r/joshwlewis/unitwise)
|
7
6
|
[](https://codeclimate.com/github/joshwlewis/unitwise)
|
8
|
-

|
9
7
|
|
10
8
|
Unitwise is a Ruby library for unit measurement conversion and math.
|
11
9
|
|
@@ -273,11 +271,9 @@ Unitwise(1, "🥃").to_cup
|
|
273
271
|
This library aims to support and is tested against the following Ruby
|
274
272
|
implementations:
|
275
273
|
|
276
|
-
* Ruby 2.1
|
277
|
-
* Ruby 2.2
|
278
|
-
* Ruby 2.3
|
279
|
-
* Ruby 2.4
|
274
|
+
* Ruby 2.6 - 3.1
|
280
275
|
* [JRuby](http://jruby.org/)
|
276
|
+
* [TruffleRuby](https://github.com/oracle/truffleruby)
|
281
277
|
|
282
278
|
If something doesn't work on one of these versions, it's a bug.
|
283
279
|
|