mongar 0.0.5 → 0.0.6
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/lib/mongar/replica.rb +3 -1
- data/mongar.gemspec +1 -1
- data/spec/mongar/replica_spec.rb +5 -0
- metadata +3 -3
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0.0. | 
| 1 | 
            +
            0.0.6
         | 
    
        data/lib/mongar/replica.rb
    CHANGED
    
    | @@ -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  | 
| 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
         | 
    
        data/mongar.gemspec
    CHANGED
    
    
    
        data/spec/mongar/replica_spec.rb
    CHANGED
    
    | @@ -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:  | 
| 4 | 
            +
              hash: 19
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
              segments: 
         | 
| 7 7 | 
             
              - 0
         | 
| 8 8 | 
             
              - 0
         | 
| 9 | 
            -
              -  | 
| 10 | 
            -
              version: 0.0. | 
| 9 | 
            +
              - 6
         | 
| 10 | 
            +
              version: 0.0.6
         | 
| 11 11 | 
             
            platform: ruby
         | 
| 12 12 | 
             
            authors: 
         | 
| 13 13 | 
             
            - Philippe Green
         |