unit_measurements 5.15.0 → 5.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -1
  3. data/Gemfile.lock +1 -1
  4. data/README.md +47 -80
  5. data/lib/unit_measurements/unit_group.rb +7 -9
  6. data/lib/unit_measurements/unit_groups/acceleration.rb +3 -2
  7. data/lib/unit_measurements/unit_groups/area.rb +9 -1
  8. data/lib/unit_measurements/unit_groups/density.rb +4 -0
  9. data/lib/unit_measurements/unit_groups/dynamic_viscosity.rb +0 -2
  10. data/lib/unit_measurements/unit_groups/electric_charge.rb +4 -2
  11. data/lib/unit_measurements/unit_groups/electric_conductance.rb +0 -3
  12. data/lib/unit_measurements/unit_groups/electric_current.rb +4 -2
  13. data/lib/unit_measurements/unit_groups/electric_dipole_moment.rb +0 -2
  14. data/lib/unit_measurements/unit_groups/electric_potential.rb +0 -2
  15. data/lib/unit_measurements/unit_groups/electric_quadrupole_moment.rb +0 -2
  16. data/lib/unit_measurements/unit_groups/electrical_capacitance.rb +0 -3
  17. data/lib/unit_measurements/unit_groups/electrical_inductance.rb +1 -4
  18. data/lib/unit_measurements/unit_groups/electrical_resistance.rb +1 -4
  19. data/lib/unit_measurements/unit_groups/energy.rb +5 -4
  20. data/lib/unit_measurements/unit_groups/force.rb +5 -4
  21. data/lib/unit_measurements/unit_groups/illuminance.rb +0 -3
  22. data/lib/unit_measurements/unit_groups/kinetic_viscosity.rb +2 -4
  23. data/lib/unit_measurements/unit_groups/length.rb +9 -1
  24. data/lib/unit_measurements/unit_groups/luminance.rb +3 -5
  25. data/lib/unit_measurements/unit_groups/magnetic_flux.rb +1 -4
  26. data/lib/unit_measurements/unit_groups/magnetic_induction.rb +0 -2
  27. data/lib/unit_measurements/unit_groups/magnetomotive_force.rb +0 -2
  28. data/lib/unit_measurements/unit_groups/power.rb +3 -2
  29. data/lib/unit_measurements/unit_groups/pressure.rb +5 -4
  30. data/lib/unit_measurements/unit_groups/radiation_absorbed_dose.rb +0 -3
  31. data/lib/unit_measurements/unit_groups/radiation_equivalent_dose.rb +0 -2
  32. data/lib/unit_measurements/unit_groups/temperature.rb +4 -0
  33. data/lib/unit_measurements/unit_groups/time.rb +4 -0
  34. data/lib/unit_measurements/unit_groups/torque.rb +0 -2
  35. data/lib/unit_measurements/unit_groups/volume.rb +7 -0
  36. data/lib/unit_measurements/unit_groups/weight.rb +7 -0
  37. data/lib/unit_measurements/version.rb +1 -1
  38. data/units.md +29 -3
  39. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e89ba7ff921595afff359baeafb673b3d1d08d65293aefb4efc3082b99bfad3
4
- data.tar.gz: ce3695641b050fa395920124859257d2757707cbdda8b8cc42feaa64a75363bc
3
+ metadata.gz: b5523e11bcd4bdd1e35bc7918abb1c964deccd3ac18591128dbd6fcda313e675
4
+ data.tar.gz: 7dc18749b8c120aa513851d2cdab24c80a821de3d9aa436557a18add32bb7b6b
5
5
  SHA512:
6
- metadata.gz: 8b4085c191ebe55c90a272c63ba47c0d54860af42278860f3e30096060a0ebfa34b20a5b81ee57c35327e3f3336617193bacfdab7b76be0361b75d4ebd665f75
7
- data.tar.gz: a2fe5a6c2f58534a2a688bca5140927906e4c10035dd1e05a4c1b40686a61dc90e2afa1c5929b5a25041101c9327fbb5e6e2e1c937fe025e433bea21b3e99507
6
+ metadata.gz: '08423b7864bdf2707d237161ce90fcd59d0d2696aaad0730359151050720c9918a250c59cf743f360bd6c603f1844bffedaf2c507aea17b7f4da84ca02853a5e'
7
+ data.tar.gz: d8187b3c2c1abedf3c87522618f2afda3c8ec34118649f52dcd6a6c2d3e34dfa9f69d942bc108a0f6f5421c4846f6684e43cba2bf2f31bee077b4679d3c7905a
data/CHANGELOG.md CHANGED
@@ -1,4 +1,29 @@
1
- ## [5.15.0](https://github.com/shivam091/unit_measurements/compare/v5.14.0...v5.15.0) - 2023-12-01
1
+ ## [5.17.0](https://github.com/shivam091/unit_measurements/compare/v5.16.0...v5.17.0) - 2023-12-15
2
+
3
+ ### What's new
4
+
5
+ - Added new units `qr`, `U`, and `z` in `length`.
6
+ - Added new units `qr`, `fir`, and `us_qr` in `weight`.
7
+ - Added new units `dun`, `sec`, and `twp` in `area`.
8
+ - Added new units `st`, `fir`, and `pot` in `volume`.
9
+
10
+ ### What's changed
11
+
12
+ - Changed implementation of `#units_for!` to raise error if the unit system is not defined
13
+ within the unit group.
14
+ - Changed symbol of `barleycorn` length unit.
15
+
16
+ ----------
17
+
18
+ ## [5.16.0](https://github.com/shivam091/unit_measurements/compare/v5.15.0...v5.16.0) - 2023-12-13
19
+
20
+ ### What's new
21
+
22
+ - Added planck units and their conversions.
23
+
24
+ ----------
25
+
26
+ ## [5.15.0](https://github.com/shivam091/unit_measurements/compare/v5.14.0...v5.15.0) - 2023-12-11
2
27
 
3
28
  ### What's new
4
29
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unit_measurements (5.15.0)
4
+ unit_measurements (5.17.0)
5
5
  activesupport (~> 7.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -9,7 +9,7 @@ A library that encapsulate measurements and their units in Ruby.
9
9
  [![Test Coverage](https://api.codeclimate.com/v1/badges/b8aec9bffa356d108784/test_coverage)](https://codeclimate.com/github/shivam091/unit_measurements/test_coverage)
10
10
  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/shivam091/unit_measurements/blob/main/LICENSE.md)
11
11
 
12
- [Harshal V. Ladhe, Master of Computer Science.](https://shivam091.github.io)
12
+ **[Harshal V. Ladhe, Master of Computer Science.](https://shivam091.github.io)**
13
13
 
14
14
  ## Introduction
15
15
 
@@ -47,8 +47,7 @@ Users are advised to cross-verify conversions for their specific use cases._
47
47
 
48
48
  ## Installation
49
49
 
50
- To use `unit_measurements` in your Rails application, add the
51
- following line to your Gemfile:
50
+ To use `unit_measurements` in your Rails application, add the following line to your Gemfile:
52
51
 
53
52
  ```ruby
54
53
  gem "unit_measurements"
@@ -88,8 +87,7 @@ viz., `UnitMeasurements::Weight`, `UnitMeasurements::Length`, etc.
88
87
  **Initialize a measurement:**
89
88
 
90
89
  ```ruby
91
- UnitMeasurements::Length.new(1, "km")
92
- #=> 1 km
90
+ UnitMeasurements::Length.new(1, "km") #=> 1 km
93
91
  ```
94
92
 
95
93
  **Converting to other units:**
@@ -103,22 +101,19 @@ These methods provide `use_cache` parameter which defaults to `false` to indicat
103
101
  You can use `#convert_to` as:
104
102
 
105
103
  ```ruby
106
- UnitMeasurements::Length.new(1, "km").convert_to("m", use_cache: true)
107
- #=> 1000.0 m
104
+ UnitMeasurements::Length.new(1, "km").convert_to("m", use_cache: true) #=> 1000.0 m
108
105
  ```
109
106
 
110
107
  If you want to modify measurement object itself, you can use `#convert_to!` method as:
111
108
 
112
109
  ```ruby
113
- UnitMeasurements::Length.new(1, "km").convert_to!("m")
114
- #=> 1000.0 m
110
+ UnitMeasurements::Length.new(1, "km").convert_to!("m") #=> 1000.0 m
115
111
  ```
116
112
 
117
113
  You can convert the measurement directly to the `primitive` unit of the unit group as:
118
114
 
119
115
  ```ruby
120
- UnitMeasurements::Length.new(1, "cm").to_primitive
121
- #=> 0.01 m
116
+ UnitMeasurements::Length.new(1, "cm").to_primitive #=> 0.01 m
122
117
  ```
123
118
 
124
119
  Note: `#to_primitive` method is aliased as `#in_primitive` and `#as_primitive`.
@@ -128,8 +123,7 @@ Note: `#to_primitive` method is aliased as `#in_primitive` and `#as_primitive`.
128
123
  This method provides `use_cache` parameter which defaults to `false` to indicate whether the caching of conversion factors should happen.
129
124
 
130
125
  ```ruby
131
- UnitMeasurements::Length.parse("1 km")
132
- #=> 1.0 km
126
+ UnitMeasurements::Length.parse("1 km") #=> 1.0 km
133
127
  ```
134
128
 
135
129
  **Parse string that mentions quantity, source unit, and target unit:**
@@ -137,17 +131,14 @@ UnitMeasurements::Length.parse("1 km")
137
131
  A source unit can be separated from the target unit using the `in`, `to`, or `as` operators.
138
132
 
139
133
  ```ruby
140
- UnitMeasurements::Length.parse("1 km to m")
141
- #=> 1000.0 m
134
+ UnitMeasurements::Length.parse("1 km to m") #=> 1000.0 m
142
135
  ```
143
136
 
144
137
  **Parse scientific numbers, source unit, and (or) target unit:**
145
138
 
146
139
  ```ruby
147
- UnitMeasurements::Length.parse("2e+2 km").convert_to("m")
148
- #=> 200000.0 m
149
- UnitMeasurements::Length.parse("2e+2 km to m")
150
- #=> 200000.0 m
140
+ UnitMeasurements::Length.parse("2e+2 km").convert_to("m") #=> 200000.0 m
141
+ UnitMeasurements::Length.parse("2e+2 km to m") #=> 200000.0 m
151
142
  ```
152
143
  You can check supported special characters for exponents
153
144
  [here](https://shivam091.github.io/unit_measurements/UnitMeasurements/Normalizer.html).
@@ -155,19 +146,15 @@ You can check supported special characters for exponents
155
146
  **Parse complex numbers, source unit, and (or) target unit:**
156
147
 
157
148
  ```ruby
158
- UnitMeasurements::Length.parse("2+3i km").convert_to("m")
159
- #=> 2000.0+3000.0i m
160
- UnitMeasurements::Length.parse("2+3i km to m")
161
- #=> 2000.0+3000.0i m
149
+ UnitMeasurements::Length.parse("2+3i km").convert_to("m") #=> 2000.0+3000.0i m
150
+ UnitMeasurements::Length.parse("2+3i km to m") #=> 2000.0+3000.0i m
162
151
  ```
163
152
 
164
153
  **Parse fractional/mixed fractional numbers, source unit, and (or) target unit:**
165
154
 
166
155
  ```ruby
167
- UnitMeasurements::Length.parse("2 ½ km").convert_to("m")
168
- #=> 2500.0 m
169
- UnitMeasurements::Length.parse("2/3 km to m")
170
- #=> 666.666666666667 m
156
+ UnitMeasurements::Length.parse("2 ½ km").convert_to("m") #=> 2500.0 m
157
+ UnitMeasurements::Length.parse("2/3 km to m") #=> 666.666666666667 m
171
158
  ```
172
159
 
173
160
  You can check supported special characters for fractional notations
@@ -176,17 +163,14 @@ You can check supported special characters for fractional notations
176
163
  **Parse ratios, source unit, and (or) target unit:**
177
164
 
178
165
  ```ruby
179
- UnitMeasurements::Length.parse("1:2 km").convert_to("m")
180
- #=> 500.0 m
181
- UnitMeasurements::Length.parse("1:2 km to m")
182
- #=> 500.0 m
166
+ UnitMeasurements::Length.parse("1:2 km").convert_to("m") #=> 500.0 m
167
+ UnitMeasurements::Length.parse("1:2 km to m") #=> 500.0 m
183
168
  ```
184
169
 
185
170
  **Calculate the ratio between two units:**
186
171
 
187
172
  ```ruby
188
- UnitMeasurements::Length.ratio("in", "ft")
189
- #=> "12.0 in/ft"
173
+ UnitMeasurements::Length.ratio("in", "ft") #=> "12.0 in/ft"
190
174
  ```
191
175
 
192
176
  **Formatting measurement:**
@@ -195,8 +179,7 @@ If you want to format the measurement to certain format, you can use `#to_fs` me
195
179
  If format is not specified, it defaults to `"%.2<value>f %<unit>s"`.
196
180
 
197
181
  ```ruby
198
- UnitMeasurements::Length.new(100, "m").to("in").to_fs("%.4<quantity>f %<unit>s")
199
- #=> "3937.0079 in"
182
+ UnitMeasurements::Length.new(100, "m").to("in").to_fs("%.4<quantity>f %<unit>s") #=> "3937.0079 in"
200
183
  ```
201
184
 
202
185
  You can check more about formatting along with their examples
@@ -206,26 +189,23 @@ You can check more about formatting along with their examples
206
189
 
207
190
  ```ruby
208
191
  length = UnitMeasurements::Length.new(1, "km")
209
- length.quantity
210
- #=> 1
211
- length.unit
212
- #=> #<UnitMeasurements::Unit: km (kilometer, kilometers, kilometre, kilometres)>
192
+ length.quantity #=> 1
193
+ length.unit #=> #<UnitMeasurements::Unit: km (kilometer, kilometers, kilometre, kilometres)>
213
194
  ```
214
195
 
215
196
  Unit object can be interrogated for a range of attributes:
216
197
 
217
198
  ```ruby
218
- length.unit.aliases # Alternative names for the unit.
219
- #=> #<Set: {"kilometer", "kilometers", "kilometre", "kilometres"}>
220
- length.unit.conversion_factor # Conversion factor relative to primitive unit.
221
- #=> 1000.0
199
+ # Alternative names for the unit.
200
+ length.unit.aliases #=> #<Set: {"kilometer", "kilometers", "kilometre", "kilometres"}>
201
+ # Conversion factor relative to primitive unit.
202
+ length.unit.conversion_factor #=> 1000.0
222
203
  ```
223
204
 
224
205
  **See primitive unit of the unit group:**
225
206
 
226
207
  ```ruby
227
- UnitMeasurements::Length.primitive
228
- #=> #<UnitMeasurements::Unit: m (meter, meters, metre, metres)>
208
+ UnitMeasurements::Length.primitive #=> #<UnitMeasurements::Unit: m (meter, meters, metre, metres)>
229
209
  ```
230
210
 
231
211
  **See all units of the unit group:**
@@ -238,8 +218,7 @@ UnitMeasurements::Length.units
238
218
  **See names of all valid units of the unit group:**
239
219
 
240
220
  ```ruby
241
- UnitMeasurements::Length.unit_names
242
- #=> ["ft", "in", "m", "mi", "yd"]
221
+ UnitMeasurements::Length.unit_names #=> ["ft", "in", "m", "mi", "yd"]
243
222
  ```
244
223
 
245
224
  **See all valid units of the unit group along with their aliases:**
@@ -252,15 +231,14 @@ UnitMeasurements::Length.unit_names_with_aliases
252
231
  **See list of unit systems defined within the unit group:**
253
232
 
254
233
  ```ruby
255
- UnitMeasurements::Length.systems
256
- #=> ["metric", "imperial", "us_customary", "astronomical"]
234
+ UnitMeasurements::Length.systems #=> ["metric", "imperial", "us_customary", "astronomical"]
257
235
  ```
258
236
 
259
237
  **See list of units within the unit system:**
260
238
 
261
- You can use `#units_for` or `#units_for!` methods to find units within the unit system.
262
- `#units_for!` method returns an error if there are no units associated with specified
263
- unit system.
239
+ You can use `#units_for` or `#units_for!` methods to find all the units defined
240
+ within the unit system. `#units_for!` method returns a runtime error if the unit
241
+ system is not defined within the unit group.
264
242
 
265
243
  ```ruby
266
244
  UnitMeasurements::Length.units_for("metric")
@@ -270,33 +248,27 @@ UnitMeasurements::Length.units_for("metric")
270
248
  **Finding units within the unit group:**
271
249
 
272
250
  You can use `#unit_for` or `#unit_for!` (aliased as `#[]`) methods to find units
273
- within the unit group. `#unit_for!` method returns an error if a unit system is not defined within the unit group.
251
+ within the unit group. `#unit_for!` method returns an error if the unit is not
252
+ defined within the unit group.
274
253
 
275
254
  ```ruby
276
- UnitMeasurements::Length.unit_for("m")
277
- #=> #<UnitMeasurements::Unit: m (meter, meters, metre, metres)>
278
- UnitMeasurements::Length.unit_for("z")
279
- #=> nil
280
- UnitMeasurements::Length.unit_for!("z")
281
- #=> Invalid unit: 'z'. (UnitMeasurements::UnitError)
255
+ UnitMeasurements::Length.unit_for("m") #=> #<UnitMeasurements::Unit: m (meter, meters, metre, metres)>
256
+ UnitMeasurements::Length.unit_for("z") #=> nil
257
+ UnitMeasurements::Length.unit_for!("z") #=> Invalid unit: 'z'. (UnitMeasurements::UnitError)
282
258
  ```
283
259
 
284
260
  **Finding whether the unit is defined within the unit group:**
285
261
 
286
262
  ```ruby
287
- UnitMeasurements::Length.defined?("m")
288
- #=> true
289
- UnitMeasurements::Length.defined?("metre")
290
- #=> false
263
+ UnitMeasurements::Length.defined?("m") #=> true
264
+ UnitMeasurements::Length.defined?("metre") #=> false
291
265
  ```
292
266
 
293
267
  **Check if the unit is a valid unit or alias within the unit group:**
294
268
 
295
269
  ```ruby
296
- UnitMeasurements::Length.unit_or_alias?("m")
297
- #=> true
298
- UnitMeasurements::Length.unit_or_alias?("metre")
299
- #=> true
270
+ UnitMeasurements::Length.unit_or_alias?("m") #=> true
271
+ UnitMeasurements::Length.unit_or_alias?("metre") #=> true
300
272
  ```
301
273
 
302
274
  **Clear cached data for the unit group:**
@@ -311,8 +283,7 @@ You have ability to compare the measurements with the same or different units wi
311
283
  For example, comparing length with length will work, comparing a length with a area would fail.
312
284
 
313
285
  ```ruby
314
- UnitMeasurements::Length.parse("1 km") != UnitMeasurements::Length.parse("1 m")
315
- #=> true
286
+ UnitMeasurements::Length.parse("1 km") != UnitMeasurements::Length.parse("1 m") #=> true
316
287
  ```
317
288
 
318
289
  You can check supported comparisons along with their examples
@@ -326,10 +297,8 @@ measurement by either other measurement with compatible unit or numeric value.
326
297
  In cases of different units, the left hand side takes precedence.
327
298
 
328
299
  ```ruby
329
- UnitMeasurements::Length.new(1, "km") + UnitMeasurements::Length.new(1, "m")
330
- #=> 1.001 km
331
- UnitMeasurements::Length.new(2, "km") * 2+2i
332
- #=> 4+2i km
300
+ UnitMeasurements::Length.new(1, "km") + UnitMeasurements::Length.new(1, "m") #=> 1.001 km
301
+ UnitMeasurements::Length.new(2, "km") * 2+2i #=> 4+2i km
333
302
  ```
334
303
 
335
304
  You can check supported arithmetic operations along with their examples
@@ -340,8 +309,7 @@ You can check supported arithmetic operations along with their examples
340
309
  You can perform mathematical functions on the measurements.
341
310
 
342
311
  ```ruby
343
- UnitMeasurements::Length.new(17.625, "m").round
344
- # => 18 m
312
+ UnitMeasurements::Length.new(17.625, "m").round #=> 18 m
345
313
  ```
346
314
 
347
315
  You can check supported mathematical functions along with their examples
@@ -353,8 +321,7 @@ You can convert measurement quantity directly to other numeric types viz.
353
321
  `Integer`, `BigDecimal`, `Rational`, `Complex`, and `Float`.
354
322
 
355
323
  ```ruby
356
- UnitMeasurements::Length.new(2.25567, "km").to_i
357
- #=> 2 km
324
+ UnitMeasurements::Length.new(2.25567, "km").to_i #=> 2 km
358
325
  ```
359
326
 
360
327
  You can check more about them along with their examples
@@ -500,9 +467,9 @@ This will enable the usage of these units as methods to instantiate and use meas
500
467
 
501
468
  ```ruby
502
469
  # Initialize a measurement
503
- 1.m #=> 1 m
504
- 5.feet #=> 5 ft
505
- 10.inches #=> 10 in
470
+ 1.m #=> 1 m
471
+ 5.feet #=> 5 ft
472
+ 10.inches #=> 10 in
506
473
 
507
474
  # Usage
508
475
  ## Equality comparison
@@ -212,8 +212,8 @@ module UnitMeasurements
212
212
  units.select { |unit| unit.system.to_s == system_name.to_s }
213
213
  end
214
214
 
215
- # This method works same as +units_for+ method but it raises an error if
216
- # there are no units associated with the +system_name+.
215
+ # This method works same as {units_for} method but it raises an error if
216
+ # the unit system +system_name+ is not defined within the unit group.
217
217
  #
218
218
  # @example
219
219
  # UnitMeasurements::Length.units_for!("metric")
@@ -231,20 +231,18 @@ module UnitMeasurements
231
231
  # @return [Array<Unit>]
232
232
  # An array of +Unit+ instances associated with the specified unit system.
233
233
  #
234
- # @raise [BaseError]
235
- # If there are no units associated with the provided +system_name+.
234
+ # @raise [RuntimeError]
235
+ # If unit system is not defined within the unit group.
236
236
  #
237
237
  # @see #units_for
238
238
  # @author {Harshal V. Ladhe}[https://shivam091.github.io/]
239
239
  # @since 5.0.0
240
240
  def units_for!(system_name)
241
- system_units = units_for(system_name)
242
-
243
- unless system_units.any?
244
- raise BaseError, "Invalid unit system '#{system_name}' within the unit group."
241
+ unless systems.include?(system_name.to_s)
242
+ raise "Invalid unit system '#{system_name}' within the unit group."
245
243
  end
246
244
 
247
- system_units
245
+ units_for(system_name)
248
246
  end
249
247
 
250
248
  # Returns an array of unit system names defined within the unit group.
@@ -6,6 +6,7 @@ UnitMeasurements::Acceleration = UnitMeasurements.build do
6
6
  primitive "m/s²"
7
7
 
8
8
  system :metric do
9
+ unit "Gal", value: "1e-2 m/s²", aliases: ["gal", "galileo"]
9
10
  unit "m/s²", aliases: ["m/s^2", "meter per second squared", "meters per second squared", "metre per second squared", "metres per second squared"]
10
11
  end
11
12
 
@@ -29,7 +30,7 @@ UnitMeasurements::Acceleration = UnitMeasurements.build do
29
30
  unit "Kn/s", value: "0.5144444 m/s²", aliases: ["knot per second", "knots per second"]
30
31
  end
31
32
 
32
- system :centimetre_gram_second do
33
- unit "Gal", value: "1e-2 m/s²", aliases: ["gal", "galileo"]
33
+ system :planck_units do
34
+ unit "aₚ", value: "5.5608e+51 m/s²", aliases: ["planck acceleration", "quantum acceleration"]
34
35
  end
35
36
  end
@@ -12,6 +12,8 @@ UnitMeasurements::Area = UnitMeasurements.build do
12
12
 
13
13
  unit "ha", value: "10000 m²", aliases: ["hectare", "hectares"]
14
14
  unit "km²", value: "1e+6 m²", aliases: ["km^2", "sq km", "square kilometer", "square kilometers", "square kilometre", "square kilometres"]
15
+
16
+ unit "dun", value: "10 a", aliases: ["ḍn", "dunam", "dunams"]
15
17
  end
16
18
 
17
19
  system :imperial do
@@ -29,13 +31,19 @@ UnitMeasurements::Area = UnitMeasurements.build do
29
31
  end
30
32
 
31
33
  system :us_customary do
32
- unit "ac (US)", value: "4046.873 ", aliases: ["acre (US)", "acres (US)"]
34
+ unit "sec", value: "640 ac", aliases: ["sect", "section", "sections"]
35
+ unit "twp", value: "36 sec", aliases: ["survey township", "survey townships"]
33
36
 
37
+ unit "ac (US)", value: "4046.873 m²", aliases: ["acre (US)", "acres (US)"]
34
38
  unit "ft² (US)", value: "0.09290341161327482 m²", aliases: ["ft^2 (US)", "sq ft (US)", "square foot (US)", "square feet (US)"]
35
39
  unit "mi² (US)", value: "2.58999847e+6 m²", aliases: ["mi^2 (US)", "sq mi (US)", "square mile (US)", "square miles (US)"]
36
40
  unit "ch² (US)", value: "404.6873 m²", aliases: ["ch^2 (US)", "sq ch (US)", "square chain (US)", "square chains (US)"]
37
41
  end
38
42
 
43
+ system :planck_units do
44
+ unit "Aₚ", value: "2.6121e-70 m²", aliases: ["planck area", "quantum area"]
45
+ end
46
+
39
47
  unit "bd", value: "0.00774192 m²", aliases: ["board", "boards"]
40
48
  unit "ro", value: "1/4 ac", aliases: ["rood"]
41
49
  end
@@ -26,4 +26,8 @@ UnitMeasurements::Density = UnitMeasurements.build do
26
26
  unit "slug/ft³", value: "515.3788184 kg/m³", aliases: ["slug/ft^3", "slug per cubic foot", "slugs per cubic foot"]
27
27
  unit "slug/in³", value: "890574.582782 kg/m³", aliases: ["slug/in^3", "slug per cubic inch", "slugs per cubic inch"]
28
28
  end
29
+
30
+ system :planck_units do
31
+ unit "ρₚ", value: "5.1550e+96 kg/m³", aliases: ["planck density", "quantum density"]
32
+ end
29
33
  end
@@ -7,9 +7,7 @@ UnitMeasurements::DynamicViscosity = UnitMeasurements.build do
7
7
 
8
8
  system :metric do
9
9
  si_unit "Pa⋅s", aliases: ["Pa*s", "pascal second"]
10
- end
11
10
 
12
- system :centimetre_gram_second do
13
11
  unit "P", value: "1 dPa⋅s", aliases: ["dyne·s/cm²", "dyne*s/cm^2", "poise"]
14
12
  unit "Pl", value: "10 P", aliases: ["poiseuille"]
15
13
  end
@@ -7,12 +7,14 @@ UnitMeasurements::ElectricCharge = UnitMeasurements.build do
7
7
 
8
8
  system :metric do
9
9
  si_unit "C", aliases: ["coulomb", "coulombs"]
10
- end
11
10
 
12
- system :centimetre_gram_second do
13
11
  unit "Fr", value: "3.335641e-10 C", aliases: ["franklin", "franklins"]
14
12
  unit "Fd", value: "96485.3377164 C", aliases: ["faraday", "faradays"]
15
13
  unit "abC", value: "10 C", aliases: ["abcoulomb", "abcoulombs"]
16
14
  unit "statC", value: "3.335641e-10 C", aliases: ["statcoulomb", "statcoulombs"]
17
15
  end
16
+
17
+ system :planck_units do
18
+ unit "qₚ", value: "1.875545956e-18 C", aliases: ["planck length", "quantum length"]
19
+ end
18
20
  end
@@ -9,9 +9,6 @@ UnitMeasurements::ElectricConductance = UnitMeasurements.build do
9
9
  si_unit "S", aliases: ["℧", "Ω⁻¹", "siemens", "mho", "mhos"]
10
10
 
11
11
  unit "A/V", value: "1 S", aliases: ["amp/volt", "amps/volt", "ampere/volt", "amperes/volt", "ampere per volt", "amperes per volt"]
12
- end
13
-
14
- system :centimetre_gram_second do
15
12
  unit "abS", value: "1e+9 S", aliases: ["ab℧", "absiemens", "abmho", "abmhos"]
16
13
  unit "statS", value: "1.112347e-12 S", aliases: ["stat℧", "statsiemens", "statmho", "statmhos"]
17
14
  end
@@ -7,11 +7,13 @@ UnitMeasurements::ElectricCurrent = UnitMeasurements.build do
7
7
 
8
8
  system :metric do
9
9
  si_unit "A", aliases: ["amp", "ampere", "amperes"]
10
- end
11
10
 
12
- system :centimetre_gram_second do
13
11
  unit "Bi", value: "10 A", aliases: ["biot", "biots"]
14
12
  unit "abA", value: "10 A", aliases: ["abampere", "abamperes"]
15
13
  unit "statA", value: "3.33564e-10 A", aliases: ["statampere", "statamperes"]
16
14
  end
15
+
16
+ system :planck_units do
17
+ unit "Iₚ", value: "3.4789e+25 A", aliases: ["planck current", "quantum current"]
18
+ end
17
19
  end
@@ -7,9 +7,7 @@ UnitMeasurements::ElectricDipoleMoment = UnitMeasurements.build do
7
7
 
8
8
  system :metric do
9
9
  si_unit "C⋅m", aliases: ["C*m", "coulomb-meter", "coulomb-metre"]
10
- end
11
10
 
12
- system :centimetre_gram_second do
13
11
  unit "D", value: "3.33564095e-30 C⋅m", aliases: ["debye", "debyes"]
14
12
  end
15
13
  end
@@ -10,9 +10,7 @@ UnitMeasurements::ElectricPotential = UnitMeasurements.build do
10
10
 
11
11
  unit "W/A", value: "1 V", aliases: ["watt per ampere", "watts per ampere"]
12
12
  unit "J/C", value: "1 V", aliases: ["joule per coulomb", "joules per coulomb"]
13
- end
14
13
 
15
- system :centimetre_gram_second do
16
14
  unit "abV", value: "1e-8 V", aliases: ["abvolt", "abvolts"]
17
15
  unit "statV", value: "299.792458 V", aliases: ["statvolt", "statvolts"]
18
16
  end
@@ -7,9 +7,7 @@ UnitMeasurements::ElectricQuadrupoleMoment = UnitMeasurements.build do
7
7
 
8
8
  system :metric do
9
9
  si_unit "C·m²", aliases: ["C*m^2", "coulomb square meter", "coulomb square metre"]
10
- end
11
10
 
12
- system :centimetre_gram_second do
13
11
  unit "B", value: "1e-26 statC·cm²", aliases: ["buckingham", "buckinghams"]
14
12
  unit "statC·cm²", value: "3.335641e-14 C·m²", aliases: ["statC*m^2", "statcoulomb square meter", "statcoulomb square metre"]
15
13
  end
@@ -9,9 +9,6 @@ UnitMeasurements::ElectricalCapacitance = UnitMeasurements.build do
9
9
  si_unit "F", aliases: ["farad", "farads"]
10
10
 
11
11
  unit "C/V", value: "1 F", aliases: ["coulomb/volt", "coulombs/volt", "coulomb per volt", "coulombs per volt"]
12
- end
13
-
14
- system :centimetre_gram_second do
15
12
  unit "abF", value: "1e+9 F", aliases: ["abfarad", "abfarads"]
16
13
  unit "statF", value: "1.1127e-12 F", aliases: ["statfarad", "statfarads"]
17
14
  end
@@ -8,11 +8,8 @@ UnitMeasurements::ElectricalInductance = UnitMeasurements.build do
8
8
  system :metric do
9
9
  si_unit "H", aliases: ["henry", "henries"]
10
10
 
11
- unit "Wb/A", value: "1 H", aliases: ["weber per ampere", "webers per ampere"]
12
- end
13
-
14
- system :centimetre_gram_second do
15
11
  unit "abH", value: "1e-9 H", aliases: ["abhenry", "abhenries"]
12
+ unit "Wb/A", value: "1 H", aliases: ["weber per ampere", "webers per ampere"]
16
13
  unit "statH", value: "8.98755178736818e+11 H", aliases: ["stathenry", "stathenries"]
17
14
  end
18
15
  end
@@ -9,11 +9,8 @@ UnitMeasurements::ElectricalResistance = UnitMeasurements.build do
9
9
  si_unit "Ω", aliases: ["ω", "ohm", "ohms", "reciprocal siemens"]
10
10
 
11
11
  unit "S", value: "1 Ω", aliases: ["siemens", "mho", "mhos"]
12
- unit "V/A", value: "1 Ω", aliases: ["volt/amp", "volts/amp", "volt/ampere", "volts/ampere", "volt per ampere", "volts per ampere"]
13
- end
14
-
15
- system :centimetre_gram_second do
16
12
  unit "abΩ", value: "1e-9 Ω", aliases: ["abω", "abohm", "abohms"]
17
13
  unit "statΩ", value: "8.98755178737e+11 Ω", aliases: ["statω", "statohm", "statohms"]
14
+ unit "V/A", value: "1 Ω", aliases: ["volt/amp", "volts/amp", "volt/ampere", "volts/ampere", "volt per ampere", "volts per ampere"]
18
15
  end
19
16
  end
@@ -10,16 +10,13 @@ UnitMeasurements::Energy = UnitMeasurements.build do
10
10
  si_unit "cal", value: "4.1868 J", aliases: ["calorie", "calories"]
11
11
 
12
12
  unit "eV", value: "1.602176634e-19 J", aliases: ["electronvolt", "electron volt", "electron-volt"]
13
+ unit "erg", value: "1e-7 J", aliases: ["ergs"]
13
14
 
14
15
  unit "W⋅s", value: "1 J", aliases: ["W*s", "watt-second"]
15
16
  unit "W⋅h", value: "3600 J", aliases: ["W*h", "watt-hour"]
16
17
  unit "kW⋅h", value: "3.6e+6 J", aliases: ["kW*h", "kilowatt-hour"]
17
18
  end
18
19
 
19
- system :centimetre_gram_second do
20
- unit "erg", value: "1e-7 J", aliases: ["ergs"]
21
- end
22
-
23
20
  system :us_customary do
24
21
  si_unit "BTU", value: "1055.05585262 J", aliases: ["Btu", "british thermal unit", "british thermal units"]
25
22
 
@@ -46,6 +43,10 @@ UnitMeasurements::Energy = UnitMeasurements.build do
46
43
  unit "hp⋅h", value: "2.685e+13 erg", aliases: ["hp*h", "horsepower-hour"]
47
44
  end
48
45
 
46
+ system :planck_units do
47
+ unit "Eₚ", value: "1.9561e+9 J", aliases: ["planck energy", "quantum energy"]
48
+ end
49
+
49
50
  unit "Ry", value: "2.179872e-18 J", aliases: ["rydberg"]
50
51
  unit "Ha", value: "4.359744e-18 J", aliases: ["hartree", "atomic unit of energy"]
51
52
  unit "boe", value: "5.86152 GJ", aliases: ["barrel of oil equivalent", "barrels of oil equivalent"]
@@ -11,11 +11,8 @@ UnitMeasurements::Force = UnitMeasurements.build do
11
11
  unit "p", value: "0.00980665 N", aliases: ["pond", "ponds"]
12
12
  unit "gf", value: "0.00980665 N", aliases: ["gram-force", "gramme-force"]
13
13
  unit "kgf", value: "9.80665 N", aliases: ["kp", "gvf", "kilogram-force", "kilogramme-force"]
14
- unit "mgvf", value: "9.80665 mN", aliases: ["gvtf", "gravet-force", "milligrave-force"]
15
- end
16
-
17
- system :centimetre_gram_second do
18
14
  unit "dyn", value: "1e-5 N", aliases: ["dyne", "dynes"]
15
+ unit "mgvf", value: "9.80665 mN", aliases: ["gvtf", "gravet-force", "milligrave-force"]
19
16
  end
20
17
 
21
18
  system :metre_tonne_second do
@@ -43,4 +40,8 @@ UnitMeasurements::Force = UnitMeasurements.build do
43
40
  unit "(lb⋅ft)/s²", value: "0.138254954376 N", aliases: ["(lb*ft)/s^2", "pound foot per second squared"]
44
41
  unit "(lb⋅in)/s²", value: "0.011521246198 N", aliases: ["(lb*in)/s^2", "pound inch per second squared"]
45
42
  end
43
+
44
+ system :planck_units do
45
+ unit "Fₚ", value: "1.2103e+44 N", aliases: ["planck force", "quantum force"]
46
+ end
46
47
  end
@@ -7,9 +7,6 @@ UnitMeasurements::Illuminance = UnitMeasurements.build do
7
7
 
8
8
  system :metric do
9
9
  si_unit "lx", aliases: ["lux", "lm/m²", "lm/m^2", "lumen per square metre", "lumen per square meter"]
10
- end
11
-
12
- system :centimetre_gram_second do
13
10
  unit "ph", value: "10000 lx", aliases: ["phot", "phots", "lm/cm²", "lm/cm^2", "lumen per square centimetre", "lumen per square centimeter"]
14
11
  end
15
12
 
@@ -7,14 +7,12 @@ UnitMeasurements::KineticViscosity = UnitMeasurements.build do
7
7
 
8
8
  system :metric do
9
9
  unit "m²/s", aliases: ["m^2/s", "square metre per second", "square meter per second", "square metres per second", "square meters per second"]
10
+
11
+ unit "St", value: "1e-4 m²/s", aliases: ["stoke", "strokes"]
10
12
  end
11
13
 
12
14
  system :foot_pound_second do
13
15
  unit "ft²/s", value: "0.09290304 m²/s", aliases: ["ft^2/s", "square foot per second", "square feet per second"]
14
16
  unit "in²/s", value: "0.006944444444444443 ft²/s", aliases: ["in^2/s", "square inch per second", "square inches per second"]
15
17
  end
16
-
17
- system :centimetre_gram_second do
18
- unit "St", value: "1e-4 m²/s", aliases: ["stoke", "strokes"]
19
- end
20
18
  end
@@ -26,6 +26,8 @@ UnitMeasurements::Length = UnitMeasurements.build do
26
26
  unit "nl", value: "3 nmi", aliases: ["NL", "nleague", "nleagues", "nautical league", "nautical leagues"]
27
27
  unit "rd", value: "16 1/2 ft", aliases: ["rod", "rods", "perch", "pole", "lug"]
28
28
  unit "cb", value: "608 ft", aliases: ["CBL.", "cable length"]
29
+ unit "qr", value: "1/4 yd", aliases: ["quarter", "quarters"]
30
+ unit "bc", value: "1/3 in", aliases: ["b.c.", "barleycorn", "barleycorns"]
29
31
 
30
32
  unit "ftm", value: "6 ft", aliases: ["fathom", "fathoms"]
31
33
  unit "fur", value: "220 yd", aliases: ["furlong", "furlongs"]
@@ -33,10 +35,10 @@ UnitMeasurements::Length = UnitMeasurements.build do
33
35
  unit "lnk", value: "33/50 ft", aliases: ["l", "li", "link", "links"]
34
36
  unit "lea", value: "3 mi", aliases: ["league", "leagues"]
35
37
 
36
- unit "b.c.", value: "1/3 in", aliases: ["bc", "barleycorn", "barleycorns"]
37
38
  end
38
39
 
39
40
  system :us_customary do
41
+ unit "U", value: "1.75 in", aliases: ["RU", "rack unit", "rack units"]
40
42
  unit "sft", value: "1200/3937 m", aliases: ["sfoot", "sfeet", "survey-foot", "survey-feet"]
41
43
 
42
44
  unit "cb (US)", value: "720 ft", aliases: ["CBL. (US)", "cable length (US)"]
@@ -56,4 +58,10 @@ UnitMeasurements::Length = UnitMeasurements.build do
56
58
  unit "lm", value: "30 ld", aliases: ["light-month", "light-months"]
57
59
  unit "ly", value: "365.25 ld", aliases: ["light-year", "light-years"]
58
60
  end
61
+
62
+ system :planck_units do
63
+ unit "lₚ", value: "1.616255e-35 m", aliases: ["planck length", "quantum length"]
64
+ end
65
+
66
+ unit "z", value: "1.302773e+26 m", aliases: ["red-shift", "redshift", "redshifts"]
59
67
  end
@@ -7,6 +7,9 @@ UnitMeasurements::Luminance = UnitMeasurements.build do
7
7
 
8
8
  system :metric do
9
9
  unit "cd/m²", aliases: ["cd/m^2", "candela per square metre", "candelas per square metre", "candela per square meter", "candelas per square meter"]
10
+
11
+ unit "L", value: [Rational(10000, Math::PI), "cd/m²"], aliases: ["lambert", "lamberts"]
12
+ unit "sb", value: "10000 cd/m²", aliases: ["stlib"]
10
13
  end
11
14
 
12
15
  system :us_customary do
@@ -15,9 +18,4 @@ UnitMeasurements::Luminance = UnitMeasurements.build do
15
18
  unit "cd/in²", value: "1550.0031 cd/m²", aliases: ["cd/in^2", "candela per square inch", "candelas per square inch"]
16
19
  unit "cd/ft²", value: "10.763910417 cd/m²", aliases: ["cd/ft^2", "candela per square foot", "candelas per square foot"]
17
20
  end
18
-
19
- system :centimetre_gram_second do
20
- unit "L", value: [Rational(10000, Math::PI), "cd/m²"], aliases: ["lambert", "lamberts"]
21
- unit "sb", value: "10000 cd/m²", aliases: ["stlib"]
22
- end
23
21
  end
@@ -8,11 +8,8 @@ UnitMeasurements::MagneticFlux = UnitMeasurements.build do
8
8
  system :metric do
9
9
  si_unit "Wb", aliases: ["weber", "webers"]
10
10
 
11
- unit "T·m²", value: "1 Wb", aliases: ["T*m^2", "tesla-square meter", "tesla-square metre"]
12
- end
13
-
14
- system :centimetre_gram_second do
15
11
  unit "Mx", value: "1e-8 Wb", aliases: ["maxwell", "maxwells"]
12
+ unit "T·m²", value: "1 Wb", aliases: ["T*m^2", "tesla-square meter", "tesla-square metre"]
16
13
  unit "G·cm²", value: "1e-8 Wb", aliases: ["G*cm^2", "gauss-square centimeter", "gauss-square centimetre"]
17
14
  end
18
15
  end
@@ -7,9 +7,7 @@ UnitMeasurements::MagneticInduction = UnitMeasurements.build do
7
7
 
8
8
  system :metric do
9
9
  si_unit "T", aliases: ["tesla", "teslas"]
10
- end
11
10
 
12
- system :centimetre_gram_second do
13
11
  unit "G", value: "1e-4 T", aliases: ["Gs", "gauss"]
14
12
  end
15
13
  end
@@ -7,9 +7,7 @@ UnitMeasurements::MagnetomotiveForce = UnitMeasurements.build do
7
7
 
8
8
  system :metric do
9
9
  unit "A⋅t", aliases: ["A*t", "ampere-turn"]
10
- end
11
10
 
12
- system :centimetre_gram_second do
13
11
  unit "Gb", value: [Rational(10, (4 * Math::PI)), "A⋅t"], aliases: ["Gi", "gilbert", "gilberts"]
14
12
  end
15
13
  end
@@ -13,6 +13,7 @@ UnitMeasurements::Power = UnitMeasurements.build do
13
13
  unit "hp (M)", value: "735.49875 W", aliases: ["PS", "metric horsepower"]
14
14
 
15
15
  unit "kgf⋅m", value: "9.80665 W", aliases: ["kgf*m", "kilogramme-force meter", "kilogram-force meter"]
16
+ unit "erg/s", value: "1e-7 W", aliases: ["erg per second", "ergs per second"]
16
17
 
17
18
  unit "cal/s", value: "4.1868 W", aliases: ["calorie per second", "calories per second"]
18
19
  unit "cal/min", value: "0.06978 W", aliases: ["calorie per minute", "calories per minute"]
@@ -45,8 +46,8 @@ UnitMeasurements::Power = UnitMeasurements.build do
45
46
  unit "BTU/h", value: "0.29307107017222 W", aliases: ["british thermal unit per hour", "british thermal units per hour"]
46
47
  end
47
48
 
48
- system :centimetre_gram_second do
49
- unit "erg/s", value: "1e-7 W", aliases: ["erg per second", "ergs per second"]
49
+ system :planck_units do
50
+ unit "Pₚ", value: "3.6283e+52 W", aliases: ["planck power", "quantum power"]
50
51
  end
51
52
 
52
53
  unit "lusec", value: "133.3224 μW", aliases: ["lusecs"]
@@ -8,6 +8,7 @@ UnitMeasurements::Pressure = UnitMeasurements.build do
8
8
  system :metric do
9
9
  si_unit "Pa", aliases: ["pascal", "pascals"]
10
10
 
11
+ unit "Ba", value: "0.1 Pa", aliases: ["barye", "baryes"]
11
12
  unit "bar", value: "100 kPa", aliases: ["bars"]
12
13
  unit "atm", value: "101325 Pa", aliases: ["atmosphere", "atmospheres"]
13
14
  unit "Torr", value: "1/760 atm", aliases: ["torr"]
@@ -45,10 +46,6 @@ UnitMeasurements::Pressure = UnitMeasurements.build do
45
46
  unit "tn/ft²", value: "9.5760518e+4 Pa", aliases: ["tn/ft^2", "ton per square foot", "tons per square foot", "short ton per square foot", "short tons per square foot"]
46
47
  end
47
48
 
48
- system :centimetre_gram_second do
49
- unit "Ba", value: "0.1 Pa", aliases: ["barye", "baryes"]
50
- end
51
-
52
49
  system :metre_tonne_second do
53
50
  unit "pz", value: "1 kPa", aliases: ["pieze", "pièze"]
54
51
  end
@@ -56,4 +53,8 @@ UnitMeasurements::Pressure = UnitMeasurements.build do
56
53
  system :gravitational_metric do
57
54
  unit "at", value: "98066.5 Pa", aliases: ["technical atmosphere", "technical atmospheres"]
58
55
  end
56
+
57
+ system :planck_units do
58
+ unit "Pₚ", value: "4.63309e+113 Pa", aliases: ["planck pressure", "quantum pressure"]
59
+ end
59
60
  end
@@ -7,11 +7,8 @@ UnitMeasurements::RadiationAbsorbedDose = UnitMeasurements.build do
7
7
 
8
8
  system :metric do
9
9
  si_unit "Gy", aliases: ["gray", "grays"]
10
- end
11
10
 
12
- system :centimetre_gram_second do
13
11
  unit "rad", value: "0.01 Gy", aliases: ["radiation absorbed dose"]
14
-
15
12
  unit "erg/g", value: "1e-4 Gy", aliases: ["erg per gram", "erg per gramme", "ergs per gram", "ergs per gramme"]
16
13
  end
17
14
  end
@@ -7,9 +7,7 @@ UnitMeasurements::RadiationEquivalentDose = UnitMeasurements.build do
7
7
 
8
8
  system :metric do
9
9
  si_unit "Sv", aliases: ["sievert", "sieverts"]
10
- end
11
10
 
12
- system :centimetre_gram_second do
13
11
  unit "rem", value: "0.01 Sv", aliases: ["röntgen equivalent man", "roentgen equivalent man"]
14
12
  end
15
13
  end
@@ -12,4 +12,8 @@ UnitMeasurements::Temperature = UnitMeasurements.build do
12
12
  system :english_engineering do
13
13
  unit "°R", value: "5/9 K", aliases: ["R", "°Ra", "Ra", "rankine"]
14
14
  end
15
+
16
+ system :planck_units do
17
+ unit "Tₚ", value: "1.416784e+32 K", aliases: ["planck temperature", "quantum temperature"]
18
+ end
15
19
  end
@@ -13,6 +13,10 @@ UnitMeasurements::Time = UnitMeasurements.build do
13
13
  unit "min", value: "60 s", aliases: ["minute", "minutes"]
14
14
  end
15
15
 
16
+ system :planck_units do
17
+ unit "tₚ", value: "5.391247e-44 s", aliases: ["planck time", "quantum time"]
18
+ end
19
+
16
20
  unit "wk", value: "7 d", aliases: ["week", "weeks"]
17
21
  unit "mo", value: "30.4167 d", aliases: ["month", "months"]
18
22
  unit "yr", value: "365 d", aliases: ["y", "year", "years"]
@@ -18,9 +18,7 @@ UnitMeasurements::Torque = UnitMeasurements.build do
18
18
  unit "kgf·m", value: "9.80665 N·m", aliases: ["kgf*m", "Kilogram-force meter", "kilogramme-force metre"]
19
19
  unit "kgf·cm", value: "0.0980665 N·m", aliases: ["kgf*cm", "Kilogram-force centimeter", "kilogramme-force centimetre"]
20
20
  unit "kgf·mm", value: "0.00980665 N·m", aliases: ["kgf*mm", "Kilogram-force millimeter", "kilogramme-force millimetre"]
21
- end
22
21
 
23
- system :centimetre_gram_second do
24
22
  unit "dyn·m", value: "1e-5 N·m", aliases: ["dyn*m", "dyne meter", "dyne metre"]
25
23
  unit "dyn·cm", value: "1e-7 N·m", aliases: ["dyn*cm", "dyne centimeter", "dyne centimetre"]
26
24
  unit "dyn·mm", value: "1e-8 N·m", aliases: ["dyn*mm", "dyne millimeter", "dyne millimetre"]
@@ -10,6 +10,7 @@ UnitMeasurements::Volume = UnitMeasurements.build do
10
10
 
11
11
  unit "λ", value: "1e-9 m³", aliases: ["lambda", "lambdas"]
12
12
  unit "m³", value: "1000 l", aliases: ["m^3", "cu m", "cubic meter", "cubic meters", "cubic metre", "cubic metres"]
13
+ unit "st", value: "1 m³", aliases: ["stère", "stere", "steres"]
13
14
 
14
15
  unit "mm³", value: "1e-9 m³", aliases: ["mm^3", "cu mm", "cubic millimeter", "cubic millimeters", "cubic millimetre", "cubic millimetres"]
15
16
  unit "cm³", value: "1e-6 m³", aliases: ["cm^3", "cu cm", "cubic centimeter", "cubic centimeters", "cubic centimetre", "cubic centimetres"]
@@ -40,6 +41,7 @@ UnitMeasurements::Volume = UnitMeasurements.build do
40
41
  unit "bkt", value: "4 gal", aliases: ["bucket", "buckets"]
41
42
  unit "hhd", value: "2 bbl", aliases: ["hogshead", "hogsheads"]
42
43
  unit "fls", value: "1/24 floz", aliases: ["fluid scruple", "fluid scruples"]
44
+ unit "fir", value: "0.25 bbl", aliases: ["firkin", "firkins"]
43
45
 
44
46
  unit "dspn", value: "10 ml", aliases: ["dsp", "dstspn", "dessertspoon", "dessertspoons"]
45
47
  unit "tbsp", value: "3 tsp", aliases: ["tbs", "tablespoon", "tablespoons"]
@@ -50,6 +52,7 @@ UnitMeasurements::Volume = UnitMeasurements.build do
50
52
  system :us_customary do
51
53
  unit "cd", value: "128 ft³", aliases: ["cord", "cords"]
52
54
 
55
+ unit "pot", value: "2 qt", aliases: ["pottle", "pottles"]
53
56
  unit "bdft", value: "144 in³", aliases: ["bf", "fbm", "board-foot", "board-feet"]
54
57
 
55
58
  unit "ac⋅ft", value: "43560 ft³", aliases: ["acre-foot", "acre-feet"]
@@ -57,4 +60,8 @@ UnitMeasurements::Volume = UnitMeasurements.build do
57
60
 
58
61
  unit "cd-ft", value: "1/8 cd", aliases: ["cord-foot", "cord-feet"]
59
62
  end
63
+
64
+ system :planck_units do
65
+ unit "Vₚ", value: "4.2217e-105 m³", aliases: ["planck volume", "quantum volume"]
66
+ end
60
67
  end
@@ -20,6 +20,7 @@ UnitMeasurements::Weight = UnitMeasurements.build do
20
20
  unit "s", value: "20 gr", aliases: ["scruple", "scruples"]
21
21
 
22
22
  unit "lb", value: "0.45359237 kg", aliases: ["lbs", "lbm", "pound-mass", "pound", "pounds", "#"]
23
+ unit "qr", value: "1/4 cwt", aliases: ["qtr", "quarter", "quarters"]
23
24
  unit "st", value: "14 lb", aliases: ["stone", "stones"]
24
25
  unit "oz", value: "1/16 lb", aliases: ["ounce", "ounces"]
25
26
  unit "dr", value: "1/16 oz", aliases: ["dram", "drams"]
@@ -31,10 +32,12 @@ UnitMeasurements::Weight = UnitMeasurements.build do
31
32
  unit "lbt", value: "5760 gr", aliases: ["troy pound", "troy pounds"]
32
33
  unit "dwt", value: "1/20 ozt", aliases: ["pwt", "pennyweight", "pennyweights"]
33
34
  unit "cwt", value: "112 lb", aliases: ["hundredweight", "long hundredweight", "imperial hundredweight"]
35
+ unit "fir", value: "56 lb", aliases: ["firkin", "firkins"]
34
36
  end
35
37
 
36
38
  system :us_customary do
37
39
  unit "tn", value: "2000 lb", aliases: ["ton", "tons", "short ton", "short tons"]
40
+ unit "us qr", value: "1/4 cwt (US)", aliases: ["us qtr", "us quarter", "us quarters"]
38
41
  unit "cwt (US)", value: "100 lb", aliases: ["hundredweight (US)", "short hundredweight"]
39
42
  end
40
43
 
@@ -45,4 +48,8 @@ UnitMeasurements::Weight = UnitMeasurements.build do
45
48
  system :foot_pound_second do
46
49
  unit "slug", value: "32.17404856 lb", aliases: ["slugs"]
47
50
  end
51
+
52
+ system :planck_units do
53
+ unit "mₚ", value: "2.176434e-8 kg", aliases: ["planck mass", "quantum mass"]
54
+ end
48
55
  end
@@ -4,5 +4,5 @@
4
4
 
5
5
  module UnitMeasurements
6
6
  # Current stable version.
7
- VERSION = "5.15.0"
7
+ VERSION = "5.17.0"
8
8
  end
data/units.md CHANGED
@@ -45,10 +45,14 @@ These units are defined in `UnitMeasurements::Length`.
45
45
  | 26 | lnk | l, li, link, links |
46
46
  | 27 | lea | league, leagues |
47
47
  | 28 | sft | sfoot, sfeet, survey-foot, survey-feet |
48
- | 29 | b.c. | bc, barleycorn, barleycorns |
48
+ | 29 | bc | b.c., barleycorn, barleycorns |
49
49
  | 30 | lmin | light-minute, light-minutes |
50
50
  | 31 | cb (M) | CBL. (M), cable length (M) |
51
51
  | 32 | cb (US) | CBL. (US), cable length (US) |
52
+ | 33 | lₚ | planck length, quantum length |
53
+ | 34 | qr | quarter, quarters |
54
+ | 35 | U | RU, rack unit, rack units |
55
+ | 36 | z | red-shift, redshift, redshifts |
52
56
 
53
57
  ## 2. Weight or mass
54
58
 
@@ -78,6 +82,10 @@ These units are defined in `UnitMeasurements::Weight`.
78
82
  | 20 | cwt | hundredweight, long hundredweight, imperial hundredweight |
79
83
  | 21 | slug | slugs |
80
84
  | 22 | cwt (US) | hundredweight (US), short hundredweight |
85
+ | 23 | mₚ | planck mass, quantum mass |
86
+ | 24 | qr | qtr, quarter, quarters |
87
+ | 25 | fir | firkin, firkins |
88
+ | 26 | us qr | us qtr, us quarter, us quarters |
81
89
 
82
90
  ## 3. Time or duration
83
91
 
@@ -96,6 +104,7 @@ These units are defined in `UnitMeasurements::Time`.
96
104
  | 9 | qtr | quarter, quarters |
97
105
  | 10 | dec | decade, decades |
98
106
  | 11 | cent | century, centuries |
107
+ | 12 | tₚ | planck time, quantum time |
99
108
 
100
109
  ## 4. Amount of substance
101
110
 
@@ -116,6 +125,7 @@ These units are defined in `UnitMeasurements::ElectricCurrent`.
116
125
  | 2 | abA | abampere, abamperes |
117
126
  | 3 | Bi | biot, biots |
118
127
  | 4 | statA | statampere, statamperes |
128
+ | 5 | Iₚ | planck current, quantum current |
119
129
 
120
130
  ## 6. Luminous intensity
121
131
 
@@ -134,6 +144,7 @@ These units are defined in `UnitMeasurements::Temperature`.
134
144
  |:--|:--|:--|
135
145
  | _1_ | _K*_ | _kelvin, kelvins_ |
136
146
  | 2 | °R | R, °Ra, Ra, rankine |
147
+ | 3 | Tₚ | planck temperature, quantum temperature |
137
148
 
138
149
  ## 8. Area
139
150
 
@@ -161,6 +172,10 @@ These units are defined in `UnitMeasurements::Area`.
161
172
  | 18 | ft² (US) | ft^2 (US), sq ft (US), square foot (US), square feet (US) |
162
173
  | 19 | mi² (US) | mi^2 (US), sq mi (US), square mile (US), square miles (US) |
163
174
  | 20 | ch² (US) | ch^2 (US), sq ch (US), square chain (US), square chains (US) |
175
+ | 21 | Aₚ | planck area, quantum area |
176
+ | 22 | dun | ḍn, dunam, dunams |
177
+ | 23 | sec | sect, section, sections |
178
+ | 24 | twp | survey township, survey townships |
164
179
 
165
180
  ## 9. Volume & capacity
166
181
 
@@ -203,6 +218,10 @@ These units are defined in `UnitMeasurements::Volume`.
203
218
  | 33 | ac⋅ft | acre-foot, acre-feet |
204
219
  | 34 | ac⋅in | acre-inch, acre-inches |
205
220
  | 35 | cd-ft | cord-foot, cord-feet |
221
+ | 36 | Vₚ | planck volume, quantum volume |
222
+ | 37 | st | stère, stere, steres |
223
+ | 38 | fir | firkin, firkins |
224
+ | 39 | pot | pottle, pottles |
206
225
 
207
226
  ## 10. Density
208
227
 
@@ -223,6 +242,7 @@ These units are defined in `UnitMeasurements::Density`.
223
242
  | 11 | lb/gal | pound per gallon, pounds per gallon |
224
243
  | 12 | slug/ft³ | slug/ft^3, slug per cubic foot, slugs per cubic foot |
225
244
  | 13 | slug/in³ | slug/in^3, slug per cubic inch, slugs per cubic inch |
245
+ | 14 | ρₚ | planck density, quantum density |
226
246
 
227
247
  ## 11. Quantity
228
248
 
@@ -302,7 +322,8 @@ These units are defined in `UnitMeasurements::Force`.
302
322
  | 14 | kipf | kip, klbf, kip-force |
303
323
  | 15 | (lb⋅m)/s² | (lb*m)/s^2, pound meter per second squared, pound metre per second squared |
304
324
  | 16 | (lb⋅ft)/s² | (lb*ft)/s^2, pound foot per second squared |
305
- | 17 | (lb⋅in)/s² | (lb*in)/s^2, pound inch per second squared |
325
+ | 17 | (lb⋅in)/s² | (lb\*in)/s^2, pound inch per second squared |
326
+ | 18 | Fₚ | planck force, quantum force |
306
327
 
307
328
  ## 16. Velocity or speed
308
329
 
@@ -343,6 +364,7 @@ These units are defined in `UnitMeasurements::Acceleration`.
343
364
  | 10 | mpm/s | mi/(min⋅s), mile per minute per second, miles per minute per second |
344
365
  | 11 | mph/s | mi/(h⋅s), mile per hour per second, miles per hour per second |
345
366
  | 12 | Kn/s | knot per second, knots per second |
367
+ | 13 | aₚ | planck acceleration, quantum acceleration |
346
368
 
347
369
  ## 18. Angular velocity or rotational speed
348
370
 
@@ -396,6 +418,7 @@ These units are defined in `UnitMeasurements::ElectricCharge`.
396
418
  | 3 | statC | statcoulomb, statcoulombs |
397
419
  | 4 | Fr | franklin, franklins |
398
420
  | 5 | Fd | faraday, faradays |
421
+ | 6 | qₚ | planck charge, quantum charge |
399
422
 
400
423
  ## 22. Electrical capacitance
401
424
 
@@ -541,6 +564,7 @@ These units are defined in `UnitMeasurements::Pressure`.
541
564
  | 25 | kgf/m² | kgf/m^2, kilogram-force per square metre, kilogramme-force per square metre |
542
565
  | 26 | kgf/mm² | kgf/mm^2, kilogram-force per square millimetre, kilogramme-force per square millimetre |
543
566
  | 27 | kgf/dm² | kgf/dm^2, kilogram-force per square decimetre, kilogramme-force per square decimetre |
567
+ | 28 | Pₚ | planck pressure, quantum pressure |
544
568
 
545
569
  ## 34. Torque or moment of force
546
570
 
@@ -639,7 +663,8 @@ These units are defined in `UnitMeasurements::Power`.
639
663
  | 22 | lusec | lusecs |
640
664
  | 23 | atm⋅ft³/s | atm*ft^3/s, atmosphere-cubic foot per second |
641
665
  | 24 | atm⋅ft³/min | atm*ft^3/min, atmosphere-cubic foot per minute |
642
- | 25 | atm⋅ft³/h | atm*ft^3/h, atmosphere-cubic foot per hour |
666
+ | 25 | atm⋅ft³/h | atm\*ft^3/h, atmosphere-cubic foot per hour |
667
+ | 26 | Pₚ | planck power, quantum power |
643
668
 
644
669
  ## 40. Energy
645
670
 
@@ -671,6 +696,7 @@ These units are defined in `UnitMeasurements::Energy`.
671
696
  | 22 | in⋅lbf | in\*lbf, in⋅lb, in\*lb, inch-pound force |
672
697
  | 23 | ft⋅pdl | ft*pdl, foot-poundal |
673
698
  | 24 | gal⋅atm | gal*atm, gallon-atmosphere |
699
+ | 25 | Eₚ | planck energy, quantum energy |
674
700
 
675
701
  ## 41. Dynamic viscosity
676
702
 
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: 5.15.0
4
+ version: 5.17.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-12-11 00:00:00.000000000 Z
11
+ date: 2023-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport