dew 0.1.13 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,9 +34,10 @@ class EnvironmentsCommand < Clamp::Command
34
34
  subcommand "show", "Show environment" do
35
35
 
36
36
  parameter "ENVIRONMENT_NAME", "Name of the environment"
37
-
37
+ option ['-j', '--json'], :flag, "Output as JSON", :default => false
38
+
38
39
  def execute
39
- controller.show(environment_name)
40
+ controller.show(environment_name, :json => json?)
40
41
  end
41
42
 
42
43
  end
@@ -20,10 +20,10 @@ class EnvironmentsController
20
20
  Environment.index
21
21
  end
22
22
 
23
- def show(name)
23
+ def show(name, options = {})
24
24
  before_get_environment name
25
25
 
26
- @environment.show
26
+ @environment.show(options)
27
27
  end
28
28
 
29
29
  def destroy name, opts={}
@@ -57,7 +57,9 @@ class Environment
57
57
  Inform.info View.new('Environments', owners, %w(name owner)).index
58
58
  end
59
59
 
60
- def show
60
+ def show(options = {})
61
+ return show_json if options[:json]
62
+
61
63
  result = ""
62
64
 
63
65
  result << "ENVIRONMENT:\n"
@@ -85,6 +87,17 @@ class Environment
85
87
 
86
88
  Inform.info result
87
89
  end
90
+
91
+ def show_json
92
+ json = servers.map do |s|
93
+ {
94
+ 'public_dns' => s.dns_name,
95
+ 'public_ip' => s.public_ip_address
96
+ }
97
+ end
98
+
99
+ puts JSON.pretty_generate(json)
100
+ end
88
101
 
89
102
  def destroy
90
103
  servers.each do |server|
@@ -1,3 +1,3 @@
1
1
  module Dew
2
- VERSION = "0.1.13"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,299 +1,293 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: dew
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
4
5
  prerelease:
5
- version: 0.1.13
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - PlayUp Devops
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-08-15 00:00:00 +10:00
12
+ date: 2011-08-24 00:00:00.000000000 +10:00
14
13
  default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
17
16
  name: inform
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &15304020 !ruby/object:Gem::Requirement
20
18
  none: false
21
- requirements:
19
+ requirements:
22
20
  - - ~>
23
- - !ruby/object:Gem::Version
21
+ - !ruby/object:Gem::Version
24
22
  version: 0.0.4
25
23
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: clamp
29
24
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *15304020
26
+ - !ruby/object:Gem::Dependency
27
+ name: clamp
28
+ requirement: &15303520 !ruby/object:Gem::Requirement
31
29
  none: false
32
- requirements:
30
+ requirements:
33
31
  - - ~>
34
- - !ruby/object:Gem::Version
32
+ - !ruby/object:Gem::Version
35
33
  version: 0.2.2
36
34
  type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: fog
40
35
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
36
+ version_requirements: *15303520
37
+ - !ruby/object:Gem::Dependency
38
+ name: fog
39
+ requirement: &15303060 !ruby/object:Gem::Requirement
42
40
  none: false
43
- requirements:
41
+ requirements:
44
42
  - - ~>
45
- - !ruby/object:Gem::Version
43
+ - !ruby/object:Gem::Version
46
44
  version: 0.8.2
47
45
  type: :runtime
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: gofer
51
46
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
47
+ version_requirements: *15303060
48
+ - !ruby/object:Gem::Dependency
49
+ name: gofer
50
+ requirement: &15302600 !ruby/object:Gem::Requirement
53
51
  none: false
54
- requirements:
52
+ requirements:
55
53
  - - ~>
56
- - !ruby/object:Gem::Version
54
+ - !ruby/object:Gem::Version
57
55
  version: 0.2.5
58
56
  type: :runtime
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
61
- name: highline
62
57
  prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
58
+ version_requirements: *15302600
59
+ - !ruby/object:Gem::Dependency
60
+ name: highline
61
+ requirement: &15302140 !ruby/object:Gem::Requirement
64
62
  none: false
65
- requirements:
63
+ requirements:
66
64
  - - ~>
67
- - !ruby/object:Gem::Version
65
+ - !ruby/object:Gem::Version
68
66
  version: 1.6.2
69
67
  type: :runtime
70
- version_requirements: *id005
71
- - !ruby/object:Gem::Dependency
72
- name: terminal-table
73
68
  prerelease: false
74
- requirement: &id006 !ruby/object:Gem::Requirement
69
+ version_requirements: *15302140
70
+ - !ruby/object:Gem::Dependency
71
+ name: terminal-table
72
+ requirement: &15301680 !ruby/object:Gem::Requirement
75
73
  none: false
76
- requirements:
74
+ requirements:
77
75
  - - ~>
78
- - !ruby/object:Gem::Version
76
+ - !ruby/object:Gem::Version
79
77
  version: 1.4.2
80
78
  type: :runtime
81
- version_requirements: *id006
82
- - !ruby/object:Gem::Dependency
83
- name: opensrs
84
79
  prerelease: false
85
- requirement: &id007 !ruby/object:Gem::Requirement
80
+ version_requirements: *15301680
81
+ - !ruby/object:Gem::Dependency
82
+ name: opensrs
83
+ requirement: &15301300 !ruby/object:Gem::Requirement
86
84
  none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: "0"
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
91
89
  type: :runtime
92
- version_requirements: *id007
93
- - !ruby/object:Gem::Dependency
94
- name: nokogiri
95
90
  prerelease: false
96
- requirement: &id008 !ruby/object:Gem::Requirement
91
+ version_requirements: *15301300
92
+ - !ruby/object:Gem::Dependency
93
+ name: nokogiri
94
+ requirement: &15300840 !ruby/object:Gem::Requirement
97
95
  none: false
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: "0"
96
+ requirements:
97
+ - - ! '>='
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
102
100
  type: :runtime
103
- version_requirements: *id008
104
- - !ruby/object:Gem::Dependency
105
- name: rake
106
101
  prerelease: false
107
- requirement: &id009 !ruby/object:Gem::Requirement
102
+ version_requirements: *15300840
103
+ - !ruby/object:Gem::Dependency
104
+ name: rake
105
+ requirement: &15300340 !ruby/object:Gem::Requirement
108
106
  none: false
109
- requirements:
107
+ requirements:
110
108
  - - ~>
111
- - !ruby/object:Gem::Version
109
+ - !ruby/object:Gem::Version
112
110
  version: 0.8.7
113
111
  type: :development
114
- version_requirements: *id009
115
- - !ruby/object:Gem::Dependency
116
- name: rspec
117
112
  prerelease: false
118
- requirement: &id010 !ruby/object:Gem::Requirement
113
+ version_requirements: *15300340
114
+ - !ruby/object:Gem::Dependency
115
+ name: rspec
116
+ requirement: &15299840 !ruby/object:Gem::Requirement
119
117
  none: false
120
- requirements:
118
+ requirements:
121
119
  - - ~>
122
- - !ruby/object:Gem::Version
120
+ - !ruby/object:Gem::Version
123
121
  version: 2.6.0
124
122
  type: :development
125
- version_requirements: *id010
126
- - !ruby/object:Gem::Dependency
127
- name: cucumber
128
123
  prerelease: false
129
- requirement: &id011 !ruby/object:Gem::Requirement
124
+ version_requirements: *15299840
125
+ - !ruby/object:Gem::Dependency
126
+ name: cucumber
127
+ requirement: &15299380 !ruby/object:Gem::Requirement
130
128
  none: false
131
- requirements:
129
+ requirements:
132
130
  - - ~>
133
- - !ruby/object:Gem::Version
131
+ - !ruby/object:Gem::Version
134
132
  version: 0.10.3
135
133
  type: :development
136
- version_requirements: *id011
137
- - !ruby/object:Gem::Dependency
138
- name: simplecov
139
134
  prerelease: false
140
- requirement: &id012 !ruby/object:Gem::Requirement
135
+ version_requirements: *15299380
136
+ - !ruby/object:Gem::Dependency
137
+ name: simplecov
138
+ requirement: &15298920 !ruby/object:Gem::Requirement
141
139
  none: false
142
- requirements:
140
+ requirements:
143
141
  - - ~>
144
- - !ruby/object:Gem::Version
142
+ - !ruby/object:Gem::Version
145
143
  version: 0.4.0
146
144
  type: :development
147
- version_requirements: *id012
148
- - !ruby/object:Gem::Dependency
149
- name: flay
150
145
  prerelease: false
151
- requirement: &id013 !ruby/object:Gem::Requirement
146
+ version_requirements: *15298920
147
+ - !ruby/object:Gem::Dependency
148
+ name: flay
149
+ requirement: &15298460 !ruby/object:Gem::Requirement
152
150
  none: false
153
- requirements:
151
+ requirements:
154
152
  - - ~>
155
- - !ruby/object:Gem::Version
153
+ - !ruby/object:Gem::Version
156
154
  version: 1.4.2
157
155
  type: :development
158
- version_requirements: *id013
159
- - !ruby/object:Gem::Dependency
160
- name: geminabox
161
156
  prerelease: false
162
- requirement: &id014 !ruby/object:Gem::Requirement
157
+ version_requirements: *15298460
158
+ - !ruby/object:Gem::Dependency
159
+ name: geminabox
160
+ requirement: &15298080 !ruby/object:Gem::Requirement
163
161
  none: false
164
- requirements:
165
- - - ">="
166
- - !ruby/object:Gem::Version
167
- version: "0"
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
168
166
  type: :development
169
- version_requirements: *id014
170
- description: |
171
- Dew is a layer between fog and the ground
167
+ prerelease: false
168
+ version_requirements: *15298080
169
+ description: ! 'Dew is a layer between fog and the ground
172
170
 
173
- email:
171
+ '
172
+ email:
174
173
  - devops@playup.com
175
- executables:
174
+ executables:
176
175
  - dew
177
176
  extensions: []
178
-
179
177
  extra_rdoc_files: []
180
-
181
- files:
182
- - lib/dew/commands.rb
183
- - lib/dew/controllers/deploy_controller.rb
184
- - lib/dew/controllers/environments_controller.rb
185
- - lib/dew/controllers/amis_controller.rb
178
+ files:
179
+ - lib/tasks/spec.rake
180
+ - lib/dew.rb
186
181
  - lib/dew/base_command.rb
187
- - lib/dew/models/deploy/puge.rb
188
- - lib/dew/models/deploy/run.rb
189
- - lib/dew/models/deploy.rb
190
- - lib/dew/models/server.rb
191
- - lib/dew/models/profile.rb
192
- - lib/dew/models/environment.rb
193
- - lib/dew/models/account.rb
194
- - lib/dew/models/database.rb
195
- - lib/dew/models/fog_model.rb
196
- - lib/dew/password.rb
197
- - lib/dew/controllers.rb
182
+ - lib/dew/commands/tidy.rb
183
+ - lib/dew/commands/environments.rb
184
+ - lib/dew/commands/deploy.rb
198
185
  - lib/dew/commands/ami.rb
199
- - lib/dew/commands/deploy/templates/known_hosts
200
186
  - lib/dew/commands/deploy/templates/rvmrc
187
+ - lib/dew/commands/deploy/templates/known_hosts
201
188
  - lib/dew/commands/deploy/templates/apache.conf.erb
202
- - lib/dew/commands/deploy.rb
203
- - lib/dew/commands/environments.rb
204
189
  - lib/dew/commands/console.rb
205
- - lib/dew/commands/tidy.rb
206
190
  - lib/dew/commands/console/irb_override.rb
207
- - lib/dew/tasks/spec.rake
208
- - lib/dew/view.rb
209
191
  - lib/dew/models.rb
210
- - lib/dew/aws_resources.yaml
192
+ - lib/dew/models/database.rb
193
+ - lib/dew/models/account.rb
194
+ - lib/dew/models/deploy.rb
195
+ - lib/dew/models/fog_model.rb
196
+ - lib/dew/models/deploy/puge.rb
197
+ - lib/dew/models/deploy/run.rb
198
+ - lib/dew/models/server.rb
199
+ - lib/dew/models/environment.rb
200
+ - lib/dew/models/profile.rb
201
+ - lib/dew/commands.rb
202
+ - lib/dew/view.rb
203
+ - lib/dew/controllers/environments_controller.rb
204
+ - lib/dew/controllers/deploy_controller.rb
205
+ - lib/dew/controllers/amis_controller.rb
211
206
  - lib/dew/version.rb
212
- - lib/dew/validations.rb
207
+ - lib/dew/password.rb
213
208
  - lib/dew/cloud.rb
214
- - lib/tasks/spec.rake
215
- - lib/dew.rb
209
+ - lib/dew/tasks/spec.rake
210
+ - lib/dew/validations.rb
211
+ - lib/dew/controllers.rb
212
+ - lib/dew/aws_resources.yaml
216
213
  - README.md
217
214
  - LICENSE
218
- - example/dew/profiles/test-full.yaml
219
215
  - example/dew/profiles/template.yaml
220
216
  - example/dew/profiles/test-light.yaml
217
+ - example/dew/profiles/test-full.yaml
221
218
  - example/dew/accounts/development.yaml
222
219
  - Rakefile
223
- - spec/dew/controllers/deploy_controller_spec.rb
224
- - spec/dew/controllers/amis_controller_spec.rb
225
- - spec/dew/controllers/environments_controller_spec.rb
226
- - spec/dew/models/profile_spec.rb
220
+ - spec/dew/view_spec.rb
221
+ - spec/dew/models/fog_model_spec.rb
222
+ - spec/dew/models/server_spec.rb
223
+ - spec/dew/models/account_spec.rb
227
224
  - spec/dew/models/deploy/puge_spec.rb
228
225
  - spec/dew/models/deploy/run_spec.rb
229
226
  - spec/dew/models/environment_spec.rb
230
- - spec/dew/models/fog_model_spec.rb
231
- - spec/dew/models/account_spec.rb
232
- - spec/dew/models/server_spec.rb
227
+ - spec/dew/models/profile_spec.rb
233
228
  - spec/dew/models/database_spec.rb
229
+ - spec/dew/controllers/deploy_controller_spec.rb
230
+ - spec/dew/controllers/amis_controller_spec.rb
231
+ - spec/dew/controllers/environments_controller_spec.rb
234
232
  - spec/dew/password_spec.rb
235
- - spec/dew/cloud_spec.rb
236
233
  - spec/dew/spec_helper.rb
237
- - spec/dew/view_spec.rb
234
+ - spec/dew/cloud_spec.rb
235
+ - features/deploy-puge.feature
236
+ - features/create-ami.feature
237
+ - features/create-environments.feature
238
238
  - features/support/hooks.rb
239
239
  - features/support/env.rb
240
- - features/deploy-puge.feature
241
240
  - features/step_definitions/deploy-puge-steps.rb
242
241
  - features/step_definitions/aws-steps.rb
243
- - features/create-ami.feature
244
- - features/create-environments.feature
245
242
  - config/cucumber.yaml
246
243
  - bin/dew
247
244
  has_rdoc: true
248
245
  homepage: http://github.com/playup/dew
249
246
  licenses: []
250
-
251
247
  post_install_message:
252
248
  rdoc_options: []
253
-
254
- require_paths:
249
+ require_paths:
255
250
  - lib
256
- required_ruby_version: !ruby/object:Gem::Requirement
251
+ required_ruby_version: !ruby/object:Gem::Requirement
257
252
  none: false
258
- requirements:
259
- - - ">="
260
- - !ruby/object:Gem::Version
261
- version: "0"
262
- required_rubygems_version: !ruby/object:Gem::Requirement
253
+ requirements:
254
+ - - ! '>='
255
+ - !ruby/object:Gem::Version
256
+ version: '0'
257
+ required_rubygems_version: !ruby/object:Gem::Requirement
263
258
  none: false
264
- requirements:
265
- - - ">="
266
- - !ruby/object:Gem::Version
267
- version: "0"
259
+ requirements:
260
+ - - ! '>='
261
+ - !ruby/object:Gem::Version
262
+ version: '0'
268
263
  requirements: []
269
-
270
264
  rubyforge_project:
271
265
  rubygems_version: 1.6.2
272
266
  signing_key:
273
267
  specification_version: 3
274
268
  summary: Uses fog to access the cloud
275
- test_files:
269
+ test_files:
276
270
  - Rakefile
277
- - spec/dew/controllers/deploy_controller_spec.rb
278
- - spec/dew/controllers/amis_controller_spec.rb
279
- - spec/dew/controllers/environments_controller_spec.rb
280
- - spec/dew/models/profile_spec.rb
271
+ - spec/dew/view_spec.rb
272
+ - spec/dew/models/fog_model_spec.rb
273
+ - spec/dew/models/server_spec.rb
274
+ - spec/dew/models/account_spec.rb
281
275
  - spec/dew/models/deploy/puge_spec.rb
282
276
  - spec/dew/models/deploy/run_spec.rb
283
277
  - spec/dew/models/environment_spec.rb
284
- - spec/dew/models/fog_model_spec.rb
285
- - spec/dew/models/account_spec.rb
286
- - spec/dew/models/server_spec.rb
278
+ - spec/dew/models/profile_spec.rb
287
279
  - spec/dew/models/database_spec.rb
280
+ - spec/dew/controllers/deploy_controller_spec.rb
281
+ - spec/dew/controllers/amis_controller_spec.rb
282
+ - spec/dew/controllers/environments_controller_spec.rb
288
283
  - spec/dew/password_spec.rb
289
- - spec/dew/cloud_spec.rb
290
284
  - spec/dew/spec_helper.rb
291
- - spec/dew/view_spec.rb
285
+ - spec/dew/cloud_spec.rb
286
+ - features/deploy-puge.feature
287
+ - features/create-ami.feature
288
+ - features/create-environments.feature
292
289
  - features/support/hooks.rb
293
290
  - features/support/env.rb
294
- - features/deploy-puge.feature
295
291
  - features/step_definitions/deploy-puge-steps.rb
296
292
  - features/step_definitions/aws-steps.rb
297
- - features/create-ami.feature
298
- - features/create-environments.feature
299
293
  - config/cucumber.yaml