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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86b3b3a059205dfbff5012f1a149d91fee0a7b8f
4
- data.tar.gz: 6c35073b01b66dff3a23cfd95dcf3af7b88afde2
3
+ metadata.gz: 6ba7d0ae38d0154cb299425afbccd647328cf656
4
+ data.tar.gz: 6c8a39d238e7cd97ad45657b4589d545994225b7
5
5
  SHA512:
6
- metadata.gz: 1c2f66e138184bfa1c1d3494c30734f02964a03b63f056c19240e0acaba046080e9323840737c510184a8c7479931f93f7511af748c8172734b46d28438b1f3b
7
- data.tar.gz: d9857e86333565c89cb4245f6bf196b066dd46eaa9f8922b4b466a80823659a293e6449a2cc764b5e140c217c8ffe9b7ea4d168a232f43461d7906957cc33e75
6
+ metadata.gz: 07ee599f83021b50b69f12fd4c25c311282e15a3436a123b28658c847a054dfce24e04757be0fa951e3a80fa2afef45a25c9e0ebf027c33dd782b1ea2d723bd7
7
+ data.tar.gz: ca977de578fd5653e276de3e03800b567c10f9c59a2469e3e9e6a87b5a7c484bfd73ef35bc07ce118a50c7bc24a77f4d196acd7bbe37be039ed773562370595e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-si-units (0.0.5)
4
+ ruby-si-units (0.0.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
 
@@ -1,4 +1,4 @@
1
1
  module SIUnits
2
2
  # Project Version
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
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.5
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-06 00:00:00.000000000 Z
11
+ date: 2013-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler