rhc 0.98.16 → 1.0.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.
Files changed (94) hide show
  1. data/bin/rhc +7 -49
  2. data/bin/rhc-app +14 -3
  3. data/bin/rhc-chk +16 -16
  4. data/bin/rhc-create-app +2 -0
  5. data/bin/rhc-create-domain +1 -2
  6. data/bin/rhc-ctl-app +12 -3
  7. data/bin/rhc-ctl-domain +1 -2
  8. data/bin/rhc-domain +1 -2
  9. data/bin/rhc-domain-info +1 -2
  10. data/bin/rhc-port-forward +1 -2
  11. data/bin/rhc-snapshot +3 -0
  12. data/bin/rhc-sshkey +1 -2
  13. data/bin/rhc-tail-files +1 -1
  14. data/bin/rhc-user-info +1 -3
  15. data/features/application.feature +4 -1
  16. data/features/domain.feature +0 -4
  17. data/features/geared_application.feature +11 -0
  18. data/features/lib/rhc_helper/app.rb +16 -5
  19. data/features/lib/rhc_helper/cartridge.rb +25 -9
  20. data/features/lib/rhc_helper/commandify.rb +34 -7
  21. data/features/lib/rhc_helper/domain.rb +2 -2
  22. data/features/lib/rhc_helper/httpify.rb +24 -14
  23. data/features/lib/rhc_helper/persistable.rb +1 -1
  24. data/features/lib/rhc_helper/sshkey.rb +11 -7
  25. data/features/lib/rhc_helper.rb +5 -3
  26. data/features/multiple_cartridge.feature +1 -1
  27. data/features/scaled_application.feature +48 -0
  28. data/features/sshkey.feature +37 -31
  29. data/features/step_definitions/application_steps.rb +18 -7
  30. data/features/step_definitions/cartridge_steps.rb +29 -3
  31. data/features/step_definitions/domain_steps.rb +2 -2
  32. data/features/step_definitions/sshkey_steps.rb +34 -34
  33. data/features/support/assumptions.rb +21 -9
  34. data/features/support/before_hooks.rb +24 -6
  35. data/features/support/env.rb +45 -19
  36. data/lib/rhc/cartridge_helper.rb +27 -0
  37. data/lib/rhc/cli.rb +1 -1
  38. data/lib/rhc/command_runner.rb +31 -3
  39. data/lib/rhc/commands/alias.rb +38 -0
  40. data/lib/rhc/commands/app.rb +478 -0
  41. data/lib/rhc/commands/base.rb +42 -12
  42. data/lib/rhc/commands/cartridge.rb +189 -0
  43. data/lib/rhc/commands/domain.rb +11 -49
  44. data/lib/rhc/commands/port-forward.rb +0 -1
  45. data/lib/rhc/commands/setup.rb +2 -1
  46. data/lib/rhc/commands/snapshot.rb +118 -0
  47. data/lib/rhc/commands/sshkey.rb +24 -38
  48. data/lib/rhc/commands/tail.rb +24 -0
  49. data/lib/rhc/commands/threaddump.rb +16 -0
  50. data/lib/rhc/commands.rb +33 -7
  51. data/lib/rhc/config.rb +28 -12
  52. data/lib/rhc/context_helper.rb +19 -5
  53. data/lib/rhc/core_ext.rb +86 -0
  54. data/lib/rhc/exceptions.rb +44 -0
  55. data/lib/rhc/git_helper.rb +59 -0
  56. data/lib/rhc/helpers.rb +86 -5
  57. data/lib/rhc/output_helpers.rb +213 -0
  58. data/lib/rhc/rest/application.rb +134 -67
  59. data/lib/rhc/rest/base.rb +48 -0
  60. data/lib/rhc/rest/cartridge.rb +40 -44
  61. data/lib/rhc/rest/client.rb +127 -59
  62. data/lib/rhc/rest/domain.rb +29 -39
  63. data/lib/rhc/rest/gear_group.rb +10 -0
  64. data/lib/rhc/rest/key.rb +8 -23
  65. data/lib/rhc/rest/user.rb +8 -24
  66. data/lib/rhc/rest.rb +22 -11
  67. data/lib/rhc/ssh_key_helpers.rb +47 -0
  68. data/lib/rhc/usage_templates/help.erb +0 -1
  69. data/lib/rhc/version.rb +3 -3
  70. data/lib/rhc/wizard.rb +123 -225
  71. data/lib/rhc-common.rb +43 -62
  72. data/spec/rest_spec_helper.rb +159 -36
  73. data/spec/rhc/cli_spec.rb +29 -1
  74. data/spec/rhc/command_spec.rb +32 -35
  75. data/spec/rhc/commands/alias_spec.rb +123 -0
  76. data/spec/rhc/commands/app_spec.rb +414 -0
  77. data/spec/rhc/commands/cartridge_spec.rb +342 -0
  78. data/spec/rhc/commands/domain_spec.rb +8 -8
  79. data/spec/rhc/commands/setup_spec.rb +17 -6
  80. data/spec/rhc/commands/snapshot_spec.rb +140 -0
  81. data/spec/rhc/commands/sshkey_spec.rb +26 -4
  82. data/spec/rhc/commands/tail_spec.rb +34 -0
  83. data/spec/rhc/commands/threaddump_spec.rb +83 -0
  84. data/spec/rhc/config_spec.rb +39 -13
  85. data/spec/rhc/context_spec.rb +51 -0
  86. data/spec/rhc/helpers_spec.rb +52 -12
  87. data/spec/rhc/rest_application_spec.rb +16 -3
  88. data/spec/rhc/rest_client_spec.rb +144 -36
  89. data/spec/rhc/rest_spec.rb +1 -1
  90. data/spec/rhc/wizard_spec.rb +133 -232
  91. data/spec/spec_helper.rb +4 -3
  92. metadata +56 -31
  93. data/features/support/ssh.sh +0 -2
  94. data/spec/rhc/common_spec.rb +0 -49
data/spec/spec_helper.rb CHANGED
@@ -126,14 +126,15 @@ module ClassSpecHelpers
126
126
  @output.to_s
127
127
  end
128
128
 
129
- def run
129
+ def run(input=[])
130
130
  #Commander::Runner.instance_variable_set :"@singleton", nil
131
131
  mock_terminal
132
+ input.each { |i| $terminal.write_line(i) }
132
133
  RHC::CLI.start(arguments)
133
134
  "#{@output.string}\n#{$stderr.string}"
134
135
  end
135
- def run_output
136
- run
136
+ def run_output(input=[])
137
+ run(input)
137
138
  rescue SystemExit => e
138
139
  "#{@output.string}\n#{$stderr.string}#{e}"
139
140
  else
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 439
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 98
9
- - 16
10
- version: 0.98.16
9
+ - 4
10
+ version: 1.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Red Hat
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-09-17 00:00:00 -05:00
18
+ date: 2012-11-02 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -109,7 +109,7 @@ dependencies:
109
109
  type: :runtime
110
110
  version_requirements: *id006
111
111
  - !ruby/object:Gem::Dependency
112
- name: rake
112
+ name: open4
113
113
  prerelease: false
114
114
  requirement: &id007 !ruby/object:Gem::Requirement
115
115
  none: false
@@ -120,10 +120,10 @@ dependencies:
120
120
  segments:
121
121
  - 0
122
122
  version: "0"
123
- type: :development
123
+ type: :runtime
124
124
  version_requirements: *id007
125
125
  - !ruby/object:Gem::Dependency
126
- name: webmock
126
+ name: rake
127
127
  prerelease: false
128
128
  requirement: &id008 !ruby/object:Gem::Requirement
129
129
  none: false
@@ -132,43 +132,42 @@ dependencies:
132
132
  - !ruby/object:Gem::Version
133
133
  hash: 3
134
134
  segments:
135
- - 1
136
- - 6
137
- version: "1.6"
135
+ - 0
136
+ version: "0"
138
137
  type: :development
139
138
  version_requirements: *id008
140
139
  - !ruby/object:Gem::Dependency
141
- name: rspec
140
+ name: webmock
142
141
  prerelease: false
143
142
  requirement: &id009 !ruby/object:Gem::Requirement
144
143
  none: false
145
144
  requirements:
146
- - - ~>
145
+ - - ">="
147
146
  - !ruby/object:Gem::Version
148
- hash: 9
147
+ hash: 3
149
148
  segments:
150
149
  - 1
151
- - 3
152
- version: "1.3"
150
+ - 6
151
+ version: "1.6"
153
152
  type: :development
154
153
  version_requirements: *id009
155
154
  - !ruby/object:Gem::Dependency
156
- name: fakefs
155
+ name: rspec
157
156
  prerelease: false
158
157
  requirement: &id010 !ruby/object:Gem::Requirement
159
158
  none: false
160
159
  requirements:
161
- - - ">="
160
+ - - ~>
162
161
  - !ruby/object:Gem::Version
163
- hash: 3
162
+ hash: 9
164
163
  segments:
165
- - 0
166
- - 4
167
- version: "0.4"
164
+ - 1
165
+ - 3
166
+ version: "1.3"
168
167
  type: :development
169
168
  version_requirements: *id010
170
169
  - !ruby/object:Gem::Dependency
171
- name: thor
170
+ name: fakefs
172
171
  prerelease: false
173
172
  requirement: &id011 !ruby/object:Gem::Requirement
174
173
  none: false
@@ -178,11 +177,12 @@ dependencies:
178
177
  hash: 3
179
178
  segments:
180
179
  - 0
181
- version: "0"
180
+ - 4
181
+ version: "0.4"
182
182
  type: :development
183
183
  version_requirements: *id011
184
184
  - !ruby/object:Gem::Dependency
185
- name: cucumber
185
+ name: thor
186
186
  prerelease: false
187
187
  requirement: &id012 !ruby/object:Gem::Requirement
188
188
  none: false
@@ -196,7 +196,7 @@ dependencies:
196
196
  type: :development
197
197
  version_requirements: *id012
198
198
  - !ruby/object:Gem::Dependency
199
- name: dnsruby
199
+ name: cucumber
200
200
  prerelease: false
201
201
  requirement: &id013 !ruby/object:Gem::Requirement
202
202
  none: false
@@ -210,7 +210,7 @@ dependencies:
210
210
  type: :development
211
211
  version_requirements: *id013
212
212
  - !ruby/object:Gem::Dependency
213
- name: open4
213
+ name: dnsruby
214
214
  prerelease: false
215
215
  requirement: &id014 !ruby/object:Gem::Requirement
216
216
  none: false
@@ -265,8 +265,11 @@ files:
265
265
  - lib/rhc/version.rb
266
266
  - lib/rhc/ssh_key_helpers.rb
267
267
  - lib/rhc/client.rb
268
+ - lib/rhc/git_helper.rb
268
269
  - lib/rhc/exceptions.rb
269
270
  - lib/rhc/cli.rb
271
+ - lib/rhc/rest/gear_group.rb
272
+ - lib/rhc/rest/base.rb
270
273
  - lib/rhc/rest/client.rb
271
274
  - lib/rhc/rest/domain.rb
272
275
  - lib/rhc/rest/user.rb
@@ -278,6 +281,7 @@ files:
278
281
  - lib/rhc/commands.rb
279
282
  - lib/rhc/json.rb
280
283
  - lib/rhc/help_formatter.rb
284
+ - lib/rhc/output_helpers.rb
281
285
  - lib/rhc/core_ext.rb
282
286
  - lib/rhc/vendor/zliby.rb
283
287
  - lib/rhc/vendor/parseconfig.rb
@@ -288,13 +292,20 @@ files:
288
292
  - lib/rhc/rest.rb
289
293
  - lib/rhc/commands/base.rb
290
294
  - lib/rhc/commands/setup.rb
295
+ - lib/rhc/commands/threaddump.rb
296
+ - lib/rhc/commands/alias.rb
291
297
  - lib/rhc/commands/port-forward.rb
292
298
  - lib/rhc/commands/domain.rb
299
+ - lib/rhc/commands/snapshot.rb
293
300
  - lib/rhc/commands/sshkey.rb
294
301
  - lib/rhc/commands/server.rb
302
+ - lib/rhc/commands/cartridge.rb
303
+ - lib/rhc/commands/tail.rb
304
+ - lib/rhc/commands/app.rb
295
305
  - lib/rhc/helpers.rb
296
306
  - lib/rhc/config.rb
297
307
  - lib/rhc/coverage_helper.rb
308
+ - lib/rhc/cartridge_helper.rb
298
309
  - lib/rhc-common.rb
299
310
  - lib/rhc/usage_templates/missing_help.erb
300
311
  - lib/rhc/usage_templates/command_help.erb
@@ -311,17 +322,23 @@ files:
311
322
  - spec/rhc/rest_client_spec.rb
312
323
  - spec/rhc/targz_spec.rb
313
324
  - spec/rhc/rest_application_spec.rb
314
- - spec/rhc/common_spec.rb
315
325
  - spec/rhc/rest_spec.rb
316
326
  - spec/rhc/assets/foo.txt
317
327
  - spec/rhc/assets/targz_corrupted.tar.gz
318
328
  - spec/rhc/assets/targz_sample.tar.gz
319
329
  - spec/rhc/command_spec.rb
320
330
  - spec/rhc/commands/port-forward_spec.rb
331
+ - spec/rhc/commands/tail_spec.rb
321
332
  - spec/rhc/commands/sshkey_spec.rb
322
333
  - spec/rhc/commands/setup_spec.rb
334
+ - spec/rhc/commands/app_spec.rb
335
+ - spec/rhc/commands/alias_spec.rb
336
+ - spec/rhc/commands/threaddump_spec.rb
323
337
  - spec/rhc/commands/domain_spec.rb
338
+ - spec/rhc/commands/cartridge_spec.rb
324
339
  - spec/rhc/commands/server_spec.rb
340
+ - spec/rhc/commands/snapshot_spec.rb
341
+ - spec/rhc/context_spec.rb
325
342
  - spec/rhc/wizard_spec.rb
326
343
  - spec/rhc/cli_spec.rb
327
344
  - spec/rhc/json_spec.rb
@@ -334,7 +351,6 @@ files:
334
351
  - features/support/key1.pub
335
352
  - features/support/before_hooks.rb
336
353
  - features/support/assumptions.rb
337
- - features/support/ssh.sh
338
354
  - features/support/key2
339
355
  - features/support/key3.pub
340
356
  - features/support/key2.pub
@@ -360,6 +376,8 @@ files:
360
376
  - features/domain.feature
361
377
  - features/client.feature
362
378
  - features/README.md
379
+ - features/scaled_application.feature
380
+ - features/geared_application.feature
363
381
  - bin/rhc-tail-files
364
382
  - bin/rhc-sshkey
365
383
  - bin/rhc-snapshot
@@ -415,17 +433,23 @@ test_files:
415
433
  - spec/rhc/rest_client_spec.rb
416
434
  - spec/rhc/targz_spec.rb
417
435
  - spec/rhc/rest_application_spec.rb
418
- - spec/rhc/common_spec.rb
419
436
  - spec/rhc/rest_spec.rb
420
437
  - spec/rhc/assets/foo.txt
421
438
  - spec/rhc/assets/targz_corrupted.tar.gz
422
439
  - spec/rhc/assets/targz_sample.tar.gz
423
440
  - spec/rhc/command_spec.rb
424
441
  - spec/rhc/commands/port-forward_spec.rb
442
+ - spec/rhc/commands/tail_spec.rb
425
443
  - spec/rhc/commands/sshkey_spec.rb
426
444
  - spec/rhc/commands/setup_spec.rb
445
+ - spec/rhc/commands/app_spec.rb
446
+ - spec/rhc/commands/alias_spec.rb
447
+ - spec/rhc/commands/threaddump_spec.rb
427
448
  - spec/rhc/commands/domain_spec.rb
449
+ - spec/rhc/commands/cartridge_spec.rb
428
450
  - spec/rhc/commands/server_spec.rb
451
+ - spec/rhc/commands/snapshot_spec.rb
452
+ - spec/rhc/context_spec.rb
429
453
  - spec/rhc/wizard_spec.rb
430
454
  - spec/rhc/cli_spec.rb
431
455
  - spec/rhc/json_spec.rb
@@ -438,7 +462,6 @@ test_files:
438
462
  - features/support/key1.pub
439
463
  - features/support/before_hooks.rb
440
464
  - features/support/assumptions.rb
441
- - features/support/ssh.sh
442
465
  - features/support/key2
443
466
  - features/support/key3.pub
444
467
  - features/support/key2.pub
@@ -464,3 +487,5 @@ test_files:
464
487
  - features/domain.feature
465
488
  - features/client.feature
466
489
  - features/README.md
490
+ - features/scaled_application.feature
491
+ - features/geared_application.feature
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env bash
2
- ssh -o StrictHostKeyChecking=no -- "$@"
@@ -1,49 +0,0 @@
1
- require 'spec_helper'
2
- require 'rest_spec_helper'
3
- require 'rhc-common'
4
-
5
- # The existence of this file is a stopgap to provide test coverage
6
- # for a specific bug fix (BZ836882). This test should be migrated
7
- # to a more appropriate location when rhc-common is refactored out
8
- # of existence.
9
-
10
- describe RHC do
11
- let(:client_links) { mock_response_links(mock_client_links) }
12
- let(:domain_links) { mock_response_links(mock_domain_links('mock_domain')) }
13
- let(:user_info) {
14
- { 'user_info' => { 'domains' => [ { 'namespace' => 'mock_domain' } ] } }
15
- }
16
- context "#create_app" do
17
- context " creating a scaling app" do
18
- before do
19
- stub_request(:get, mock_href('broker/rest/api', true)).
20
- to_return({ :body => { :data => client_links }.to_json,
21
- :status => 200
22
- })
23
- stub_request(:any, mock_href(client_links['LIST_DOMAINS']['relative'], true)).
24
- to_return({ :body => {
25
- :type => 'domains',
26
- :data =>
27
- [{ :id => 'mock_domain',
28
- :links => domain_links,
29
- }]
30
- }.to_json,
31
- :status => 200
32
- })
33
- stub_request(:any, mock_href(domain_links['ADD_APPLICATION']['relative'], true)).
34
- to_raise(RHC::Rest::ServerErrorException.new("Mock server error"))
35
- RHC.stub!(:print_response_err) { |output| @test_output = output; exit 1 }
36
- end
37
- it "posts an error message if the Rest API encounters a server error" do
38
- lambda{ RHC.create_app( mock_uri, Net::HTTP, user_info,
39
- 'mock_app', 'mock_type', mock_user, mock_pass,
40
- nil, false, false, false, 'small', true) }.
41
- should raise_error(SystemExit)
42
- @test_output.body.should match(/Mock server error/)
43
- end
44
- after do
45
- RHC.unstub!(:print_response_err)
46
- end
47
- end
48
- end
49
- end