ey_cloud_awareness 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ey_cloud_awareness}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Seamus Abshere"]
12
- s.date = %q{2009-11-04}
12
+ s.date = %q{2009-11-05}
13
13
  s.description = %q{Make your EngineYard cloud instances aware of each other.}
14
14
  s.email = %q{seamus@abshere.net}
15
15
  s.extra_rdoc_files = [
@@ -1,11 +1,11 @@
1
1
  require 'open-uri'
2
2
  require 'set'
3
3
  require 'active_support'
4
- require 'right_aws'
4
+ require 'right_aws' # See aws-s3 compatibility hack below
5
5
  require File.expand_path(File.join(File.dirname(__FILE__), 'engine_yard_cloud_instance'))
6
6
 
7
- # http://pragmatig.wordpress.com/2009/04/14/recursive-symbolize_keys/
8
7
  class Hash
8
+ # http://pragmatig.wordpress.com/2009/04/14/recursive-symbolize_keys/
9
9
  def recursive_symbolize_keys!
10
10
  symbolize_keys!
11
11
  values.select { |v| v.is_a?(Hash) }.each { |h| h.recursive_symbolize_keys! }
@@ -13,6 +13,35 @@ class Hash
13
13
  end
14
14
 
15
15
  def deep_copy
16
- Marshal.load(Marshal.dump(self))
16
+ Marshal.load Marshal.dump(self)
17
+ end
18
+ end
19
+
20
+ # sabshere 11/05/09
21
+ # Compatibility hack for aws-s3/right_aws
22
+ # Apologies for rescuing instead of directly checking arity
23
+ # I couldn't figure out how to do that because we don't have Module#instance_method
24
+ # ... and the class has overridden Object#method (=> "GET"/"POST"/etc)
25
+ module Net
26
+ class HTTPGenericRequest
27
+ def exec(sock, ver, path, send_only = nil) #:nodoc: internal use only
28
+ if @body
29
+ begin
30
+ send_request_with_body sock, ver, path, @body, send_only
31
+ rescue ArgumentError
32
+ $stderr.puts "[EY CLOUD AWARENESS GEM] Rescued from #{$!} because we thought it might have to do with aws-s3/right_aws incompatibility"
33
+ send_request_with_body sock, ver, path, @body
34
+ end
35
+ elsif @body_stream
36
+ begin
37
+ send_request_with_body_stream sock, ver, path, @body_stream, send_only
38
+ rescue ArgumentError
39
+ $stderr.puts "[EY CLOUD AWARENESS GEM] Rescued from #{$!} because we thought it might have to do with aws-s3/right_aws incompatibility"
40
+ send_request_with_body_stream sock, ver, path, @body_stream
41
+ end
42
+ else
43
+ write_header sock, ver, path
44
+ end
45
+ end
17
46
  end
18
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ey_cloud_awareness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seamus Abshere
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-04 00:00:00 -05:00
12
+ date: 2009-11-05 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency