unit_measurements 4.3.0 → 4.5.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 +18 -0
- data/Gemfile.lock +1 -1
- data/lib/unit_measurements/unit_groups/all.rb +4 -0
- data/lib/unit_measurements/unit_groups/energy.rb +27 -0
- data/lib/unit_measurements/unit_groups/frequency.rb +16 -0
- data/lib/unit_measurements/unit_groups/luminance.rb +22 -0
- data/lib/unit_measurements/unit_groups/power.rb +23 -0
- data/lib/unit_measurements/version.rb +1 -1
- data/units.md +51 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c247fd1e99142d30ce86410eec3c46782b1614c46ea770fbbdf0838da0ca24ff
|
4
|
+
data.tar.gz: 2e473dcfb0227dd324f1e6b4fe8a6f9d89b0b72a93d7ca510578ef66cbcca84a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e067faa355f836a0ea06077773c08a2e8a6da3599dc772d322e65f25f1188cc1f6d3d9a17e1be065ea665773fe59e19408634ac2905fe772d16076b4777b8b5
|
7
|
+
data.tar.gz: 2f57493cfc1632ad57ccbe8dec4d5690ad436f8b1d1e22278d6855346fc820d8ca8ac81d1f0834597cbffbb358bf5f22c594306b74085d828fe058ae0e2d013a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
## [4.5.0](https://github.com/shivam091/unit_measurements/compare/v4.4.0...v4.5.0) - 2023-10-09
|
2
|
+
|
3
|
+
### What's new
|
4
|
+
|
5
|
+
- Added unit group for `energy` units.
|
6
|
+
- Added unit group for `power` units.
|
7
|
+
|
8
|
+
----------
|
9
|
+
|
10
|
+
## [4.4.0](https://github.com/shivam091/unit_measurements/compare/v4.3.0...v4.4.0) - 2023-10-08
|
11
|
+
|
12
|
+
### What's new
|
13
|
+
|
14
|
+
- Added unit group for `luminance` units.
|
15
|
+
- Added unit group for `frequency` units.
|
16
|
+
|
17
|
+
----------
|
18
|
+
|
1
19
|
## [4.3.0](https://github.com/shivam091/unit_measurements/compare/v4.2.0...v4.3.0) - 2023-10-07
|
2
20
|
|
3
21
|
### What's new
|
data/Gemfile.lock
CHANGED
@@ -39,6 +39,10 @@ require_relative "pressure"
|
|
39
39
|
require_relative "torque"
|
40
40
|
require_relative "luminous_flux"
|
41
41
|
require_relative "illuminance"
|
42
|
+
require_relative "luminance"
|
43
|
+
require_relative "frequency"
|
44
|
+
require_relative "power"
|
45
|
+
require_relative "energy"
|
42
46
|
|
43
47
|
## Other units
|
44
48
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# -*- frozen_string_literal: true -*-
|
3
|
+
# -*- warn_indent: true -*-
|
4
|
+
|
5
|
+
UnitMeasurements::Energy = UnitMeasurements.build do
|
6
|
+
primitive "J"
|
7
|
+
|
8
|
+
system :metric do
|
9
|
+
si_unit "J", aliases: ["joule", "joules"]
|
10
|
+
si_unit "cal", value: "4.1868 J", aliases: ["calorie", "calories"]
|
11
|
+
|
12
|
+
unit "eV", value: "1.602176634e-19 J", aliases: ["electronvolt", "electron volt", "electron-volt"]
|
13
|
+
end
|
14
|
+
|
15
|
+
system :centimetre_gram_second do
|
16
|
+
unit "erg", value: "1e-7 J", aliases: ["ergs"]
|
17
|
+
end
|
18
|
+
|
19
|
+
system :us_customary do
|
20
|
+
si_unit "Btu", value: "1055.05585262 J", aliases: ["btu", "btus", "british thermal unit", "british thermal units"]
|
21
|
+
|
22
|
+
unit "thm", value: "100 kBtu", aliases: ["therm", "therms"]
|
23
|
+
unit "quad", value: "1.05505585262e+18 J", aliases: ["quads"]
|
24
|
+
end
|
25
|
+
|
26
|
+
unit "foe", value: "1e+51 erg", aliases: ["bethe"]
|
27
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# -*- frozen_string_literal: true -*-
|
3
|
+
# -*- warn_indent: true -*-
|
4
|
+
|
5
|
+
UnitMeasurements::Frequency = UnitMeasurements.build do
|
6
|
+
primitive "Hz"
|
7
|
+
|
8
|
+
system :metric do
|
9
|
+
si_unit "Hz", aliases: ["hertz", "hertzes"]
|
10
|
+
|
11
|
+
unit "rad/s", value: [Rational(1, (2 * Math::PI)), "Hz"], aliases: ["rad·s⁻¹", "radian per second", "radians per second"]
|
12
|
+
end
|
13
|
+
|
14
|
+
unit "deg/s", value: [Rational(1, 360), "Hz"], aliases: ["°/s", "deg·s⁻¹", "degree per second", "degrees per second"]
|
15
|
+
unit "rev/s", value: [1, "Hz"], aliases: ["rps", "rev·s⁻¹", "revolution per second", "revolutions per second"]
|
16
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# -*- frozen_string_literal: true -*-
|
3
|
+
# -*- warn_indent: true -*-
|
4
|
+
|
5
|
+
UnitMeasurements::Luminance = UnitMeasurements.build do
|
6
|
+
primitive "cd/m²"
|
7
|
+
|
8
|
+
system :metric do
|
9
|
+
unit "cd/m²", aliases: ["cd/m^2", "cd·m⁻²", "candela per square metre", "candelas per square metre", "candela per square meter", "candelas per square meter"]
|
10
|
+
end
|
11
|
+
|
12
|
+
system :us_customary do
|
13
|
+
unit "cd/in²", value: "1550.0031 cd/m²", aliases: ["cd/in^2", "cd·in⁻²", "candela per square inch", "candelas per square inch"]
|
14
|
+
unit "cd/ft²", value: "10.763910417 cd/m²", aliases: ["cd/ft^2", "cd·ft⁻²", "candela per square foot", "candelas per square foot"]
|
15
|
+
unit "fL", value: [Rational(1, Math::PI), "cd/ft²"], aliases: ["ft-L", "foot lambert", "foot-lambert"]
|
16
|
+
end
|
17
|
+
|
18
|
+
system :centimetre_gram_second do
|
19
|
+
unit "L", value: [Rational(10000, Math::PI), "cd/m²"], aliases: ["lambert", "lamberts"]
|
20
|
+
unit "sb", value: "10000 cd/m²", aliases: ["stlib"]
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# -*- frozen_string_literal: true -*-
|
3
|
+
# -*- warn_indent: true -*-
|
4
|
+
|
5
|
+
UnitMeasurements::Power = UnitMeasurements.build do
|
6
|
+
primitive "W"
|
7
|
+
|
8
|
+
system :metric do
|
9
|
+
si_unit "W", aliases: ["watt", "watts"]
|
10
|
+
|
11
|
+
unit "hp (M)", value: "735.49875 W", aliases: ["PS", "metric horsepower"]
|
12
|
+
end
|
13
|
+
|
14
|
+
system :imperial do
|
15
|
+
unit "hp", value: "745.69987158227022 W", aliases: ["hp (I)", "horsepower"]
|
16
|
+
end
|
17
|
+
|
18
|
+
system :centimetre_gram_second do
|
19
|
+
unit "erg/s", value: "1e-7 W", aliases: ["erg·s⁻¹", "erg per second", "ergs per second"]
|
20
|
+
end
|
21
|
+
|
22
|
+
unit "cal/s", value: "4.1868 W", aliases: ["cal·s⁻¹", "calorie per second", "calories per second"]
|
23
|
+
end
|
data/units.md
CHANGED
@@ -430,3 +430,54 @@ These units are defined in `UnitMeasurements::Illuminance`.
|
|
430
430
|
| 2 | ph | phot, phots, lm/cm², lm/cm^2, lm·cm⁻², lumen per square centimetre, lumen per square centimeter |
|
431
431
|
| 3 | fc | footcandle, lm/ft², lm/ft^2, lm·ft⁻², lumen per square foot |
|
432
432
|
| 4 | nx | nox |
|
433
|
+
|
434
|
+
## 37. Luminance
|
435
|
+
|
436
|
+
These units are defined in `UnitMeasurements::Luminance`.
|
437
|
+
|
438
|
+
| # | Name | Aliases |
|
439
|
+
|:--|:--|:--|
|
440
|
+
| _1_ | _cd/m²_ | _cd/m^2, cd·m⁻², candela per square metre, candelas per square metre, candela per square meter, candelas per square meter_ |
|
441
|
+
| 2 | cd/in² | cd/in^2, cd·in⁻², candela per square inch, candelas per square inch |
|
442
|
+
| 3 | cd/ft² | cd/ft^2, cd·ft⁻², candela per square foot, candelas per square foot |
|
443
|
+
| 4 | fL | ft-L, foot lambert, foot-lambert |
|
444
|
+
| 5 | L | lambert, lamberts |
|
445
|
+
| 6 | sb | stlib |
|
446
|
+
|
447
|
+
## 38. Frequency
|
448
|
+
|
449
|
+
These units are defined in `UnitMeasurements::Frequency`.
|
450
|
+
|
451
|
+
| # | Name | Aliases |
|
452
|
+
|:--|:--|:--|
|
453
|
+
| _1_ | _Hz*_ | _hertz, hertzes_ |
|
454
|
+
| 2 | rad/s | rad·s⁻¹, radian per second, radians per second |
|
455
|
+
| 3 | deg/s | °/s, deg·s⁻¹, degree per second, degrees per second |
|
456
|
+
| 4 | rev/s | rps, rev·s⁻¹, revolution per second, revolutions per second |
|
457
|
+
|
458
|
+
## 39. Power
|
459
|
+
|
460
|
+
These units are defined in `UnitMeasurements::Power`.
|
461
|
+
|
462
|
+
| # | Name | Aliases |
|
463
|
+
|:--|:--|:--|
|
464
|
+
| _1_ | _W*_ | _watt, watts_ |
|
465
|
+
| 2 | hp (M) | PS, metric horsepower |
|
466
|
+
| 3 | hp | hp (I), horsepower |
|
467
|
+
| 4 | erg/s | erg·s⁻¹, erg per second, ergs per second |
|
468
|
+
| 5 | cal/s | cal·s⁻¹, calorie per second, calories per second |
|
469
|
+
|
470
|
+
## 40. Energy
|
471
|
+
|
472
|
+
These units are defined in `UnitMeasurements::Energy`.
|
473
|
+
|
474
|
+
| # | Name | Aliases |
|
475
|
+
|:--|:--|:--|
|
476
|
+
| _1_ | _J*_ | _joule, joules_ |
|
477
|
+
| 2 | cal | calorie, calories |
|
478
|
+
| 3 | eV | electronvolt, electron volt, electron-volt |
|
479
|
+
| 4 | erg | ergs |
|
480
|
+
| 5 | Btu | btu, btus, british thermal unit, british thermal units |
|
481
|
+
| 6 | thm | therm, therms |
|
482
|
+
| 7 | quad | quads |
|
483
|
+
| 8 | foe | bethe |
|
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.5.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-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -137,15 +137,19 @@ files:
|
|
137
137
|
- lib/unit_measurements/unit_groups/electrical_elastance.rb
|
138
138
|
- lib/unit_measurements/unit_groups/electrical_inductance.rb
|
139
139
|
- lib/unit_measurements/unit_groups/electrical_resistance.rb
|
140
|
+
- lib/unit_measurements/unit_groups/energy.rb
|
140
141
|
- lib/unit_measurements/unit_groups/force.rb
|
142
|
+
- lib/unit_measurements/unit_groups/frequency.rb
|
141
143
|
- lib/unit_measurements/unit_groups/illuminance.rb
|
142
144
|
- lib/unit_measurements/unit_groups/length.rb
|
145
|
+
- lib/unit_measurements/unit_groups/luminance.rb
|
143
146
|
- lib/unit_measurements/unit_groups/luminous_flux.rb
|
144
147
|
- lib/unit_measurements/unit_groups/luminous_intensity.rb
|
145
148
|
- lib/unit_measurements/unit_groups/magnetic_field.rb
|
146
149
|
- lib/unit_measurements/unit_groups/magnetic_flux.rb
|
147
150
|
- lib/unit_measurements/unit_groups/magnetic_induction.rb
|
148
151
|
- lib/unit_measurements/unit_groups/plane_angle.rb
|
152
|
+
- lib/unit_measurements/unit_groups/power.rb
|
149
153
|
- lib/unit_measurements/unit_groups/pressure.rb
|
150
154
|
- lib/unit_measurements/unit_groups/quantity.rb
|
151
155
|
- lib/unit_measurements/unit_groups/solid_angle.rb
|