unit_measurements 2.4.0 → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f69716c5e1584bd135672c262a7faf5152064647589c70aefb57d7d8d0ede2c3
4
- data.tar.gz: e50c33f90b4253ddced0aeffa0b25d19bfb69130fe36194fcc67b3f97cee91fb
3
+ metadata.gz: a1e54b9e8726c0a2fd3740f367a5ad4194f8f5f0d3026dfea34b4a2c22805520
4
+ data.tar.gz: 4d4232bac494619070f54e4062009bf8426f058e3900a7c9f3a1dddb0e191071
5
5
  SHA512:
6
- metadata.gz: edf204fc24abf9c91a7eb8e8e9deda27c174cd3919689a4f8881ae30969b225060ae419a2cdd18b625b45af5320fb6c9442246eda2abde28b4e33b20174cc06d
7
- data.tar.gz: c437b34ec1c55e42f12dc2597d9b5fbf637f22c1a3012c7b0110834108cbc9e37cd894ef92eaa3b5a27761e1f2ff6288bd251f7ad455ed851ef2ec395056e3c2
6
+ metadata.gz: 126901d82bfd00b119e847a32206c0bc0bc51f2c277c1ee2da721e3c142785d67d18e43c88062ace020d08f5da80d31d6e4c5289e48b6a7eded1692b00d52878
7
+ data.tar.gz: '09472081f85dbe8a3bbd8d8380ca700cf0e39a63ff167ddab00fd0b2e7368e596d3051c94e5cde27c019930ca1f4cb2a224e793fe80f24ddf7770da560074b94'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [2.5.0](https://github.com/shivam091/unit_measurements/compare/v2.4.0...v2.5.0) - 2023-08-23
2
+
3
+ ### What's new
4
+
5
+ - Added unit group for `sound level` units.
6
+ - Added unit group for `plane angle` units.
7
+
8
+ ----------
9
+
1
10
  ## [2.4.0](https://github.com/shivam091/unit_measurements/compare/v2.3.0...v2.4.0) - 2023-08-23
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 (2.4.0)
4
+ unit_measurements (2.5.0)
5
5
  activesupport (~> 7.0)
6
6
 
7
7
  GEM
@@ -19,4 +19,6 @@ require_relative "volume"
19
19
  require_relative "density"
20
20
 
21
21
  ## Other units
22
+ require_relative "plane_angle"
23
+ require_relative "sound_level"
22
24
  require_relative "quantity"
@@ -0,0 +1,18 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::PlaneAngle = UnitMeasurements.build do
6
+ si_unit :rad, aliases: [:radian, :radians]
7
+
8
+ unit :deg, value: [(Math::PI / 180), :rad], aliases: [:°, :degree, :degrees] # (π / 180) rad
9
+ unit :gon, value: [(Math::PI / 200), :rad], aliases: [:ᵍ, :grad, :gradian, :gradians] # (π / 200) rad
10
+ unit :cir, value: "360 deg", aliases: [:circle, :circles] # (2 * π) rad
11
+ unit :mil, value: "1/6400 cir", aliases: [:mils] # ((2 * π) / 6400) rad
12
+ unit :rev, value: "1 cir", aliases: [:revolution, :revolutions] # (2 * π) rad
13
+
14
+ unit :brad, value: [(Math::PI / 128), :rad], aliases: [:b°, :bdeg, :"binary degree", :"binary radian", :"binary degrees", :"binary radians"] # (π / 128) rad
15
+
16
+ unit :arcmin, value: "1/60 deg", aliases: [:′, :amin, :arcminute, :arcminutes] # ((π / 180) / 60) rad
17
+ unit :arcsec, value: "1/60 arcmin", aliases: [:″, :asec, :arcsecond, :arcseconds] # ((π / 180) / 3600) rad
18
+ end
@@ -0,0 +1,9 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::SoundLevel = UnitMeasurements.build do
6
+ si_unit :B, aliases: [:bel, :bels]
7
+
8
+ unit :Np, value: [(20 / Math.log(10)), :dB], aliases: [:neper, :nepers] # (20 / ln(10)) dB
9
+ end
@@ -3,5 +3,5 @@
3
3
  # -*- warn_indent: true -*-
4
4
 
5
5
  module UnitMeasurements
6
- VERSION = "2.4.0"
6
+ VERSION = "2.5.0"
7
7
  end
data/units.md CHANGED
@@ -140,3 +140,28 @@ These units are defined in `UnitMeasurements::Quantity`.
140
140
  | 3 | gr | gross, grosses |
141
141
  | 4 | dz | doz, dozen, dozens |
142
142
  | 5 | gg | great gross, great grosses, grand gross, grand grosses, dozen gross, dozen grosses |
143
+
144
+ ## 12. Sound level
145
+
146
+ These units are defined in `UnitMeasurements::SoundLevel`.
147
+
148
+ | # | Name | Aliases |
149
+ |:--|:--|:--|
150
+ | **1** | **B\*** | **bel, bels** |
151
+ | 2 | Np | neper, nepers |
152
+
153
+ ## 13. Plane angle
154
+
155
+ These units are defined in `UnitMeasurements::PlaneAngle`.
156
+
157
+ | # | Name | Aliases |
158
+ |:--|:--|:--|
159
+ | **1** | **rad\*** | **radian, radians** |
160
+ | 2 | deg | °, degree, degrees |
161
+ | 3 | gon | ᵍ, grad, gradian, gradians |
162
+ | 4 | cir | circle, circles |
163
+ | 5 | mil | mils |
164
+ | 6 | rev | revolution, revolutions |
165
+ | 7 | brad | b°, bdeg, binary degree, binary radian, binary degrees, binary radians |
166
+ | 8 | arcmin | ′, amin, arcminute, arcminutes |
167
+ | 9 | arcsec | ″, asec, arcsecond, arcseconds |
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: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harshal LADHE
@@ -125,7 +125,9 @@ files:
125
125
  - lib/unit_measurements/unit_groups/electric_current.rb
126
126
  - lib/unit_measurements/unit_groups/length.rb
127
127
  - lib/unit_measurements/unit_groups/luminous_intensity.rb
128
+ - lib/unit_measurements/unit_groups/plane_angle.rb
128
129
  - lib/unit_measurements/unit_groups/quantity.rb
130
+ - lib/unit_measurements/unit_groups/sound_level.rb
129
131
  - lib/unit_measurements/unit_groups/temperature.rb
130
132
  - lib/unit_measurements/unit_groups/time.rb
131
133
  - lib/unit_measurements/unit_groups/volume.rb