unit_measurements 2.6.2 → 3.1.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 +25 -0
- data/Gemfile.lock +1 -1
- data/{LICENSE → LICENSE.md} +1 -1
- data/README.md +19 -19
- data/lib/unit_measurements/measurement.rb +9 -1
- data/lib/unit_measurements/unit_group_builder.rb +0 -4
- data/lib/unit_measurements/unit_groups/all.rb +3 -0
- data/lib/unit_measurements/unit_groups/area.rb +1 -1
- data/lib/unit_measurements/unit_groups/density.rb +1 -1
- data/lib/unit_measurements/unit_groups/quantity.rb +1 -1
- data/lib/unit_measurements/unit_groups/velocity.rb +20 -0
- data/lib/unit_measurements/unit_groups/voltage.rb +13 -0
- data/lib/unit_measurements/version.rb +1 -1
- data/unit_measurements.gemspec +1 -1
- data/units.md +45 -17
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 014d47c99d809be7cca2674c2842cc841410cc911f65ff606fe4ee030e8113e8
|
4
|
+
data.tar.gz: d3e72bfe774954f0a9f81625adbd042eff2da2b4bef7f969774209bacbda334d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 441c675c511223db61d4f7b7e791f62c63f635777f5e02474cae5b0527453075ac93af5c172f5f23608641ef82d7d64a5237ebce22fe445e080ce3b0c111c3f7
|
7
|
+
data.tar.gz: 19fdcb0fb797bec37b30e5ed56f817497b8620cb6cd199293d31083006583fd5b936af10ee744d8f5c9d093b91ca7c1fc3b051a7cee7500f95c0518fdf3f8d34
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
## [3.1.0](https://github.com/shivam091/unit_measurements/compare/v3.0.0...v3.1.0) - 2023-08-26
|
2
|
+
|
3
|
+
### What's new
|
4
|
+
|
5
|
+
- Added unit group for `voltage` units.
|
6
|
+
- Added unit group for `velocity` units.
|
7
|
+
|
8
|
+
----------
|
9
|
+
|
10
|
+
## [3.0.0](https://github.com/shivam091/unit_measurements/compare/v2.6.2...v3.0.0) - 2023-08-25
|
11
|
+
|
12
|
+
### What's new
|
13
|
+
|
14
|
+
- Added method `Measurement.name` to get humanized name of the unit group.
|
15
|
+
- Raised `BaseError` in `Measurement.unit_group`.
|
16
|
+
- Added aliases `in`, `as`, `in!`, `as` for `convert_to` and `convert_to!` methods.
|
17
|
+
|
18
|
+
### What's changed
|
19
|
+
|
20
|
+
- Moved LICENSE to markdown file.
|
21
|
+
- Replaced `$LOAD_PATH` by shorthand `$:`
|
22
|
+
- Replaced `base` method by `unit`.
|
23
|
+
|
24
|
+
----------
|
25
|
+
|
1
26
|
## [2.6.2](https://github.com/shivam091/unit_measurements/compare/v2.6.1...v2.6.2) - 2023-08-25
|
2
27
|
|
3
28
|
### What's changed
|
data/Gemfile.lock
CHANGED
data/{LICENSE → LICENSE.md}
RENAMED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ A library that encapsulate measurements and their units in Ruby.
|
|
7
7
|
[![Gem Downloads](https://img.shields.io/gem/dt/unit_measurements.svg)](http://rubygems.org/gems/unit_measurements)
|
8
8
|
[![Maintainability](https://api.codeclimate.com/v1/badges/b8aec9bffa356d108784/maintainability)](https://codeclimate.com/github/shivam091/unit_measurements/maintainability)
|
9
9
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/b8aec9bffa356d108784/test_coverage)](https://codeclimate.com/github/shivam091/unit_measurements/test_coverage)
|
10
|
-
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/shivam091/unit_measurements/blob/main/LICENSE)
|
10
|
+
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/shivam091/unit_measurements/blob/main/LICENSE.md)
|
11
11
|
|
12
12
|
**Harshal V. Ladhe, M.Sc. Computer Science.**
|
13
13
|
|
@@ -72,8 +72,9 @@ UnitMeasurements::Weight.new(1, :kg)
|
|
72
72
|
**Converting to other units:**
|
73
73
|
|
74
74
|
This gem allows you to convert among units of same unit group.
|
75
|
-
You can convert measurement to other unit using `#convert_to`
|
76
|
-
|
75
|
+
You can convert measurement to other unit using `#convert_to`
|
76
|
+
(aliased as `#to`, `#in`, and `as`) or `#convert_to!`
|
77
|
+
(aliased as `#to!`, `#in!`, and `as!`) methods.
|
77
78
|
|
78
79
|
You can use `#convert_to` as:
|
79
80
|
|
@@ -243,6 +244,13 @@ weight.unit
|
|
243
244
|
#=> #<UnitMeasurements::Unit: kg (kilogram, kilogramme, kilogrammes, kilograms)>
|
244
245
|
```
|
245
246
|
|
247
|
+
**See humanized name of the unit group:**
|
248
|
+
|
249
|
+
```ruby
|
250
|
+
UnitMeasurements::Weight.name
|
251
|
+
#=> weight
|
252
|
+
```
|
253
|
+
|
246
254
|
**See all units of the unit group:**
|
247
255
|
|
248
256
|
```ruby
|
@@ -467,31 +475,23 @@ gem "unit_measurements", require: ["unit_measurements/base", "unit_measurements/
|
|
467
475
|
### Building new unit groups
|
468
476
|
|
469
477
|
This library provides simpler way to build your own unit groups. To build new unit group,
|
470
|
-
use `UnitMeasurements.build` in order to define
|
478
|
+
use `UnitMeasurements.build` in order to define units within it:
|
471
479
|
|
472
|
-
If
|
480
|
+
If the unit is supporting [si prefixes](#si-units-support), you can use `si_unit` method to build it.
|
481
|
+
If you build unit using `si_unit`, the unit will be added along with all SI prefixes for it.
|
473
482
|
|
474
483
|
```ruby
|
475
484
|
UnitMeasurements::Time = UnitMeasurements.build do
|
476
|
-
|
477
|
-
base :s, aliases: [:second, :seconds]
|
478
|
-
|
479
|
-
# Add other units to the group, along with their conversion multipliers against
|
480
|
-
# base unit.
|
481
|
-
unit :min, value: 60.0, aliases: [:minute, :minutes]
|
485
|
+
unit :s, aliases: [:second, :seconds]
|
482
486
|
|
483
|
-
#
|
484
|
-
|
485
|
-
unit :h, value: "60 min", aliases: [:hour, :hours]
|
487
|
+
# Add units to the group, along with their conversion multipliers.
|
488
|
+
unit :min, value: "60 s", aliases: [:hour, :hours]
|
486
489
|
|
487
490
|
# You can also specify unit value as an array.
|
488
|
-
unit :
|
491
|
+
unit :h, value: [60, :min], aliases: [:day, :days]
|
489
492
|
end
|
490
493
|
```
|
491
494
|
|
492
|
-
If the unit is supporting [si prefixes](#si-units-support), you can use `si_unit` method to build it.
|
493
|
-
If you build unit using `si_unit`, Base unit is automatically added to the group along with all SI prefixes for it.
|
494
|
-
|
495
495
|
```ruby
|
496
496
|
UnitMeasurements::Time = UnitMeasurements.build do
|
497
497
|
# Add a SI unit to the unit group
|
@@ -501,7 +501,7 @@ UnitMeasurements::Time = UnitMeasurements.build do
|
|
501
501
|
end
|
502
502
|
```
|
503
503
|
|
504
|
-
All units allow aliases, as long as they are unique. Unit
|
504
|
+
All units allow aliases, as long as they are unique. Unit names can be used to
|
505
505
|
define the unit as long as it is unique. All unit names are case sensitive.
|
506
506
|
|
507
507
|
### Namespaces
|
@@ -32,6 +32,8 @@ module UnitMeasurements
|
|
32
32
|
self.class.new((quantity * conversion_factor), target_unit)
|
33
33
|
end
|
34
34
|
alias_method :to, :convert_to
|
35
|
+
alias_method :in, :convert_to
|
36
|
+
alias_method :as, :convert_to
|
35
37
|
|
36
38
|
def convert_to!(target_unit)
|
37
39
|
measurement = convert_to(target_unit)
|
@@ -40,6 +42,8 @@ module UnitMeasurements
|
|
40
42
|
self
|
41
43
|
end
|
42
44
|
alias_method :to!, :convert_to!
|
45
|
+
alias_method :in!, :convert_to!
|
46
|
+
alias_method :as!, :convert_to!
|
43
47
|
|
44
48
|
def inspect(dump: false)
|
45
49
|
return super() if dump
|
@@ -64,7 +68,7 @@ module UnitMeasurements
|
|
64
68
|
extend Forwardable
|
65
69
|
|
66
70
|
def unit_group
|
67
|
-
raise "`Measurement` does not have a `unit_group` object. You cannot directly use `Measurement`. Instead, build a new unit group by calling `UnitMeasurements.build`."
|
71
|
+
raise BaseError, "`Measurement` does not have a `unit_group` object. You cannot directly use `Measurement`. Instead, build a new unit group by calling `UnitMeasurements.build`."
|
68
72
|
end
|
69
73
|
|
70
74
|
def_delegators :unit_group, :units, :unit_names, :unit_with_name_and_aliases,
|
@@ -78,6 +82,10 @@ module UnitMeasurements
|
|
78
82
|
target ? _parse(source).convert_to(target) : _parse(source)
|
79
83
|
end
|
80
84
|
|
85
|
+
def name
|
86
|
+
to_s.split("::").last.underscore.humanize.downcase
|
87
|
+
end
|
88
|
+
|
81
89
|
private
|
82
90
|
|
83
91
|
def _parse(string)
|
@@ -10,10 +10,6 @@ module UnitMeasurements
|
|
10
10
|
@units = []
|
11
11
|
end
|
12
12
|
|
13
|
-
def base(name, aliases: [])
|
14
|
-
@units << build_unit(name, value: 1.0, aliases: aliases)
|
15
|
-
end
|
16
|
-
|
17
13
|
def unit(name, value: 1.0, aliases: [])
|
18
14
|
@units << build_unit(name, value: value, aliases: aliases)
|
19
15
|
end
|
@@ -18,8 +18,11 @@ require_relative "area"
|
|
18
18
|
require_relative "volume"
|
19
19
|
require_relative "density"
|
20
20
|
require_relative "force"
|
21
|
+
require_relative "voltage"
|
22
|
+
require_relative "velocity"
|
21
23
|
|
22
24
|
## Other units
|
25
|
+
|
23
26
|
require_relative "sound_level"
|
24
27
|
require_relative "plane_angle"
|
25
28
|
require_relative "solid_angle"
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# -*- warn_indent: true -*-
|
4
4
|
|
5
5
|
UnitMeasurements::Area = UnitMeasurements.build do
|
6
|
-
|
6
|
+
unit :m², aliases: [:"m^2", :"sq m", :"square meter", :"square meters", :"square metre", :"square metres"]
|
7
7
|
|
8
8
|
unit :km², value: "1e+6 m²", aliases: [:"km^2", :"sq km", :"square kilometer", :"square kilometers", :"square kilometre", :"square kilometres"]
|
9
9
|
unit :in², value: "0.00064516 m²", aliases: [:"in^2", :"sq in", :"square inch", :"square inches"]
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# -*- warn_indent: true -*-
|
4
4
|
|
5
5
|
UnitMeasurements::Density = UnitMeasurements.build do
|
6
|
-
|
6
|
+
unit :"g/m³", aliases: [:"g/m^3", :"g·m⁻³", :"gram per cubic meter", :"grams per cubic meter", :"gramme per cubic metre", :"grammes per cubic metre"]
|
7
7
|
|
8
8
|
unit :"g/l", value: "1 kg/m³", aliases: [:"g·l⁻¹", :"gram per liter", :"grams per liter", :"gramme per litre", :"grammes per litre"]
|
9
9
|
unit :"g/ml", value: "1000 g/l", aliases: [:"g·ml⁻¹", :"gram per milliliter", :"grams per milliliter", :"gramme per millilitre", :"grammes per millilitre"]
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# -*- warn_indent: true -*-
|
4
4
|
|
5
5
|
UnitMeasurements::Quantity = UnitMeasurements.build do
|
6
|
-
|
6
|
+
unit :pc, aliases: [:pcs, :piece, :pieces]
|
7
7
|
|
8
8
|
unit :pr, value: "2 pc", aliases: [:pair, :pairs]
|
9
9
|
unit :dz, value: "6 pr", aliases: [:doz, :dozen, :dozens]
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# -*- frozen_string_literal: true -*-
|
3
|
+
# -*- warn_indent: true -*-
|
4
|
+
|
5
|
+
UnitMeasurements::Velocity = UnitMeasurements.build do
|
6
|
+
unit :"m/s", aliases: [:"m·s⁻¹", :"meter per second", :"meters per second", :"metre per second", :"metres per second"]
|
7
|
+
|
8
|
+
unit :"m/min", value: "1/60 m/s", aliases: [:"m·min⁻¹", :"meter per minute", :"meters per minute", :"metre per minute", :"metres per minute"]
|
9
|
+
unit :"m/h", value: "1/60 m/min", aliases: [:"m·h⁻¹", :"meter per hour", :"meters per hour", :"metre per hour", :"metres per hour"]
|
10
|
+
|
11
|
+
unit :"in/s", value: "0.0254 m/s", aliases: [:"in·s⁻¹", :"inch per second", :"inches per second"]
|
12
|
+
unit :"in/min", value: "1/60 in/s", aliases: [:"in·min⁻¹", :"inch per minute", :"inches per minute"]
|
13
|
+
unit :"in/h", value: "1/60 in/min", aliases: [:"in·h⁻¹", :"inch per hour", :"inches per hour"]
|
14
|
+
|
15
|
+
unit :"ft/s", value: "12 in/s", aliases: [:"ft·s⁻¹", :"foot per second", :"feet per second"]
|
16
|
+
unit :"ft/min", value: "1/60 ft/s", aliases: [:"ft·min⁻¹", :"foot per minute", :"feet per minute"]
|
17
|
+
unit :"ft/h", value: "1/60 ft/min", aliases: [:"ft·h⁻¹", :"foot per hour", :"feet per hour"]
|
18
|
+
|
19
|
+
unit :Kn, value: "0.514773 m/s", aliases: [:kt, :knot, :knots]
|
20
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# -*- frozen_string_literal: true -*-
|
3
|
+
# -*- warn_indent: true -*-
|
4
|
+
|
5
|
+
UnitMeasurements::Voltage = UnitMeasurements.build do
|
6
|
+
si_unit :V, aliases: [:volt, :volts]
|
7
|
+
|
8
|
+
unit :abV, value: "1e-8 V", aliases: [:abvolt, :abvolts]
|
9
|
+
unit :statV, value: "299.792458 V", aliases: [:statvolt, :statvolts]
|
10
|
+
|
11
|
+
unit :"W/A", value: "1 V", aliases: [:"W·A⁻¹", :"watt per ampere", :"watts per ampere"]
|
12
|
+
unit :"J/C", value: "1 V", aliases: [:"J·C⁻¹", :"joule per coulomb", :"joules per coulomb"]
|
13
|
+
end
|
data/unit_measurements.gemspec
CHANGED
data/units.md
CHANGED
@@ -4,8 +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.
|
8
|
-
2. 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#si-units-support).
|
9
8
|
|
10
9
|
Below are the units which are bundled in the unit_measurements.
|
11
10
|
|
@@ -15,7 +14,7 @@ These units are defined in `UnitMeasurements::Length`.
|
|
15
14
|
|
16
15
|
| # | Name | Aliases |
|
17
16
|
|:--|:--|:--|
|
18
|
-
|
|
17
|
+
| 1 | m* | meter, metre, meters, metres |
|
19
18
|
| 2 | in | ", inch, inches |
|
20
19
|
| 3 | ft | ', foot, feet |
|
21
20
|
| 4 | yd | yard, yards |
|
@@ -27,7 +26,7 @@ These units are defined in `UnitMeasurements::Weight`.
|
|
27
26
|
|
28
27
|
| # | Name | Aliases |
|
29
28
|
|--|--|--|
|
30
|
-
|
|
29
|
+
| 1 | g* | gram, grams, gramme, grammes |
|
31
30
|
| 2 | q | quintal, quintals |
|
32
31
|
| 3 | t | tonne, tonnes, metric tonne, metric tonnes |
|
33
32
|
|
@@ -37,7 +36,7 @@ These units are defined in `UnitMeasurements::Time`.
|
|
37
36
|
|
38
37
|
| # | Name | Aliases |
|
39
38
|
|:--|:--|:--|
|
40
|
-
|
|
39
|
+
| 1 | s* | sec, second, seconds |
|
41
40
|
| 2 | h | hr, hour, hours |
|
42
41
|
| 3 | d | day, days |
|
43
42
|
| 4 | wk | week, weeks |
|
@@ -55,7 +54,7 @@ These units are defined in `UnitMeasurements::AmountOfSubstance`.
|
|
55
54
|
|
56
55
|
| # | Name | Aliases |
|
57
56
|
|:--|:--|:--|
|
58
|
-
|
|
57
|
+
| 1 | mol* | mole, moles |
|
59
58
|
| 2 | NA | avogadro constant |
|
60
59
|
|
61
60
|
## 5. Electric current
|
@@ -64,7 +63,7 @@ These units are defined in `UnitMeasurements::ElectricCurrent`.
|
|
64
63
|
|
65
64
|
| # | Name | Aliases |
|
66
65
|
|:--|:--|:--|
|
67
|
-
|
|
66
|
+
| 1 | A* | amp, ampere, amperes |
|
68
67
|
| 2 | abA | abampere, abamperes |
|
69
68
|
| 3 | Bi | biot, biots |
|
70
69
|
| 4 | statA | statampere, statamperes |
|
@@ -75,7 +74,7 @@ These units are defined in `UnitMeasurements::LuminousIntensity`.
|
|
75
74
|
|
76
75
|
| # | Name | Aliases |
|
77
76
|
|:--|:--|:--|
|
78
|
-
|
|
77
|
+
| 1 | cd* | candela, candelas |
|
79
78
|
| 2 | hk | hefnerkerze |
|
80
79
|
|
81
80
|
## 7. Temperature
|
@@ -84,7 +83,7 @@ These units are defined in `UnitMeasurements::Temperature`.
|
|
84
83
|
|
85
84
|
| # | Name | Aliases |
|
86
85
|
|:--|:--|:--|
|
87
|
-
|
|
86
|
+
| 1 | K* | kelvin, kelvins |
|
88
87
|
| 2 | °R | R, °Ra, Ra, rankine |
|
89
88
|
|
90
89
|
## 8. Area
|
@@ -93,7 +92,7 @@ These units are defined in `UnitMeasurements::Area`.
|
|
93
92
|
|
94
93
|
| # | Name | Aliases |
|
95
94
|
|:--|:--|:--|
|
96
|
-
|
|
95
|
+
| 1 | m² | m^2, sq m, square meter, square meters, square metre, square metres |
|
97
96
|
| 2 | km² | km^2, sq km, square kilometer, square kilometers, square kilometre, square kilometres |
|
98
97
|
| 3 | in² | in^2, sq in, square inch, square inches |
|
99
98
|
| 4 | ft² | ft^2, sq ft, square foot, square feet |
|
@@ -106,7 +105,7 @@ These units are defined in `UnitMeasurements::Volume`.
|
|
106
105
|
|
107
106
|
| # | Name | Aliases |
|
108
107
|
|:--|:--|:--|
|
109
|
-
|
|
108
|
+
| 1 | l* | liter, litre, liters, litres |
|
110
109
|
| 2 | m³ | m^3, cu m, cubic meter, cubic meters, cubic metre, cubic metres |
|
111
110
|
| 3 | mm³ | mm^3, cu mm, cubic millimeter, cubic millimeters, cubic millimetre, cubic millimetres |
|
112
111
|
| 4 | cm³ | cm^3, cu cm, cubic centimeter, cubic centimeters, cubic centimetre, cubic centimetres |
|
@@ -123,7 +122,7 @@ These units are defined in `UnitMeasurements::Density`.
|
|
123
122
|
|
124
123
|
| # | Name | Aliases |
|
125
124
|
|:--|:--|:--|
|
126
|
-
|
|
125
|
+
| 1 | g/m³ | g/m^3, g·m⁻³, gram per cubic meter, grams per cubic meter, gramme per cubic metre, grammes per cubic metre |
|
127
126
|
| 2 | kg/m³ | kg/m^3, kg·m⁻³, kilogram per cubic meter, kilograms per cubic meter, kilogramme per cubic metre, kilogrammes per cubic metre |
|
128
127
|
| 3 | g/l | g·l⁻¹, gram per liter, grams per liter, gramme per litre, grammes per litre |
|
129
128
|
| 4 | g/ml | g·ml⁻¹, gram per milliliter, grams per milliliter, gramme per millilitre, grammes per millilitre |
|
@@ -135,7 +134,7 @@ These units are defined in `UnitMeasurements::Quantity`.
|
|
135
134
|
|
136
135
|
| # | Name | Aliases |
|
137
136
|
|:--|:--|:--|
|
138
|
-
|
|
137
|
+
| 1 | pc | pcs, piece, pieces |
|
139
138
|
| 2 | pr | pair, pairs |
|
140
139
|
| 3 | gr | gross, grosses |
|
141
140
|
| 4 | dz | doz, dozen, dozens |
|
@@ -147,7 +146,7 @@ These units are defined in `UnitMeasurements::SoundLevel`.
|
|
147
146
|
|
148
147
|
| # | Name | Aliases |
|
149
148
|
|:--|:--|:--|
|
150
|
-
|
|
149
|
+
| 1 | B* | bel, bels |
|
151
150
|
| 2 | Np | neper, nepers |
|
152
151
|
|
153
152
|
## 13. Plane angle
|
@@ -156,7 +155,7 @@ These units are defined in `UnitMeasurements::PlaneAngle`.
|
|
156
155
|
|
157
156
|
| # | Name | Aliases |
|
158
157
|
|:--|:--|:--|
|
159
|
-
|
|
158
|
+
| 1 | rad* | radian, radians |
|
160
159
|
| 2 | deg | °, degree, degrees |
|
161
160
|
| 3 | gon | ᵍ, grad, gradian, gradians |
|
162
161
|
| 4 | cir | circle, circles |
|
@@ -172,7 +171,7 @@ These units are defined in `UnitMeasurements::SolidAngle`.
|
|
172
171
|
|
173
172
|
| # | Name | Aliases |
|
174
173
|
|:--|:--|:--|
|
175
|
-
|
|
174
|
+
| 1 | sr* | steradian, steradians |
|
176
175
|
| 2 | sp | spat, spats |
|
177
176
|
| 3 | deg² | (°)², sq °, square degree, square degrees |
|
178
177
|
| 4 | arcmin² | (′)², sq ′, square arcminute, square arcminutes |
|
@@ -184,10 +183,39 @@ These units are defined in `UnitMeasurements::Force`.
|
|
184
183
|
|
185
184
|
| # | Name | Aliases |
|
186
185
|
|:--|:--|:--|
|
187
|
-
|
|
186
|
+
| 1 | N* | newton, newtons |
|
188
187
|
| 2 | tf | tonne-force |
|
189
188
|
| 3 | dyn | dyne, dynes |
|
190
189
|
| 4 | kgf | kilogram-force, kilogramme-force |
|
191
190
|
| 5 | ozf | ounce-force |
|
192
191
|
| 6 | lbf | pound-force |
|
193
192
|
| 7 | pdl | poundal, poundals |
|
193
|
+
|
194
|
+
## 16. Voltage
|
195
|
+
|
196
|
+
These units are defined in `UnitMeasurements::Voltage`.
|
197
|
+
|
198
|
+
| # | Name | Aliases |
|
199
|
+
|:--|:--|:--|
|
200
|
+
| 1 | V\* | volt, volts |
|
201
|
+
| 2 | abV | abvolt, abvolts |
|
202
|
+
| 3 | statV | statvolt, statvolts |
|
203
|
+
| 4 | W/A | W·A⁻¹, watt per ampere, watts per ampere |
|
204
|
+
| 5 | J/C | J·C⁻¹, joule per coulomb, joules per coulomb |
|
205
|
+
|
206
|
+
## 17. Velocity
|
207
|
+
|
208
|
+
These units are defined in `UnitMeasurements::Velocity`.
|
209
|
+
|
210
|
+
| # | Name | Aliases |
|
211
|
+
|:--|:--|:--|
|
212
|
+
| 1 | m/s | m·s⁻¹, meter per second, meters per second, metre per second, metres per second |
|
213
|
+
| 2 | m/min | m·min⁻¹, meter per minute, meters per minute, metre per minute, metres per minute |
|
214
|
+
| 3 | m/h | m·h⁻¹, meter per hour, meters per hour, metre per hour, metres per hour |
|
215
|
+
| 4 | Kn | kt, knot, knots |
|
216
|
+
| 5 | in/s | in·s⁻¹, inch per second, inches per second |
|
217
|
+
| 6 | in/min | in·min⁻¹, inch per minute, inches per minute |
|
218
|
+
| 7 | in/h | in·h⁻¹, inch per hour, inches per hour |
|
219
|
+
| 8 | ft/s | ft·s⁻¹, foot per second, feet per second |
|
220
|
+
| 9 | ft/min | ft·min⁻¹, foot per minute, feet per minute |
|
221
|
+
| 10 | ft/h | ft·h⁻¹, foot per hour, feet per hour |
|
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
|
+
version: 3.1.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-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -99,7 +99,7 @@ files:
|
|
99
99
|
- CHANGELOG.md
|
100
100
|
- Gemfile
|
101
101
|
- Gemfile.lock
|
102
|
-
- LICENSE
|
102
|
+
- LICENSE.md
|
103
103
|
- README.md
|
104
104
|
- Rakefile
|
105
105
|
- lib/unit_measurements.rb
|
@@ -132,6 +132,8 @@ files:
|
|
132
132
|
- lib/unit_measurements/unit_groups/sound_level.rb
|
133
133
|
- lib/unit_measurements/unit_groups/temperature.rb
|
134
134
|
- lib/unit_measurements/unit_groups/time.rb
|
135
|
+
- lib/unit_measurements/unit_groups/velocity.rb
|
136
|
+
- lib/unit_measurements/unit_groups/voltage.rb
|
135
137
|
- lib/unit_measurements/unit_groups/volume.rb
|
136
138
|
- lib/unit_measurements/unit_groups/weight.rb
|
137
139
|
- lib/unit_measurements/version.rb
|