amee-data-abstraction 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -1
- data/Gemfile +4 -0
- data/Gemfile.lock +2 -0
- data/VERSION +1 -1
- data/amee-data-abstraction.gemspec +3 -3
- data/lib/amee-data-abstraction/drill.rb +17 -6
- data/spec/amee-data-abstraction/prototype_calculation_spec.rb +5 -0
- metadata +23 -23
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm 1.8.7@amee-data-abstraction
|
1
|
+
rvm 1.8.7@amee-data-abstraction
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -7,6 +7,7 @@ GEM
|
|
7
7
|
json
|
8
8
|
log4r
|
9
9
|
nokogiri (~> 1.4.3.1)
|
10
|
+
builder (3.0.0)
|
10
11
|
diff-lcs (1.1.3)
|
11
12
|
flexmock (0.9.0)
|
12
13
|
git (1.2.5)
|
@@ -39,6 +40,7 @@ PLATFORMS
|
|
39
40
|
|
40
41
|
DEPENDENCIES
|
41
42
|
amee (~> 4.0)
|
43
|
+
builder
|
42
44
|
bundler (~> 1.0.0)
|
43
45
|
flexmock (> 0.8.6)
|
44
46
|
jeweler (~> 1.6.4)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.1.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 = "2.
|
8
|
+
s.version = "2.1.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-
|
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 = [
|
@@ -71,7 +71,7 @@ Gem::Specification.new do |s|
|
|
71
71
|
s.homepage = %q{http://github.com/AMEE/amee-data-abstraction}
|
72
72
|
s.licenses = ["BSD 3-Clause"]
|
73
73
|
s.require_paths = ["lib"]
|
74
|
-
s.rubygems_version = %q{1.
|
74
|
+
s.rubygems_version = %q{1.5.3}
|
75
75
|
s.summary = %q{Calculation and form building tool hiding details of AMEEconnect}
|
76
76
|
|
77
77
|
if s.respond_to? :specification_version then
|
@@ -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
|
#
|
@@ -21,6 +21,11 @@ describe PrototypeCalculation do
|
|
21
21
|
pc=PrototypeCalculation.new {drill{label :alpha}}
|
22
22
|
pc[:alpha].should be_a Drill
|
23
23
|
end
|
24
|
+
it 'can set custom drill choices in the DSL block' do
|
25
|
+
pc=PrototypeCalculation.new {drill{label :alpha; choices "ball","cat","dog"}}
|
26
|
+
pc[:alpha].should be_a Drill
|
27
|
+
pc[:alpha].choices.should eql ["ball","cat","dog"]
|
28
|
+
end
|
24
29
|
it 'can''t make a DSL block term without a label' do
|
25
30
|
lambda{
|
26
31
|
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:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 2.0.0
|
10
|
+
version: 2.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Hetherington
|
@@ -18,13 +18,11 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2011-
|
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
25
|
name: amee
|
27
|
-
type: :runtime
|
28
26
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
29
27
|
none: false
|
30
28
|
requirements:
|
@@ -35,11 +33,11 @@ dependencies:
|
|
35
33
|
- 4
|
36
34
|
- 0
|
37
35
|
version: "4.0"
|
36
|
+
prerelease: false
|
37
|
+
type: :runtime
|
38
38
|
requirement: *id001
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
|
-
prerelease: false
|
41
40
|
name: uuidtools
|
42
|
-
type: :runtime
|
43
41
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
44
42
|
none: false
|
45
43
|
requirements:
|
@@ -51,11 +49,11 @@ dependencies:
|
|
51
49
|
- 1
|
52
50
|
- 2
|
53
51
|
version: 2.1.2
|
52
|
+
prerelease: false
|
53
|
+
type: :runtime
|
54
54
|
requirement: *id002
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
prerelease: false
|
57
56
|
name: quantify
|
58
|
-
type: :runtime
|
59
57
|
version_requirements: &id003 !ruby/object:Gem::Requirement
|
60
58
|
none: false
|
61
59
|
requirements:
|
@@ -67,11 +65,11 @@ dependencies:
|
|
67
65
|
- 0
|
68
66
|
- 0
|
69
67
|
version: 2.0.0
|
68
|
+
prerelease: false
|
69
|
+
type: :runtime
|
70
70
|
requirement: *id003
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
|
-
prerelease: false
|
73
72
|
name: bundler
|
74
|
-
type: :development
|
75
73
|
version_requirements: &id004 !ruby/object:Gem::Requirement
|
76
74
|
none: false
|
77
75
|
requirements:
|
@@ -83,11 +81,11 @@ dependencies:
|
|
83
81
|
- 0
|
84
82
|
- 0
|
85
83
|
version: 1.0.0
|
84
|
+
prerelease: false
|
85
|
+
type: :development
|
86
86
|
requirement: *id004
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
|
-
prerelease: false
|
89
88
|
name: jeweler
|
90
|
-
type: :development
|
91
89
|
version_requirements: &id005 !ruby/object:Gem::Requirement
|
92
90
|
none: false
|
93
91
|
requirements:
|
@@ -99,11 +97,11 @@ dependencies:
|
|
99
97
|
- 6
|
100
98
|
- 4
|
101
99
|
version: 1.6.4
|
100
|
+
prerelease: false
|
101
|
+
type: :development
|
102
102
|
requirement: *id005
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
|
-
prerelease: false
|
105
104
|
name: rspec
|
106
|
-
type: :development
|
107
105
|
version_requirements: &id006 !ruby/object:Gem::Requirement
|
108
106
|
none: false
|
109
107
|
requirements:
|
@@ -115,11 +113,11 @@ dependencies:
|
|
115
113
|
- 6
|
116
114
|
- 0
|
117
115
|
version: 2.6.0
|
116
|
+
prerelease: false
|
117
|
+
type: :development
|
118
118
|
requirement: *id006
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
|
-
prerelease: false
|
121
120
|
name: flexmock
|
122
|
-
type: :development
|
123
121
|
version_requirements: &id007 !ruby/object:Gem::Requirement
|
124
122
|
none: false
|
125
123
|
requirements:
|
@@ -131,11 +129,11 @@ dependencies:
|
|
131
129
|
- 8
|
132
130
|
- 6
|
133
131
|
version: 0.8.6
|
132
|
+
prerelease: false
|
133
|
+
type: :development
|
134
134
|
requirement: *id007
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
|
-
prerelease: false
|
137
136
|
name: rcov
|
138
|
-
type: :development
|
139
137
|
version_requirements: &id008 !ruby/object:Gem::Requirement
|
140
138
|
none: false
|
141
139
|
requirements:
|
@@ -145,11 +143,11 @@ dependencies:
|
|
145
143
|
segments:
|
146
144
|
- 0
|
147
145
|
version: "0"
|
146
|
+
prerelease: false
|
147
|
+
type: :development
|
148
148
|
requirement: *id008
|
149
149
|
- !ruby/object:Gem::Dependency
|
150
|
-
prerelease: false
|
151
150
|
name: rdoc
|
152
|
-
type: :development
|
153
151
|
version_requirements: &id009 !ruby/object:Gem::Requirement
|
154
152
|
none: false
|
155
153
|
requirements:
|
@@ -159,6 +157,8 @@ dependencies:
|
|
159
157
|
segments:
|
160
158
|
- 0
|
161
159
|
version: "0"
|
160
|
+
prerelease: false
|
161
|
+
type: :development
|
162
162
|
requirement: *id009
|
163
163
|
description: Part of the AMEEappkit this gem provides a data abstraction layer, decreasing the amount and detail of development required
|
164
164
|
email: help@amee.com
|
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
250
250
|
requirements: []
|
251
251
|
|
252
252
|
rubyforge_project:
|
253
|
-
rubygems_version: 1.
|
253
|
+
rubygems_version: 1.5.3
|
254
254
|
signing_key:
|
255
255
|
specification_version: 3
|
256
256
|
summary: Calculation and form building tool hiding details of AMEEconnect
|