unitwise 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.2.0
@@ -7,7 +7,8 @@ rvm:
7
7
  - 1.9.2
8
8
  - 1.9.3
9
9
  - 2.0.0
10
- - 2.1.0
10
+ - 2.1
11
+ - 2.2
11
12
  - ruby-head
12
13
  - rbx-2
13
14
  matrix:
@@ -5,6 +5,11 @@ version 1.0.0.
5
5
 
6
6
  Unitwise uses semantic versioning.
7
7
 
8
+ ## 1.0.4 - 2015-01-10
9
+
10
+ - Added Ruby 2.2 support.
11
+ - Empty strings are no longer valid units.
12
+
8
13
  ## 1.0.3 - 2014-10-05
9
14
 
10
15
  ### Added
data/Gemfile CHANGED
@@ -1,10 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  if RUBY_VERSION > '1.8.7'
4
- # https://bugs.ruby-lang.org/issues/9316
5
- gem 'bigdecimal', '~> 1.2.4', :platform => :mri
6
- # Coveralls doesn't run on 1.8.7, but we only need it for testing.
7
4
  gem 'coveralls', '~> 0.7'
5
+ if RUBY_VERSION >= '2.2.0'
6
+ gem 'bigdecimal', '~> 1.2.6', :platform => :mri
7
+ else
8
+ gem 'bigdecimal', '~> 1.2.5', :platform => :mri
9
+ end
8
10
  end
9
11
 
10
12
  gemspec
@@ -106,7 +106,7 @@ module Unitwise
106
106
  base? ? BigDecimal(magnitude.to_s) : scale.scalar(magnitude)
107
107
  end
108
108
 
109
- def magnitude(scalar = scalar)
109
+ def magnitude(scalar = scalar())
110
110
  special? ? scale.magnitude(scalar) : BigDecimal('1')
111
111
  end
112
112
 
@@ -38,7 +38,7 @@ module Unitwise
38
38
 
39
39
  def initialize(expression)
40
40
  @expression = expression.to_s
41
- if terms.nil? || terms.empty?
41
+ if expression.empty? || terms.nil? || terms.empty?
42
42
  fail(ExpressionError, "Could not evaluate '#{ expression }'.")
43
43
  end
44
44
  end
@@ -110,7 +110,7 @@ module Unitwise
110
110
  # @param scalar [Numeric] A linear scalar value
111
111
  # @return [Numeric] The equivalent magnitude on this scale
112
112
  # @api public
113
- def magnitude(scalar = scalar)
113
+ def magnitude(scalar = scalar())
114
114
  self.class.send(:"to_#{function_name}", scalar)
115
115
  end
116
116
  end
@@ -65,7 +65,7 @@ module Unitwise
65
65
  # @param scalar [Numeric] A linear scalar value
66
66
  # @return [Numeric] The equivalent magnitude on this scale
67
67
  # @api public
68
- def magnitude(scalar = scalar)
68
+ def magnitude(scalar = scalar())
69
69
  if special?
70
70
  unit.magnitude(scalar)
71
71
  else
@@ -67,7 +67,7 @@ module Unitwise
67
67
  # @param scalar [Numeric] The scalar for which you want the magnitude
68
68
  # @return [Numeric] The magnitude on this scale.
69
69
  # @api public
70
- def magnitude(scalar = scalar)
70
+ def magnitude(scalar = scalar())
71
71
  calculate(atom ? atom.magnitude(scalar) : 1.0)
72
72
  end
73
73
 
@@ -97,7 +97,7 @@ module Unitwise
97
97
  # @param scalar [Numeric] A linear scalar value
98
98
  # @return [Numeric] The equivalent magnitude on this scale
99
99
  # @api public
100
- def magnitude(scalar = scalar)
100
+ def magnitude(scalar = scalar())
101
101
  terms.reduce(1.0) do |prod, term|
102
102
  prod * term.magnitude(scalar)
103
103
  end
@@ -1,3 +1,3 @@
1
1
  module Unitwise
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
3
3
  end
metadata CHANGED
@@ -1,139 +1,158 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unitwise
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Josh Lewis
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-10-05 00:00:00.000000000 Z
12
+ date: 2015-01-10 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: liner
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - "~>"
19
+ - - ~>
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0.2'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - "~>"
27
+ - - ~>
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0.2'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: signed_multiset
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - "~>"
35
+ - - ~>
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0.2'
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - "~>"
43
+ - - ~>
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0.2'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: memoizable
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - "~>"
51
+ - - ~>
46
52
  - !ruby/object:Gem::Version
47
53
  version: '0.4'
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - "~>"
59
+ - - ~>
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0.4'
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: parslet
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - "~>"
67
+ - - ~>
60
68
  - !ruby/object:Gem::Version
61
69
  version: 1.5.0
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - "~>"
75
+ - - ~>
67
76
  - !ruby/object:Gem::Version
68
77
  version: 1.5.0
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: nokogiri
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - "~>"
83
+ - - ~>
74
84
  - !ruby/object:Gem::Version
75
85
  version: 1.5.10
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - "~>"
91
+ - - ~>
81
92
  - !ruby/object:Gem::Version
82
93
  version: 1.5.10
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: pry
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
- - - "~>"
99
+ - - ~>
88
100
  - !ruby/object:Gem::Version
89
101
  version: '0.9'
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
- - - "~>"
107
+ - - ~>
95
108
  - !ruby/object:Gem::Version
96
109
  version: '0.9'
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: minitest
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
- - - "~>"
115
+ - - ~>
102
116
  - !ruby/object:Gem::Version
103
117
  version: '5.0'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
- - - "~>"
123
+ - - ~>
109
124
  - !ruby/object:Gem::Version
110
125
  version: '5.0'
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: rake
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
- - - "~>"
131
+ - - ~>
116
132
  - !ruby/object:Gem::Version
117
133
  version: '10.0'
118
134
  type: :development
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
- - - "~>"
139
+ - - ~>
123
140
  - !ruby/object:Gem::Version
124
141
  version: '10.0'
125
142
  - !ruby/object:Gem::Dependency
126
143
  name: nori
127
144
  requirement: !ruby/object:Gem::Requirement
145
+ none: false
128
146
  requirements:
129
- - - "~>"
147
+ - - ~>
130
148
  - !ruby/object:Gem::Version
131
149
  version: '2.3'
132
150
  type: :development
133
151
  prerelease: false
134
152
  version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
135
154
  requirements:
136
- - - "~>"
155
+ - - ~>
137
156
  - !ruby/object:Gem::Version
138
157
  version: '2.3'
139
158
  description: Physical quantity and units of measure conversion and math library
@@ -143,9 +162,9 @@ executables: []
143
162
  extensions: []
144
163
  extra_rdoc_files: []
145
164
  files:
146
- - ".gitignore"
147
- - ".ruby-version"
148
- - ".travis.yml"
165
+ - .gitignore
166
+ - .ruby-version
167
+ - .travis.yml
149
168
  - CHANGELOG.md
150
169
  - Gemfile
151
170
  - LICENSE.txt
@@ -203,26 +222,27 @@ files:
203
222
  homepage: http://github.com/joshwlewis/unitwise
204
223
  licenses:
205
224
  - MIT
206
- metadata: {}
207
225
  post_install_message:
208
226
  rdoc_options: []
209
227
  require_paths:
210
228
  - lib
211
229
  required_ruby_version: !ruby/object:Gem::Requirement
230
+ none: false
212
231
  requirements:
213
- - - ">="
232
+ - - ! '>='
214
233
  - !ruby/object:Gem::Version
215
234
  version: '0'
216
235
  required_rubygems_version: !ruby/object:Gem::Requirement
236
+ none: false
217
237
  requirements:
218
- - - ">="
238
+ - - ! '>='
219
239
  - !ruby/object:Gem::Version
220
240
  version: '0'
221
241
  requirements: []
222
242
  rubyforge_project:
223
- rubygems_version: 2.2.0
243
+ rubygems_version: 1.8.23
224
244
  signing_key:
225
- specification_version: 4
245
+ specification_version: 3
226
246
  summary: Convert between and perform mathematical operations on physical quantities
227
247
  and units of measure defined by the Unified Code for Units of Measure.
228
248
  test_files:
@@ -242,3 +262,4 @@ test_files:
242
262
  - test/unitwise/term_test.rb
243
263
  - test/unitwise/unit_test.rb
244
264
  - test/unitwise_test.rb
265
+ has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 4d56341dd889cc55e9289497dd98cb6919b4c407
4
- data.tar.gz: 3edb93758dcb292a7a6894228470859252e8fe30
5
- SHA512:
6
- metadata.gz: 3feb6a4ca9b67743dd9c3e3a66d9f142c93096fe95127eba58d7d579beee693f85e93a7d841e89662cdb3704f14785bc02ea928fa48481257723372eac50bf8d
7
- data.tar.gz: 868522db37708233ea85b08ebb1aa9ec7407c0187f638a99f3878b69262230f43d6b4ac110423792963ad631a7cf6c97d2346b84d467f812b4b2a0e73850f6fe