unit_measurements 4.4.0 → 4.6.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: 97b1f40dcd946ddde0dcfc746431ac768147585a1aa5a100a356b8c59f9da235
4
- data.tar.gz: 8f1453cb23ff2ae5140d8cfb0b72d4b8dba70025c5ac797c3bdc4a88d5c1020b
3
+ metadata.gz: f778d0da784791b298251ee764e132b83b10586b964a02ec8bda832abf95cd79
4
+ data.tar.gz: a456881b5b96eefd259f8db1488f12fb89d2f5c2c14828d60d8c38f363e616d0
5
5
  SHA512:
6
- metadata.gz: 12121950bb3682117d3d81851de85022a3409043ad9206f58f7a8c5f7caeaebc677175917b874013644cb68df505f3197f5ac21154a2a6708733ace96c3cfc11
7
- data.tar.gz: df30c4e06c04adc8085c1fd902249d4bc1ba934017b8b1565617c543cbdf16c22c0904a21bc9f7c9644d1467753534e86025f50c7c6d66d5e20d059491947c41
6
+ metadata.gz: 1634e803d9b7dbd70839b76d66e7b9c386db22f594a944c877fc1180777a91f9953e46d154d89545895d16f377e68ea64ac348303b63740786aef21c97b228de
7
+ data.tar.gz: 92e9edecf0f55c62eead495418d97c75825d3f6df49aa1e052cf3155ddbea3d005401dc8091cafc787478fcb477170847cea3150e5dd3184d121a28c672eef84
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## [4.6.0](https://github.com/shivam091/unit_measurements/compare/v4.5.0...v4.6.0) - 2023-10-10
2
+
3
+ ### What's new
4
+
5
+ - Added unit group for `dynamic viscosity` units.
6
+ - Added unit group for `kinetic viscosity` units.
7
+
8
+ ----------
9
+
10
+ ## [4.5.0](https://github.com/shivam091/unit_measurements/compare/v4.4.0...v4.5.0) - 2023-10-09
11
+
12
+ ### What's new
13
+
14
+ - Added unit group for `energy` units.
15
+ - Added unit group for `power` units.
16
+
17
+ ----------
18
+
1
19
  ## [4.4.0](https://github.com/shivam091/unit_measurements/compare/v4.3.0...v4.4.0) - 2023-10-08
2
20
 
3
21
  ### What's new
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unit_measurements (4.4.0)
4
+ unit_measurements (4.6.0)
5
5
  activesupport (~> 7.0)
6
6
 
7
7
  GEM
@@ -41,6 +41,10 @@ require_relative "luminous_flux"
41
41
  require_relative "illuminance"
42
42
  require_relative "luminance"
43
43
  require_relative "frequency"
44
+ require_relative "power"
45
+ require_relative "energy"
46
+ require_relative "dynamic_viscosity"
47
+ require_relative "kinetic_viscosity"
44
48
 
45
49
  ## Other units
46
50
 
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::DynamicViscosity = UnitMeasurements.build do
6
+ primitive "Pa⋅s"
7
+
8
+ system :metric do
9
+ si_unit "Pa⋅s", aliases: ["Pa*s", "pascal second"]
10
+ end
11
+
12
+ system :centimetre_gram_second do
13
+ unit "P", value: "1 dPa⋅s", aliases: ["dyne·s/cm²", "dyne*s/cm^2", "poise"]
14
+ unit "Pl", value: "10 P", aliases: ["poiseuille"]
15
+ end
16
+
17
+ system :foot_pound_second do
18
+ unit "lb/(ft⋅s)", value: "1.488164 Pa⋅s", aliases: ["lb/(ft*s)", "pound per foot second"]
19
+ unit "lb/(ft⋅h)", value: "0.0004133789 Pa⋅s", aliases: ["lb/(ft*h)", "pound per foot hour"]
20
+
21
+ unit "(lbf⋅s)/ft²", value: "47.88026 Pa⋅s", aliases: ["(lb⋅s)/ft²", "(lbf*s)/ft^2", "(lb*s)/ft^2", "pound-force second per square foot"]
22
+ unit "(lbf⋅s)/in²", value: "6894.757 Pa⋅s", aliases: ["(lb⋅s)/in²", "(lbf*s)/in^2", "(lb*s)/in^2", "pound-force second per square inch"]
23
+ end
24
+ end
@@ -0,0 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::Energy = UnitMeasurements.build do
6
+ primitive "J"
7
+
8
+ system :metric do
9
+ si_unit "J", aliases: ["joule", "joules"]
10
+ si_unit "cal", value: "4.1868 J", aliases: ["calorie", "calories"]
11
+
12
+ unit "eV", value: "1.602176634e-19 J", aliases: ["electronvolt", "electron volt", "electron-volt"]
13
+ end
14
+
15
+ system :centimetre_gram_second do
16
+ unit "erg", value: "1e-7 J", aliases: ["ergs"]
17
+ end
18
+
19
+ system :us_customary do
20
+ si_unit "Btu", value: "1055.05585262 J", aliases: ["btu", "btus", "british thermal unit", "british thermal units"]
21
+
22
+ unit "thm", value: "100 kBtu", aliases: ["therm", "therms"]
23
+ unit "quad", value: "1.05505585262e+18 J", aliases: ["quads"]
24
+ end
25
+
26
+ unit "foe", value: "1e+51 erg", aliases: ["bethe"]
27
+ end
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::KineticViscosity = UnitMeasurements.build do
6
+ primitive "m²/s"
7
+
8
+ system :metric do
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
+ end
11
+
12
+ system :foot_pound_second do
13
+ unit "ft²/s", value: "0.09290304 m²/s", aliases: ["ft^2/s", "square foot per second", "square feet per second"]
14
+ unit "in²/s", value: "0.006944444444444443 ft²/s", aliases: ["in^2/s", "square inch per second", "square inches per second"]
15
+ end
16
+
17
+ system :centimetre_gram_second do
18
+ unit "St", value: "1e-4 m²/s", aliases: ["strokes"]
19
+ end
20
+ end
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ UnitMeasurements::Power = UnitMeasurements.build do
6
+ primitive "W"
7
+
8
+ system :metric do
9
+ si_unit "W", aliases: ["watt", "watts"]
10
+
11
+ unit "hp (M)", value: "735.49875 W", aliases: ["PS", "metric horsepower"]
12
+ end
13
+
14
+ system :imperial do
15
+ unit "hp", value: "745.69987158227022 W", aliases: ["hp (I)", "horsepower"]
16
+ end
17
+
18
+ system :centimetre_gram_second do
19
+ unit "erg/s", value: "1e-7 W", aliases: ["erg·s⁻¹", "erg per second", "ergs per second"]
20
+ end
21
+
22
+ unit "cal/s", value: "4.1868 W", aliases: ["cal·s⁻¹", "calorie per second", "calories per second"]
23
+ end
@@ -3,5 +3,5 @@
3
3
  # -*- warn_indent: true -*-
4
4
 
5
5
  module UnitMeasurements
6
- VERSION = "4.4.0"
6
+ VERSION = "4.6.0"
7
7
  end
data/units.md CHANGED
@@ -454,3 +454,55 @@ These units are defined in `UnitMeasurements::Frequency`.
454
454
  | 2 | rad/s | rad·s⁻¹, radian per second, radians per second |
455
455
  | 3 | deg/s | °/s, deg·s⁻¹, degree per second, degrees per second |
456
456
  | 4 | rev/s | rps, rev·s⁻¹, revolution per second, revolutions per second |
457
+
458
+ ## 39. Power
459
+
460
+ These units are defined in `UnitMeasurements::Power`.
461
+
462
+ | # | Name | Aliases |
463
+ |:--|:--|:--|
464
+ | _1_ | _W*_ | _watt, watts_ |
465
+ | 2 | hp (M) | PS, metric horsepower |
466
+ | 3 | hp | hp (I), horsepower |
467
+ | 4 | erg/s | erg·s⁻¹, erg per second, ergs per second |
468
+ | 5 | cal/s | cal·s⁻¹, calorie per second, calories per second |
469
+
470
+ ## 40. Energy
471
+
472
+ These units are defined in `UnitMeasurements::Energy`.
473
+
474
+ | # | Name | Aliases |
475
+ |:--|:--|:--|
476
+ | _1_ | _J*_ | _joule, joules_ |
477
+ | 2 | cal | calorie, calories |
478
+ | 3 | eV | electronvolt, electron volt, electron-volt |
479
+ | 4 | erg | ergs |
480
+ | 5 | Btu | btu, btus, british thermal unit, british thermal units |
481
+ | 6 | thm | therm, therms |
482
+ | 7 | quad | quads |
483
+ | 8 | foe | bethe |
484
+
485
+ ## 41. Dynamic viscosity
486
+
487
+ These units are defined in `UnitMeasurements::DynamicViscosity`.
488
+
489
+ | # | Name | Aliases |
490
+ |:--|:--|:--|
491
+ | _1_ | _Pa⋅s*_ | _Pa*s, pascal second_ |
492
+ | 2 | P | dyne·s/cm², dyne*s/cm^2, poise |
493
+ | 3 | lb/(ft⋅s) | lb/(ft*s), pound per foot second |
494
+ | 4 | lb/(ft⋅h) | lb/(ft*h), pound per foot hour |
495
+ | 5 | (lbf⋅s)/ft² | (lb⋅s)/ft², (lbf\*s)/ft^2, (lb\*s)/ft^2, pound-force second per square foot |
496
+ | 6 | (lbf⋅s)/in² | (lb⋅s)/in², (lbf\*s)/in^2, (lb\*s)/in^2, pound-force second per square inch |
497
+ | 7 | Pl | poiseuille |
498
+
499
+ ## 42. Kinetic viscosity
500
+
501
+ These units are defined in `UnitMeasurements::KineticViscosity`.
502
+
503
+ | # | Name | Aliases |
504
+ |:--|:--|:--|
505
+ | _1_ | _m²/s_ | _m^2/s, square metre per second, square meter per second, square metres per second, square meters per second_ |
506
+ | 2 | St | strokes |
507
+ | 3 | ft²/s | ft^2/s, square foot per second, square feet per second |
508
+ | 4 | in²/s | in^2/s, square inch per second, square inches per second |
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.4.0
4
+ version: 4.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-10-08 00:00:00.000000000 Z
11
+ date: 2023-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -127,6 +127,7 @@ files:
127
127
  - lib/unit_measurements/unit_groups/area.rb
128
128
  - lib/unit_measurements/unit_groups/catalytic_activity.rb
129
129
  - lib/unit_measurements/unit_groups/density.rb
130
+ - lib/unit_measurements/unit_groups/dynamic_viscosity.rb
130
131
  - lib/unit_measurements/unit_groups/electric_charge.rb
131
132
  - lib/unit_measurements/unit_groups/electric_conductance.rb
132
133
  - lib/unit_measurements/unit_groups/electric_current.rb
@@ -137,9 +138,11 @@ files:
137
138
  - lib/unit_measurements/unit_groups/electrical_elastance.rb
138
139
  - lib/unit_measurements/unit_groups/electrical_inductance.rb
139
140
  - lib/unit_measurements/unit_groups/electrical_resistance.rb
141
+ - lib/unit_measurements/unit_groups/energy.rb
140
142
  - lib/unit_measurements/unit_groups/force.rb
141
143
  - lib/unit_measurements/unit_groups/frequency.rb
142
144
  - lib/unit_measurements/unit_groups/illuminance.rb
145
+ - lib/unit_measurements/unit_groups/kinetic_viscosity.rb
143
146
  - lib/unit_measurements/unit_groups/length.rb
144
147
  - lib/unit_measurements/unit_groups/luminance.rb
145
148
  - lib/unit_measurements/unit_groups/luminous_flux.rb
@@ -148,6 +151,7 @@ files:
148
151
  - lib/unit_measurements/unit_groups/magnetic_flux.rb
149
152
  - lib/unit_measurements/unit_groups/magnetic_induction.rb
150
153
  - lib/unit_measurements/unit_groups/plane_angle.rb
154
+ - lib/unit_measurements/unit_groups/power.rb
151
155
  - lib/unit_measurements/unit_groups/pressure.rb
152
156
  - lib/unit_measurements/unit_groups/quantity.rb
153
157
  - lib/unit_measurements/unit_groups/solid_angle.rb