hugo 0.3.2 → 0.3.4

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.
data/lib/hugo/app.rb CHANGED
@@ -203,7 +203,7 @@ private
203
203
  :zone => zone || ZONE,
204
204
  :image_id => image_id || AMI,
205
205
  :key_name => key_name,
206
- :security_group => "default").create
206
+ :security_group => security_group || "default").create
207
207
 
208
208
  new_ec2 = nil
209
209
  sleep 10
data/lib/hugo/aws/ec2.rb CHANGED
@@ -40,10 +40,10 @@ module Hugo
40
40
  @status = "unknown"
41
41
  end
42
42
 
43
- # @security_group = options[:security_group] || nil
44
- # if options["groupSet"] and options["groupSet"]["item"] and options["groupSet"]["item"][0]
45
- # @security_group = options["groupSet"]["item"][0]["groupId"]
46
- # end
43
+ @security_group = options[:security_group] || "default"
44
+ if options["groupSet"] and options["groupSet"]["item"] and options["groupSet"]["item"][0]
45
+ @security_group = options["groupSet"]["item"][0]["groupId"]
46
+ end
47
47
 
48
48
  end
49
49
 
@@ -52,7 +52,8 @@ module Hugo
52
52
  @ec2 = AWS::EC2::Base.new(:access_key_id => ACCESS_KEY, :secret_access_key => SECRET_KEY)
53
53
  result = @ec2.run_instances(:image_id => self.image_id, :key_name => self.key_name,
54
54
  :max_count => 1,
55
- :availability_zone => self.zone) unless self.create_time
55
+ :availability_zone => self.zone,
56
+ :security_group => self.security_group) unless self.create_time
56
57
  set_attributes(result.instancesSet.item[0]) if result.instancesSet.item[0]
57
58
  self
58
59
  end
@@ -74,27 +75,27 @@ module Hugo
74
75
  ssh.exec!("echo \"#{dna.to_json.gsub('"','\"')}\" > ~/dna.json")
75
76
  end
76
77
  commands.each do |cmd|
77
- puts ssh.exec!(cmd)
78
+ print ssh.exec!(cmd)
78
79
  end
79
80
  end
80
81
  rescue
81
82
  end
82
83
  end
83
84
 
84
- def self.find_or_create_security_group(name, description)
85
- @ec2 = AWS::EC2::Base.new(:access_key_id => ACCESS_KEY, :secret_access_key => SECRET_KEY)
86
- begin
87
- @security_groups = @ec2.describe_security_groups(:group_name => name)
88
- rescue
89
- @security_groups = @ec2.create_security_group(:group_name => name, :group_description => description)
90
- end
91
- @security_groups
92
- end
93
-
94
- def self.destroy_security_group(name)
95
- @ec2 = AWS::EC2::Base.new(:access_key_id => ACCESS_KEY, :secret_access_key => SECRET_KEY)
96
- @ec2.delete_security_group(:group_name => name)
97
- end
85
+ # def self.find_or_create_security_group(name, description)
86
+ # @ec2 = AWS::EC2::Base.new(:access_key_id => ACCESS_KEY, :secret_access_key => SECRET_KEY)
87
+ # begin
88
+ # @security_groups = @ec2.describe_security_groups(:group_name => name)
89
+ # rescue
90
+ # @security_groups = @ec2.create_security_group(:group_name => name, :group_description => description)
91
+ # end
92
+ # @security_groups
93
+ # end
94
+ #
95
+ # def self.destroy_security_group(name)
96
+ # @ec2 = AWS::EC2::Base.new(:access_key_id => ACCESS_KEY, :secret_access_key => SECRET_KEY)
97
+ # @ec2.delete_security_group(:group_name => name)
98
+ # end
98
99
 
99
100
  def self.all
100
101
  @ec2 = AWS::EC2::Base.new(:access_key_id => ACCESS_KEY, :secret_access_key => SECRET_KEY)
data/lib/hugo/cloud.rb CHANGED
@@ -60,10 +60,10 @@ class Hugo::Cloud
60
60
  if db
61
61
  puts <<REPORT
62
62
  ------------------------
63
- DATABASE: #{db.db}
64
- User: #{db.user}
65
- Password: #{db.password}
66
- Uri: #{db.uri}
63
+ DATABASE: #{db.info[:name]}
64
+ User: #{db.info[:user]}
65
+ Password: #{db.info[:password]}
66
+ Uri: #{db.info[:uri]}
67
67
  REPORT
68
68
  end
69
69
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hugo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Wilson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-02-18 00:00:00 -05:00
13
+ date: 2010-02-25 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency