Module: Rudy::AWS

Extended by:
AWS
Included in:
AWS
Defined in:
lib/rudy/aws.rb,
lib/rudy/aws/s3.rb,
lib/rudy/aws/ec2.rb,
lib/rudy/aws/sdb.rb,
lib/rudy/aws/ec2/zone.rb,
lib/rudy/aws/ec2/group.rb,
lib/rudy/aws/ec2/image.rb,
lib/rudy/aws/sdb/error.rb,
lib/rudy/aws/ec2/volume.rb,
lib/rudy/aws/ec2/address.rb,
lib/rudy/aws/ec2/keypair.rb,
lib/rudy/aws/ec2/instance.rb,
lib/rudy/aws/ec2/snapshot.rb

Defined Under Namespace

Modules: EC2, ObjectBase Classes: Error, S3, SDB

Constant Summary collapse

VALID_REGIONS =
['eu-west-1', 'us-east-1'].freeze

Instance Method Summary collapse

Instance Method Details

#escape(str) ⇒ Object

Modifies str by removing [\0\n\r\032\\] and escaping [\'\"]



17
18
19
# File 'lib/rudy/aws.rb', line 17

def escape(str)
  str.to_s.tr("[\0\n\r\032\\\\]", '').gsub(/([\'\"])/, '\\1\\1')
end

#escape!(str) ⇒ Object



20
21
22
# File 'lib/rudy/aws.rb', line 20

def escape!(str)
  str.to_s.tr!("[\0\n\r\032\\\\]", '').gsub!(/([\'\"])/, '\\1\\1')
end

#valid_region?(r) ⇒ Boolean

Returns:

  • (Boolean)


14
# File 'lib/rudy/aws.rb', line 14

def valid_region?(r); VALID_REGIONS.member?(r.to_s || ''); end