data_miner 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/data_miner.gemspec +1 -1
- data/lib/data_miner.rb +4 -4
- data/lib/data_miner/import.rb +1 -0
- data/lib/data_miner/verify.rb +3 -1
- data/lib/data_miner/version.rb +1 -1
- data/test/test_verify.rb +9 -17
- metadata +39 -15
data/data_miner.gemspec
CHANGED
@@ -26,8 +26,8 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.add_dependency 'conversions', '>=1.4.4'
|
27
27
|
s.add_dependency 'blockenspiel', '>=0.3.2'
|
28
28
|
s.add_dependency 'taps', '>=0.3.11'
|
29
|
+
s.add_dependency 'errata', '>=1.0.1'
|
29
30
|
s.add_development_dependency 'loose_tight_dictionary', ">=0.0.5"
|
30
|
-
s.add_development_dependency 'errata', '>=1.0.1'
|
31
31
|
s.add_development_dependency 'test-unit'
|
32
32
|
s.add_development_dependency 'shoulda'
|
33
33
|
s.add_development_dependency 'mysql'
|
data/lib/data_miner.rb
CHANGED
@@ -65,14 +65,14 @@ Output:
|
|
65
65
|
|
66
66
|
def start_logging
|
67
67
|
if logger.nil?
|
68
|
-
if defined? Rails
|
69
|
-
self.logger = Rails.logger
|
68
|
+
if defined? ::Rails
|
69
|
+
self.logger = ::Rails.logger
|
70
70
|
else
|
71
71
|
require 'logger'
|
72
|
-
self.logger = Logger.new $stdout
|
72
|
+
self.logger = ::Logger.new $stdout
|
73
73
|
end
|
74
74
|
end
|
75
|
-
ActiveRecord::Base.logger = logger
|
75
|
+
::ActiveRecord::Base.logger = logger
|
76
76
|
end
|
77
77
|
|
78
78
|
# Mine data. Defaults to all resource_names touched by DataMiner.
|
data/lib/data_miner/import.rb
CHANGED
data/lib/data_miner/verify.rb
CHANGED
data/lib/data_miner/version.rb
CHANGED
data/test/test_verify.rb
CHANGED
@@ -2,28 +2,20 @@ require File.expand_path('helper', File.dirname(__FILE__))
|
|
2
2
|
|
3
3
|
class TestVerify < Test::Unit::TestCase
|
4
4
|
context '#run' do
|
5
|
-
setup do
|
6
|
-
@run = Object.new
|
7
|
-
check = lambda do
|
8
|
-
true
|
9
|
-
end
|
10
|
-
@verify = DataMiner::Verify.new Aircraft.new.data_miner_config,
|
11
|
-
'verification of engine type', &check
|
12
|
-
end
|
13
5
|
should 'raise an exception if the verification block fails through exception' do
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
assert_raise(DataMiner::VerificationFailed) { @verify.run }
|
6
|
+
raising_check = lambda { raise "boom" }
|
7
|
+
verify = DataMiner::Verify.new Aircraft.new.data_miner_config, 'verification of engine type', &raising_check
|
8
|
+
assert_raise(DataMiner::VerificationFailed) { verify.run }
|
18
9
|
end
|
19
10
|
should 'raise an exception if the result of the verification block is false' do
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
assert_raise(DataMiner::VerificationFailed) { @verify.run }
|
11
|
+
failing_check = lambda { false }
|
12
|
+
verify = DataMiner::Verify.new Aircraft.new.data_miner_config, 'verification of engine type', &failing_check
|
13
|
+
assert_raise(DataMiner::VerificationFailed) { verify.run }
|
24
14
|
end
|
25
15
|
should 'return true if the verification block succeeds' do
|
26
|
-
|
16
|
+
passing_check = lambda { true }
|
17
|
+
verify = DataMiner::Verify.new Aircraft.new.data_miner_config, 'verification of engine type', &passing_check
|
18
|
+
assert_nil verify.run
|
27
19
|
end
|
28
20
|
end
|
29
21
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_miner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 1
|
8
|
-
-
|
9
|
-
version: 1.1.
|
9
|
+
- 2
|
10
|
+
version: 1.1.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Seamus Abshere
|
@@ -16,7 +17,7 @@ autorequire:
|
|
16
17
|
bindir: bin
|
17
18
|
cert_chain: []
|
18
19
|
|
19
|
-
date: 2011-01-
|
20
|
+
date: 2011-01-28 00:00:00 -06:00
|
20
21
|
default_executable:
|
21
22
|
dependencies:
|
22
23
|
- !ruby/object:Gem::Dependency
|
@@ -27,6 +28,7 @@ dependencies:
|
|
27
28
|
requirements:
|
28
29
|
- - ">="
|
29
30
|
- !ruby/object:Gem::Version
|
31
|
+
hash: 19
|
30
32
|
segments:
|
31
33
|
- 1
|
32
34
|
- 1
|
@@ -42,6 +44,7 @@ dependencies:
|
|
42
44
|
requirements:
|
43
45
|
- - ">="
|
44
46
|
- !ruby/object:Gem::Version
|
47
|
+
hash: 23
|
45
48
|
segments:
|
46
49
|
- 0
|
47
50
|
- 0
|
@@ -57,6 +60,7 @@ dependencies:
|
|
57
60
|
requirements:
|
58
61
|
- - ">="
|
59
62
|
- !ruby/object:Gem::Version
|
63
|
+
hash: 11
|
60
64
|
segments:
|
61
65
|
- 2
|
62
66
|
- 3
|
@@ -72,6 +76,7 @@ dependencies:
|
|
72
76
|
requirements:
|
73
77
|
- - ">="
|
74
78
|
- !ruby/object:Gem::Version
|
79
|
+
hash: 11
|
75
80
|
segments:
|
76
81
|
- 2
|
77
82
|
- 3
|
@@ -87,6 +92,7 @@ dependencies:
|
|
87
92
|
requirements:
|
88
93
|
- - ">="
|
89
94
|
- !ruby/object:Gem::Version
|
95
|
+
hash: 15
|
90
96
|
segments:
|
91
97
|
- 1
|
92
98
|
- 4
|
@@ -102,6 +108,7 @@ dependencies:
|
|
102
108
|
requirements:
|
103
109
|
- - ">="
|
104
110
|
- !ruby/object:Gem::Version
|
111
|
+
hash: 23
|
105
112
|
segments:
|
106
113
|
- 0
|
107
114
|
- 3
|
@@ -117,6 +124,7 @@ dependencies:
|
|
117
124
|
requirements:
|
118
125
|
- - ">="
|
119
126
|
- !ruby/object:Gem::Version
|
127
|
+
hash: 5
|
120
128
|
segments:
|
121
129
|
- 0
|
122
130
|
- 3
|
@@ -125,33 +133,35 @@ dependencies:
|
|
125
133
|
type: :runtime
|
126
134
|
version_requirements: *id007
|
127
135
|
- !ruby/object:Gem::Dependency
|
128
|
-
name:
|
136
|
+
name: errata
|
129
137
|
prerelease: false
|
130
138
|
requirement: &id008 !ruby/object:Gem::Requirement
|
131
139
|
none: false
|
132
140
|
requirements:
|
133
141
|
- - ">="
|
134
142
|
- !ruby/object:Gem::Version
|
143
|
+
hash: 21
|
135
144
|
segments:
|
145
|
+
- 1
|
136
146
|
- 0
|
137
|
-
-
|
138
|
-
|
139
|
-
|
140
|
-
type: :development
|
147
|
+
- 1
|
148
|
+
version: 1.0.1
|
149
|
+
type: :runtime
|
141
150
|
version_requirements: *id008
|
142
151
|
- !ruby/object:Gem::Dependency
|
143
|
-
name:
|
152
|
+
name: loose_tight_dictionary
|
144
153
|
prerelease: false
|
145
154
|
requirement: &id009 !ruby/object:Gem::Requirement
|
146
155
|
none: false
|
147
156
|
requirements:
|
148
157
|
- - ">="
|
149
158
|
- !ruby/object:Gem::Version
|
159
|
+
hash: 21
|
150
160
|
segments:
|
151
|
-
- 1
|
152
161
|
- 0
|
153
|
-
-
|
154
|
-
|
162
|
+
- 0
|
163
|
+
- 5
|
164
|
+
version: 0.0.5
|
155
165
|
type: :development
|
156
166
|
version_requirements: *id009
|
157
167
|
- !ruby/object:Gem::Dependency
|
@@ -162,6 +172,7 @@ dependencies:
|
|
162
172
|
requirements:
|
163
173
|
- - ">="
|
164
174
|
- !ruby/object:Gem::Version
|
175
|
+
hash: 3
|
165
176
|
segments:
|
166
177
|
- 0
|
167
178
|
version: "0"
|
@@ -175,6 +186,7 @@ dependencies:
|
|
175
186
|
requirements:
|
176
187
|
- - ">="
|
177
188
|
- !ruby/object:Gem::Version
|
189
|
+
hash: 3
|
178
190
|
segments:
|
179
191
|
- 0
|
180
192
|
version: "0"
|
@@ -188,19 +200,21 @@ dependencies:
|
|
188
200
|
requirements:
|
189
201
|
- - ">="
|
190
202
|
- !ruby/object:Gem::Version
|
203
|
+
hash: 3
|
191
204
|
segments:
|
192
205
|
- 0
|
193
206
|
version: "0"
|
194
207
|
type: :development
|
195
208
|
version_requirements: *id012
|
196
209
|
- !ruby/object:Gem::Dependency
|
197
|
-
name: ruby-
|
210
|
+
name: ruby-debug
|
198
211
|
prerelease: false
|
199
212
|
requirement: &id013 !ruby/object:Gem::Requirement
|
200
213
|
none: false
|
201
214
|
requirements:
|
202
215
|
- - ">="
|
203
216
|
- !ruby/object:Gem::Version
|
217
|
+
hash: 3
|
204
218
|
segments:
|
205
219
|
- 0
|
206
220
|
version: "0"
|
@@ -259,6 +273,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
259
273
|
requirements:
|
260
274
|
- - ">="
|
261
275
|
- !ruby/object:Gem::Version
|
276
|
+
hash: 3
|
262
277
|
segments:
|
263
278
|
- 0
|
264
279
|
version: "0"
|
@@ -267,6 +282,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
282
|
requirements:
|
268
283
|
- - ">="
|
269
284
|
- !ruby/object:Gem::Version
|
285
|
+
hash: 3
|
270
286
|
segments:
|
271
287
|
- 0
|
272
288
|
version: "0"
|
@@ -277,5 +293,13 @@ rubygems_version: 1.3.7
|
|
277
293
|
signing_key:
|
278
294
|
specification_version: 3
|
279
295
|
summary: Mine remote data into your ActiveRecord models.
|
280
|
-
test_files:
|
281
|
-
|
296
|
+
test_files:
|
297
|
+
- test/helper.rb
|
298
|
+
- test/support/aircraft.rb
|
299
|
+
- test/support/airport.rb
|
300
|
+
- test/support/automobile_fuel_type.rb
|
301
|
+
- test/support/automobile_variant.rb
|
302
|
+
- test/support/country.rb
|
303
|
+
- test/test_attribute.rb
|
304
|
+
- test/test_old_syntax.rb
|
305
|
+
- test/test_verify.rb
|