unit_measurements 4.1.0 → 4.3.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: 54863b62dd4674220ac85d06db8ea39ef6fe8d14a88094ef130cea64c88600ba
4
- data.tar.gz: '07942fcca2e28edc8c82ef7ea6b52c605fddd9f13361d688f0866014151b5bf5'
3
+ metadata.gz: d3f6773d12334f587bca5c48febf8c0200364b0211c1a5f41f9c6956679fb5d6
4
+ data.tar.gz: 4a2a8539a325b5d8039b491808449ea742c9f1573b0f1aaa5750041a52f2cd1b
5
5
  SHA512:
6
- metadata.gz: a04de0e1c960848df45f496019e36c1c4315735db618d804fd56045b0260fb4d3454ec1c29abd35aa9ed000812081a2418af06264e984661c221a8c39244c4f6
7
- data.tar.gz: 5133befe012095a9a755dda45abdcbba8a2f5e302c85a79cb59aa762a76ba975a432ff3de938106c22d6a57f54489525a8ae82ef76493accb1663fc13fb65467
6
+ metadata.gz: 4222392e0060b5be820580325ebf1736b2f30ed9b0a565bcdd116a5cbc6987066e144afe4be990f2e48f0d2d2c948e0ea8c5171899b7e594aa2e4ac152ff034e
7
+ data.tar.gz: e30b6814c18dcb98140e62b169638ffbc450ed469940237ad010f148ed8bb6315439e91f37d6d898e79d4c33c286241af06367d2d9d513b18dfedf047c2d440e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## [4.3.0](https://github.com/shivam091/unit_measurements/compare/v4.2.0...v4.3.0) - 2023-10-07
2
+
3
+ ### What's new
4
+
5
+ - Added unit group for `luminous flux` units.
6
+ - Added unit group for `illuminance` units.
7
+
8
+ ----------
9
+
10
+ ## [4.2.0](https://github.com/shivam091/unit_measurements/compare/v4.1.0...v4.2.0) - 2023-10-06
11
+
12
+ ### What's new
13
+
14
+ - Added unit group for `pressure` units.
15
+ - Added unit group for `torque` units.
16
+
17
+ ----------
18
+
1
19
  ## [4.1.0](https://github.com/shivam091/unit_measurements/compare/v4.0.0...v4.1.0) - 2023-10-05
2
20
 
3
21
  ### What's new
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unit_measurements (4.1.0)
4
+ unit_measurements (4.3.0)
5
5
  activesupport (~> 7.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -424,10 +424,10 @@ and set primitive unit for each unit group using `primitive` method.
424
424
 
425
425
  ```ruby
426
426
  UnitMeasurements::Time = UnitMeasurements.build do
427
- # Set primitive unit for the unit group.
427
+ # Set primitive unit for the unit group (optional).
428
428
  primitive "s"
429
429
 
430
- # Group units by the unit system.
430
+ # Group units by the unit system (optional).
431
431
  system :metric do
432
432
  # Add a SI unit to the unit group.
433
433
  si_unit "s", aliases: ["second", "seconds"]
@@ -35,6 +35,10 @@ require_relative "magnetic_flux"
35
35
  require_relative "magnetic_induction"
36
36
  require_relative "magnetic_field"
37
37
  require_relative "catalytic_activity"
38
+ require_relative "pressure"
39
+ require_relative "torque"
40
+ require_relative "luminous_flux"
41
+ require_relative "illuminance"
38
42
 
39
43
  ## Other units
40
44
 
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::Illuminance = UnitMeasurements.build do
6
+ primitive "lx"
7
+
8
+ system :metric do
9
+ si_unit "lx", aliases: ["lux", "lm/m²", "lm/m^2", "lm·m⁻²", "lumen per square metre", "lumen per square meter"]
10
+ end
11
+
12
+ system :centimetre_gram_second do
13
+ unit "ph", value: "10000 lx", aliases: ["phot", "phots", "lm/cm²", "lm/cm^2", "lm·cm⁻²", "lumen per square centimetre", "lumen per square centimeter"]
14
+ end
15
+
16
+ system :us_customary do
17
+ unit "fc", value: "10.763910417 lx", aliases: ["footcandle", "lm/ft²", "lm/ft^2", "lm·ft⁻²", "lumen per square foot"]
18
+ end
19
+
20
+ unit "nx", value: "1 mlx", aliases: ["nox"]
21
+ end
@@ -0,0 +1,11 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::LuminousFlux = UnitMeasurements.build do
6
+ primitive "lm"
7
+
8
+ system :metric do
9
+ si_unit "lm", aliases: ["lumen", "lumens"]
10
+ end
11
+ end
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::Pressure = UnitMeasurements.build do
6
+ primitive "Pa"
7
+
8
+ system :metric do
9
+ si_unit "Pa", aliases: ["pascal", "pascals"]
10
+
11
+ unit "bar", value: "100 kPa", aliases: ["bars"]
12
+ end
13
+
14
+ system :centimetre_gram_second do
15
+ unit "Ba", value: "0.1 Pa", aliases: ["barye", "baryes"]
16
+ end
17
+
18
+ system :metre_tonne_second do
19
+ unit "pz", value: "1 kPa", aliases: ["pièze"]
20
+ end
21
+
22
+ unit "at", value: "98066.5 Pa", aliases: ["technical atmosphere", "technical atmospheres"]
23
+ unit "atm", value: "101325 Pa", aliases: ["atmosphere", "atmospheres"]
24
+ unit "Torr", value: [Rational(1, 760), "atm"], aliases: ["torr"]
25
+ end
@@ -0,0 +1,31 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::Torque = UnitMeasurements.build do
6
+ primitive "N·m"
7
+
8
+ system :metric do
9
+ si_unit "N·m", aliases: ["N*m", "newton meter", "newton metre"]
10
+
11
+ unit "kgf·m", value: "9.80665 N·m", aliases: ["kgf*m", "Kilogram-force meter", "kilogramme-force metre"]
12
+ end
13
+
14
+ system :centimetre_gram_second do
15
+ unit "dyn·cm", value: "1e-7 N·m", aliases: ["dyn*cm", "dyne centimeter", "dyne centimetre"]
16
+ end
17
+
18
+ system :foot_pound_second do
19
+ unit "pdl⋅ft", value: "0.0421401100938048 N·m", aliases: ["pdl*ft", "poundal foot", "foot-poundal"]
20
+ unit "ozf·in", value: "0.00706155 N·m", aliases: ["oz⋅in", "ozf*in", "oz*in", "ounce-force inch", "ounce-inch"]
21
+ unit "ozf·ft", value: "12 ozf·in", aliases: ["oz⋅ft", "ozf*ft", "oz*ft", "ounce-force foot", "ounce-foot"]
22
+ end
23
+
24
+ system :imperial do
25
+ unit "lbf⋅in", value: "0.1129848290276167 N·m", aliases: ["lb⋅in", "lbf*in", "lb*in", "pound-force inch", "pound-inch"]
26
+ end
27
+
28
+ system :english_engineering do
29
+ unit "lbf⋅ft", value: "12 lbf⋅in", aliases: ["lb⋅ft", "lbf*ft", "lb*ft", "pound-force foot", "pound-foot"]
30
+ end
31
+ end
@@ -3,5 +3,5 @@
3
3
  # -*- warn_indent: true -*-
4
4
 
5
5
  module UnitMeasurements
6
- VERSION = "4.1.0"
6
+ VERSION = "4.3.0"
7
7
  end
data/units.md CHANGED
@@ -4,7 +4,7 @@ As there are lots of units bundled with `unit_measurements`, we recommend you to
4
4
  bundled units before converting your measurements.
5
5
 
6
6
  **Notes:**
7
- 1. Unit names suffixed with `*` support all [SI prefixes](README.md#si-units-support).
7
+ 1. Unit names suffixed with `*` support all [SI prefixes](README.md#support-for-si-decimal-prefixes).
8
8
  2. Primitive unit of the unit group is in _emphasis typeface_.
9
9
 
10
10
  ## 1. Length/Distance
@@ -373,7 +373,7 @@ These units are defined in `UnitMeasurements::ElectricDipoleMoment`.
373
373
  | _1_ | _C⋅m*_ | _C*m, coulomb-meter, coulomb-metre_ |
374
374
  | 2 | D | debye, debyes |
375
375
 
376
- ## 31. Electric quadrupole moment
376
+ ## 32. Electric quadrupole moment
377
377
 
378
378
  These units are defined in `UnitMeasurements::ElectricQuadrupoleMoment`.
379
379
 
@@ -382,3 +382,51 @@ These units are defined in `UnitMeasurements::ElectricQuadrupoleMoment`.
382
382
  | _1_ | _C·m²*_ | _C*m^2, coulomb square meter, coulomb square metre_ |
383
383
  | 2 | statC·cm² | statC*m^2, statcoulomb square meter, statcoulomb square metre |
384
384
  | 3 | B | buckingham, buckinghams |
385
+
386
+ ## 33. Pressure
387
+
388
+ These units are defined in `UnitMeasurements::Pressure`.
389
+
390
+ | # | Name | Aliases |
391
+ |:--|:--|:--|
392
+ | _1_ | _Pa*_ | _pascal, pascals_ |
393
+ | 2 | bar | bars |
394
+ | 3 | Ba | barye, baryes |
395
+ | 4 | pz | pièze |
396
+ | 5 | at | technical atmosphere, technical atmospheres |
397
+ | 6 | atm | atmosphere, atmospheres |
398
+ | 7 | Torr | torr |
399
+
400
+ ## 34. Torque
401
+
402
+ These units are defined in `UnitMeasurements::Torque`.
403
+
404
+ | # | Name | Aliases |
405
+ |:--|:--|:--|
406
+ | _1_ | _N·m*_ | _N*m, newton meter, newton metre_ |
407
+ | 2 | kgf·m | kgf*m, Kilogram-force meter, kilogramme-force metre |
408
+ | 3 | dyn·cm | dyn*cm, dyne centimeter, dyne centimetre |
409
+ | 4 | pdl⋅ft | pdl*ft, poundal foot, foot-poundal |
410
+ | 5 | ozf·in | oz⋅in, ozf\*in, oz\*in, ounce-force inch, ounce-inch |
411
+ | 6 | ozf·ft | oz⋅ft, ozf\*ft, oz\*ft, ounce-force foot, ounce-foot |
412
+ | 7 | lbf⋅in | lb⋅in, lbf\*in, lb\*in, pound-force inch, pound-inch |
413
+ | 8 | lbf⋅ft | lb⋅ft, lbf\*ft, lb\*ft, pound-force foot, pound-foot |
414
+
415
+ ## 35. Luminous flux
416
+
417
+ These units are defined in `UnitMeasurements::LuminousFlux`.
418
+
419
+ | # | Name | Aliases |
420
+ |:--|:--|:--|
421
+ | _1_ | _lm*_ | _lumen, lumens_ |
422
+
423
+ ## 36. Illuminance
424
+
425
+ These units are defined in `UnitMeasurements::Illuminance`.
426
+
427
+ | # | Name | Aliases |
428
+ |:--|:--|:--|
429
+ | _1_ | _lx*_ | _lux, lm/m², lm/m^2, lm·m⁻², lumen per square metre, lumen per square meter_ |
430
+ | 2 | ph | phot, phots, lm/cm², lm/cm^2, lm·cm⁻², lumen per square centimetre, lumen per square centimeter |
431
+ | 3 | fc | footcandle, lm/ft², lm/ft^2, lm·ft⁻², lumen per square foot |
432
+ | 4 | nx | nox |
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.1.0
4
+ version: 4.3.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-05 00:00:00.000000000 Z
11
+ date: 2023-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -138,17 +138,21 @@ files:
138
138
  - lib/unit_measurements/unit_groups/electrical_inductance.rb
139
139
  - lib/unit_measurements/unit_groups/electrical_resistance.rb
140
140
  - lib/unit_measurements/unit_groups/force.rb
141
+ - lib/unit_measurements/unit_groups/illuminance.rb
141
142
  - lib/unit_measurements/unit_groups/length.rb
143
+ - lib/unit_measurements/unit_groups/luminous_flux.rb
142
144
  - lib/unit_measurements/unit_groups/luminous_intensity.rb
143
145
  - lib/unit_measurements/unit_groups/magnetic_field.rb
144
146
  - lib/unit_measurements/unit_groups/magnetic_flux.rb
145
147
  - lib/unit_measurements/unit_groups/magnetic_induction.rb
146
148
  - lib/unit_measurements/unit_groups/plane_angle.rb
149
+ - lib/unit_measurements/unit_groups/pressure.rb
147
150
  - lib/unit_measurements/unit_groups/quantity.rb
148
151
  - lib/unit_measurements/unit_groups/solid_angle.rb
149
152
  - lib/unit_measurements/unit_groups/sound_level.rb
150
153
  - lib/unit_measurements/unit_groups/temperature.rb
151
154
  - lib/unit_measurements/unit_groups/time.rb
155
+ - lib/unit_measurements/unit_groups/torque.rb
152
156
  - lib/unit_measurements/unit_groups/velocity.rb
153
157
  - lib/unit_measurements/unit_groups/volume.rb
154
158
  - lib/unit_measurements/unit_groups/weight.rb