diff --git a/Gemfile.lock b/Gemfile.lock index 13ae2ac..932e48f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,13 +8,12 @@ GEM remote: http://rubygems.org/ specs: mocha (0.9.9) - rake - rake (0.8.7) + rake (0.9.2.2) rcov (0.9.9) test-spec (0.10.0) test-unit (2.1.2) xml-simple (1.0.12) - yard (0.6.2) + yard (0.8.2.1) PLATFORMS ruby @@ -22,6 +21,7 @@ PLATFORMS DEPENDENCIES amazon-ec2! mocha (>= 0.9.9) + rake (>= 0.8.7) rcov (>= 0.9.9) test-spec (>= 0.10.0) test-unit (>= 2.1.2) diff --git a/amazon-ec2.gemspec b/amazon-ec2.gemspec index 835ac37..db25725 100644 --- a/amazon-ec2.gemspec +++ b/amazon-ec2.gemspec @@ -26,6 +26,7 @@ Gem::Specification.new do |s| s.add_development_dependency('test-unit', '>= 2.1.2') s.add_development_dependency('test-spec', '>= 0.10.0') s.add_development_dependency('rcov', '>= 0.9.9') + s.add_development_dependency('rake', '>= 0.8.7') # s.add_development_dependency('perftools.rb', '>= 0.5.4') s.add_development_dependency('yard', '>= 0.6.2') diff --git a/lib/AWS/EC2/instances.rb b/lib/AWS/EC2/instances.rb index 71f7653..d234a06 100644 --- a/lib/AWS/EC2/instances.rb +++ b/lib/AWS/EC2/instances.rb @@ -37,7 +37,7 @@ def run_instances( options = {} ) raise ArgumentError, ":image_id must be provided" if options[:image_id].nil? || options[:image_id].empty? raise ArgumentError, ":min_count is not valid" unless options[:min_count].to_i > 0 raise ArgumentError, ":max_count is not valid or must be >= :min_count" unless options[:max_count].to_i > 0 && options[:max_count].to_i >= options[:min_count].to_i - raise ArgumentError, ":instance_type must specify a valid instance type" unless options[:instance_type].nil? || ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge"].include?(options[:instance_type]) + raise ArgumentError, ":instance_type must specify a valid instance type" unless options[:instance_type].nil? || ["t1.micro", "m1.small", "m1.medium", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge"].include?(options[:instance_type]) raise ArgumentError, ":monitoring_enabled must be 'true' or 'false'" unless options[:monitoring_enabled].nil? || [true, false].include?(options[:monitoring_enabled]) raise ArgumentError, ":disable_api_termination must be 'true' or 'false'" unless options[:disable_api_termination].nil? || [true, false].include?(options[:disable_api_termination]) raise ArgumentError, ":instance_initiated_shutdown_behavior must be 'stop' or 'terminate'" unless options[:instance_initiated_shutdown_behavior].nil? || ["stop", "terminate"].include?(options[:instance_initiated_shutdown_behavior])