ruby-si-units 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/si_units/unit.rb +4 -1
- data/lib/si_units/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6ba7d0ae38d0154cb299425afbccd647328cf656
|
|
4
|
+
data.tar.gz: 6c8a39d238e7cd97ad45657b4589d545994225b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 07ee599f83021b50b69f12fd4c25c311282e15a3436a123b28658c847a054dfce24e04757be0fa951e3a80fa2afef45a25c9e0ebf027c33dd782b1ea2d723bd7
|
|
7
|
+
data.tar.gz: ca977de578fd5653e276de3e03800b567c10f9c59a2469e3e9e6a87b5a7c484bfd73ef35bc07ce118a50c7bc24a77f4d196acd7bbe37be039ed773562370595e
|
data/Gemfile.lock
CHANGED
data/lib/si_units/unit.rb
CHANGED
|
@@ -76,9 +76,12 @@ module SIUnits
|
|
|
76
76
|
|
|
77
77
|
private
|
|
78
78
|
|
|
79
|
-
#Logic to convert the absolute value to a best form of representation
|
|
79
|
+
# Logic to convert the absolute value to a best form of representation
|
|
80
|
+
# Only aliase if scalar is zero!
|
|
81
|
+
# => Don't raise a ZeroDivisionError, the zero is defined
|
|
80
82
|
def best_value_with_scale
|
|
81
83
|
aliase, scalar = UNITS_DEFINITION[@unit_kind]
|
|
84
|
+
return aliase.first if scalar == 0
|
|
82
85
|
[(@unit_value / scalar), aliase.first].join
|
|
83
86
|
end
|
|
84
87
|
|
data/lib/si_units/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-si-units
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kenner Kliemann
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-09-
|
|
11
|
+
date: 2013-09-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|