jzimmek-ec2 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.11
1
+ 0.0.12
data/ec2.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ec2}
8
- s.version = "0.0.11"
8
+ s.version = "0.0.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jan Zimmek"]
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "lib/ec2/instance_binding.rb",
26
26
  "lib/ec2/manager.rb",
27
27
  "lib/ec2/pending.rb",
28
+ "lib/ec2/ssh_proxy.rb",
28
29
  "lib/ec2_init.rb",
29
30
  "test/ec2_test.rb",
30
31
  "test/test_helper.rb"
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'active_support'
3
3
  require 'net/ssh'
4
4
  require 'net/scp'
5
+ require 'ec2/ssh_proxy'
5
6
 
6
7
  module Ec2
7
8
  class InstanceBinding
@@ -19,7 +20,8 @@ module Ec2
19
20
  @public_dns_name = public_dns_name
20
21
  @private_dns_name = private_dns_name
21
22
 
22
- @ssh = Net::SSH.start(@public_dns_name, "root", :keys => [@cloud.ssh_key_file], :paranoid => false)
23
+ ssh = Net::SSH.start(@public_dns_name, "root", :keys => [@cloud.ssh_key_file], :paranoid => false)
24
+ @ssh = Ec2::SshProxy.new(self, ssh)
23
25
 
24
26
  @fqdn = fetch_from_file("/root/.fqdn")
25
27
 
@@ -0,0 +1,17 @@
1
+ module Ec2
2
+
3
+ class SshProxy < BlankSlate
4
+
5
+ def initialize(binding, target)
6
+ @binding = binding
7
+ @target = target
8
+ end
9
+
10
+ def method_missing(name, *args, &block)
11
+ puts "#{@binding.fqdn} running #{name} - #{args.inspect}"
12
+ @target.send name, *args, &block
13
+ end
14
+
15
+ end
16
+
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jzimmek-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Zimmek
@@ -32,6 +32,7 @@ files:
32
32
  - lib/ec2/instance_binding.rb
33
33
  - lib/ec2/manager.rb
34
34
  - lib/ec2/pending.rb
35
+ - lib/ec2/ssh_proxy.rb
35
36
  - lib/ec2_init.rb
36
37
  - test/ec2_test.rb
37
38
  - test/test_helper.rb