unit_measurements 4.10.0 → 4.11.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 +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/unit_measurements/unit_groups/length.rb +12 -1
- data/lib/unit_measurements/unit_groups/weight.rb +22 -0
- data/lib/unit_measurements/version.rb +1 -1
- data/units.md +19 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60c27b3d75f3b92e616011aecc0f220ef26f1a2e0828bcc5c85b2d0cadd3b81b
|
4
|
+
data.tar.gz: d9d8fd3e291b6cb8391bd45184f09432c1ed9808d80cc0124f26d889f578f680
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5612e9192c1c59076d94072d2e7c6d7838c4022ff152124ece55a9d4986fc8008759947469b0310c6c6dfa7045cb732c1e46d993585f907c595b9b342d5abad8
|
7
|
+
data.tar.gz: bbe280e459ae3ccfe7cbed4fdf56bd4f0666b4f02e4b91ba1b4b46747f7fb717a9ac77590eb7767723c23a2eca1993a95e803d5f661dec5530b392e4d633738b
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## [4.11.0](https://github.com/shivam091/unit_measurements/compare/v4.10.0...v4.11.0) - 2023-10-15
|
2
|
+
|
3
|
+
### What's new
|
4
|
+
|
5
|
+
- Added new units in `length` (ch, th, ftm, fur, nmi, rod, au, pc) unit group.
|
6
|
+
- Added new units in `weight` (ct, Da, lb, st, oz, gr, ozt, dwt, dr, slug) unit group.
|
7
|
+
|
8
|
+
----------
|
9
|
+
|
1
10
|
## [4.10.0](https://github.com/shivam091/unit_measurements/compare/v4.9.0...v4.10.0) - 2023-10-14
|
2
11
|
|
3
12
|
### What's new
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ A library that encapsulate measurements and their units in Ruby.
|
|
9
9
|
[](https://codeclimate.com/github/shivam091/unit_measurements/test_coverage)
|
10
10
|
[](https://github.com/shivam091/unit_measurements/blob/main/LICENSE.md)
|
11
11
|
|
12
|
-
|
12
|
+
[Harshal V. Ladhe, Master of Computer Science.](https://shivam091.github.io)
|
13
13
|
|
14
14
|
## Introduction
|
15
15
|
|
@@ -431,4 +431,4 @@ Volume = UnitMeasurements::Volume
|
|
431
431
|
|
432
432
|
## License
|
433
433
|
|
434
|
-
Copyright 2023 [Harshal V. LADHE](https://github.
|
434
|
+
Copyright 2023 [Harshal V. LADHE]((https://shivam091.github.io)), Released under the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -13,6 +13,17 @@ UnitMeasurements::Length = UnitMeasurements.build do
|
|
13
13
|
unit "in", value: "25.4 mm", aliases: ['"', "inch", "inches"]
|
14
14
|
unit "ft", value: "12 in", aliases: ["'", "foot", "feet"]
|
15
15
|
unit "yd", value: "3 ft", aliases: ["yard", "yards"]
|
16
|
-
unit "mi", value: "1760 yd", aliases: ["mile", "miles"]
|
16
|
+
unit "mi", value: "1760 yd", aliases: ["mile", "miles", "statute mile", "international mile"]
|
17
|
+
unit "ch", value: "22 yd", aliases: ["chain", "chains"]
|
18
|
+
unit "th", value: "1/1000 in", aliases: ["thou", "thousandth of an inch"]
|
19
|
+
unit "ftm", value: "6 ft", aliases: ["fathom", "fathoms"]
|
20
|
+
unit "fur", value: "220 yd", aliases: ["furlong", "furlongs"]
|
21
|
+
unit "nmi", value: "1852 m", aliases: ["NMI", "M", "NM", "nautical mile", "nautical miles"]
|
22
|
+
unit "rod", value: "16 1/2 ft", aliases: ["rods", "perch", "pole", "lug"]
|
23
|
+
end
|
24
|
+
|
25
|
+
system :astronomical do
|
26
|
+
unit "au", value: "149597870700 m", aliases: ["astronomical unit", "astronomical units"]
|
27
|
+
unit "pc", value: [Rational(648000, Math::PI), "au"], aliases: ["parsec", "parsecs"]
|
17
28
|
end
|
18
29
|
end
|
@@ -10,5 +10,27 @@ UnitMeasurements::Weight = UnitMeasurements.build do
|
|
10
10
|
|
11
11
|
unit "q", value: "100 kg", aliases: ["quintal", "quintals"]
|
12
12
|
unit "t", value: "1000 kg", aliases: ["tonne", "tonnes", "metric tonne", "metric tonnes"]
|
13
|
+
unit "ct", value: "200 mg", aliases: ["carat", "carats"]
|
14
|
+
unit "Da", value: "1.660538921e-27 kg", aliases: ["dalton", "daltons"]
|
15
|
+
end
|
16
|
+
|
17
|
+
system :imperial do
|
18
|
+
unit "lb", value: [Rational(45_359_237, 1e+8), "kg"], aliases: ["lbs", "lbm", "pound-mass", "pound", "pounds", "#"]
|
19
|
+
unit "st", value: "14 lb", aliases: ["stone", "stones"]
|
20
|
+
unit "oz", value: [Rational(1, 16), "lb"], aliases: ["ounce", "ounces"]
|
21
|
+
end
|
22
|
+
|
23
|
+
system :troy_weight do
|
24
|
+
unit "gr", value: [Rational(1, 7000), "lb"], aliases: ["grain", "grains"]
|
25
|
+
unit "ozt", value: "480 gr", aliases: ["troy ounce", "troy ounces"]
|
26
|
+
unit "dwt", value: [Rational(1, 20), "ozt"], aliases: ["pennyweight", "pennyweights"]
|
27
|
+
end
|
28
|
+
|
29
|
+
system :avoirdupois do
|
30
|
+
unit "dr", value: [Rational(1, 16), "oz"], aliases: ["dram", "drams"]
|
31
|
+
end
|
32
|
+
|
33
|
+
system :foot_pound_second do
|
34
|
+
unit "slug", value: "32.1740 lb", aliases: ["slugs"]
|
13
35
|
end
|
14
36
|
end
|
data/units.md
CHANGED
@@ -17,7 +17,15 @@ These units are defined in `UnitMeasurements::Length`.
|
|
17
17
|
| 2 | in | ", inch, inches |
|
18
18
|
| 3 | ft | ', foot, feet |
|
19
19
|
| 4 | yd | yard, yards |
|
20
|
-
| 5 | mi | mile, miles |
|
20
|
+
| 5 | mi | mile, miles, statute mile, international mile |
|
21
|
+
| 6 | ch | chain, chains |
|
22
|
+
| 7 | th | thou, thousandth of an inch |
|
23
|
+
| 8 | au | astronomical unit, astronomical units |
|
24
|
+
| 9 | pc | parsec, parsecs |
|
25
|
+
| 10 | ftm | fathom, fathoms |
|
26
|
+
| 11 | fur | furlong, furlongs |
|
27
|
+
| 12 | nmi | NMI, M, NM, nautical mile, nautical miles |
|
28
|
+
| 13 | rod | rods, perch, pole, lug |
|
21
29
|
|
22
30
|
## 2. Weight/Mass
|
23
31
|
|
@@ -28,6 +36,16 @@ These units are defined in `UnitMeasurements::Weight`.
|
|
28
36
|
| _1_ | _g*_ | _gram, grams, gramme, grammes_ |
|
29
37
|
| 2 | q | quintal, quintals |
|
30
38
|
| 3 | t | tonne, tonnes, metric tonne, metric tonnes |
|
39
|
+
| 4 | ct | carat, carats |
|
40
|
+
| 5 | Da | dalton, daltons |
|
41
|
+
| 6 | st | stone, stones |
|
42
|
+
| 7 | dr | dram, drams |
|
43
|
+
| 8 | dwt | pennyweight, pennyweights |
|
44
|
+
| 9 | ozt | troy ounce, troy ounces |
|
45
|
+
| 10 | slug | slugs |
|
46
|
+
| 11 | lb | lbs, lbm, pound-mass, pound, pounds, \# |
|
47
|
+
| 12 | oz | ounce, ounces |
|
48
|
+
| 13 | gr | grain, grains |
|
31
49
|
|
32
50
|
## 3. Time
|
33
51
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unit_measurements
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harshal LADHE
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|