weighable 0.10.0 → 0.10.1

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
  SHA1:
3
- metadata.gz: 8fcb2ad44acb8fa91d311207dafaab42e6b3bc22
4
- data.tar.gz: 794c7738019d489ccca5c957c00f5a390d555600
3
+ metadata.gz: 738914f0c2ec7192f9a3533f0472690aee4a03fc
4
+ data.tar.gz: 8e1cf00aac99a482353637073b5abf004ee82848
5
5
  SHA512:
6
- metadata.gz: 16c995bb7cc1512e2ea0b631bae0740430897b392f8fd17fcfd02772dd964ad0dafb992fea476a4834d5cc5fc0d24941d281211219d0229af6a30b782add1192
7
- data.tar.gz: c46c5885215fef364313d62c2f444ed7f0a573d4e56858c694d00d00aac97580eb3ffc8b506662ed332f47b5f762a5adf0e674ebe062c8068fc80a71e52cbaa8
6
+ metadata.gz: 8bbc61d0f965aee9e91533c80f07ada70e7c6188f407dfbb5bb4c9fc10168fedf8bfd0d1feeafca1e35112e03f0ceea7bc6adf27ff3b5de9da7edbab6aa9bf88
7
+ data.tar.gz: ed3838c041512cdf5b220391908ca7ea6a776a5f307265accf517f0af8968b262527e018035a722968bd2dff986cf1d24d8365c621190d916fdfa0fc0d136773
@@ -1,3 +1,3 @@
1
1
  module Weighable
2
- VERSION = '0.10.0'.freeze
2
+ VERSION = '0.10.1'.freeze
3
3
  end
@@ -156,11 +156,11 @@ module Weighable
156
156
  end
157
157
 
158
158
  def /(other)
159
- if other.is_a?(Weight) && !other.is_unit?
159
+ if !other.is_a?(Weight) || (other.is_unit? && other.unit != @unit)
160
+ Weight.new(@value / to_math_value(other), unit_name)
161
+ else
160
162
  other = other.to(unit_name)
161
163
  BigDecimal.new(@value / other.value)
162
- else
163
- Weight.new(@value / to_math_value(other), unit_name)
164
164
  end
165
165
  end
166
166
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weighable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trae Robrock
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-31 00:00:00.000000000 Z
11
+ date: 2018-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport