restforce-db 0.5.0 → 0.5.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42506d7bec2c00a7c2161188ef2b238459942da8
4
- data.tar.gz: ce83cb60cbfdbd48388189aef560b3257d86995c
3
+ metadata.gz: 530452ffeea884be628f06f4227de2fe1404ebc4
4
+ data.tar.gz: 2b94172a1c712955af08ac61f3131a1de4d3ea83
5
5
  SHA512:
6
- metadata.gz: 0b394e0887d9b4986320b8c1776f0098069aed032a0810c17465ab14d75ce57ac9bbc505cdbabe861b80a89fc7b559ba3f559954ae0beb2adfd398c5c5d502e9
7
- data.tar.gz: 7821768fbd4a8da7e87ca397a9015059e9f81d1f08e064e63b4fd626705a58a2ee27a62e0c7499423f59843dfaf5d8d3d4b5b1b34f7697fc8d820b4336f67e8a
6
+ metadata.gz: 6cb953ba90c351994aeccef4fd2ffefefe5364955fa6c566098166f5053d74f121a4d2cc69629bba386c96b932d7a7c8ad657dcc609c359cbb50c75b4cd3aa08
7
+ data.tar.gz: d1e69dfef74e097947fcbe5abfaa31aa2d6b73e74e373ae2ad9605db9c0445ed26717c1b8531cec1e624b27adc1bcc3a13dea3ab25da40448be1199495a45548
@@ -3,7 +3,7 @@ module Restforce
3
3
  # :nodoc:
4
4
  module DB
5
5
 
6
- VERSION = "0.5.0"
6
+ VERSION = "0.5.1"
7
7
 
8
8
  end
9
9
 
@@ -25,7 +25,7 @@ module Restforce
25
25
  def initialize(options = {})
26
26
  @verbose = options.fetch(:verbose) { false }
27
27
  @interval = options.fetch(:interval) { DEFAULT_INTERVAL }
28
- @runner = Runner.new(options.fetch(:delay) { DEFAULT_DELAY })
28
+ @delay = options.fetch(:delay) { DEFAULT_DELAY }
29
29
 
30
30
  DB.reset
31
31
  DB.configure { |config| config.parse(options[:config]) }
@@ -71,10 +71,10 @@ module Restforce
71
71
  #
72
72
  # Returns nothing.
73
73
  def perform
74
- @runner.tick!
75
- @changes = Hash.new { |h, k| h[k] = Accumulator.new }
76
-
77
74
  track do
75
+ runner.tick!
76
+ @changes = Hash.new { |h, k| h[k] = Accumulator.new }
77
+
78
78
  Restforce::DB::Mapping.each do |mapping|
79
79
  task("PROPAGATING RECORDS", mapping) { propagate mapping }
80
80
  task("COLLECTING CHANGES", mapping) { collect mapping }
@@ -112,6 +112,14 @@ module Restforce
112
112
  end
113
113
  end
114
114
 
115
+ # Internal: Get a Runner object which can be passed to the various
116
+ # workflow objects to scope their record lookups.
117
+ #
118
+ # Returns a Restforce::DB::Runner.
119
+ def runner
120
+ @runner ||= Runner.new(@delay)
121
+ end
122
+
115
123
  # Internal: Propagate unsynchronized records between the two systems for
116
124
  # the passed mapping.
117
125
  #
@@ -119,7 +127,7 @@ module Restforce
119
127
  #
120
128
  # Returns nothing.
121
129
  def propagate(mapping)
122
- Initializer.new(mapping, @runner).run
130
+ Initializer.new(mapping, runner).run
123
131
  end
124
132
 
125
133
  # Internal: Collect a list of changes from recently-updated records for
@@ -129,7 +137,7 @@ module Restforce
129
137
  #
130
138
  # Returns nothing.
131
139
  def collect(mapping)
132
- Collector.new(mapping, @runner).run(@changes)
140
+ Collector.new(mapping, runner).run(@changes)
133
141
  end
134
142
 
135
143
  # Internal: Apply the aggregated changes to the objects in both systems,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restforce-db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Horner