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 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.0'
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'
@@ -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
@@ -22,6 +22,11 @@ class DataMiner
22
22
  def table
23
23
  @table ||= ::RemoteTable.new options['url']
24
24
  end
25
+
26
+ def free
27
+ @table.free if @table.is_a?(::RemoteTable)
28
+ @table = nil
29
+ end
25
30
 
26
31
  def lookup(key)
27
32
  find key_name, key, value_name, 'sprintf' => sprintf
@@ -69,13 +69,13 @@ class DataMiner
69
69
  @table = ::RemoteTable.new options
70
70
  end
71
71
 
72
- def expire_remote_data
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
@@ -1,3 +1,3 @@
1
1
  class DataMiner
2
- VERSION = '1.1.5'
2
+ VERSION = '1.1.6'
3
3
  end
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: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 5
10
- version: 1.1.5
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-22 00:00:00 -05:00
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: 19
31
+ hash: 31
32
32
  segments:
33
33
  - 1
34
34
  - 1
35
- - 0
36
- version: 1.1.0
35
+ - 6
36
+ version: 1.1.6
37
37
  type: :runtime
38
38
  version_requirements: *id001
39
39
  - !ruby/object:Gem::Dependency