mongar 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -123,7 +123,9 @@ class Mongar
123
123
  def do_full_refresh?(last_replicated_time = nil)
124
124
  last_replicated_time ||= destination.last_replicated_at
125
125
 
126
- if @full_refresh.nil?
126
+ if last_replicated_time.nil? || last_replicated_time == Time.parse("1/1/1902 00:00:00")
127
+ true
128
+ elsif @full_refresh.nil?
127
129
  false
128
130
  elsif @full_refresh.is_a?(Proc)
129
131
  source.instance_exec last_replicated_time, &@full_refresh
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "mongar"
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Philippe Green"]
@@ -311,6 +311,11 @@ describe "Mongar::Replica" do
311
311
  @replica.destination = @collection
312
312
  end
313
313
 
314
+ it "should return true if the last_replicated_at is 1902" do
315
+ @collection.stub!(:last_replicated_at).and_return(Time.parse("1/1/1902 00:00:00"))
316
+ @replica.do_full_refresh?.should be_true
317
+ end
318
+
314
319
  context "given the full_refresh condition is a time period" do
315
320
  before do
316
321
  @replica.full_refresh :every => 3600
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongar
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Philippe Green