unit_measurements 5.3.0 → 5.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +1 -1
- data/lib/unit_measurements/unit_groups/length.rb +14 -2
- data/lib/unit_measurements/unit_groups/weight.rb +12 -11
- data/lib/unit_measurements/version.rb +1 -1
- data/units.md +35 -25
- 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: e3db321077ce62eba3bf98f77fc58980cdfdef88789fba2a219a71655bb8a9af
|
4
|
+
data.tar.gz: 3c5b51f6d643d8cce56f67452fdd76643ae385f2d325b479151e1ce3686caeb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 193497aecf9153a9098fb6cc496f7f72ed82cff90d6045a60a7567eed3bb3c07af9a03e62d0c49ce479ac517a59d45501336cceb66c12edaed3986811e9f12aa
|
7
|
+
data.tar.gz: 5a8d0f77ae6b7f9455f05e122db97f3ad4ddaf448c0bf45b9c0d086b7363b6fd7e65ad3d12288d0b1e5541d413270b8ac7a3bc7d3a4377ce7ea40c9bcbef366e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## [5.4.0](https://github.com/shivam091/unit_measurements/compare/v5.3.0...v5.4.0) - 2023-10-27
|
2
|
+
|
3
|
+
### What's new
|
4
|
+
|
5
|
+
- Added new units `Å`, `lnk`, `lea`, `hh`, `nl`, and `sft` in length.
|
6
|
+
- Added new units `N`, `s`, `drt`, and `lbt` in weight.
|
7
|
+
|
8
|
+
----------
|
9
|
+
|
1
10
|
## [5.3.0](https://github.com/shivam091/unit_measurements/compare/v5.2.0...v5.3.0) - 2023-10-24
|
2
11
|
|
3
12
|
### What's new
|
data/Gemfile.lock
CHANGED
@@ -7,19 +7,31 @@ UnitMeasurements::Length = UnitMeasurements.build do
|
|
7
7
|
|
8
8
|
system :metric do
|
9
9
|
si_unit "m", aliases: ["meter", "metre", "meters", "metres"]
|
10
|
+
|
11
|
+
unit "Å", value: "1e-10 m", aliases: ["angstrom", "angstroms", "ångström"]
|
10
12
|
end
|
11
13
|
|
12
14
|
system :imperial do
|
15
|
+
unit "h", value: "4 in", aliases: ["hh", "hand", "hands"]
|
16
|
+
|
13
17
|
unit "in", value: "25.4 mm", aliases: ['"', "inch", "inches"]
|
14
18
|
unit "ft", value: "12 in", aliases: ["'", "foot", "feet"]
|
15
19
|
unit "yd", value: "3 ft", aliases: ["yard", "yards"]
|
16
|
-
unit "mi", value: "
|
20
|
+
unit "mi", value: "5280 ft", aliases: ["mile", "miles", "statute mile", "international mile"]
|
17
21
|
unit "ch", value: "22 yd", aliases: ["chain", "chains"]
|
18
|
-
unit "th", value: "1/1000 in", aliases: ["thou", "thousandth of an inch"]
|
22
|
+
unit "th", value: "1/1000 in", aliases: ["thou", "thousandth of an inch", "mil", "mils"]
|
23
|
+
unit "nl", value: "3 nmi", aliases: ["NL", "nleague", "nleagues", "nautical league", "nautical leagues"]
|
24
|
+
|
19
25
|
unit "ftm", value: "6 ft", aliases: ["fathom", "fathoms"]
|
20
26
|
unit "fur", value: "220 yd", aliases: ["furlong", "furlongs"]
|
21
27
|
unit "nmi", value: "1852 m", aliases: ["NMI", "M", "NM", "nautical mile", "nautical miles"]
|
22
28
|
unit "rod", value: "16 1/2 ft", aliases: ["rods", "perch", "pole", "lug"]
|
29
|
+
unit "lnk", value: "33/50 ft", aliases: ["l", "li", "link", "links"]
|
30
|
+
unit "lea", value: "3 mi", aliases: ["league", "leagues"]
|
31
|
+
end
|
32
|
+
|
33
|
+
system :us_customary do
|
34
|
+
unit "sft", value: "1200/3937 m", aliases: ["sfoot", "sfeet", "survey-foot", "survey-feet"]
|
23
35
|
end
|
24
36
|
|
25
37
|
system :astronomical do
|
@@ -10,27 +10,28 @@ 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 "N", value: "0.10197162129779283 kg", aliases: ["newton", "newtons"]
|
14
|
+
|
13
15
|
unit "ct", value: "200 mg", aliases: ["carat", "carats"]
|
14
16
|
unit "Da", value: "1.660538921e-27 kg", aliases: ["dalton", "daltons"]
|
15
17
|
end
|
16
18
|
|
17
19
|
system :imperial do
|
18
|
-
unit "
|
20
|
+
unit "s", value: "20 gr", aliases: ["scruple", "scruples"]
|
21
|
+
|
22
|
+
unit "lb", value: "0.45359237 kg", aliases: ["lbs", "lbm", "pound-mass", "pound", "pounds", "#"]
|
19
23
|
unit "st", value: "14 lb", aliases: ["stone", "stones"]
|
20
|
-
unit "oz", value:
|
21
|
-
|
24
|
+
unit "oz", value: "1/16 lb", aliases: ["ounce", "ounces"]
|
25
|
+
unit "dr", value: "1/16 oz", aliases: ["dram", "drams"]
|
26
|
+
unit "gr", value: "1/7000 lb", aliases: ["grain", "grains"]
|
22
27
|
|
23
|
-
|
24
|
-
unit "gr", value: [Rational(1, 7000), "lb"], aliases: ["grain", "grains"]
|
28
|
+
unit "drt", value: "60 gr", aliases: ["troy dram", "troy drams"]
|
25
29
|
unit "ozt", value: "480 gr", aliases: ["troy ounce", "troy ounces"]
|
26
|
-
unit "
|
27
|
-
|
28
|
-
|
29
|
-
system :avoirdupois do
|
30
|
-
unit "dr", value: [Rational(1, 16), "oz"], aliases: ["dram", "drams"]
|
30
|
+
unit "lbt", value: "5760 gr", aliases: ["troy pound", "troy pounds"]
|
31
|
+
unit "dwt", value: "1/20 ozt", aliases: ["pwt", "pennyweight", "pennyweights"]
|
31
32
|
end
|
32
33
|
|
33
34
|
system :foot_pound_second do
|
34
|
-
unit "slug", value: "32.
|
35
|
+
unit "slug", value: "32.17404856 lb", aliases: ["slugs"]
|
35
36
|
end
|
36
37
|
end
|
data/units.md
CHANGED
@@ -9,27 +9,33 @@ check below list of bundled units before converting your measurements.
|
|
9
9
|
in addition to [Decimal SI prefixes](README.md#decimal-si-prefixes).
|
10
10
|
3. Primitive unit of the unit group is in _emphasised typeface_.
|
11
11
|
|
12
|
-
## 1. Length
|
12
|
+
## 1. Length or distance
|
13
13
|
|
14
14
|
These units are defined in `UnitMeasurements::Length`.
|
15
15
|
|
16
16
|
| # | Name | Aliases |
|
17
17
|
|:--|:--|:--|
|
18
18
|
| _1_ | _m*_ | _meter, metre, meters, metres_ |
|
19
|
-
| 2 |
|
20
|
-
| 3 |
|
21
|
-
| 4 |
|
22
|
-
| 5 |
|
23
|
-
| 6 |
|
24
|
-
| 7 |
|
25
|
-
| 8 |
|
26
|
-
| 9 |
|
27
|
-
| 10 |
|
28
|
-
| 11 |
|
29
|
-
| 12 |
|
30
|
-
| 13 |
|
31
|
-
|
32
|
-
|
19
|
+
| 2 | Å | angstrom, angstroms, ångström |
|
20
|
+
| 3 | h | hh, hand, hands |
|
21
|
+
| 4 | in | ", inch, inches |
|
22
|
+
| 5 | ft | ', foot, feet |
|
23
|
+
| 6 | yd | yard, yards |
|
24
|
+
| 7 | mi | mile, miles, statute mile, international mile |
|
25
|
+
| 8 | ch | chain, chains |
|
26
|
+
| 9 | th | thou, thousandth of an inch, mil, mils |
|
27
|
+
| 10 | au | astronomical unit, astronomical units |
|
28
|
+
| 11 | pc | parsec, parsecs |
|
29
|
+
| 12 | nl | NL, nleague, nleagues, nautical league, nautical leagues |
|
30
|
+
| 13 | ftm | fm, fathom, fathoms |
|
31
|
+
| 14 | fur | furlong, furlongs |
|
32
|
+
| 15 | nmi | NMI, M, NM, nautical mile, nautical miles |
|
33
|
+
| 16 | rod | rods, perch, pole, lug |
|
34
|
+
| 17 | lnk | l, li, link, links |
|
35
|
+
| 18 | lea | league, leagues |
|
36
|
+
| 19 | sft | sfoot, sfeet, survey-foot, survey-feet |
|
37
|
+
|
38
|
+
## 2. Weight or mass
|
33
39
|
|
34
40
|
These units are defined in `UnitMeasurements::Weight`.
|
35
41
|
|
@@ -38,16 +44,20 @@ These units are defined in `UnitMeasurements::Weight`.
|
|
38
44
|
| _1_ | _g*_ | _gram, grams, gramme, grammes_ |
|
39
45
|
| 2 | q | quintal, quintals |
|
40
46
|
| 3 | t | tonne, tonnes, metric tonne, metric tonnes |
|
41
|
-
| 4 |
|
42
|
-
| 5 |
|
43
|
-
| 6 |
|
44
|
-
| 7 |
|
45
|
-
| 8 |
|
46
|
-
| 9 |
|
47
|
-
| 10 |
|
48
|
-
| 11 |
|
49
|
-
| 12 |
|
50
|
-
| 13 |
|
47
|
+
| 4 | N | newton, newtons |
|
48
|
+
| 5 | s | scruple, scruples |
|
49
|
+
| 6 | ct | carat, carats |
|
50
|
+
| 7 | Da | dalton, daltons |
|
51
|
+
| 8 | st | stone, stones |
|
52
|
+
| 9 | dr | dram, drams |
|
53
|
+
| 10 | lb | lbs, lbm, pound-mass, pound, pounds, \# |
|
54
|
+
| 11 | oz | ounce, ounces |
|
55
|
+
| 12 | gr | grain, grains |
|
56
|
+
| 13 | dwt | pennyweight, pennyweights |
|
57
|
+
| 14 | ozt | troy ounce, troy ounces |
|
58
|
+
| 15 | lbt | troy pound, troy pounds |
|
59
|
+
| 16 | drt | troy dram, troy drams |
|
60
|
+
| 17 | slug | slugs |
|
51
61
|
|
52
62
|
## 3. Time
|
53
63
|
|
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: 5.
|
4
|
+
version: 5.4.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-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|