data_miner 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/data_miner.gemspec +2 -2
- data/lib/data_miner/run.rb +8 -0
- data/test/data_miner_test.rb +5 -0
- metadata +2 -2
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.9
|
data/data_miner.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{data_miner}
|
|
8
|
-
s.version = "0.3.
|
|
8
|
+
s.version = "0.3.9"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Seamus Abshere", "Andy Rossmeissl"]
|
|
12
|
-
s.date = %q{2010-03-
|
|
12
|
+
s.date = %q{2010-03-10}
|
|
13
13
|
s.description = %q{Mine remote data into your ActiveRecord models. You can also perform associations and convert units.}
|
|
14
14
|
s.email = %q{seamus@abshere.net}
|
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/data_miner/run.rb
CHANGED
|
@@ -2,5 +2,13 @@ module DataMiner
|
|
|
2
2
|
class Run < ActiveRecord::Base
|
|
3
3
|
set_table_name 'data_miner_runs'
|
|
4
4
|
default_scope :order => 'id ASC'
|
|
5
|
+
|
|
6
|
+
def resource
|
|
7
|
+
resource_name.constantize
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def resource_records_last_touched_by_me
|
|
11
|
+
resource.scoped :conditions => { :data_miner_last_run_id => id }
|
|
12
|
+
end
|
|
5
13
|
end
|
|
6
14
|
end
|
data/test/data_miner_test.rb
CHANGED
|
@@ -911,6 +911,11 @@ class DataMinerTest < Test::Unit::TestCase
|
|
|
911
911
|
assert_equal a, Country.first.data_miner_last_run
|
|
912
912
|
end
|
|
913
913
|
|
|
914
|
+
should "be able to get how many rows affected by a run" do
|
|
915
|
+
DataMiner.run :resource_names => %w{ Country }, :from_scratch => true
|
|
916
|
+
assert_equal Country.first.data_miner_last_run.resource_records_last_touched_by_me.count, Country.count
|
|
917
|
+
end
|
|
918
|
+
|
|
914
919
|
unless ENV['FAST'] == 'true'
|
|
915
920
|
should "import using a dictionary" do
|
|
916
921
|
DataMiner.run :resource_names => %w{ ResidentialEnergyConsumptionSurveyResponse }
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: data_miner
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Seamus Abshere
|
|
@@ -10,7 +10,7 @@ autorequire:
|
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
12
|
|
|
13
|
-
date: 2010-03-
|
|
13
|
+
date: 2010-03-10 00:00:00 -05:00
|
|
14
14
|
default_executable:
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|