data_miner 1.1.5 → 1.1.6
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/attribute.rb +5 -0
- data/lib/data_miner/dictionary.rb +5 -0
- data/lib/data_miner/import.rb +5 -4
- data/lib/data_miner/version.rb +1 -1
- metadata +7 -7
data/data_miner.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_dependency 'remote_table', '>=1.1.
|
22
|
+
s.add_dependency 'remote_table', '>=1.1.6'
|
23
23
|
s.add_dependency 'escape', '>=0.0.4'
|
24
24
|
s.add_dependency 'activerecord', '>=2.3.4'
|
25
25
|
s.add_dependency 'activesupport', '>=2.3.4'
|
data/lib/data_miner/attribute.rb
CHANGED
@@ -234,5 +234,10 @@ class DataMiner
|
|
234
234
|
def matcher
|
235
235
|
@matcher ||= (options['matcher'].is_a?(::String) ? options['matcher'].constantize.new : options['matcher'])
|
236
236
|
end
|
237
|
+
|
238
|
+
def free
|
239
|
+
@dictionary.free if @dictionary.is_a?(Dictionary)
|
240
|
+
@dictionary = nil
|
241
|
+
end
|
237
242
|
end
|
238
243
|
end
|
data/lib/data_miner/import.rb
CHANGED
@@ -69,13 +69,13 @@ class DataMiner
|
|
69
69
|
@table = ::RemoteTable.new options
|
70
70
|
end
|
71
71
|
|
72
|
-
def
|
72
|
+
def free
|
73
|
+
attributes.each { |_, attr| attr.free }
|
74
|
+
@table.free if @table.is_a?(::RemoteTable)
|
73
75
|
@table = nil
|
74
|
-
attributes.each { |_, attr| attr.instance_variable_set :@dictionary, nil }
|
75
76
|
end
|
76
|
-
|
77
|
+
|
77
78
|
def run
|
78
|
-
expire_remote_data
|
79
79
|
table.each do |row|
|
80
80
|
record = resource.send "find_or_initialize_by_#{@_key}", attributes[@_key].value_from_row(row)
|
81
81
|
attributes.each { |_, attr| attr.set_record_from_row record, row }
|
@@ -85,6 +85,7 @@ class DataMiner
|
|
85
85
|
::DataMiner.logger.debug "Skipping #{row} because there's no primary key"
|
86
86
|
end
|
87
87
|
end
|
88
|
+
free
|
88
89
|
nil
|
89
90
|
end
|
90
91
|
end
|
data/lib/data_miner/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_miner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 6
|
10
|
+
version: 1.1.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Seamus Abshere
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-03-
|
20
|
+
date: 2011-03-31 00:00:00 -05:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -28,12 +28,12 @@ dependencies:
|
|
28
28
|
requirements:
|
29
29
|
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
hash:
|
31
|
+
hash: 31
|
32
32
|
segments:
|
33
33
|
- 1
|
34
34
|
- 1
|
35
|
-
-
|
36
|
-
version: 1.1.
|
35
|
+
- 6
|
36
|
+
version: 1.1.6
|
37
37
|
type: :runtime
|
38
38
|
version_requirements: *id001
|
39
39
|
- !ruby/object:Gem::Dependency
|