grempe-amazon-ec2 0.3.5 → 0.3.6

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.
Files changed (5) hide show
  1. data/CHANGELOG +8 -0
  2. data/Rakefile +5 -0
  3. data/lib/EC2.rb +6 -6
  4. data/test/test_EC2.rb +12 -0
  5. metadata +2 -2
data/CHANGELOG CHANGED
@@ -1,3 +1,11 @@
1
+ === 0.3.6 2009-03-02
2
+ * You can now specify any arbitrary SSL tcp port to connect to (kerryb)
3
+ * Added rake target to quickly install the gem without docs
4
+
5
+ === 0.3.5 2009-02-26
6
+ * Honor the EC2_URL env var if provided in the main lib
7
+ * Some minor modifications to the exceptions raised when unknown
8
+
1
9
  === 0.3.4 2009-01-31
2
10
  * Added support in the helper binaries for EC2_URL server url for Euro servers
3
11
  * AWS Signature v2 support
data/Rakefile CHANGED
@@ -16,6 +16,11 @@ task :install => [:package] do
16
16
  sh %{sudo gem install pkg/#{GEM}-#{VER}}
17
17
  end
18
18
 
19
+ desc "Package and then install the gem locally omitting documentation"
20
+ task :install_nodoc => [:package] do
21
+ sh %{sudo gem install --no-ri --no-rdoc pkg/#{GEM}-#{VER}}
22
+ end
23
+
19
24
  Rake::TestTask.new do |t|
20
25
  t.libs << "test"
21
26
  t.test_files = FileList['test/test*.rb']
data/lib/EC2.rb CHANGED
@@ -118,14 +118,14 @@ module EC2
118
118
  raise ArgumentError, "No :use_ssl value provided" if options[:use_ssl].nil?
119
119
  raise ArgumentError, "Invalid :use_ssl value provided, only 'true' or 'false' allowed" unless options[:use_ssl] == true || options[:use_ssl] == false
120
120
  raise ArgumentError, "No :server provided" if options[:server].nil? || options[:server].empty?
121
-
122
-
123
- # based on the :use_ssl boolean, determine which port we should connect to
124
- case @use_ssl
125
- when true
121
+
122
+ if options[:port]
123
+ # user-specified port
124
+ @port = options[:port]
125
+ elsif @use_ssl
126
126
  # https
127
127
  @port = 443
128
- when false
128
+ else
129
129
  # http
130
130
  @port = 80
131
131
  end
@@ -37,6 +37,18 @@ context "The EC2 method " do
37
37
  @ec2.server.should.equal "foo.example.com"
38
38
  end
39
39
 
40
+ specify "EC2::Base should allow specification of port" do
41
+ @ec2 = EC2::Base.new( :access_key_id => "not a key",
42
+ :secret_access_key => "not a secret",
43
+ :use_ssl => true,
44
+ :server => "foo.example.com",
45
+ :port => 8443 )
46
+
47
+ @ec2.use_ssl.should.equal true
48
+ @ec2.port.should.equal 8443
49
+ @ec2.server.should.equal "foo.example.com"
50
+ end
51
+
40
52
  specify "EC2.canonical_string(path) should conform to Amazon's requirements " do
41
53
  path = {"name1" => "value1", "name2" => "value2", "name3" => "value3"}
42
54
  if ENV['EC2_URL'].nil? || ENV['EC2_URL'] == 'https://ec2.amazonaws.com'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grempe-amazon-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glenn Rempe
@@ -23,7 +23,7 @@ dependencies:
23
23
  version: 1.0.11
24
24
  version:
25
25
  description: An interface library that allows Ruby applications to easily connect to the HTTP 'Query API' for the Amazon Web Services Elastic Compute Cloud (EC2) and manipulate cloud servers.
26
- email: glenn.rempe@gmail.com
26
+ email: glenn@rempe.us
27
27
  executables:
28
28
  - ec2-gem-example.rb
29
29
  - ec2sh