tugboat 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +520 -0
  3. data/CHANGELOG.md +9 -0
  4. data/Gemfile +0 -6
  5. data/README.md +34 -2
  6. data/Rakefile +6 -1
  7. data/bin/tugboat +2 -2
  8. data/features/cassettes/config/Array_of_SSH_Keys_in_Config.yml +1 -1
  9. data/features/cassettes/config/Single_SSH_key_as_number_in_config.yml +1 -1
  10. data/features/step_definitions/steps.rb +1 -1
  11. data/features/support/env.rb +7 -3
  12. data/lib/tugboat.rb +2 -2
  13. data/lib/tugboat/cli.rb +394 -444
  14. data/lib/tugboat/config.rb +43 -61
  15. data/lib/tugboat/middleware.rb +33 -33
  16. data/lib/tugboat/middleware/add_key.rb +12 -13
  17. data/lib/tugboat/middleware/ask_for_credentials.rb +12 -13
  18. data/lib/tugboat/middleware/base.rb +25 -20
  19. data/lib/tugboat/middleware/check_configuration.rb +3 -6
  20. data/lib/tugboat/middleware/check_credentials.rb +0 -1
  21. data/lib/tugboat/middleware/check_droplet_active.rb +2 -4
  22. data/lib/tugboat/middleware/check_droplet_inactive.rb +2 -4
  23. data/lib/tugboat/middleware/config.rb +3 -5
  24. data/lib/tugboat/middleware/confirm_action.rb +4 -6
  25. data/lib/tugboat/middleware/create_droplet.rb +27 -44
  26. data/lib/tugboat/middleware/custom_logger.rb +52 -54
  27. data/lib/tugboat/middleware/destroy_droplet.rb +5 -6
  28. data/lib/tugboat/middleware/destroy_image.rb +5 -6
  29. data/lib/tugboat/middleware/find_droplet.rb +43 -47
  30. data/lib/tugboat/middleware/find_image.rb +23 -29
  31. data/lib/tugboat/middleware/halt_droplet.rb +9 -10
  32. data/lib/tugboat/middleware/info_droplet.rb +30 -33
  33. data/lib/tugboat/middleware/info_image.rb +1 -1
  34. data/lib/tugboat/middleware/inject_client.rb +8 -10
  35. data/lib/tugboat/middleware/inject_configuration.rb +1 -2
  36. data/lib/tugboat/middleware/list_droplets.rb +9 -10
  37. data/lib/tugboat/middleware/list_images.rb +9 -9
  38. data/lib/tugboat/middleware/list_regions.rb +1 -1
  39. data/lib/tugboat/middleware/list_sizes.rb +1 -1
  40. data/lib/tugboat/middleware/list_ssh_keys.rb +1 -3
  41. data/lib/tugboat/middleware/password_reset.rb +6 -7
  42. data/lib/tugboat/middleware/rebuild_droplet.rb +7 -7
  43. data/lib/tugboat/middleware/resize_droplet.rb +6 -7
  44. data/lib/tugboat/middleware/restart_droplet.rb +4 -11
  45. data/lib/tugboat/middleware/snapshot_droplet.rb +7 -8
  46. data/lib/tugboat/middleware/ssh_droplet.rb +30 -31
  47. data/lib/tugboat/middleware/start_droplet.rb +5 -5
  48. data/lib/tugboat/middleware/wait_for_state.rb +2 -3
  49. data/lib/tugboat/version.rb +1 -1
  50. data/spec/cli/add_key_spec.rb +25 -28
  51. data/spec/cli/authorize_cli_spec.rb +57 -60
  52. data/spec/cli/config_cli_spec.rb +8 -11
  53. data/spec/cli/create_cli_spec.rb +40 -46
  54. data/spec/cli/debug_cli_spec.rb +29 -29
  55. data/spec/cli/destroy_cli_spec.rb +58 -60
  56. data/spec/cli/destroy_image_cli_spec.rb +42 -45
  57. data/spec/cli/droplets_cli_spec.rb +62 -64
  58. data/spec/cli/env_variable_spec.rb +14 -15
  59. data/spec/cli/halt_cli_spec.rb +65 -69
  60. data/spec/cli/help_cli_spec.rb +8 -8
  61. data/spec/cli/images_cli_spec.rb +28 -30
  62. data/spec/cli/info_cli_spec.rb +144 -147
  63. data/spec/cli/info_image_cli_spec.rb +57 -60
  64. data/spec/cli/keys_cli_spec.rb +8 -10
  65. data/spec/cli/password_reset_cli_spec.rb +56 -56
  66. data/spec/cli/rebuild_cli_spec.rb +194 -198
  67. data/spec/cli/regions_cli_spec.rb +8 -8
  68. data/spec/cli/resize_cli_spec.rb +54 -56
  69. data/spec/cli/restart_cli_spec.rb +53 -57
  70. data/spec/cli/sizes_cli_spec.rb +7 -8
  71. data/spec/cli/snapshot_cli_spec.rb +50 -53
  72. data/spec/cli/ssh_cli_spec.rb +41 -42
  73. data/spec/cli/start_cli_spec.rb +48 -52
  74. data/spec/cli/verify_cli_spec.rb +22 -25
  75. data/spec/cli/version_cli_spec.rb +6 -8
  76. data/spec/cli/wait_cli_spec.rb +50 -52
  77. data/spec/config_spec.rb +56 -57
  78. data/spec/middleware/base_spec.rb +5 -6
  79. data/spec/middleware/check_configuration_spec.rb +5 -7
  80. data/spec/middleware/check_credentials_spec.rb +9 -10
  81. data/spec/middleware/check_droplet_active_spec.rb +5 -7
  82. data/spec/middleware/check_droplet_inactive_spec.rb +5 -7
  83. data/spec/middleware/find_droplet_spec.rb +4 -5
  84. data/spec/middleware/find_image_spec.rb +4 -5
  85. data/spec/middleware/inject_client_spec.rb +9 -12
  86. data/spec/middleware/inject_configuration_spec.rb +4 -7
  87. data/spec/middleware/ssh_droplet_spec.rb +70 -73
  88. data/spec/shared/environment.rb +18 -20
  89. data/spec/spec_helper.rb +4 -4
  90. data/tugboat.gemspec +10 -6
  91. metadata +88 -17
@@ -1,35 +1,34 @@
1
1
  require 'spec_helper'
2
2
 
3
- shared_context "spec" do
3
+ shared_context 'spec' do
4
4
  # Default configuration and
5
5
  let(:config) { Tugboat::Configuration.instance }
6
6
  let(:access_token) { 'foo' }
7
- let(:ssh_user) { "baz" }
8
- let(:ssh_port) { "33" }
9
- let(:ssh_key_path) { "~/.ssh/id_rsa2" }
10
- let(:droplet_name) { "foo" }
11
- let(:droplet_ip) { "33.33.33.10" }
12
- let(:droplet_ip_private) { "10.20.30.40" }
7
+ let(:ssh_user) { 'baz' }
8
+ let(:ssh_port) { '33' }
9
+ let(:ssh_key_path) { '~/.ssh/id_rsa2' }
10
+ let(:droplet_name) { 'foo' }
11
+ let(:droplet_ip) { '33.33.33.10' }
12
+ let(:droplet_ip_private) { '10.20.30.40' }
13
13
  let(:droplet_id) { 1234 }
14
14
  let(:region) { 'nyc2' }
15
- let(:image) { 'ubuntu-14-04-x64'}
16
- let(:size) { '512mb'}
15
+ let(:image) { 'ubuntu-14-04-x64' }
16
+ let(:size) { '512mb' }
17
17
  let(:ssh_key_id) { '1234' }
18
18
  let(:ssh_key_name) { 'macbook_pro' }
19
19
  let(:ssh_public_key) { 'ssh-dss A123= user@host' }
20
- let(:private_networking) { 'false'}
21
- let(:backups_enabled) { 'false'}
20
+ let(:private_networking) { 'false' }
21
+ let(:backups_enabled) { 'false' }
22
22
  let(:ip6) { 'false' }
23
- let(:ocean) { Barge::Client.new(:access_token => access_token) }
24
- let(:app) { lambda { |env| } }
23
+ let(:ocean) { Barge::Client.new(access_token: access_token) }
24
+ let(:app) { ->(env) {} }
25
25
  let(:env) { {} }
26
+ let(:cli) { Tugboat::CLI.new }
26
27
 
27
- before(:each) do
28
+ before do
28
29
  $stdout.sync = true
29
30
  $stderr.sync = true
30
31
 
31
- @cli = Tugboat::CLI.new
32
-
33
32
  # Set a temprary project path and create fake config.
34
33
  config.create_config_file(access_token, ssh_key_path, ssh_user, ssh_port, region, image, size, ssh_key_id, private_networking, backups_enabled, ip6)
35
34
  config.reload!
@@ -43,15 +42,14 @@ shared_context "spec" do
43
42
  $stdout = StringIO.new
44
43
  end
45
44
 
46
- after(:each) do
45
+ after do
47
46
  # Reassign the stderr / out so rspec can have it back.
48
47
  $stderr = @orig_stderr
49
48
  $stdout = @orig_stdout
50
49
  end
51
50
 
52
- after(:each) do
51
+ after do
53
52
  # Delete the temporary configuration file if it exists.
54
- File.delete(project_path + "/tmp/tugboat") if File.exist?(project_path + "/tmp/tugboat")
53
+ File.delete(project_path + '/tmp/tugboat') if File.exist?(project_path + '/tmp/tugboat')
55
54
  end
56
-
57
55
  end
data/spec/spec_helper.rb CHANGED
@@ -14,7 +14,7 @@ end
14
14
  require 'tugboat'
15
15
  require 'webmock/rspec'
16
16
  require 'barge'
17
- require "shared/environment"
17
+ require 'shared/environment'
18
18
 
19
19
  RSpec.configure do |config|
20
20
  # Pretty tests
@@ -24,11 +24,11 @@ RSpec.configure do |config|
24
24
  end
25
25
 
26
26
  def project_path
27
- File.expand_path("../..", __FILE__)
27
+ File.expand_path('../..', __FILE__)
28
28
  end
29
29
 
30
- def fixture(fixture_name, format='json')
30
+ def fixture(fixture_name, format = 'json')
31
31
  File.new(project_path + "/spec/fixtures/#{fixture_name}.#{format}")
32
32
  end
33
33
 
34
- ENV["TUGBOAT_CONFIG_PATH"] = project_path + "/tmp/tugboat"
34
+ ENV['TUGBOAT_CONFIG_PATH'] = project_path + '/tmp/tugboat'
data/tugboat.gemspec CHANGED
@@ -18,11 +18,12 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ['lib']
19
19
  gem.required_ruby_version = '>= 1.9.2'
20
20
 
21
- gem.add_dependency 'thor', '~> 0.18.1'
22
- gem.add_dependency 'barge', '~> 0.12.0'
23
- gem.add_dependency 'middleware', '~> 0.1.0'
21
+ gem.add_dependency 'thor', '0.18.1'
22
+ gem.add_dependency 'barge', '0.12.0'
23
+ gem.add_dependency 'middleware', '0.1.0'
24
+ gem.add_dependency 'faraday', '0.11.0'
24
25
 
25
- gem.add_development_dependency 'rake'
26
+ gem.add_development_dependency 'rake', '< 11.0'
26
27
  gem.add_development_dependency 'rspec-core', '~> 2.14.0'
27
28
  gem.add_development_dependency 'rspec-expectations', '~> 2.14.0'
28
29
  gem.add_development_dependency 'rspec-mocks', '~> 2.14.0'
@@ -31,8 +32,12 @@ Gem::Specification.new do |gem|
31
32
  gem.add_development_dependency 'simplecov-console', '0.2.0'
32
33
  gem.add_development_dependency 'coveralls', '~> 0.6.7'
33
34
  gem.add_development_dependency 'aruba', '0.7.4'
34
- gem.add_development_dependency 'pry'
35
+ gem.add_development_dependency 'pry', '0.10.4'
36
+ gem.add_development_dependency 'rb-readline', '0.5.3'
35
37
  gem.add_development_dependency 'vcr', '2.9.3'
38
+ gem.add_development_dependency 'cucumber', '2.0.2'
39
+ gem.add_development_dependency 'rubocop', '0.47.1'
40
+ gem.add_development_dependency 'rubocop-rspec', '1.5.0'
36
41
 
37
42
  gem.post_install_message = '***************************************'
38
43
  gem.post_install_message = ' . o .. '
@@ -52,5 +57,4 @@ Gem::Specification.new do |gem|
52
57
  gem.post_install_message = ' The Tugboat 1.0 API EOL as of November 9th 2015'
53
58
  gem.post_install_message = ' Tugboat < 1.0.0 will no longer work from that time'
54
59
  gem.post_install_message = '***************************************'
55
-
56
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tugboat
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Pearkes
@@ -10,64 +10,78 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-02-18 00:00:00.000000000 Z
13
+ date: 2017-03-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - "~>"
19
+ - - '='
20
20
  - !ruby/object:Gem::Version
21
21
  version: 0.18.1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - "~>"
26
+ - - '='
27
27
  - !ruby/object:Gem::Version
28
28
  version: 0.18.1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: barge
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - "~>"
33
+ - - '='
34
34
  - !ruby/object:Gem::Version
35
35
  version: 0.12.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - "~>"
40
+ - - '='
41
41
  - !ruby/object:Gem::Version
42
42
  version: 0.12.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: middleware
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
47
+ - - '='
48
48
  - !ruby/object:Gem::Version
49
49
  version: 0.1.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - "~>"
54
+ - - '='
55
55
  - !ruby/object:Gem::Version
56
56
  version: 0.1.0
57
+ - !ruby/object:Gem::Dependency
58
+ name: faraday
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - '='
62
+ - !ruby/object:Gem::Version
63
+ version: 0.11.0
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - '='
69
+ - !ruby/object:Gem::Version
70
+ version: 0.11.0
57
71
  - !ruby/object:Gem::Dependency
58
72
  name: rake
59
73
  requirement: !ruby/object:Gem::Requirement
60
74
  requirements:
61
- - - ">="
75
+ - - "<"
62
76
  - !ruby/object:Gem::Version
63
- version: '0'
77
+ version: '11.0'
64
78
  type: :development
65
79
  prerelease: false
66
80
  version_requirements: !ruby/object:Gem::Requirement
67
81
  requirements:
68
- - - ">="
82
+ - - "<"
69
83
  - !ruby/object:Gem::Version
70
- version: '0'
84
+ version: '11.0'
71
85
  - !ruby/object:Gem::Dependency
72
86
  name: rspec-core
73
87
  requirement: !ruby/object:Gem::Requirement
@@ -184,16 +198,30 @@ dependencies:
184
198
  name: pry
185
199
  requirement: !ruby/object:Gem::Requirement
186
200
  requirements:
187
- - - ">="
201
+ - - '='
188
202
  - !ruby/object:Gem::Version
189
- version: '0'
203
+ version: 0.10.4
190
204
  type: :development
191
205
  prerelease: false
192
206
  version_requirements: !ruby/object:Gem::Requirement
193
207
  requirements:
194
- - - ">="
208
+ - - '='
195
209
  - !ruby/object:Gem::Version
196
- version: '0'
210
+ version: 0.10.4
211
+ - !ruby/object:Gem::Dependency
212
+ name: rb-readline
213
+ requirement: !ruby/object:Gem::Requirement
214
+ requirements:
215
+ - - '='
216
+ - !ruby/object:Gem::Version
217
+ version: 0.5.3
218
+ type: :development
219
+ prerelease: false
220
+ version_requirements: !ruby/object:Gem::Requirement
221
+ requirements:
222
+ - - '='
223
+ - !ruby/object:Gem::Version
224
+ version: 0.5.3
197
225
  - !ruby/object:Gem::Dependency
198
226
  name: vcr
199
227
  requirement: !ruby/object:Gem::Requirement
@@ -208,6 +236,48 @@ dependencies:
208
236
  - - '='
209
237
  - !ruby/object:Gem::Version
210
238
  version: 2.9.3
239
+ - !ruby/object:Gem::Dependency
240
+ name: cucumber
241
+ requirement: !ruby/object:Gem::Requirement
242
+ requirements:
243
+ - - '='
244
+ - !ruby/object:Gem::Version
245
+ version: 2.0.2
246
+ type: :development
247
+ prerelease: false
248
+ version_requirements: !ruby/object:Gem::Requirement
249
+ requirements:
250
+ - - '='
251
+ - !ruby/object:Gem::Version
252
+ version: 2.0.2
253
+ - !ruby/object:Gem::Dependency
254
+ name: rubocop
255
+ requirement: !ruby/object:Gem::Requirement
256
+ requirements:
257
+ - - '='
258
+ - !ruby/object:Gem::Version
259
+ version: 0.47.1
260
+ type: :development
261
+ prerelease: false
262
+ version_requirements: !ruby/object:Gem::Requirement
263
+ requirements:
264
+ - - '='
265
+ - !ruby/object:Gem::Version
266
+ version: 0.47.1
267
+ - !ruby/object:Gem::Dependency
268
+ name: rubocop-rspec
269
+ requirement: !ruby/object:Gem::Requirement
270
+ requirements:
271
+ - - '='
272
+ - !ruby/object:Gem::Version
273
+ version: 1.5.0
274
+ type: :development
275
+ prerelease: false
276
+ version_requirements: !ruby/object:Gem::Requirement
277
+ requirements:
278
+ - - '='
279
+ - !ruby/object:Gem::Version
280
+ version: 1.5.0
211
281
  description: A command line tool for interacting with your DigitalOcean droplets.
212
282
  email:
213
283
  - jackpearkes@gmail.com
@@ -217,6 +287,7 @@ extensions: []
217
287
  extra_rdoc_files: []
218
288
  files:
219
289
  - ".gitignore"
290
+ - ".rubocop.yml"
220
291
  - ".travis.yml"
221
292
  - CHANGELOG.md
222
293
  - CHANGELOG_old.md
@@ -365,7 +436,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
365
436
  version: '0'
366
437
  requirements: []
367
438
  rubyforge_project:
368
- rubygems_version: 2.5.1
439
+ rubygems_version: 2.6.8
369
440
  signing_key:
370
441
  specification_version: 4
371
442
  summary: A command line tool for interacting with your DigitalOcean droplets.