unit_measurements 4.2.0 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3a74eda6588ea67b8d469b7bb51f933e8df36cfe3e1879b50656c0629111413
4
- data.tar.gz: dfb6588696254c70afa9dc0aeb40c71f7b913df3cdb61b5e4c546be7438d924d
3
+ metadata.gz: d3f6773d12334f587bca5c48febf8c0200364b0211c1a5f41f9c6956679fb5d6
4
+ data.tar.gz: 4a2a8539a325b5d8039b491808449ea742c9f1573b0f1aaa5750041a52f2cd1b
5
5
  SHA512:
6
- metadata.gz: ab088d43d155a1251eec52df0e96a272f3b3edf3835401490fc568490de96c344893e6716f92dfa40a5f07610e857759743d1a5e1e43b8ae3063884e85539408
7
- data.tar.gz: 47dadbb4085c0f549df05d79bd7c2baf02b3439488ad3eaf7353c420cd44fb39b269e2fb0df9a4916f5087145decf20d3f6f306e926c5e756f87049ee022db29
6
+ metadata.gz: 4222392e0060b5be820580325ebf1736b2f30ed9b0a565bcdd116a5cbc6987066e144afe4be990f2e48f0d2d2c948e0ea8c5171899b7e594aa2e4ac152ff034e
7
+ data.tar.gz: e30b6814c18dcb98140e62b169638ffbc450ed469940237ad010f148ed8bb6315439e91f37d6d898e79d4c33c286241af06367d2d9d513b18dfedf047c2d440e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
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
+
1
10
  ## [4.2.0](https://github.com/shivam091/unit_measurements/compare/v4.1.0...v4.2.0) - 2023-10-06
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 (4.2.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"]
@@ -37,6 +37,8 @@ require_relative "magnetic_field"
37
37
  require_relative "catalytic_activity"
38
38
  require_relative "pressure"
39
39
  require_relative "torque"
40
+ require_relative "luminous_flux"
41
+ require_relative "illuminance"
40
42
 
41
43
  ## Other units
42
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
@@ -3,5 +3,5 @@
3
3
  # -*- warn_indent: true -*-
4
4
 
5
5
  module UnitMeasurements
6
- VERSION = "4.2.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
@@ -411,3 +411,22 @@ These units are defined in `UnitMeasurements::Torque`.
411
411
  | 6 | ozf·ft | oz⋅ft, ozf\*ft, oz\*ft, ounce-force foot, ounce-foot |
412
412
  | 7 | lbf⋅in | lb⋅in, lbf\*in, lb\*in, pound-force inch, pound-inch |
413
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.2.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-06 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,7 +138,9 @@ 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