raca 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.markdown +12 -1
  3. data/lib/raca/container.rb +13 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41701304d4625b6d3f99be830e6b5aa1facf6875
4
- data.tar.gz: eadc909441d33e2b46270ff08f1c7762d424393b
3
+ metadata.gz: 96ffbbfd74e51b99894091ce939cb3521766e52c
4
+ data.tar.gz: 0551b2e01de644084a4099a984a25c90e6add01c
5
5
  SHA512:
6
- metadata.gz: d52aca857ce76407dd7f3fc83ff1eb044627eb3054e397eee46787f467eacd1764147750847b6a5e3be635b63b4c120a7e9b6b8b4bf3d7e9f8bfeb95253a78b1
7
- data.tar.gz: a46a22b4169f9a7d888633cc402b68634fae716d007a10bcca21cc9c2cd72c5ac5468289ecdb911b0d1b230596e5765ff148a937b50a23fa7a079c5f266a95a7
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 0.0.x because it's highly unstable. Until we release
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.
@@ -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|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Healy