amazon-ec2 0.9.15 → 0.9.17

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -6,3 +6,6 @@ doc
6
6
  .yardoc
7
7
  pkg
8
8
  .idea
9
+ .bundle
10
+ .rvmrc
11
+ perftools
data/ChangeLog CHANGED
@@ -1,3 +1,28 @@
1
+ * (In progress) Close issue #22, allow detach_volume to take a boolean as a string or TrueClass FalseClass
2
+
3
+ === 0.9.17 2010-11-21
4
+ * Converted from Jeweler to Bundler, 'bundle install' to install dependencies
5
+ * Adding ability to launch t1.micro instances for ec2 regular and spot price instances
6
+ * Adding support for describe/modify/reset instance attributes with tests.
7
+ * Updated to API version : 2010-08-31
8
+ * Added experimental support for EC2 create_tags, describe_tags, delete_tags
9
+ * Added experimental Eucalyptus support, provide by Sang-Min Park from Eucalyptus.
10
+ * Instead of having hard coded "/" as URL path, the path can be given to as an option. Setup.rb is changed such that server, port, path, and use_ssl can be correctly set up.
11
+ * RDS :db_security_groups should be an Array, not a String.
12
+ * Use HmacSHA256 signatures instead of SHA1 (preferred by AWS and improves support for Eucalyptus)
13
+ * added AWS::EC2::Base#get_password_data for GetPasswordData API (Windows instances)
14
+ * Fix #26. Raise an exception immediately if the response is a 5xx Server Error.
15
+ * Applied experimental CloudWatch Monitoring Patch by fred-secludit, removes limitations on which server to connect to, and better handles statistics and dimensions.
16
+ * Changed AWS::EC2::Instance from a module to a class to help along an experiment by bdigital
17
+ * Zarro open boogs. Zarro Open pull requests. W00t
18
+
19
+ === 0.9.16 2010-07-07
20
+ * Less strict checking on which server endpoints you can pass in as an environment var.
21
+ * Moved ec2sh script to awshell to better reflect the more comprehensive nature of the gem.
22
+ * Better instructions on using awshell upon running
23
+ * awshell now sets up handles for all of the various services we use, not just @ec2 (+ @as, @rds, @elb, @cw)
24
+ * awshell prints out the various server endpoints that it will actually use in the shell (you can override with env vars).
25
+
1
26
  === 0.9.11 2010-04-23
2
27
  * RDS#create_db_instance : renamed misspelled :backend_retention_period option to :backup_retention_period.
3
28
  * Better handling of FixNum options in a few methods.
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in amazon-ec2.gemspec
4
+ gemspec
5
+
6
+
@@ -0,0 +1,29 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ amazon-ec2 (0.9.17)
5
+ xml-simple (>= 1.0.12)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ mocha (0.9.9)
11
+ rake
12
+ perftools.rb (0.5.4)
13
+ rake (0.8.7)
14
+ rcov (0.9.9)
15
+ test-spec (0.10.0)
16
+ xml-simple (1.0.12)
17
+ yard (0.6.2)
18
+
19
+ PLATFORMS
20
+ ruby
21
+
22
+ DEPENDENCIES
23
+ amazon-ec2!
24
+ mocha (>= 0.9.9)
25
+ perftools.rb (>= 0.5.4)
26
+ rcov (>= 0.9.9)
27
+ test-spec (>= 0.10.0)
28
+ xml-simple (>= 1.0.12)
29
+ yard (>= 0.6.2)
@@ -22,59 +22,32 @@ or the official EC2 website at http://aws.amazon.com/ec2
22
22
 
23
23
  == Installation
24
24
 
25
- This gem follows the standard conventions for installation on any system with Ruby and RubyGems installed. If you have worked with gems before this will look very familiar.
25
+ This gem follows the standard conventions for installation on any system with Ruby and RubyGems installed and uses Bundler for gem installation and build management. If you have worked with gems before this will look very familiar.
26
26
 
27
27
  === Get an AWS account
28
28
 
29
29
  Before you can make use of this gem you will need an Amazon Web Services developer account which you can sign up for at https://aws-portal.amazon.com/gp/aws/developer/registration/index.html. This account must also be specifically enabled for Amazon EC2 usage. AWS will provide you with an 'AWS Access Key ID' and a 'Secret Access Key' which will allow you to authenticate any API calls you make and ensure correct billing to you for usage of the service. Take note of these (and keep them secret!).
30
30
 
31
- === Install required gem pre-requisites
32
-
33
- The following gems should be installed automatically as part of your install of amazon-ec2. Most of them are needed for testing build dependencies but they should be painless to install even if you don't plan on running the tests or building this gem manually on your own.
34
-
35
- XmlSimple (required)
36
- Mocha (optional for testing)
37
- Rcov (optional for testing)
38
- Test-Spec (optional for testing)
39
-
40
-
41
31
  === Install the amazon-ec2 gem (Canonical Release)
42
32
 
43
- This is the standard install for stable releases from Gemcutter.
44
-
45
- # Install the stable release gem from Gemcutter (one time only) ( learn more here : http://gemcutter.org/pages/faq )
46
- sudo gem install gemcutter
47
-
48
- # Set Gemcutter to be your canonical gems source (one time only)
49
- sudo gem tumble
33
+ This is the standard install for stable releases from RubyGems.
50
34
 
51
35
  # Install the gem
52
- sudo gem install amazon-ec2
53
-
54
- # OR if you want to skip the Gemcutter setup
55
- sudo gem install amazon-ec2 -s http://gemcutter.org
36
+ [sudo] gem install amazon-ec2
56
37
 
57
38
 
58
39
  === Install from local Git clone (for amazon-ec2 developers)
59
40
 
60
- GitHub has unfortunately given up on the feature they had where they would build gems
61
- when pushed to git. Too bad. So to install from git, you'll need to clone and build.
41
+ To install from git for adding features or fixing bugs, you'll need to clone and build.
62
42
 
63
43
  git clone git://github.com/grempe/amazon-ec2.git
64
44
  cd amazon-ec2
65
- rake gemspec
45
+ bundle install
46
+ rake test
66
47
  rake build
67
48
  rake install
68
49
 
69
50
 
70
- === EXPERIMENTAL : Install the amazon-ec2 gem using Rip (for more bleeding edge versions)
71
-
72
- For those who intend to do development on the gem, or want the bleeding edge. Install Rip as described at hellorip.com.
73
-
74
- # (Experimental) Install using Rip (hellorip.com) instead of RubyGems
75
- rip install git://github.com/grempe/amazon-ec2.git
76
-
77
-
78
51
  == Using amazon-ec2
79
52
 
80
53
  The library exposes one main interface class AWS::EC2::Base. It is through an instance of this class that you will perform all the operations for using the EC2 service including query string header signing.
@@ -84,7 +57,7 @@ The public methods on AWS::EC2::Base closely mirror the EC2 Query API, and as su
84
57
 
85
58
  === Setting up
86
59
 
87
- The 'ec2sh' and 'ec2-gem-example.rb' scripts which will be introduced to you shortly expect your AWS EC2 credentials to be stored as shell environment variables which are accessible to those scripts. This makes them convenient to use whenever you need to do a quick query to see what images you have available to you, what's running now, or to start or stop an instance on EC2. You'll find 'ec2sh' to be a very handy tool. I'll describe only the OS X route for setting up (of course the setup steps will vary depending on your particular system and preferred shell). If you don't want to do it this way, feel free to copy these scripts from the gem dir to any location where you can run them from and modify them directly to include your credentials.
60
+ The 'awshell' and 'ec2-gem-example.rb' scripts which will be introduced to you shortly expect your AWS EC2 credentials to be stored as shell environment variables which are accessible to those scripts. This makes them convenient to use whenever you need to do a quick query to see what images you have available to you, what's running now, or to start or stop an instance on EC2. You'll find 'awshell' to be a very handy tool. I'll describe only the OS X route for setting up (of course the setup steps will vary depending on your particular system and preferred shell). If you don't want to do it this way, feel free to copy these scripts from the gem dir to any location where you can run them from and modify them directly to include your credentials.
88
61
 
89
62
  Edit the file ~/.bash_login and add the following to the existing contents:
90
63
 
@@ -130,16 +103,16 @@ An example Ruby script which exercises the library a bit more is installed for y
130
103
 
131
104
  Since we also package this sample file in the gem's bin/ dir you should also be able to run it from anywhere on your shell path (once you have set your environment variables as described above).
132
105
 
133
- ==== Using the 'ec2sh' command shell
106
+ ==== Using the 'awshell' command shell
134
107
 
135
- The 'ec2sh' command shell is actually a standard 'irb' Ruby shell, with the main difference being we read your AWS credentials from your environment and pre-configure a connection string for you. This lets you run any EC2 command very simply. This has proven to be a valuable tool during the development of this gem and you should try it out. Since we install this tool in your system path as part of the installation of this gem, you should be able to simply run 'ec2sh' from any terminal command prompt on your local system. You'll see some basic instructions for use, and a few examples when you start 'ec2sh'. Go ahead and try it out now. We'll wait...
108
+ The 'awshell' command shell is actually a standard 'irb' Ruby shell, with the main difference being we read your AWS credentials from your environment and pre-configure a connection string for you. This lets you run any EC2 command very simply. This has proven to be a valuable tool during the development of this gem and you should try it out. Since we install this tool in your system path as part of the installation of this gem, you should be able to simply run 'awshell' from any terminal command prompt on your local system. You'll see some basic instructions for use, and a few examples when you start 'awshell'. Go ahead and try it out now. We'll wait...
136
109
 
137
110
  If you're not in front of a terminal shell now (perhaps you're browsing this site on your iPhone) this is what you would see:
138
111
 
139
112
 
140
- hostname:/tmp/rails/amazon_test glenn$ ec2sh
113
+ hostname:/tmp/rails/amazon_test glenn$ awshell
141
114
 
142
- 'ec2sh' usage :
115
+ 'awshell' usage :
143
116
  This is an interactive 'irb' command shell that allows you to use all
144
117
  commands available to the amazon-ec2 gem. You'll find this to be a
145
118
  great tool to help you debug issues and practice running commands
@@ -191,7 +164,8 @@ Try out the following bit of code. This should walk through each image returned
191
164
 
192
165
  === Ruby on Rails usage example:
193
166
 
194
- <b>config/environment.rb</b>
167
+
168
+ <b>Rails 2.3.x - config/environment.rb</b>
195
169
 
196
170
  Rails::Initializer.run do |config|
197
171
  ...
@@ -200,6 +174,12 @@ Try out the following bit of code. This should walk through each image returned
200
174
  end
201
175
 
202
176
 
177
+ <b>Rails 3.x.x - Gemfile</b>
178
+
179
+ ...
180
+ gem "amazon-ec2", :require => "AWS"
181
+
182
+
203
183
  <b>app/controllers/my_controller.rb</b>
204
184
 
205
185
  [some controller code ...]
@@ -259,7 +239,7 @@ Try out the following bit of code. This should walk through each image returned
259
239
 
260
240
  === Important notes regarding the structure of AWS::Response Objects
261
241
 
262
- One of the key benefits of this new version of the library is that all responses from EC2 are bundled up in a real data structure and no longer require parsing of text. The hash returned is populated directly from the XML given to us by EC2 in response to any command we issue. This means that future changes to the API and what is returned by EC2 will be handled transparently by the gem. This is a huge benefit. What this means though, is that you may have to do a little homework on what actually gets returned by EC2 as XML. For example, when you make a #describe_images call in 'ec2sh' what AWS returns behind the scenes looks like:
242
+ One of the key benefits of this new version of the library is that all responses from EC2 are bundled up in a real data structure and no longer require parsing of text. The hash returned is populated directly from the XML given to us by EC2 in response to any command we issue. This means that future changes to the API and what is returned by EC2 will be handled transparently by the gem. This is a huge benefit. What this means though, is that you may have to do a little homework on what actually gets returned by EC2 as XML. For example, when you make a #describe_images call in 'awshell' what AWS returns behind the scenes looks like:
263
243
 
264
244
  <?xml version="1.0"?>
265
245
  <DescribeImagesResponse xmlns="http://ec2.amazonaws.com/doc/2007-01-19/">
@@ -316,7 +296,7 @@ So, for example, if you wanted to get the image ID of the third image listed in
316
296
  >> puts @ec2.describe_images(:owner_id => 'amazon').imagesSet.item[2].imageId
317
297
  ami-23b6534a
318
298
 
319
- EC2 will typically return sets of things (imagesSet, reservationSet, etc.) which we map to ruby Arrays (.imagesSet.item in the example above). If you want to iterate over a response set you will need to iterate over this array. The Arrays will typically contain additional AWS::Response objects that represent each individual item. You'll find that you can use the 'ec2sh' to help you understand the structure more completely if you try issuing commands there as a way to practice seeing what will be returned and making sure you get exactly what you want.
299
+ EC2 will typically return sets of things (imagesSet, reservationSet, etc.) which we map to ruby Arrays (.imagesSet.item in the example above). If you want to iterate over a response set you will need to iterate over this array. The Arrays will typically contain additional AWS::Response objects that represent each individual item. You'll find that you can use the 'awshell' to help you understand the structure more completely if you try issuing commands there as a way to practice seeing what will be returned and making sure you get exactly what you want.
320
300
 
321
301
  === Handling Exceptions
322
302
  If for some reason an error occurs when executing a method (e.g. its arguments were
@@ -355,11 +335,11 @@ Please follow these steps if you want to send a patch or a GitHub pull request:
355
335
  * Fork grempe/amazon-ec2
356
336
  * Create a topic branch: `git checkout -b my_fix`
357
337
  * Make sure you add tests for your changes and that they all pass with 'rake test'
358
- * Don't change files that you don't own like the gemspec or VERSION
338
+ * Don't change files that you don't own like the gemspec or version.rb
359
339
  * Commit your changes, one change/fix per commit
360
340
  * Push your fixes branch: `git push origin my_fix`
361
- * Open an Issue referencing your branch.
362
- * Please do not push to `master` on your fork. This will make everyone’s life easier.
341
+ * Open an Issue on GitHub referencing your branch and send a pull request.
342
+ * Please do not push to `master` on your fork. Using a feature/bugfix branch will make everyone’s life easier.
363
343
 
364
344
 
365
345
  Enjoy!
data/Rakefile CHANGED
@@ -1,26 +1,5 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "amazon-ec2"
8
- gem.summary = %Q{Amazon EC2 Ruby Gem}
9
- gem.description = %Q{A Ruby library for accessing the Amazon Web Services EC2, ELB, RDS, Cloudwatch, and Autoscaling APIs.}
10
- gem.email = "glenn@rempe.us"
11
- gem.homepage = "http://github.com/grempe/amazon-ec2"
12
- gem.authors = ["Glenn Rempe"]
13
- gem.rdoc_options = ["--title", "amazon-ec2 documentation", "--line-numbers", "--main", "README.rdoc"]
14
- gem.rubyforge_project = 'amazon-ec2'
15
- gem.add_dependency('xml-simple', '>= 1.0.12')
16
- gem.add_development_dependency('mocha', '>= 0.9.8')
17
- gem.add_development_dependency('test-spec', '>= 0.10.0')
18
- gem.add_development_dependency('rcov', '>= 0.9.6')
19
- gem.add_development_dependency('perftools.rb', '>= 0.3.9')
20
- end
21
- rescue LoadError
22
- puts "Jeweler (or a dependency) not available. Install it with: [sudo] gem install jeweler"
23
- end
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
24
3
 
25
4
  require 'rake/testtask'
26
5
  Rake::TestTask.new(:test) do |test|
@@ -71,7 +50,7 @@ end
71
50
 
72
51
  desc "Generate a perftools.rb profile"
73
52
  task :profile do
74
- system("CPUPROFILE=perftools/ec2prof RUBYOPT='-r/Library/Ruby/Gems/1.8/gems/perftools.rb-0.3.2/lib/perftools.bundle' ruby -r'rubygems' bin/ec2-gem-profile.rb")
53
+ system("CPUPROFILE=perftools/ec2prof RUBYOPT='-r/Users/glenn/.rvm/gems/ruby-1.8.7-p302@amazon-ec2/gems/perftools.rb-0.5.4/lib/perftools.bundle' ruby -r'rubygems' bin/ec2-gem-profile.rb")
75
54
  system("pprof.rb --text --ignore=Gem perftools/ec2prof > perftools/ec2prof-results.txt")
76
55
  system("pprof.rb --dot --ignore=Gem perftools/ec2prof > perftools/ec2prof-results.dot")
77
56
  end
@@ -1,151 +1,36 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "AWS/version"
5
4
 
6
5
  Gem::Specification.new do |s|
7
- s.name = %q{amazon-ec2}
8
- s.version = "0.9.15"
6
+ s.name = "amazon-ec2"
7
+ s.version = AWS::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Glenn Rempe"]
10
+ s.email = ["glenn@rempe.us"]
11
+ s.homepage = "http://github.com/grempe/amazon-ec2"
12
+ s.summary = "Amazon EC2 Ruby gem"
13
+ s.description = "A Ruby library for accessing the Amazon Web Services EC2, ELB, RDS, Cloudwatch, and Autoscaling APIs."
9
14
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Glenn Rempe"]
12
- s.date = %q{2010-06-10}
13
- s.description = %q{A Ruby library for accessing the Amazon Web Services EC2, ELB, RDS, Cloudwatch, and Autoscaling APIs.}
14
- s.email = %q{glenn@rempe.us}
15
- s.executables = ["ec2-gem-example.rb", "ec2-gem-profile.rb", "ec2sh", "setup.rb"]
15
+ s.rubyforge_project = "amazon-ec2"
16
+
17
+ s.rdoc_options = ["--title", "amazon-ec2 documentation", "--line-numbers", "--main", "README.rdoc"]
16
18
  s.extra_rdoc_files = [
17
19
  "ChangeLog",
18
- "LICENSE",
19
- "README.rdoc",
20
- "README_dev.rdoc"
21
- ]
22
- s.files = [
23
- ".gitignore",
24
- ".yardopts",
25
- "ChangeLog",
26
- "LICENSE",
27
- "README.rdoc",
28
- "README_dev.rdoc",
29
- "Rakefile",
30
- "VERSION",
31
- "amazon-ec2.gemspec",
32
- "bin/ec2-gem-example.rb",
33
- "bin/ec2-gem-profile.rb",
34
- "bin/ec2sh",
35
- "bin/setup.rb",
36
- "deps.rip",
37
- "lib/AWS.rb",
38
- "lib/AWS/Autoscaling.rb",
39
- "lib/AWS/Autoscaling/autoscaling.rb",
40
- "lib/AWS/Cloudwatch.rb",
41
- "lib/AWS/Cloudwatch/monitoring.rb",
42
- "lib/AWS/EC2.rb",
43
- "lib/AWS/EC2/availability_zones.rb",
44
- "lib/AWS/EC2/console.rb",
45
- "lib/AWS/EC2/devpay.rb",
46
- "lib/AWS/EC2/elastic_ips.rb",
47
- "lib/AWS/EC2/image_attributes.rb",
48
- "lib/AWS/EC2/images.rb",
49
- "lib/AWS/EC2/instances.rb",
50
- "lib/AWS/EC2/keypairs.rb",
51
- "lib/AWS/EC2/products.rb",
52
- "lib/AWS/EC2/security_groups.rb",
53
- "lib/AWS/EC2/snapshots.rb",
54
- "lib/AWS/EC2/spot_instance_requests.rb",
55
- "lib/AWS/EC2/spot_prices.rb",
56
- "lib/AWS/EC2/subnets.rb",
57
- "lib/AWS/EC2/volumes.rb",
58
- "lib/AWS/ELB.rb",
59
- "lib/AWS/ELB/load_balancers.rb",
60
- "lib/AWS/RDS.rb",
61
- "lib/AWS/RDS/rds.rb",
62
- "lib/AWS/exceptions.rb",
63
- "lib/AWS/responses.rb",
64
- "perftools/ec2prof",
65
- "perftools/ec2prof-results.dot",
66
- "perftools/ec2prof-results.txt",
67
- "perftools/ec2prof.symbols",
68
- "test/test_Autoscaling_groups.rb",
69
- "test/test_EC2.rb",
70
- "test/test_EC2_availability_zones.rb",
71
- "test/test_EC2_console.rb",
72
- "test/test_EC2_elastic_ips.rb",
73
- "test/test_EC2_image_attributes.rb",
74
- "test/test_EC2_images.rb",
75
- "test/test_EC2_instances.rb",
76
- "test/test_EC2_keypairs.rb",
77
- "test/test_EC2_products.rb",
78
- "test/test_EC2_responses.rb",
79
- "test/test_EC2_s3_xmlsimple.rb",
80
- "test/test_EC2_security_groups.rb",
81
- "test/test_EC2_snapshots.rb",
82
- "test/test_EC2_spot_instance_requests.rb",
83
- "test/test_EC2_spot_prices.rb",
84
- "test/test_EC2_subnets.rb",
85
- "test/test_EC2_volumes.rb",
86
- "test/test_ELB_load_balancers.rb",
87
- "test/test_RDS.rb",
88
- "test/test_helper.rb",
89
- "wsdl/2007-08-29.ec2.wsdl",
90
- "wsdl/2008-02-01.ec2.wsdl",
91
- "wsdl/2008-05-05.ec2.wsdl",
92
- "wsdl/2008-12-01.ec2.wsdl",
93
- "wsdl/2009-10-31.ec2.wsdl",
94
- "wsdl/2009-11-30.ec2.wsdl"
95
- ]
96
- s.homepage = %q{http://github.com/grempe/amazon-ec2}
97
- s.rdoc_options = ["--title", "amazon-ec2 documentation", "--line-numbers", "--main", "README.rdoc"]
98
- s.require_paths = ["lib"]
99
- s.rubyforge_project = %q{amazon-ec2}
100
- s.rubygems_version = %q{1.3.7}
101
- s.summary = %q{Amazon EC2 Ruby Gem}
102
- s.test_files = [
103
- "test/test_Autoscaling_groups.rb",
104
- "test/test_EC2.rb",
105
- "test/test_EC2_availability_zones.rb",
106
- "test/test_EC2_console.rb",
107
- "test/test_EC2_elastic_ips.rb",
108
- "test/test_EC2_image_attributes.rb",
109
- "test/test_EC2_images.rb",
110
- "test/test_EC2_instances.rb",
111
- "test/test_EC2_keypairs.rb",
112
- "test/test_EC2_products.rb",
113
- "test/test_EC2_responses.rb",
114
- "test/test_EC2_s3_xmlsimple.rb",
115
- "test/test_EC2_security_groups.rb",
116
- "test/test_EC2_snapshots.rb",
117
- "test/test_EC2_spot_instance_requests.rb",
118
- "test/test_EC2_spot_prices.rb",
119
- "test/test_EC2_subnets.rb",
120
- "test/test_EC2_volumes.rb",
121
- "test/test_ELB_load_balancers.rb",
122
- "test/test_helper.rb",
123
- "test/test_RDS.rb"
20
+ "LICENSE",
21
+ "README.rdoc"
124
22
  ]
125
23
 
126
- if s.respond_to? :specification_version then
127
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
128
- s.specification_version = 3
24
+ s.add_dependency('xml-simple', '>= 1.0.12')
25
+ s.add_development_dependency('mocha', '>= 0.9.9')
26
+ s.add_development_dependency('test-spec', '>= 0.10.0')
27
+ s.add_development_dependency('rcov', '>= 0.9.9')
28
+ s.add_development_dependency('perftools.rb', '>= 0.5.4')
29
+ s.add_development_dependency('yard', '>= 0.6.2')
129
30
 
130
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
131
- s.add_runtime_dependency(%q<xml-simple>, [">= 1.0.12"])
132
- s.add_development_dependency(%q<mocha>, [">= 0.9.8"])
133
- s.add_development_dependency(%q<test-spec>, [">= 0.10.0"])
134
- s.add_development_dependency(%q<rcov>, [">= 0.9.6"])
135
- s.add_development_dependency(%q<perftools.rb>, [">= 0.3.9"])
136
- else
137
- s.add_dependency(%q<xml-simple>, [">= 1.0.12"])
138
- s.add_dependency(%q<mocha>, [">= 0.9.8"])
139
- s.add_dependency(%q<test-spec>, [">= 0.10.0"])
140
- s.add_dependency(%q<rcov>, [">= 0.9.6"])
141
- s.add_dependency(%q<perftools.rb>, [">= 0.3.9"])
142
- end
143
- else
144
- s.add_dependency(%q<xml-simple>, [">= 1.0.12"])
145
- s.add_dependency(%q<mocha>, [">= 0.9.8"])
146
- s.add_dependency(%q<test-spec>, [">= 0.10.0"])
147
- s.add_dependency(%q<rcov>, [">= 0.9.6"])
148
- s.add_dependency(%q<perftools.rb>, [">= 0.3.9"])
149
- end
31
+ s.files = `git ls-files`.split("\n")
32
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
33
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
34
+ s.require_paths = ["lib"]
150
35
  end
151
36
 
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Amazon Web Services EC2 Query API Ruby library
4
+ #
5
+ # Ruby Gem Name:: amazon-ec2
6
+ # Author:: Glenn Rempe (mailto:glenn@rempe.us)
7
+ # Copyright:: Copyright (c) 2007-2010 Glenn Rempe
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://github.com/grempe/amazon-ec2/tree/master
10
+ #++
11
+
12
+ # CREDITS : Credit for this bit of shameful ripoff coolness
13
+ # goes to Marcel Molina and his AWS::S3 gem. Thanks!
14
+
15
+ aws_lib = File.dirname(__FILE__) + '/../lib/AWS'
16
+ setup = File.dirname(__FILE__) + '/setup'
17
+ irb_name = RUBY_PLATFORM =~ /mswin32/ ? 'irb.bat' : 'irb'
18
+
19
+ welcome_message = <<-MESSAGE
20
+
21
+ Usage :
22
+
23
+ This is an interactive Ruby 'irb' shell that allows you to use the
24
+ AWS commands available in the 'amazon-ec2' gem. This can be a
25
+ great tool to help you debug issues and run commands
26
+ against the live AWS servers. You can do anything in this
27
+ shell that you can in a normal irb shell.
28
+
29
+ Config :
30
+
31
+ You must set the following environment variables that contain your
32
+ AWS credentials in your system shell for this to work.
33
+
34
+ AMAZON_ACCESS_KEY_ID
35
+ AMAZON_SECRET_ACCESS_KEY
36
+
37
+ Each AWS service has its own default server endpoints. You can override
38
+ the endpoints with the following environment variables set in your
39
+ system shell:
40
+
41
+ EC2 : EC2_URL
42
+ Elastic Load Balancing : ELB_URL
43
+ AutoScaling : AS_URL
44
+ RDS : RDS_URL
45
+ CloudWatch : AWS_CLOUDWATCH_URL
46
+
47
+ For your convenience, the various AWS services are wired up in this shell
48
+ to the following class variables. You can execute methods on each of these:
49
+
50
+ @ec2 (Elastic Compute Cloud)
51
+ @elb (Elastic Load Balancing)
52
+ @as (AutoScaling)
53
+ @rds (Relational Database Service)
54
+ @cw (CloudWatch)
55
+
56
+ You can make method calls on these instances to execute commands against
57
+ the various services. Pre-pending a 'pp' should give you a pretty printed
58
+ version of the response which may be easier to read.
59
+
60
+ Examples:
61
+
62
+ returns : Pretty Print all ec2 public methods
63
+ >> pp @ec2.methods.sort
64
+
65
+ returns : Pretty Print a Hash describing your EC2 images
66
+ >> @ec2.describe_images(:owner_id => ['self'])
67
+
68
+ returns : an Array of AWS::Response objects, each an EC2 image and its data
69
+ >> @ec2.describe_images(:owner_id => ['self']).imagesSet.item
70
+ >> @ec2.describe_images(:owner_id => ['self']).imagesSet.item[0]
71
+
72
+ MESSAGE
73
+
74
+ if ( ENV['AMAZON_ACCESS_KEY_ID'] && ENV['AMAZON_SECRET_ACCESS_KEY'] )
75
+ puts welcome_message
76
+ exec "#{irb_name} -rubygems -r #{aws_lib} -r #{setup} --simple-prompt"
77
+ else
78
+ puts "You must define AMAZON_ACCESS_KEY_ID and AMAZON_SECRET_ACCESS_KEY as shell environment variables before running #{$0}!"
79
+ puts welcome_message
80
+ end
81
+