unit_measurements 5.3.0 → 5.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 006027cb5f557c69f5ba083f6624cf9e424fcb00cc794b8f50912907538a3689
4
- data.tar.gz: 4db6ec5c12a752191933c5aa6d99837c1e2dc5e8269e5d05339a6e9b631d3e7f
3
+ metadata.gz: e3db321077ce62eba3bf98f77fc58980cdfdef88789fba2a219a71655bb8a9af
4
+ data.tar.gz: 3c5b51f6d643d8cce56f67452fdd76643ae385f2d325b479151e1ce3686caeb3
5
5
  SHA512:
6
- metadata.gz: fe13840ae30879e2068b4a0628e073259d8faab8efc615f0ff6da1b4fc7307b2a4285ebe44425fc4bedf26263e02a5f29e34df6ac792e3c16429f214262dbc31
7
- data.tar.gz: d9f28aecb8b8dea511466a8e4f71288581c35407d841b20d65006a9bb8e3dad8d3ec53da4b2f83c0235d9a919a2dccf572371957c1010a8d449c7b11bdf1947f
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unit_measurements (5.3.0)
4
+ unit_measurements (5.4.0)
5
5
  activesupport (~> 7.0)
6
6
 
7
7
  GEM
@@ -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: "1760 yd", aliases: ["mile", "miles", "statute mile", "international mile"]
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 "lb", value: [Rational(45_359_237, 1e+8), "kg"], aliases: ["lbs", "lbm", "pound-mass", "pound", "pounds", "#"]
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: [Rational(1, 16), "lb"], aliases: ["ounce", "ounces"]
21
- end
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
- system :troy_weight do
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 "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"]
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.1740 lb", aliases: ["slugs"]
35
+ unit "slug", value: "32.17404856 lb", aliases: ["slugs"]
35
36
  end
36
37
  end
@@ -4,5 +4,5 @@
4
4
 
5
5
  module UnitMeasurements
6
6
  # Current stable version.
7
- VERSION = "5.3.0"
7
+ VERSION = "5.4.0"
8
8
  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/Distance
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 | in | ", inch, inches |
20
- | 3 | ft | ', foot, feet |
21
- | 4 | yd | yard, yards |
22
- | 5 | mi | mile, miles, statute mile, international mile |
23
- | 6 | ch | chain, chains |
24
- | 7 | th | thou, thousandth of an inch |
25
- | 8 | au | astronomical unit, astronomical units |
26
- | 9 | pc | parsec, parsecs |
27
- | 10 | ftm | fathom, fathoms |
28
- | 11 | fur | furlong, furlongs |
29
- | 12 | nmi | NMI, M, NM, nautical mile, nautical miles |
30
- | 13 | rod | rods, perch, pole, lug |
31
-
32
- ## 2. Weight/Mass
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 | ct | carat, carats |
42
- | 5 | Da | dalton, daltons |
43
- | 6 | st | stone, stones |
44
- | 7 | dr | dram, drams |
45
- | 8 | dwt | pennyweight, pennyweights |
46
- | 9 | ozt | troy ounce, troy ounces |
47
- | 10 | slug | slugs |
48
- | 11 | lb | lbs, lbm, pound-mass, pound, pounds, \# |
49
- | 12 | oz | ounce, ounces |
50
- | 13 | gr | grain, grains |
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.3.0
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-24 00:00:00.000000000 Z
11
+ date: 2023-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport