cryptkeeper 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +23 -23
- data/cryptkeeper.gemspec +1 -1
- data/lib/crypt_keeper.rb +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -8,32 +8,32 @@ Rails gem for connecting to the Google Storage API
|
|
8
8
|
|
9
9
|
== Usage
|
10
10
|
|
11
|
-
|
11
|
+
So far:
|
12
12
|
|
13
13
|
keeper = CryptKeeper::Connection.new({:access_key => 'your_access_key', :secret_key => 'your_secret_key'})
|
14
14
|
|
15
|
-
|
16
|
-
puts keeper.buckets.each do |bucket|
|
17
|
-
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
metas = keeper.bucket_meta_objects('adam_first_bucket', {:prefix => 'Picture'})
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
metas.each do |meta|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
end
|
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
35
|
|
36
36
|
Creates 3 new picture files on my Desktop:
|
37
|
-
Picture 1.png
|
38
|
-
Picture 2.png
|
37
|
+
Picture 1.png,
|
38
|
+
Picture 2.png,
|
39
39
|
Picture 3.png
|
data/cryptkeeper.gemspec
CHANGED
data/lib/crypt_keeper.rb
CHANGED