unit_measurements 4.4.0 → 4.5.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: c247fd1e99142d30ce86410eec3c46782b1614c46ea770fbbdf0838da0ca24ff
4
+ data.tar.gz: 2e473dcfb0227dd324f1e6b4fe8a6f9d89b0b72a93d7ca510578ef66cbcca84a
5
5
  SHA512:
6
- metadata.gz: 12121950bb3682117d3d81851de85022a3409043ad9206f58f7a8c5f7caeaebc677175917b874013644cb68df505f3197f5ac21154a2a6708733ace96c3cfc11
7
- data.tar.gz: df30c4e06c04adc8085c1fd902249d4bc1ba934017b8b1565617c543cbdf16c22c0904a21bc9f7c9644d1467753534e86025f50c7c6d66d5e20d059491947c41
6
+ metadata.gz: 5e067faa355f836a0ea06077773c08a2e8a6da3599dc772d322e65f25f1188cc1f6d3d9a17e1be065ea665773fe59e19408634ac2905fe772d16076b4777b8b5
7
+ data.tar.gz: 2f57493cfc1632ad57ccbe8dec4d5690ad436f8b1d1e22278d6855346fc820d8ca8ac81d1f0834597cbffbb358bf5f22c594306b74085d828fe058ae0e2d013a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [4.5.0](https://github.com/shivam091/unit_measurements/compare/v4.4.0...v4.5.0) - 2023-10-09
2
+
3
+ ### What's new
4
+
5
+ - Added unit group for `energy` units.
6
+ - Added unit group for `power` units.
7
+
8
+ ----------
9
+
1
10
  ## [4.4.0](https://github.com/shivam091/unit_measurements/compare/v4.3.0...v4.4.0) - 2023-10-08
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 (4.4.0)
4
+ unit_measurements (4.5.0)
5
5
  activesupport (~> 7.0)
6
6
 
7
7
  GEM
@@ -41,6 +41,8 @@ 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"
44
46
 
45
47
  ## Other units
46
48
 
@@ -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,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.5.0"
7
7
  end
data/units.md CHANGED
@@ -454,3 +454,30 @@ 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 |
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.5.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-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -137,6 +137,7 @@ files:
137
137
  - lib/unit_measurements/unit_groups/electrical_elastance.rb
138
138
  - lib/unit_measurements/unit_groups/electrical_inductance.rb
139
139
  - lib/unit_measurements/unit_groups/electrical_resistance.rb
140
+ - lib/unit_measurements/unit_groups/energy.rb
140
141
  - lib/unit_measurements/unit_groups/force.rb
141
142
  - lib/unit_measurements/unit_groups/frequency.rb
142
143
  - lib/unit_measurements/unit_groups/illuminance.rb
@@ -148,6 +149,7 @@ files:
148
149
  - lib/unit_measurements/unit_groups/magnetic_flux.rb
149
150
  - lib/unit_measurements/unit_groups/magnetic_induction.rb
150
151
  - lib/unit_measurements/unit_groups/plane_angle.rb
152
+ - lib/unit_measurements/unit_groups/power.rb
151
153
  - lib/unit_measurements/unit_groups/pressure.rb
152
154
  - lib/unit_measurements/unit_groups/quantity.rb
153
155
  - lib/unit_measurements/unit_groups/solid_angle.rb