redaranj-right_aws 1.10.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +231 -0
- data/Manifest.txt +37 -0
- data/README.txt +164 -0
- data/Rakefile +103 -0
- data/lib/acf/right_acf_interface.rb +413 -0
- data/lib/awsbase/benchmark_fix.rb +39 -0
- data/lib/awsbase/right_awsbase.rb +903 -0
- data/lib/awsbase/support.rb +115 -0
- data/lib/ec2/right_ec2.rb +1837 -0
- data/lib/right_aws.rb +72 -0
- data/lib/s3/right_s3.rb +1094 -0
- data/lib/s3/right_s3_interface.rb +1185 -0
- data/lib/sdb/active_sdb.rb +930 -0
- data/lib/sdb/right_sdb_interface.rb +672 -0
- data/lib/sqs/right_sqs.rb +388 -0
- data/lib/sqs/right_sqs_gen2.rb +343 -0
- data/lib/sqs/right_sqs_gen2_interface.rb +521 -0
- data/lib/sqs/right_sqs_interface.rb +594 -0
- data/test/acf/test_helper.rb +2 -0
- data/test/acf/test_right_acf.rb +146 -0
- data/test/ec2/test_helper.rb +2 -0
- data/test/ec2/test_right_ec2.rb +108 -0
- data/test/http_connection.rb +87 -0
- data/test/s3/test_helper.rb +2 -0
- data/test/s3/test_right_s3.rb +419 -0
- data/test/s3/test_right_s3_stubbed.rb +95 -0
- data/test/sdb/test_active_sdb.rb +299 -0
- data/test/sdb/test_helper.rb +3 -0
- data/test/sdb/test_right_sdb.rb +247 -0
- data/test/sqs/test_helper.rb +2 -0
- data/test/sqs/test_right_sqs.rb +291 -0
- data/test/sqs/test_right_sqs_gen2.rb +276 -0
- data/test/test_credentials.rb +37 -0
- data/test/ts_right_aws.rb +14 -0
- metadata +100 -0
@@ -0,0 +1,115 @@
|
|
1
|
+
# If ActiveSupport is loaded, then great - use it. But we don't
|
2
|
+
# want a dependency on it, so if it's not present, define the few
|
3
|
+
# extensions that we want to use...
|
4
|
+
unless defined? ActiveSupport::CoreExtensions
|
5
|
+
# These are ActiveSupport-;like extensions to do a few handy things in the gems
|
6
|
+
# Derived from ActiveSupport, so the AS copyright notice applies:
|
7
|
+
#
|
8
|
+
#
|
9
|
+
#
|
10
|
+
# Copyright (c) 2005 David Heinemeier Hansson
|
11
|
+
#
|
12
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
13
|
+
# a copy of this software and associated documentation files (the
|
14
|
+
# "Software"), to deal in the Software without restriction, including
|
15
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
16
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
17
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
18
|
+
# the following conditions:
|
19
|
+
#
|
20
|
+
# The above copyright notice and this permission notice shall be
|
21
|
+
# included in all copies or substantial portions of the Software.
|
22
|
+
#
|
23
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
24
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
25
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
26
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
27
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
28
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
29
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
30
|
+
#++
|
31
|
+
#
|
32
|
+
#
|
33
|
+
class String #:nodoc:
|
34
|
+
|
35
|
+
# Constantize tries to find a declared constant with the name specified
|
36
|
+
# in the string. It raises a NameError when the name is not in CamelCase
|
37
|
+
# or is not initialized.
|
38
|
+
#
|
39
|
+
# Examples
|
40
|
+
# "Module".constantize #=> Module
|
41
|
+
# "Class".constantize #=> Class
|
42
|
+
def constantize()
|
43
|
+
unless /\A(?:::)?([A-Z]\w*(?:::[A-Z]\w*)*)\z/ =~ self
|
44
|
+
raise NameError, "#{self.inspect} is not a valid constant name!"
|
45
|
+
end
|
46
|
+
|
47
|
+
Object.module_eval("::#{$1}", __FILE__, __LINE__)
|
48
|
+
end
|
49
|
+
|
50
|
+
def camelize()
|
51
|
+
self.dup.split(/_/).map{ |word| word.capitalize }.join('')
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
class Object #:nodoc:
|
58
|
+
# "", " ", nil, [], and {} are blank
|
59
|
+
def blank?
|
60
|
+
if respond_to?(:empty?) && respond_to?(:strip)
|
61
|
+
empty? or strip.empty?
|
62
|
+
elsif respond_to?(:empty?)
|
63
|
+
empty?
|
64
|
+
else
|
65
|
+
!self
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
class NilClass #:nodoc:
|
71
|
+
def blank?
|
72
|
+
true
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
class FalseClass #:nodoc:
|
77
|
+
def blank?
|
78
|
+
true
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
class TrueClass #:nodoc:
|
83
|
+
def blank?
|
84
|
+
false
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
class Array #:nodoc:
|
89
|
+
alias_method :blank?, :empty?
|
90
|
+
end
|
91
|
+
|
92
|
+
class Hash #:nodoc:
|
93
|
+
alias_method :blank?, :empty?
|
94
|
+
|
95
|
+
# Return a new hash with all keys converted to symbols.
|
96
|
+
def symbolize_keys
|
97
|
+
inject({}) do |options, (key, value)|
|
98
|
+
options[key.to_sym] = value
|
99
|
+
options
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
class String #:nodoc:
|
105
|
+
def blank?
|
106
|
+
empty? || strip.empty?
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
class Numeric #:nodoc:
|
111
|
+
def blank?
|
112
|
+
false
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|