unitwise 0.9.0 → 0.9.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: a0843dbdae33b496f257324dc0006e71ac292c7a
4
- data.tar.gz: 808f425fccb8a1f757194feecd9de18b91eb03a7
3
+ metadata.gz: 103adb7dd1ac2529083fd8d85acdf833a2f27306
4
+ data.tar.gz: 8891c69ba019723b58dbfed12cc366f0e77ef8b5
5
5
  SHA512:
6
- metadata.gz: d60cd4a403b09294175f3e0df799a73c14d0c389ebf3141a04dec4de02e0dd5bcbdea8bb99ebb2740ad4f8c86d27534d65b6462c49651670f23561fa7b8013df
7
- data.tar.gz: 1ebdb94e5df860af1807b8158f038351be2bc161c713fa186db914a306b5ccc3d08569b0ee293bfb450d9a2b6e128246b694659fd2f88acd685e8f7ffb9fa8d8
6
+ metadata.gz: 4a970bfbb1915e4ec48ee19661dcbd4c2bd2582e90f9e1d32473b6dbcb3ea7008741fb2315821b34217e43a3b6bf85b8f4ee80522ac88319bbfe67c32a1bddc9
7
+ data.tar.gz: 1674a77a54539dfc7eefa1d259ea3736caccbdc92b17527577e508712d316ec4d906dbd89300b90d4ac706203ce0f02d3faa4c4b062e41c576fef2d2a5b98a8c
@@ -74,5 +74,10 @@ module Unitwise
74
74
  "#{attr}='#{send attr}'"
75
75
  end.join(', ')
76
76
  end
77
+
78
+ def to_s(mode = :primary_code)
79
+ res = send(mode)
80
+ res.respond_to?(:each) ? res.first : res
81
+ end
77
82
  end
78
83
  end
@@ -1,3 +1,3 @@
1
1
  module Unitwise
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
  end
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'test_helper'
2
3
  require 'support/scale_tests'
3
4
 
@@ -206,7 +207,7 @@ describe Unitwise::Measurement do
206
207
  foot = described_class.new(7.00, "foot")
207
208
  foot.to_s.must_equal "7 foot"
208
209
  meter = described_class.new(Rational(22,7), "m")
209
- meter.to_s.must_equal "3.142857142857143 m"
210
+ meter.to_s.must_match(/3\.142\d+ m/)
210
211
  end
211
212
  it "should accept a mode and print that mode string" do
212
213
  temp = described_class.new(25, "degree Celsius")
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'test_helper'
2
3
 
3
4
  describe Unitwise::Unit 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.9.0
4
+ version: 0.9.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-10 00:00:00.000000000 Z
11
+ date: 2014-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liner
@@ -270,3 +270,4 @@ test_files:
270
270
  - test/unitwise/term_test.rb
271
271
  - test/unitwise/unit_test.rb
272
272
  - test/unitwise_test.rb
273
+ has_rdoc: