unit_measurements 2.4.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- 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/force.rb +14 -0
- data/lib/unit_measurements/unit_groups/plane_angle.rb +18 -0
- data/lib/unit_measurements/unit_groups/solid_angle.rb +12 -0
- data/lib/unit_measurements/unit_groups/sound_level.rb +9 -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: 3d6c07c2a7f828f3e7ac525c7100d75310bde354f0e9bc07952b0b7436dc8a5b
|
4
|
+
data.tar.gz: e6951bd9afaa36174a7491208e3e4844e59bbba19dd6b307e8cac3b297262658
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d78f1b5d0e603ed08b40769a96a6172f204019c98a103cf3fb4335bf2b47be15327588e88e4b6e286e7085632adf1e08057a09b136988b71feef1742711bfb7a
|
7
|
+
data.tar.gz: cfef2825c9fb04c0449abf0e04e143fa95310c87b70d8df6c0aa4d4991568510a09f6071a2c727e0fb28977d923fb37564be6de3025b914c67cb90867d248e28
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
## [2.6.0](https://github.com/shivam091/unit_measurements/compare/v2.5.0...v2.6.0) - 2023-08-24
|
2
|
+
|
3
|
+
### What's new
|
4
|
+
|
5
|
+
- Added unit group for `force` units.
|
6
|
+
- Added unit group for `solid angle` units.
|
7
|
+
|
8
|
+
----------
|
9
|
+
|
10
|
+
## [2.5.0](https://github.com/shivam091/unit_measurements/compare/v2.4.0...v2.5.0) - 2023-08-23
|
11
|
+
|
12
|
+
### What's new
|
13
|
+
|
14
|
+
- Added unit group for `sound level` units.
|
15
|
+
- Added unit group for `plane angle` units.
|
16
|
+
|
17
|
+
----------
|
18
|
+
|
1
19
|
## [2.4.0](https://github.com/shivam091/unit_measurements/compare/v2.3.0...v2.4.0) - 2023-08-23
|
2
20
|
|
3
21
|
### What's new
|
data/Gemfile.lock
CHANGED
@@ -17,6 +17,10 @@ require_relative "weight"
|
|
17
17
|
require_relative "area"
|
18
18
|
require_relative "volume"
|
19
19
|
require_relative "density"
|
20
|
+
require_relative "force"
|
20
21
|
|
21
22
|
## Other units
|
23
|
+
require_relative "sound_level"
|
24
|
+
require_relative "plane_angle"
|
25
|
+
require_relative "solid_angle"
|
22
26
|
require_relative "quantity"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# -*- frozen_string_literal: true -*-
|
3
|
+
# -*- warn_indent: true -*-
|
4
|
+
|
5
|
+
UnitMeasurements::Force = UnitMeasurements.build do
|
6
|
+
si_unit :N, aliases: [:newton, :newtons] # kg·m·s⁻²
|
7
|
+
|
8
|
+
unit :tf, value: "8896.443230521 N", aliases: [:"tonne-force"]
|
9
|
+
unit :dyn, value: "1e-5 N", aliases: [:dyne, :dynes]
|
10
|
+
unit :kgf, value: "9.80665 N", aliases: [:"kilogram-force", :"kilogramme-force"]
|
11
|
+
unit :ozf, value: "0.27801385095378125 N", aliases: [:"ounce-force"]
|
12
|
+
unit :lbf, value: "4.4482216152605 N", aliases: [:"pound-force"]
|
13
|
+
unit :pdl, value: "0.138254954376 N", aliases: [:poundal, :poundals]
|
14
|
+
end
|
@@ -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,12 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# -*- frozen_string_literal: true -*-
|
3
|
+
# -*- warn_indent: true -*-
|
4
|
+
|
5
|
+
UnitMeasurements::SolidAngle = UnitMeasurements.build do
|
6
|
+
si_unit :sr, aliases: [:steradian, :steradians]
|
7
|
+
|
8
|
+
unit :sp, value: [(4 * Math::PI), :sr], aliases: [:spat, :spats] # (4 * π) sr
|
9
|
+
unit :deg², value: [((Math::PI / 180) ** 2), :sr], aliases: [:"(°)²", :"sq °", :"square degree", :"square degrees"] # (π / 180)² sr
|
10
|
+
unit :arcmin², value: [(Rational(1, 60) ** 2), :deg²], aliases: [:"(′)²", :"sq ′", :"square arcminute", :"square arcminutes"] # ((π / 180) * (1 / 60))² sr
|
11
|
+
unit :arcsec², value: [(Rational(1, 60) ** 2), :arcmin²], aliases: [:"(″)²", :"sq ″", :"square arcsecond", :"square arcseconds"] # ((π / 180) * (1 / 3600))² sr
|
12
|
+
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
|
data/units.md
CHANGED
@@ -140,3 +140,54 @@ 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 |
|
168
|
+
|
169
|
+
## 14. Solid angle
|
170
|
+
|
171
|
+
These units are defined in `UnitMeasurements::SolidAngle`.
|
172
|
+
|
173
|
+
| # | Name | Aliases |
|
174
|
+
|:--|:--|:--|
|
175
|
+
| **1** | **sr\*** | **steradian, steradians** |
|
176
|
+
| 2 | sp | spat, spats |
|
177
|
+
| 3 | deg² | (°)², sq °, square degree, square degrees |
|
178
|
+
| 4 | arcmin² | (′)², sq ′, square arcminute, square arcminutes |
|
179
|
+
| 5 | arcsec² | (″)², sq ″, square arcsecond, square arcseconds |
|
180
|
+
|
181
|
+
## 15. Force
|
182
|
+
|
183
|
+
These units are defined in `UnitMeasurements::Force`.
|
184
|
+
|
185
|
+
| # | Name | Aliases |
|
186
|
+
|:--|:--|:--|
|
187
|
+
| **1** | **N\*** | **newton, newtons** |
|
188
|
+
| 2 | tf | tonne-force |
|
189
|
+
| 3 | dyn | dyne, dynes |
|
190
|
+
| 4 | kgf | kilogram-force, kilogramme-force |
|
191
|
+
| 5 | ozf | ounce-force |
|
192
|
+
| 6 | lbf | pound-force |
|
193
|
+
| 7 | pdl | poundal, poundals |
|
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: 2.
|
4
|
+
version: 2.6.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-
|
11
|
+
date: 2023-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -123,9 +123,13 @@ files:
|
|
123
123
|
- lib/unit_measurements/unit_groups/area.rb
|
124
124
|
- lib/unit_measurements/unit_groups/density.rb
|
125
125
|
- lib/unit_measurements/unit_groups/electric_current.rb
|
126
|
+
- lib/unit_measurements/unit_groups/force.rb
|
126
127
|
- lib/unit_measurements/unit_groups/length.rb
|
127
128
|
- lib/unit_measurements/unit_groups/luminous_intensity.rb
|
129
|
+
- lib/unit_measurements/unit_groups/plane_angle.rb
|
128
130
|
- lib/unit_measurements/unit_groups/quantity.rb
|
131
|
+
- lib/unit_measurements/unit_groups/solid_angle.rb
|
132
|
+
- lib/unit_measurements/unit_groups/sound_level.rb
|
129
133
|
- lib/unit_measurements/unit_groups/temperature.rb
|
130
134
|
- lib/unit_measurements/unit_groups/time.rb
|
131
135
|
- lib/unit_measurements/unit_groups/volume.rb
|