raca 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +12 -1
- data/lib/raca/container.rb +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96ffbbfd74e51b99894091ce939cb3521766e52c
|
4
|
+
data.tar.gz: 0551b2e01de644084a4099a984a25c90e6add01c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b5cf1bc1d8c2a93d6c17bef62e9fd9e6bdd35df9dd56915309ccc771cb48659703561ea3d1d2e45b46d701c11a48d12f2662c22b3f4f248370076aedf556720
|
7
|
+
data.tar.gz: 90ebbc528ed8b7a8782ea9a7dd30a3c4a30d2799ea6267995a114fe68a7a6e687c34ab0d2ecbc24b61df4be33a1c05716f4eb899646c95a5a8748eefaf7c2da6
|
data/README.markdown
CHANGED
@@ -117,7 +117,18 @@ is the temp URL key that can be set using Raca::Containers#set_temp_url_key
|
|
117
117
|
server = account.servers(:ord).get("foo")
|
118
118
|
puts server.public_addresses
|
119
119
|
|
120
|
+
## Why not fog?
|
121
|
+
|
122
|
+
[fog](http://rubygems.org/gems/fog) is the [official](http://developer.rackspace.com)
|
123
|
+
ruby library for interacting with the Rackspace API. It is a very capable
|
124
|
+
library and supports much more of the API than this modest gem.
|
125
|
+
|
126
|
+
As of version 1.20.0, fog supports dozens of providers, contains ~152000 lines
|
127
|
+
of ruby and adds ~500ms to the boot time of our rails apps. raca is a
|
128
|
+
lightweight alternative with minimal dependencies that should have a negligable
|
129
|
+
impact on application boot times.
|
130
|
+
|
120
131
|
## Compatibility
|
121
132
|
|
122
|
-
The Raca version number is
|
133
|
+
The Raca version number is < 1.0 because it's highly unstable. Until we release
|
123
134
|
a 1.0.0, consider the API of this gem to be unstable.
|
data/lib/raca/container.rb
CHANGED
@@ -58,6 +58,19 @@ module Raca
|
|
58
58
|
))
|
59
59
|
end
|
60
60
|
|
61
|
+
# Returns some metadata about a single object in this container.
|
62
|
+
#
|
63
|
+
def object_metadata(key)
|
64
|
+
object_path = File.join(container_path, key)
|
65
|
+
log "Requesting metadata from #{object_path}"
|
66
|
+
|
67
|
+
response = storage_request(Net::HTTP::Head.new(object_path))
|
68
|
+
{
|
69
|
+
:content_type => response["Content-Type"],
|
70
|
+
:bytes => response["Content-Length"].to_i
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
61
74
|
def download(key, filepath)
|
62
75
|
log "downloading #{key} from #{container_path}"
|
63
76
|
storage_request(Net::HTTP::Get.new(File.join(container_path, key))) do |response|
|