unite 1.2.0 → 1.3.0

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.
data/spec/unit_spec.rb ADDED
@@ -0,0 +1,44 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require 'spec_helper'
3
+
4
+ module Unite
5
+ describe Unit do
6
+
7
+ subject { Unit.new :expression => expression }
8
+
9
+ #include_examples "comparable unit"
10
+ #include_examples "dimension integer"
11
+ #include_examples "dimension vectors"
12
+ #include_examples "unit fractions"
13
+
14
+
15
+ describe ".init" do
16
+ subject { Unit.init expression }
17
+
18
+ context "with just value" do
19
+ let(:expression) { "200.0" }
20
+ let(:value) { 200.0 }
21
+
22
+ its(:unit) { should == '' }
23
+ its(:value) { should == 1 }
24
+ end
25
+
26
+ context "with only unit" do
27
+ let(:expression) { "#{unit}" }
28
+ let(:unit) { 'L' }
29
+
30
+ its(:unit) { should == unit }
31
+ its(:value) { should == 1 }
32
+ end
33
+
34
+ context "with unit and value" do
35
+ let(:expression) { "2.0*#{unit}" }
36
+ let(:unit) { 'L/m^3' }
37
+ its(:unit) { should == unit }
38
+ its(:value) { should == 1 }
39
+ end
40
+
41
+ end
42
+ end
43
+ end
44
+
metadata CHANGED
@@ -1,53 +1,76 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
5
- prerelease:
4
+ version: 1.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - stellard
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-07-13 00:00:00.000000000 Z
11
+ date: 2013-11-22 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activesupport
16
- requirement: &70217581503440 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 3.0.0
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *70217581503440
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.0
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: activemodel
27
- requirement: &70217581502860 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: 3.0.0
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *70217581502860
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 3.0.0
36
41
  description: Unite provides extensions to your objects to support values with units
37
42
  email:
38
43
  - scott.ellard@gmail.com
39
- executables: []
44
+ executables:
45
+ - autospec
46
+ - byebug
47
+ - guard
48
+ - htmldiff
49
+ - ldiff
50
+ - rake2thor
51
+ - rspec
52
+ - thor
40
53
  extensions: []
41
54
  extra_rdoc_files: []
42
55
  files:
56
+ - .bundle/config
43
57
  - .gitignore
44
58
  - .rspec
59
+ - .ruby-version
45
60
  - Gemfile
46
61
  - Gemfile.lock
47
62
  - Guardfile
48
63
  - MIT-LICENSE
49
64
  - README
50
65
  - Rakefile
66
+ - bin/autospec
67
+ - bin/byebug
68
+ - bin/guard
69
+ - bin/htmldiff
70
+ - bin/ldiff
71
+ - bin/rake2thor
72
+ - bin/rspec
73
+ - bin/thor
51
74
  - lib/unite.rb
52
75
  - lib/unite/arithmetic.rb
53
76
  - lib/unite/comparison.rb
@@ -62,6 +85,9 @@ files:
62
85
  - lib/unite/lookup/property.rb
63
86
  - lib/unite/lookup/simple_unit.rb
64
87
  - lib/unite/quantity.rb
88
+ - lib/unite/si_factor.rb
89
+ - lib/unite/simplify.rb
90
+ - lib/unite/unit.rb
65
91
  - lib/unite/version.rb
66
92
  - spec/arithmetic_spec.rb
67
93
  - spec/comparison_spec.rb
@@ -75,6 +101,7 @@ files:
75
101
  - spec/lookup/property_spec.rb
76
102
  - spec/lookup/simple_unit_spec.rb
77
103
  - spec/lookup_spec.rb
104
+ - spec/money_spec.rb
78
105
  - spec/quantity_spec.rb
79
106
  - spec/spec_helper.rb
80
107
  - spec/support/load_debugger.rb
@@ -84,30 +111,31 @@ files:
84
111
  - spec/support/shared_examples/units/dimension/integer.rb
85
112
  - spec/support/shared_examples/units/dimension/vector.rb
86
113
  - spec/support/shared_examples/units/fractions.rb
114
+ - spec/support/shared_examples/units/simplify.rb
115
+ - spec/unit_spec.rb
87
116
  - unite.gemspec
88
117
  homepage: https://github.com/stellard/unite
89
118
  licenses: []
119
+ metadata: {}
90
120
  post_install_message:
91
121
  rdoc_options: []
92
122
  require_paths:
93
123
  - lib
94
124
  required_ruby_version: !ruby/object:Gem::Requirement
95
- none: false
96
125
  requirements:
97
- - - ! '>='
126
+ - - '>='
98
127
  - !ruby/object:Gem::Version
99
128
  version: '0'
100
129
  required_rubygems_version: !ruby/object:Gem::Requirement
101
- none: false
102
130
  requirements:
103
- - - ! '>='
131
+ - - '>='
104
132
  - !ruby/object:Gem::Version
105
133
  version: '0'
106
134
  requirements: []
107
135
  rubyforge_project: unite
108
- rubygems_version: 1.8.6
136
+ rubygems_version: 2.0.3
109
137
  signing_key:
110
- specification_version: 3
138
+ specification_version: 4
111
139
  summary: Unite provides extensions to your objects to support values with units
112
140
  test_files:
113
141
  - spec/arithmetic_spec.rb
@@ -122,6 +150,7 @@ test_files:
122
150
  - spec/lookup/property_spec.rb
123
151
  - spec/lookup/simple_unit_spec.rb
124
152
  - spec/lookup_spec.rb
153
+ - spec/money_spec.rb
125
154
  - spec/quantity_spec.rb
126
155
  - spec/spec_helper.rb
127
156
  - spec/support/load_debugger.rb
@@ -131,3 +160,5 @@ test_files:
131
160
  - spec/support/shared_examples/units/dimension/integer.rb
132
161
  - spec/support/shared_examples/units/dimension/vector.rb
133
162
  - spec/support/shared_examples/units/fractions.rb
163
+ - spec/support/shared_examples/units/simplify.rb
164
+ - spec/unit_spec.rb