alephant-cache 0.0.3 → 0.0.4
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 +4 -4
 - data/lib/alephant/cache.rb +8 -2
 - data/lib/alephant/cache/version.rb +1 -1
 - data/spec/cache_spec.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 0b5bf5c741587aefd5d88398fb5ec9412194f566
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 831200ba65814a06a4993d3a6cae93bee54423cd
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: fbfce75cc5f65da0f6bf4d83a38c8835c6b6ae9d1d4d6448af565926044d21ce74e51853fdd13a9263310c1ee099cdf60ea9d28f27c5ef4e2b19c2b395ef602f
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 0360a92c0a490b9cc3bd798b58dfd31e08f8ec68307ac77e92da0e155f096706b575dd8074a3fbd99839f80c6001aeadb1520a3a12961ddf5525cde62f8e5253
         
     | 
    
        data/lib/alephant/cache.rb
    CHANGED
    
    | 
         @@ -20,8 +20,14 @@ module Alephant 
     | 
|
| 
       20 
20 
     | 
    
         
             
                  logger.info("Cache.clear: #{path}")
         
     | 
| 
       21 
21 
     | 
    
         
             
                end
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
     | 
    
         
            -
                def put(id, data)
         
     | 
| 
       24 
     | 
    
         
            -
                  bucket.objects["#{path}/#{id}"].write( 
     | 
| 
      
 23 
     | 
    
         
            +
                def put(id, data, meta = {})
         
     | 
| 
      
 24 
     | 
    
         
            +
                  bucket.objects["#{path}/#{id}"].write(
         
     | 
| 
      
 25 
     | 
    
         
            +
                    data,
         
     | 
| 
      
 26 
     | 
    
         
            +
                    {
         
     | 
| 
      
 27 
     | 
    
         
            +
                      :metadata => meta
         
     | 
| 
      
 28 
     | 
    
         
            +
                    }
         
     | 
| 
      
 29 
     | 
    
         
            +
                  )
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
       25 
31 
     | 
    
         
             
                  logger.info("Cache.put: #{path}/#{id}")
         
     | 
| 
       26 
32 
     | 
    
         
             
                end
         
     | 
| 
       27 
33 
     | 
    
         | 
    
        data/spec/cache_spec.rb
    CHANGED
    
    | 
         @@ -48,7 +48,7 @@ describe Alephant::Cache do 
     | 
|
| 
       48 
48 
     | 
    
         
             
              describe "put(id, data)" do
         
     | 
| 
       49 
49 
     | 
    
         
             
                it "sets bucket path/id content data" do
         
     | 
| 
       50 
50 
     | 
    
         
             
                  s3_object_collection = double()
         
     | 
| 
       51 
     | 
    
         
            -
                  s3_object_collection.should_receive(:write).with(:data)
         
     | 
| 
      
 51 
     | 
    
         
            +
                  s3_object_collection.should_receive(:write).with(:data,:metadata=>{})
         
     | 
| 
       52 
52 
     | 
    
         | 
| 
       53 
53 
     | 
    
         
             
                  s3_bucket = double()
         
     | 
| 
       54 
54 
     | 
    
         
             
                  s3_bucket.should_receive(:objects).and_return(
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: alephant-cache
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.4
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Robert Kenny
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-05-14 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rspec
         
     |