cryptkeeper 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +27 -2
- data/cryptkeeper.gemspec +1 -1
- data/lib/crypt_keeper.rb +2 -2
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -10,5 +10,30 @@ Rails gem for connecting to the Google Storage API
|
|
10
10
|
|
11
11
|
So far:
|
12
12
|
|
13
|
-
|
14
|
-
|
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
|
data/cryptkeeper.gemspec
CHANGED
data/lib/crypt_keeper.rb
CHANGED
@@ -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.
|
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
|