unit_measurements 1.7.0 → 2.1.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 +11 -2
- data/Gemfile.lock +1 -1
- data/lib/unit_measurements/unit_groups/all.rb +2 -0
- data/lib/unit_measurements/unit_groups/amount_of_substance.rb +9 -0
- data/lib/unit_measurements/unit_groups/time.rb +18 -0
- data/lib/unit_measurements/version.rb +1 -1
- data/units.md +27 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8601bdbb7fb37856840869d267729adefddbf714ab6696376d6165252f9531f3
|
4
|
+
data.tar.gz: 33c504c31db58c752ecb4b587112ae2df4b0af6c0e1efd957af1202e635e3622
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 119bd53409c40aac1242b0721e3737e65231a2e243e1e0151ede230b5b2f76358679a63a0b9fc66c8ec8bf5fda9b9395a8539c8ad2f6fd08933edc8717ffaa6d
|
7
|
+
data.tar.gz: 3a5ed9b00ec6e5abee27bc8fd653e5c8c069ad18c5c5cac2c4dbcba519f1c72cbd574243f8c5e955fb4a896a737434b376395b2b4a46e114e40b473292fe04b8
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## [2.1.0](https://github.com/shivam091/unit_measurements/compare/v1.7.0...v2.1.0) - 2023-08-21
|
2
|
+
|
3
|
+
### What's new
|
4
|
+
|
5
|
+
- Added unit group for `time` units.
|
6
|
+
- Added unit group for `amount of substance` units.
|
7
|
+
|
8
|
+
----------
|
9
|
+
|
1
10
|
## [1.7.0](https://github.com/shivam091/unit_measurements/compare/v1.6.0...v1.7.0) - 2023-08-20
|
2
11
|
|
3
12
|
### What's new
|
@@ -76,10 +85,10 @@
|
|
76
85
|
|
77
86
|
----------
|
78
87
|
|
79
|
-
##
|
88
|
+
## 0.1.0 - 2023-09-13
|
80
89
|
|
81
90
|
### Initial release
|
82
91
|
|
83
92
|
-----------
|
84
93
|
|
85
|
-
|
94
|
+
### Unreleased
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,9 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# -*- frozen_string_literal: true -*-
|
3
|
+
# -*- warn_indent: true -*-
|
4
|
+
|
5
|
+
UnitMeasurements::AmountOfSubstance = UnitMeasurements.build do
|
6
|
+
si_unit :mol, aliases: [:mole, :moles]
|
7
|
+
|
8
|
+
unit :NA, value: "1.6605389210322e-24 mol", aliases: [:"avogadro constant"]
|
9
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# -*- frozen_string_literal: true -*-
|
3
|
+
# -*- warn_indent: true -*-
|
4
|
+
|
5
|
+
UnitMeasurements::Time = UnitMeasurements.build do
|
6
|
+
si_unit :s, aliases: [:sec, :second, :seconds]
|
7
|
+
|
8
|
+
unit :h, value: "60 min", aliases: [:hr, :hour, :hours]
|
9
|
+
unit :d, value: "24 h", aliases: [:day, :days]
|
10
|
+
unit :wk, value: "7 d", aliases: [:week, :weeks]
|
11
|
+
unit :fn, value: "2 wk", aliases: [:"4tnite", :fortnight, :fortnights]
|
12
|
+
unit :mo, value: "30.4167 d", aliases: [:month, :months]
|
13
|
+
unit :yr, value: "365 d", aliases: [:y, :year, :years]
|
14
|
+
unit :min, value: "60 s", aliases: [:minute, :minutes]
|
15
|
+
unit :qtr, value: "3 mo", aliases: [:quarter, :quarters]
|
16
|
+
unit :dec, value: "10 y", aliases: [:decade, :decades]
|
17
|
+
unit :cent, value: "10 dec", aliases: [:century, :centuries]
|
18
|
+
end
|
data/units.md
CHANGED
@@ -30,3 +30,30 @@ These units are defined in `UnitMeasurements::Weight`.
|
|
30
30
|
| **1** | **g\*** | **gram, grams, gramme, grammes** |
|
31
31
|
| 2 | q | quintal, quintals |
|
32
32
|
| 3 | t | tonne, tonnes, metric tonne, metric tonnes |
|
33
|
+
|
34
|
+
## 3. Time
|
35
|
+
|
36
|
+
These units are defined in `UnitMeasurements::Time`.
|
37
|
+
|
38
|
+
| # | Name | Aliases |
|
39
|
+
|:--|:--|:--|
|
40
|
+
| **1** | **s\*** | **sec, second, seconds** |
|
41
|
+
| 2 | h | hr, hour, hours |
|
42
|
+
| 3 | d | day, days |
|
43
|
+
| 4 | wk | week, weeks |
|
44
|
+
| 5 | fn | 4tnite, fortnight, fortnights |
|
45
|
+
| 6 | mo | month, months |
|
46
|
+
| 7 | yr | y, year, years |
|
47
|
+
| 8 | min | minute, minutes |
|
48
|
+
| 9 | qtr | quarter, quarters |
|
49
|
+
| 10 | dec | decade, decades |
|
50
|
+
| 11 | cent | century, centuries |
|
51
|
+
|
52
|
+
## 4. Amount of substance
|
53
|
+
|
54
|
+
These units are defined in `UnitMeasurements::AmountOfSubstance`.
|
55
|
+
|
56
|
+
| # | Symbol | Aliases |
|
57
|
+
|:--|:--|:--|
|
58
|
+
| **1** | **mol\*** | **mole, moles** |
|
59
|
+
| 2 | NA | avogadro constant |
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unit_measurements
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harshal LADHE
|
@@ -119,7 +119,9 @@ files:
|
|
119
119
|
- lib/unit_measurements/unit_group.rb
|
120
120
|
- lib/unit_measurements/unit_group_builder.rb
|
121
121
|
- lib/unit_measurements/unit_groups/all.rb
|
122
|
+
- lib/unit_measurements/unit_groups/amount_of_substance.rb
|
122
123
|
- lib/unit_measurements/unit_groups/length.rb
|
124
|
+
- lib/unit_measurements/unit_groups/time.rb
|
123
125
|
- lib/unit_measurements/unit_groups/weight.rb
|
124
126
|
- lib/unit_measurements/version.rb
|
125
127
|
- unit_measurements.gemspec
|