hugo 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -290,7 +290,7 @@ private
290
290
  end
291
291
 
292
292
  def ec2(instance_id)
293
- Hugo::Aws::Ec2.find(instance, aws_access_key_id, aws_secret_access_key)
293
+ Hugo::Aws::Ec2.find(instance_id, @aws_access_key_id, @aws_secret_access_key)
294
294
  end
295
295
 
296
296
 
@@ -108,6 +108,7 @@ module Hugo
108
108
  end
109
109
 
110
110
  def self.find(instance, access_key_id, secret_access_key)
111
+ raise ArgumentError, "Instance Required" unless instance
111
112
  @ec2 = AWS::EC2::Base.new(:access_key_id => access_key_id, :secret_access_key => secret_access_key)
112
113
  self.new(@ec2.describe_instances(:instance_id => instance).reservationSet.item[0].instancesSet.item[0])
113
114
  end
@@ -119,7 +120,7 @@ module Hugo
119
120
 
120
121
  def self.find_or_create(options)
121
122
  if options[:name]
122
- self.find(options[:name])
123
+ self.find(options[:name], options[:access_key_id], options[:secret_access_key])
123
124
  else
124
125
  self.new(options).create
125
126
  end
@@ -99,7 +99,7 @@ module Hugo
99
99
 
100
100
  private
101
101
  def elb
102
- AWS::ELB::Base.new(:access_key_id => @aws_access_key_id, :secret_access_key => @aws_secret_access_key)
102
+ AWS::ELB::Base.new(:access_key_id => self.aws_access_key_id, :secret_access_key => self.aws_secret_access_key)
103
103
  end
104
104
 
105
105
  end
@@ -88,7 +88,7 @@ Balancer: #{lb.name}
88
88
  REPORT
89
89
 
90
90
  lb.instances.each do |i|
91
- ec2 = Hugo::Aws::Ec2.find(i)
91
+ ec2 = Hugo::Aws::Ec2.find(i, @aws_access_key_id, @aws_secret_access_key)
92
92
  puts <<REPORT
93
93
  -----------------------
94
94
  Id: #{ec2.name}
@@ -99,7 +99,7 @@ Zone: #{ec2.zone}
99
99
  REPORT
100
100
  end
101
101
  else
102
- ec2 = Hugo::Aws::Ec2.find(cloud_app.instance)
102
+ ec2 = Hugo::Aws::Ec2.find(cloud_app.instance, @aws_access_key_id, @aws_secret_access_key)
103
103
  puts <<REPORT
104
104
 
105
105
  Since you are not running a balancer
@@ -48,6 +48,9 @@ class Hugo::Database
48
48
  @user = nil
49
49
  @password = nil
50
50
  @server = nil
51
+ @aws_access_key_id = nil
52
+ @aws_secret_access_key = nil
53
+
51
54
  end
52
55
 
53
56
  def help
@@ -94,7 +94,10 @@ describe Hugo::Database do
94
94
  db.name "mydb"
95
95
  db.user "admin"
96
96
  db.password "test"
97
+ db.aws_access_key_id '12'
98
+ db.aws_secret_access_key '34'
97
99
  db.deploy.should be_a_kind_of(Hugo::Database)
100
+ db.clear
98
101
  end
99
102
 
100
103
  it "should clear required attributes" do
@@ -123,12 +126,15 @@ describe Hugo::Database do
123
126
  db.name "mydb"
124
127
  db.user "admin"
125
128
  db.password "test"
129
+ db.aws_access_key_id '12'
130
+ db.aws_secret_access_key '34'
131
+
126
132
  db.deploy
127
133
  db.info[:user].should == "user"
128
134
  db.info[:password].should == "test"
129
135
  db.info[:uri].should == "test.cwrzj6lxowfj.us-east-1.rds.amazonaws.com"
130
136
  db.info[:name].should == "mydb"
131
-
137
+ db.clear
132
138
  end
133
139
 
134
140
 
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hugo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 4
8
+ - 1
9
+ version: 0.4.1
5
10
  platform: ruby
6
11
  authors:
7
12
  - Tom Wilson
@@ -10,69 +15,87 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2010-03-07 00:00:00 -05:00
18
+ date: 2010-03-08 00:00:00 -05:00
14
19
  default_executable:
15
20
  dependencies:
16
21
  - !ruby/object:Gem::Dependency
17
22
  name: amazon-ec2
18
- type: :runtime
19
- version_requirement:
20
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
21
25
  requirements:
22
26
  - - ">="
23
27
  - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
24
30
  version: "0"
25
- version:
31
+ type: :runtime
32
+ version_requirements: *id001
26
33
  - !ruby/object:Gem::Dependency
27
34
  name: net-ssh
28
- type: :runtime
29
- version_requirement:
30
- version_requirements: !ruby/object:Gem::Requirement
35
+ prerelease: false
36
+ requirement: &id002 !ruby/object:Gem::Requirement
31
37
  requirements:
32
38
  - - ">="
33
39
  - !ruby/object:Gem::Version
40
+ segments:
41
+ - 0
34
42
  version: "0"
35
- version:
43
+ type: :runtime
44
+ version_requirements: *id002
36
45
  - !ruby/object:Gem::Dependency
37
46
  name: json
38
- type: :runtime
39
- version_requirement:
40
- version_requirements: !ruby/object:Gem::Requirement
47
+ prerelease: false
48
+ requirement: &id003 !ruby/object:Gem::Requirement
41
49
  requirements:
42
50
  - - ">="
43
51
  - !ruby/object:Gem::Version
52
+ segments:
53
+ - 0
44
54
  version: "0"
45
- version:
55
+ type: :runtime
56
+ version_requirements: *id003
46
57
  - !ruby/object:Gem::Dependency
47
58
  name: amazon-ec2
48
- type: :runtime
49
- version_requirement:
50
- version_requirements: !ruby/object:Gem::Requirement
59
+ prerelease: false
60
+ requirement: &id004 !ruby/object:Gem::Requirement
51
61
  requirements:
52
62
  - - ">="
53
63
  - !ruby/object:Gem::Version
64
+ segments:
65
+ - 0
66
+ - 7
67
+ - 5
54
68
  version: 0.7.5
55
- version:
69
+ type: :runtime
70
+ version_requirements: *id004
56
71
  - !ruby/object:Gem::Dependency
57
72
  name: json
58
- type: :runtime
59
- version_requirement:
60
- version_requirements: !ruby/object:Gem::Requirement
73
+ prerelease: false
74
+ requirement: &id005 !ruby/object:Gem::Requirement
61
75
  requirements:
62
76
  - - ">="
63
77
  - !ruby/object:Gem::Version
78
+ segments:
79
+ - 1
80
+ - 2
81
+ - 0
64
82
  version: 1.2.0
65
- version:
83
+ type: :runtime
84
+ version_requirements: *id005
66
85
  - !ruby/object:Gem::Dependency
67
86
  name: net-ssh
68
- type: :runtime
69
- version_requirement:
70
- version_requirements: !ruby/object:Gem::Requirement
87
+ prerelease: false
88
+ requirement: &id006 !ruby/object:Gem::Requirement
71
89
  requirements:
72
90
  - - ">="
73
91
  - !ruby/object:Gem::Version
92
+ segments:
93
+ - 2
94
+ - 0
95
+ - 16
74
96
  version: 2.0.16
75
- version:
97
+ type: :runtime
98
+ version_requirements: *id006
76
99
  description: Deploy your apps to the EC2 cloud.
77
100
  email: tom@jackhq.com
78
101
  executables: []
@@ -107,18 +130,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
130
  requirements:
108
131
  - - ">="
109
132
  - !ruby/object:Gem::Version
133
+ segments:
134
+ - 0
110
135
  version: "0"
111
- version:
112
136
  required_rubygems_version: !ruby/object:Gem::Requirement
113
137
  requirements:
114
138
  - - ">="
115
139
  - !ruby/object:Gem::Version
140
+ segments:
141
+ - 0
116
142
  version: "0"
117
- version:
118
143
  requirements: []
119
144
 
120
145
  rubyforge_project:
121
- rubygems_version: 1.3.5
146
+ rubygems_version: 1.3.6
122
147
  signing_key:
123
148
  specification_version: 3
124
149
  summary: Deploy Your Rack Apps to EC2 Cloud