unit_measurements 1.7.0 → 2.2.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: bbb7978f79ac8f4fac738ef87936cf1bf20397c74772c35120205aed22d1ac1c
4
- data.tar.gz: 1b99cb2665a071d0e721f78cabad86fc50a39e2eda8349bd5813ba80c48afe89
3
+ metadata.gz: 2fd329380ef25e8589462a461c67a47370fbb69275b40a47e2ffde442e5890cc
4
+ data.tar.gz: 652ad790977e5a04bbc84b8388e0879a3c0f260d731551251359c7b070a92005
5
5
  SHA512:
6
- metadata.gz: 27da14501c804050def9568138cfcab08b7b81eeab9d47ba3c23117534d2f32f33ed42260c9199d95f1c5cc71e715d1844cc493be34e347989c9fb71932fb058
7
- data.tar.gz: e6c5e47ab28b199599cc7b86b748205d3124c52fbbdfb83a38849876177764e280ce6d324336908ebdff0eff6a3acdb98b8cf8a8bc94ef8f325deca2d378f560
6
+ metadata.gz: 9d827fae22520241b97c0566afc5eaa19b6a9fe7235add28a08afcf928a5bae051f506ef5d53cee50d6c90f13c3646e360ae78c58cceac4b6d95f18f7df75ef5
7
+ data.tar.gz: 72c4dab2cc0a34f556e377b3276171274b811118979beb0b4bd940780d2d6b45fb6e7c9ed7c1c1d920f90071ffdb5745dc34c3a6723e6b09f962a7b6d7bed0cd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## [2.2.0](https://github.com/shivam091/unit_measurements/compare/v2.1.0...v2.2.0) - 2023-08-21
2
+
3
+ ### What's new
4
+
5
+ - Added unit group for `electric current` units.
6
+ - Added unit group for `luminous intensity` units.
7
+ - Added unit group for `temperature` units.
8
+
9
+ ----------
10
+
11
+ ## [2.1.0](https://github.com/shivam091/unit_measurements/compare/v1.7.0...v2.1.0) - 2023-08-20
12
+
13
+ ### What's new
14
+
15
+ - Added unit group for `time` units.
16
+ - Added unit group for `amount of substance` units.
17
+
18
+ ----------
19
+
1
20
  ## [1.7.0](https://github.com/shivam091/unit_measurements/compare/v1.6.0...v1.7.0) - 2023-08-20
2
21
 
3
22
  ### What's new
@@ -76,10 +95,10 @@
76
95
 
77
96
  ----------
78
97
 
79
- ## [0.1.0] - 2023-09-13
98
+ ## 0.1.0 - 2023-09-13
80
99
 
81
100
  ### Initial release
82
101
 
83
102
  -----------
84
103
 
85
- ## [Unreleased]
104
+ ### Unreleased
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unit_measurements (1.7.0)
4
+ unit_measurements (2.2.0)
5
5
  activesupport (~> 7.0)
6
6
 
7
7
  GEM
@@ -2,5 +2,12 @@
2
2
  # -*- frozen_string_literal: true -*-
3
3
  # -*- warn_indent: true -*-
4
4
 
5
+ # Fundamental SI units
6
+
7
+ require_relative "amount_of_substance"
8
+ require_relative "electric_current"
5
9
  require_relative "length"
10
+ require_relative "luminous_intensity"
11
+ require_relative "temperature"
12
+ require_relative "time"
6
13
  require_relative "weight"
@@ -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,11 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::ElectricCurrent = UnitMeasurements.build do
6
+ si_unit :A, aliases: [:amp, :ampere, :amperes]
7
+
8
+ unit :abA, value: "10 A", aliases: [:abampere, :abamperes]
9
+ unit :Bi, value: "10 A", aliases: [:biot, :biots]
10
+ unit :statA, value: "3.33564e-10 A", aliases: [:statampere, :statamperes]
11
+ end
@@ -0,0 +1,9 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::LuminousIntensity = UnitMeasurements.build do
6
+ si_unit :cd, aliases: [:candela, :candelas]
7
+
8
+ unit :hk, value: "0.92 cd", aliases: [:hefnerkerze]
9
+ end
@@ -0,0 +1,9 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::Temperature = UnitMeasurements.build do
6
+ si_unit :K, aliases: [:kelvin, :kelvins]
7
+
8
+ unit :°R, value: "5/9 K", aliases: [:R, :°Ra, :Ra, :rankine]
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
@@ -3,5 +3,5 @@
3
3
  # -*- warn_indent: true -*-
4
4
 
5
5
  module UnitMeasurements
6
- VERSION = "1.7.0"
6
+ VERSION = "2.2.0"
7
7
  end
data/units.md CHANGED
@@ -30,3 +30,59 @@ 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
+ | # | Name | Aliases |
57
+ |:--|:--|:--|
58
+ | **1** | **mol\*** | **mole, moles** |
59
+ | 2 | NA | avogadro constant |
60
+
61
+ ## 5. Electric current
62
+
63
+ These units are defined in `UnitMeasurements::ElectricCurrent`.
64
+
65
+ | # | Name | Aliases |
66
+ |:--|:--|:--|
67
+ | **1** | **A\*** | **amp, ampere, amperes** |
68
+ | 2 | abA | abampere, abamperes |
69
+ | 3 | Bi | biot, biots |
70
+ | 4 | statA | statampere, statamperes |
71
+
72
+ ## 6. Luminous intensity
73
+
74
+ These units are defined in `UnitMeasurements::LuminousIntensity`.
75
+
76
+ | # | Name | Aliases |
77
+ |:--|:--|:--|
78
+ | **1** | **cd\*** | **candela, candelas** |
79
+ | 2 | hk | hefnerkerze |
80
+
81
+ ## 7. Temperature
82
+
83
+ These units are defined in `UnitMeasurements::Temperature`.
84
+
85
+ | # | Name | Aliases |
86
+ |:--|:--|:--|
87
+ | **1** | **K\*** | **kelvin, kelvins** |
88
+ | 2 | °R | R, °Ra, Ra, rankine |
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: 1.7.0
4
+ version: 2.2.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-09-20 00:00:00.000000000 Z
11
+ date: 2023-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -119,7 +119,12 @@ 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
123
+ - lib/unit_measurements/unit_groups/electric_current.rb
122
124
  - lib/unit_measurements/unit_groups/length.rb
125
+ - lib/unit_measurements/unit_groups/luminous_intensity.rb
126
+ - lib/unit_measurements/unit_groups/temperature.rb
127
+ - lib/unit_measurements/unit_groups/time.rb
123
128
  - lib/unit_measurements/unit_groups/weight.rb
124
129
  - lib/unit_measurements/version.rb
125
130
  - unit_measurements.gemspec