assimilate 0.2 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,6 +31,10 @@ class Assimilate::Command
31
31
  opts.on("--domain STRING", String, "Domain value to apply to each record") do |s|
32
32
  @options[:domain] = s
33
33
  end
34
+
35
+ opts.on("--compare FIELDNAME", String, "(*extend* only) Optional field to check whether an update is current (e.g. timestamp)") do |f|
36
+ @options[:compare] = f
37
+ end
34
38
  end
35
39
  end
36
40
 
@@ -37,7 +37,7 @@ class Assimilate::Extender
37
37
  # if there is a field to compare on (i.e. a timestamp), then apply the update if the timestamp is newer;
38
38
  # otherwise (no timestamp) compare the hashes and apply if there are any differences.
39
39
  def apply_this_update(current_record, new_data)
40
- if @comparison_field
40
+ if @comparison_field && current_record[@keyfield]
41
41
  is_newer(current_record[@keyfield], new_data)
42
42
  else
43
43
  current_record[@keyfield] != new_data
@@ -1,3 +1,3 @@
1
1
  module Assimilate
2
- VERSION = "0.2"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -74,7 +74,7 @@ describe "loading extended data" do
74
74
  before(:all) do
75
75
  reset_catalog
76
76
  import_base_data("20120501")
77
- import_extended_data("20120505", "logs1.csv")
77
+ import_extended_data("20120505", "logs1.csv", :compare => 'timestamp')
78
78
  end
79
79
 
80
80
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assimilate
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongo
16
- requirement: &2157154580 !ruby/object:Gem::Requirement
16
+ requirement: &2156667700 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.6.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2157154580
24
+ version_requirements: *2156667700
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bson_ext
27
- requirement: &2157154080 !ruby/object:Gem::Requirement
27
+ requirement: &2156665740 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.6.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2157154080
35
+ version_requirements: *2156665740
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activesupport
38
- requirement: &2156541740 !ruby/object:Gem::Requirement
38
+ requirement: &2156664520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 3.2.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2156541740
46
+ version_requirements: *2156664520
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &2156539660 !ruby/object:Gem::Requirement
49
+ requirement: &2156663400 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 2.9.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2156539660
57
+ version_requirements: *2156663400
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: guard-rspec
60
- requirement: &2156536900 !ruby/object:Gem::Requirement
60
+ requirement: &2157692120 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.7.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2156536900
68
+ version_requirements: *2157692120
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ruby_gntp
71
- requirement: &2156535700 !ruby/object:Gem::Requirement
71
+ requirement: &2157691660 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: 0.3.4
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2156535700
79
+ version_requirements: *2157691660
80
80
  description: Ingest updates from CSV and apply to set of hashes
81
81
  email:
82
82
  - jmay@pobox.com