amee-data-abstraction 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm 1.8.7@amee-data-abstraction
1
+ rvm 1.8.7@amee-data-abstraction-rails2
data/Gemfile CHANGED
@@ -1,8 +1,8 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "amee", "~> 3.0"
3
+ gem "amee", "~> 3.1"
4
4
  gem 'uuidtools', '2.1.2'
5
- gem 'quantify', '1.2.0'
5
+ gem 'quantify', '1.2.2'
6
6
 
7
7
  # Add dependencies to develop your gem here.
8
8
  # Include everything needed to run rake, tests, features, etc.
data/Gemfile.lock CHANGED
@@ -2,7 +2,7 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  activesupport (2.3.12)
5
- amee (3.0.1)
5
+ amee (3.1.2)
6
6
  activesupport (~> 2.3.5)
7
7
  json
8
8
  log4r
@@ -14,10 +14,10 @@ GEM
14
14
  bundler (~> 1.0)
15
15
  git (>= 1.2.5)
16
16
  rake
17
- json (1.5.3)
17
+ json (1.6.1)
18
18
  log4r (1.1.9)
19
19
  nokogiri (1.4.3.1)
20
- quantify (1.2.0)
20
+ quantify (1.2.2)
21
21
  activesupport
22
22
  i18n
23
23
  rake (0.9.2)
@@ -32,11 +32,11 @@ PLATFORMS
32
32
  ruby
33
33
 
34
34
  DEPENDENCIES
35
- amee (~> 3.0)
35
+ amee (~> 3.1)
36
36
  bundler (~> 1.0.0)
37
37
  flexmock (> 0.8.6)
38
38
  jeweler (~> 1.6.4)
39
- quantify (= 1.2.0)
39
+ quantify (= 1.2.2)
40
40
  rcov
41
41
  rspec (= 1.3.0)
42
42
  rspec_spinner (= 1.1.3)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{amee-data-abstraction}
8
- s.version = "1.1.0"
8
+ s.version = "1.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James Hetherington", "Andrew Berkeley", "James Smith", "George Palmer"]
12
- s.date = %q{2011-08-30}
12
+ s.date = %q{2011-10-10}
13
13
  s.description = %q{Part of the AMEEappkit this gem provides a data abstraction layer, decreasing the amount and detail of development required}
14
14
  s.email = %q{help@amee.com}
15
15
  s.extra_rdoc_files = [
@@ -73,16 +73,16 @@ Gem::Specification.new do |s|
73
73
  s.homepage = %q{http://github.com/AMEE/amee-data-abstraction}
74
74
  s.licenses = ["BSD 3-Clause"]
75
75
  s.require_paths = ["lib"]
76
- s.rubygems_version = %q{1.6.2}
76
+ s.rubygems_version = %q{1.5.3}
77
77
  s.summary = %q{Calculation and form building tool hiding details of AMEEconnect}
78
78
 
79
79
  if s.respond_to? :specification_version then
80
80
  s.specification_version = 3
81
81
 
82
82
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
83
- s.add_runtime_dependency(%q<amee>, ["~> 3.0"])
83
+ s.add_runtime_dependency(%q<amee>, ["~> 3.1"])
84
84
  s.add_runtime_dependency(%q<uuidtools>, ["= 2.1.2"])
85
- s.add_runtime_dependency(%q<quantify>, ["= 1.2.0"])
85
+ s.add_runtime_dependency(%q<quantify>, ["= 1.2.2"])
86
86
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
87
87
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
88
88
  s.add_development_dependency(%q<rspec>, ["= 1.3.0"])
@@ -90,9 +90,9 @@ Gem::Specification.new do |s|
90
90
  s.add_development_dependency(%q<rspec_spinner>, ["= 1.1.3"])
91
91
  s.add_development_dependency(%q<flexmock>, ["> 0.8.6"])
92
92
  else
93
- s.add_dependency(%q<amee>, ["~> 3.0"])
93
+ s.add_dependency(%q<amee>, ["~> 3.1"])
94
94
  s.add_dependency(%q<uuidtools>, ["= 2.1.2"])
95
- s.add_dependency(%q<quantify>, ["= 1.2.0"])
95
+ s.add_dependency(%q<quantify>, ["= 1.2.2"])
96
96
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
97
97
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
98
98
  s.add_dependency(%q<rspec>, ["= 1.3.0"])
@@ -101,9 +101,9 @@ Gem::Specification.new do |s|
101
101
  s.add_dependency(%q<flexmock>, ["> 0.8.6"])
102
102
  end
103
103
  else
104
- s.add_dependency(%q<amee>, ["~> 3.0"])
104
+ s.add_dependency(%q<amee>, ["~> 3.1"])
105
105
  s.add_dependency(%q<uuidtools>, ["= 2.1.2"])
106
- s.add_dependency(%q<quantify>, ["= 1.2.0"])
106
+ s.add_dependency(%q<quantify>, ["= 1.2.2"])
107
107
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
108
108
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
109
109
  s.add_dependency(%q<rspec>, ["= 1.3.0"])
@@ -35,6 +35,23 @@ module AMEE
35
35
  choice_validation_message
36
36
  end
37
37
 
38
+ # Returns the list of available choices for <tt>self</tt>. A custom list of
39
+ # choices can be provided as an argument, in which case these will override
40
+ # the list provided by the AMEE platform
41
+ #
42
+ def choices(*args)
43
+ if args.empty?
44
+ if @choices.blank?
45
+ c=parent.amee_drill(:before=>label).choices
46
+ c.length==1 ? [value] : c
47
+ else
48
+ @choices
49
+ end
50
+ else
51
+ @choices = [args].flatten
52
+ end
53
+ end
54
+
38
55
  private
39
56
 
40
57
  # Returns <tt>true</tt> if the value set for <tt>self</tt> is one of the
@@ -44,12 +61,6 @@ module AMEE
44
61
  super && (choices.include? value)
45
62
  end
46
63
 
47
- # Returns the list of available choices for <tt>self</tt>.
48
- def choices
49
- c=parent.amee_drill(:before=>label).choices
50
- c.length==1 ? [value] : c #Intention is to get autodrilled, drill will result in a UID
51
- end
52
-
53
64
  # Returns <tt>true</tt> if <tt>self</tt> is the "first unset" drill, i.e.
54
65
  # the one which should be set next
55
66
  #
@@ -19,6 +19,11 @@ describe PrototypeCalculation do
19
19
  pc=PrototypeCalculation.new {drill{label :alpha}}
20
20
  pc[:alpha].should be_a Drill
21
21
  end
22
+ it 'can set custom drill choices in the DSL block' do
23
+ pc=PrototypeCalculation.new {drill{label :alpha; choices "ball","cat","dog"}}
24
+ pc[:alpha].should be_a Drill
25
+ pc[:alpha].choices.should eql ["ball","cat","dog"]
26
+ end
22
27
  it 'can''t make a DSL block term without a label' do
23
28
  lambda{
24
29
  pc=PrototypeCalculation.new {drill}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amee-data-abstraction
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 1.1.0
10
+ version: 1.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Hetherington
@@ -18,28 +18,27 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-08-30 00:00:00 +01:00
21
+ date: 2011-10-10 00:00:00 +01:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
25
- prerelease: false
26
- type: :runtime
27
- requirement: &id001 !ruby/object:Gem::Requirement
25
+ name: amee
26
+ version_requirements: &id001 !ruby/object:Gem::Requirement
28
27
  none: false
29
28
  requirements:
30
29
  - - ~>
31
30
  - !ruby/object:Gem::Version
32
- hash: 7
31
+ hash: 5
33
32
  segments:
34
33
  - 3
35
- - 0
36
- version: "3.0"
37
- name: amee
38
- version_requirements: *id001
39
- - !ruby/object:Gem::Dependency
34
+ - 1
35
+ version: "3.1"
40
36
  prerelease: false
41
37
  type: :runtime
42
- requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirement: *id001
39
+ - !ruby/object:Gem::Dependency
40
+ name: uuidtools
41
+ version_requirements: &id002 !ruby/object:Gem::Requirement
43
42
  none: false
44
43
  requirements:
45
44
  - - "="
@@ -50,28 +49,28 @@ dependencies:
50
49
  - 1
51
50
  - 2
52
51
  version: 2.1.2
53
- name: uuidtools
54
- version_requirements: *id002
55
- - !ruby/object:Gem::Dependency
56
52
  prerelease: false
57
53
  type: :runtime
58
- requirement: &id003 !ruby/object:Gem::Requirement
54
+ requirement: *id002
55
+ - !ruby/object:Gem::Dependency
56
+ name: quantify
57
+ version_requirements: &id003 !ruby/object:Gem::Requirement
59
58
  none: false
60
59
  requirements:
61
60
  - - "="
62
61
  - !ruby/object:Gem::Version
63
- hash: 31
62
+ hash: 27
64
63
  segments:
65
64
  - 1
66
65
  - 2
67
- - 0
68
- version: 1.2.0
69
- name: quantify
70
- version_requirements: *id003
71
- - !ruby/object:Gem::Dependency
66
+ - 2
67
+ version: 1.2.2
72
68
  prerelease: false
73
- type: :development
74
- requirement: &id004 !ruby/object:Gem::Requirement
69
+ type: :runtime
70
+ requirement: *id003
71
+ - !ruby/object:Gem::Dependency
72
+ name: bundler
73
+ version_requirements: &id004 !ruby/object:Gem::Requirement
75
74
  none: false
76
75
  requirements:
77
76
  - - ~>
@@ -82,12 +81,12 @@ dependencies:
82
81
  - 0
83
82
  - 0
84
83
  version: 1.0.0
85
- name: bundler
86
- version_requirements: *id004
87
- - !ruby/object:Gem::Dependency
88
84
  prerelease: false
89
85
  type: :development
90
- requirement: &id005 !ruby/object:Gem::Requirement
86
+ requirement: *id004
87
+ - !ruby/object:Gem::Dependency
88
+ name: jeweler
89
+ version_requirements: &id005 !ruby/object:Gem::Requirement
91
90
  none: false
92
91
  requirements:
93
92
  - - ~>
@@ -98,12 +97,12 @@ dependencies:
98
97
  - 6
99
98
  - 4
100
99
  version: 1.6.4
101
- name: jeweler
102
- version_requirements: *id005
103
- - !ruby/object:Gem::Dependency
104
100
  prerelease: false
105
101
  type: :development
106
- requirement: &id006 !ruby/object:Gem::Requirement
102
+ requirement: *id005
103
+ - !ruby/object:Gem::Dependency
104
+ name: rspec
105
+ version_requirements: &id006 !ruby/object:Gem::Requirement
107
106
  none: false
108
107
  requirements:
109
108
  - - "="
@@ -114,12 +113,12 @@ dependencies:
114
113
  - 3
115
114
  - 0
116
115
  version: 1.3.0
117
- name: rspec
118
- version_requirements: *id006
119
- - !ruby/object:Gem::Dependency
120
116
  prerelease: false
121
117
  type: :development
122
- requirement: &id007 !ruby/object:Gem::Requirement
118
+ requirement: *id006
119
+ - !ruby/object:Gem::Dependency
120
+ name: rcov
121
+ version_requirements: &id007 !ruby/object:Gem::Requirement
123
122
  none: false
124
123
  requirements:
125
124
  - - ">="
@@ -128,12 +127,12 @@ dependencies:
128
127
  segments:
129
128
  - 0
130
129
  version: "0"
131
- name: rcov
132
- version_requirements: *id007
133
- - !ruby/object:Gem::Dependency
134
130
  prerelease: false
135
131
  type: :development
136
- requirement: &id008 !ruby/object:Gem::Requirement
132
+ requirement: *id007
133
+ - !ruby/object:Gem::Dependency
134
+ name: rspec_spinner
135
+ version_requirements: &id008 !ruby/object:Gem::Requirement
137
136
  none: false
138
137
  requirements:
139
138
  - - "="
@@ -144,12 +143,12 @@ dependencies:
144
143
  - 1
145
144
  - 3
146
145
  version: 1.1.3
147
- name: rspec_spinner
148
- version_requirements: *id008
149
- - !ruby/object:Gem::Dependency
150
146
  prerelease: false
151
147
  type: :development
152
- requirement: &id009 !ruby/object:Gem::Requirement
148
+ requirement: *id008
149
+ - !ruby/object:Gem::Dependency
150
+ name: flexmock
151
+ version_requirements: &id009 !ruby/object:Gem::Requirement
153
152
  none: false
154
153
  requirements:
155
154
  - - ">"
@@ -160,8 +159,9 @@ dependencies:
160
159
  - 8
161
160
  - 6
162
161
  version: 0.8.6
163
- name: flexmock
164
- version_requirements: *id009
162
+ prerelease: false
163
+ type: :development
164
+ requirement: *id009
165
165
  description: Part of the AMEEappkit this gem provides a data abstraction layer, decreasing the amount and detail of development required
166
166
  email: help@amee.com
167
167
  executables: []
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  requirements: []
255
255
 
256
256
  rubyforge_project:
257
- rubygems_version: 1.6.2
257
+ rubygems_version: 1.5.3
258
258
  signing_key:
259
259
  specification_version: 3
260
260
  summary: Calculation and form building tool hiding details of AMEEconnect