cryptkeeper 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,5 +10,30 @@ Rails gem for connecting to the Google Storage API
10
10
 
11
11
  So far:
12
12
 
13
- google_keeper = CryptKeeper::Connection({:access_key => 'your_access_key', :secret_key => 'your_secret_key'})
14
- my_buckets = google_keeper.buckets
13
+ keeper = CryptKeeper::Connection.new({:access_key => 'your_access_key', :secret_key => 'your_secret_key'})
14
+
15
+ # See all of my buckets
16
+ puts keeper.buckets.each do |bucket|
17
+ puts bucket.name
18
+ puts bucket.created_at
19
+ end
20
+
21
+ # Search for all files that start with "Picture"
22
+ # The following returns meta info on each of the found objects within the specified bucket
23
+ metas = keeper.bucket_meta_objects('adam_first_bucket', {:prefix => 'Picture'})
24
+
25
+ # Now it's time to grab the actual object (data)
26
+ # I am writing it to Files here on my local machine
27
+ metas.each do |meta|
28
+ puts meta.key # In my case, prints Picture 1.png
29
+ f = File.new("/Users/user/Desktop/#{meta.key}",'w')
30
+ # object method will go and fetch it unless it's been fetched before
31
+ # if you want to force another trip to the Crypt, do meta.object!
32
+ f.write(meta.object)
33
+ f.close()
34
+ end
35
+
36
+ Creates 3 new picture files on my Desktop:
37
+ Picture 1.png
38
+ Picture 2.png
39
+ Picture 3.png
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cryptkeeper}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Adam Medeiros"]
@@ -4,7 +4,7 @@ require ck_path + '/crypt_keeper_http.rb'
4
4
  require 'uri'
5
5
 
6
6
  module CryptKeeper
7
- VERSION = "0.2.2"
7
+ VERSION = "0.2.3"
8
8
  class Connection
9
9
  @@http_instance = nil
10
10
  def self.http_instance
@@ -28,4 +28,4 @@ module CryptKeeper
28
28
  include Buckets
29
29
  end
30
30
 
31
- end
31
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 2
9
- version: 0.2.2
8
+ - 3
9
+ version: 0.2.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adam Medeiros