unitwise 0.8.0 → 0.8.1

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: 8f22030e678a95cdbdb00f3c6218ffbae3c224c7
4
- data.tar.gz: 14bbf7d6ca9cc4d60a099f307a3c52b29c37d1f5
3
+ metadata.gz: efe1918460c38d338cba7dda0e8f267d344df801
4
+ data.tar.gz: 545fe050c3ed7f2f09ed5b58d013d4a2176ce280
5
5
  SHA512:
6
- metadata.gz: b5884072087cb9a0261b2e22a7906ef2d27546bf30cb7c8a84fa8d8cc006fea840122bde7020e5ef23ea923afdf6c9c201f51b9c298315a900a32b3c9fad07dc
7
- data.tar.gz: 2ef4a1a779b20492b8497bca65acbec5a0d24bba1bac0208c1784d0d366672b21ac16d07e28314ed605ac969607ad55492860210a88a4a5238021c484774f0ce
6
+ metadata.gz: ba9651ddcf3dad823abdfaf1a24e7860a3917b13c026f993523bc939da4abbe76e0da4669be68deb56eccc7743cac44fcbc6db4bc86a413594298cff746c08ed
7
+ data.tar.gz: 06b6747e60076e5b9629aefe2632cd6095122d14337cd583869171be32ca8157f4d416e56392857e10ebe84bc0a445c02f4efd4bd4cce22ca188ecb1288dcdb1
@@ -94,6 +94,10 @@ module Unitwise
94
94
  end
95
95
  memoize :simplified_value
96
96
 
97
+ def expression
98
+ unit.expression
99
+ end
100
+
97
101
  # Convert to a simple string representing the scale.
98
102
  # @api public
99
103
  def to_s
@@ -1,3 +1,3 @@
1
1
  module Unitwise
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
@@ -13,7 +13,7 @@ describe Unitwise::Measurement do
13
13
 
14
14
  describe "#convert_to" do
15
15
  it "must convert to a similar unit code" do
16
- mph.convert_to('km/h').value.must_almost_equal 96.56063
16
+ mph.convert_to('km/h').value.must_almost_equal(96.56063)
17
17
  end
18
18
  it "must raise an error if the units aren't similar" do
19
19
  lambda { mph.convert_to('N') }.must_raise Unitwise::ConversionError
@@ -33,6 +33,9 @@ describe Unitwise::Measurement do
33
33
  it "must convert derived units to special units" do
34
34
  r.convert_to("Cel").value.must_almost_equal(0)
35
35
  end
36
+ it "must convert to a unit of another measurement" do
37
+ mph.convert_to(kmh).value.must_almost_equal(96.56064)
38
+ end
36
39
  end
37
40
 
38
41
  describe "#*" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unitwise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lewis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-02 00:00:00.000000000 Z
11
+ date: 2014-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liner