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
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change Log
2
2
 
3
+ ## [v2.2.2](https://github.com/pearkes/tugboat/tree/v2.2.2) (2016-02-18)
4
+ [Full Changelog](https://github.com/pearkes/tugboat/compare/v2.2.1...v2.2.2)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Changes authorize command to ask for array [\#241](https://github.com/pearkes/tugboat/pull/241) ([petems](https://github.com/petems))
9
+ - Fix ssh key id as fixnum [\#240](https://github.com/pearkes/tugboat/pull/240) ([petems](https://github.com/petems))
10
+ - Fix ssh wait option [\#239](https://github.com/pearkes/tugboat/pull/239) ([petems](https://github.com/petems))
11
+
3
12
  ## [v2.2.1](https://github.com/pearkes/tugboat/tree/v2.2.1) (2016-02-16)
4
13
  [Full Changelog](https://github.com/pearkes/tugboat/compare/v2.2.0...v2.2.1)
5
14
 
data/Gemfile CHANGED
@@ -2,9 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in tugboat.gemspec
4
4
  gemspec
5
-
6
- group :development do
7
- # Random order is not in the Aruba Cucumber yet...
8
- gem 'cucumber', git: 'https://github.com/cucumber/cucumber-ruby.git', tag: 'v2.0.2'
9
- gem 'cucumber-core', git: 'https://github.com/cucumber/cucumber-ruby-core.git', tag: 'v1.2.0'
10
- end
data/README.md CHANGED
@@ -4,6 +4,20 @@
4
4
 
5
5
  A command line tool for interacting with your [DigitalOcean](https://www.digitalocean.com/) droplets.
6
6
 
7
+ ## History
8
+
9
+ When Tugboat was created, DigitalOcean was an extremely new cloud provider. They'd only released their public beta back in [2012](https://whoapi.com/blog/1497/fast-growing-digitalocean-is-fueled-by-customer-love/), and their new SSD backed machines only primiered in early [2013](https://techcrunch.com/2013/01/15/techstars-graduate-digitalocean-switches-to-ssd-for-its-5-per-month-vps-to-take-on-linode-and-rackspace/).
10
+
11
+ Tugboat started out life around that time, [back in April 2013](https://github.com/pearkes/tugboat/commit/f0fbc1f438cce81c286f0e60014dc4393ac95cb6). Back then, there were no official libraries for DigitalOcean, and the 1.0 API was a bit unstable and occasionally flakey.
12
+
13
+ Since then, DigitalOcean has expanded rapidly and has started offering official libraries.
14
+
15
+ They now have an offically maintained command-line client called [doctl](https://github.com/digitalocean/doctl).
16
+
17
+ Some people have asked, **where does that leave Tugboat?**
18
+
19
+ If you want the bleeding edge of new features and official support from DigitalOcean engineers, **Doctl is the way to go**. However, **as long as there is one other user out there who likes Tugboat and it's workflow, I will try my darndest to maintain this project, investigate bugs, implement new features and merge pull-requests.**
20
+
7
21
  ## Installation
8
22
 
9
23
  gem install tugboat
@@ -124,7 +138,7 @@ match.
124
138
 
125
139
  Print info in machine-readable format. The ``--porcelain`` flag silences extra output for easy parsing. Fuzzy name matching is not supported with the ``--porcelain`` flag.
126
140
 
127
- $ tugboat info -n pearkes-admin-001 --attribute ip --porcelain
141
+ $ tugboat info -n pearkes-admin-001 --porcelain
128
142
  name pearkes-admin-001
129
143
  id 13231512
130
144
  status active
@@ -221,6 +235,24 @@ Or just list images that you have created.
221
235
  San Francisco 1 (slug: sfo1)
222
236
  Singapore 1 (slug: sgp1)
223
237
 
238
+ ### Add SSH keys
239
+
240
+ $ tugboat add-key digitalocean
241
+ Possible public key paths from /Users/pearkes/.ssh:
242
+
243
+ /Users/pearkes/.ssh/digitalocean.pub
244
+ /Users/pearkes/.ssh/fog.pub
245
+ /Users/pearkes/.ssh/github.pub
246
+ /Users/pearkes/.ssh/id_rsa.pub
247
+ /Users/pearkes/.ssh/terraform.pub
248
+
249
+ Enter the path to your SSH key: /Users/petersouter/.ssh/digitalocean.pub
250
+ Queueing upload of SSH key 'digitalocean'...SSH Key uploaded
251
+
252
+ Name: digitalocean
253
+ ID: 1384812
254
+ ...
255
+
224
256
  ### List SSH Keys
225
257
 
226
258
  $ tugboat keys
@@ -279,7 +311,7 @@ D, [2015-12-06T12:04:27.149334 #92772] DEBUG -- : Request Headers:
279
311
  ----------------
280
312
  Authorization : Bearer [TOKEN REDACTED]
281
313
  Content-Type : application/json
282
- User-Agent : Faraday v0.9.2
314
+ User-Agent : Faraday v0.11.0
283
315
 
284
316
  Request Body:
285
317
  -------------
data/Rakefile CHANGED
@@ -4,6 +4,7 @@ Bundler.require(:development)
4
4
  require 'bundler/gem_tasks'
5
5
  require 'rspec/core/rake_task'
6
6
  require 'cucumber/rake/task'
7
+ require 'rubocop/rake_task'
7
8
 
8
9
  RSpec::Core::RakeTask.new(:spec)
9
10
 
@@ -11,4 +12,8 @@ Cucumber::Rake::Task.new(:features) do |t|
11
12
  t.cucumber_opts = %w(--format pretty --order random)
12
13
  end
13
14
 
14
- task :default => [:spec, :features]
15
+ RuboCop::RakeTask.new(:rubocop) do |t|
16
+ t.options = ['--display-cop-names']
17
+ end
18
+
19
+ task default: [:spec, :features]
data/bin/tugboat CHANGED
@@ -3,8 +3,8 @@
3
3
  # https://github.com/mitchellh/vagrant/blob/8cc4910fa9ca6059697459d0cdee1557af8d0507/bin/vagrant#L3-L6
4
4
  # Catch any ctrl+c's to avoid stack traces. Thanks Mitchell. ^^
5
5
 
6
- Signal.trap("INT") { exit 1 }
6
+ Signal.trap('INT') { exit 1 }
7
7
 
8
- require "tugboat"
8
+ require 'tugboat'
9
9
 
10
10
  Tugboat::CLI.start(ARGV)
@@ -12,7 +12,7 @@ http_interactions:
12
12
  Content-Type:
13
13
  - application/json
14
14
  User-Agent:
15
- - Faraday v0.9.2
15
+ - Faraday v0.11.0
16
16
  Accept-Encoding:
17
17
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
18
  Accept:
@@ -12,7 +12,7 @@ http_interactions:
12
12
  Content-Type:
13
13
  - application/json
14
14
  User-Agent:
15
- - Faraday v0.9.2
15
+ - Faraday v0.11.0
16
16
  Accept-Encoding:
17
17
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
18
  Accept:
@@ -1,6 +1,6 @@
1
1
  require 'erb'
2
2
 
3
- Given(/^a '\.tugboat' config with data:$/) do |data_str|
3
+ Given(%r{^a '\.tugboat' config with data:$}) do |data_str|
4
4
  data = ERB.new(data_str).result(binding)
5
5
  File.write("#{Dir.pwd}/tmp/aruba/.tugboat", data)
6
6
  end
@@ -8,16 +8,20 @@ require 'tugboat'
8
8
  VCR.configure do |c|
9
9
  c.hook_into :webmock
10
10
  c.cassette_library_dir = 'features/cassettes'
11
- c.default_cassette_options = { :record => :new_episodes }
11
+ c.default_cassette_options = { record: :new_episodes }
12
12
  end
13
13
 
14
14
  VCR.cucumber_tags do |t|
15
- t.tag '@vcr', :use_scenario_name => true
15
+ t.tag '@vcr', use_scenario_name: true
16
16
  end
17
17
 
18
18
  class VcrFriendlyMain
19
19
  def initialize(argv, stdin, stdout, stderr, kernel)
20
- @argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel
20
+ @argv = argv
21
+ @stdin = stdin
22
+ @stdout = stdout
23
+ @stderr = stderr
24
+ @kernel = kernel
21
25
  end
22
26
 
23
27
  def execute!
data/lib/tugboat.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'tugboat/cli'
2
- require "tugboat/config"
3
- require "tugboat/version"
2
+ require 'tugboat/config'
3
+ require 'tugboat/version'
4
4
  require 'json'
5
5
 
6
6
  module Tugboat
data/lib/tugboat/cli.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'thor'
2
2
 
3
3
  module Tugboat
4
- autoload :Middleware, "tugboat/middleware"
4
+ autoload :Middleware, 'tugboat/middleware'
5
5
 
6
6
  class CLI < Thor
7
7
  include Thor::Actions
@@ -9,21 +9,19 @@ module Tugboat
9
9
 
10
10
  !check_unknown_options
11
11
 
12
- class_option :quiet, type: :boolean, aliases: "-q"
12
+ class_option :quiet, type: :boolean, aliases: '-q'
13
13
 
14
- map "--version" => :version,
15
- "-v" => :version,
16
- "password-reset" => :password_reset
14
+ map '--version' => :version,
15
+ '-v' => :version,
16
+ 'password-reset' => :password_reset
17
17
 
18
- desc "help [COMMAND]", "Describe commands or a specific command"
19
- def help(meth=nil)
18
+ desc 'help [COMMAND]', 'Describe commands or a specific command'
19
+ def help(meth = nil)
20
20
  super
21
- if !meth
22
- say "To learn more or to contribute, please see github.com/pearkes/tugboat"
23
- end
21
+ say 'To learn more or to contribute, please see github.com/pearkes/tugboat' unless meth
24
22
  end
25
23
 
26
- desc "authorize", "Authorize a DigitalOcean account with tugboat"
24
+ desc 'authorize', 'Authorize a DigitalOcean account with tugboat'
27
25
  long_desc "This takes you through a workflow for adding configuration
28
26
  details to tugboat. First, you are asked for your API and Client keys,
29
27
  which are stored in ~/.tugboat.
@@ -35,511 +33,463 @@ module Tugboat
35
33
  $USER environment variable.
36
34
  "
37
35
  def authorize
38
- Middleware.sequence_authorize.call({
39
- "tugboat_action" => __method__,
40
- "user_quiet" => options[:quiet]
41
- })
36
+ Middleware.sequence_authorize.call('tugboat_action' => __method__,
37
+ 'user_quiet' => options[:quiet])
42
38
  end
43
39
 
44
- desc "config", "Show your current config information"
40
+ desc 'config', 'Show your current config information'
45
41
  long_desc "This shows the current information in the .tugboat config
46
42
  being used by the app
47
43
  "
48
- method_option "hide",
49
- :type => :boolean,
50
- :default => true,
51
- :aliases => "-h",
52
- :desc => "Hide your API keys"
44
+ method_option 'hide',
45
+ type: :boolean,
46
+ default: true,
47
+ aliases: '-h',
48
+ desc: 'Hide your API keys'
53
49
  def config
54
- Middleware.sequence_config.call({
55
- "tugboat_action" => __method__,
56
- "user_hide_keys" => options[:hide],
57
- })
50
+ Middleware.sequence_config.call('tugboat_action' => __method__,
51
+ 'user_hide_keys' => options[:hide])
58
52
  end
59
53
 
60
- desc "verify", "Check your DigitalOcean credentials"
54
+ desc 'verify', 'Check your DigitalOcean credentials'
61
55
  long_desc "This tests that your credentials created by the \`authorize\`
62
56
  command that are stored in ~/.tugboat are correct and allow you to connect
63
57
  to the API without errors.
64
58
  "
65
59
  def verify
66
- Middleware.sequence_verify.call({
67
- "tugboat_action" => __method__,
68
- "user_quiet" => options[:quiet]
69
- })
60
+ Middleware.sequence_verify.call('tugboat_action' => __method__,
61
+ 'user_quiet' => options[:quiet])
70
62
  end
71
63
 
72
- method_option "include_urls",
73
- :type => :boolean,
74
- :default => false,
75
- :aliases => "-i",
76
- :desc => "Include URLs for the droplets (can be opened in a browser)"
77
- desc "droplets [OPTIONS]", "Retrieve a list of your droplets"
64
+ method_option 'include_urls',
65
+ type: :boolean,
66
+ default: false,
67
+ aliases: '-i',
68
+ desc: 'Include URLs for the droplets (can be opened in a browser)'
69
+ desc 'droplets [OPTIONS]', 'Retrieve a list of your droplets'
78
70
  def droplets
79
- Middleware.sequence_list_droplets.call({
80
- "tugboat_action" => __method__,
81
- "user_quiet" => options[:quiet],
82
- "include_urls" => options["include_urls"]
83
- })
71
+ Middleware.sequence_list_droplets.call('tugboat_action' => __method__,
72
+ 'user_quiet' => options[:quiet],
73
+ 'include_urls' => options['include_urls'])
84
74
  end
85
75
 
86
- desc "images [OPTIONS]", "Retrieve a list of images"
87
- method_option "show_just_private_images",
88
- :type => :boolean,
89
- :default => false,
90
- :aliases => "-p",
91
- :desc => "Show just private images"
76
+ desc 'images [OPTIONS]', 'Retrieve a list of images'
77
+ method_option 'show_just_private_images',
78
+ type: :boolean,
79
+ default: false,
80
+ aliases: '-p',
81
+ desc: 'Show just private images'
92
82
  def images
93
- Middleware.sequence_list_images.call({
94
- "tugboat_action" => __method__,
95
- "user_show_just_private_images" => options[:show_just_private_images],
96
- "user_quiet" => options[:quiet]
97
- })
83
+ Middleware.sequence_list_images.call('tugboat_action' => __method__,
84
+ 'user_show_just_private_images' => options[:show_just_private_images],
85
+ 'user_quiet' => options[:quiet])
98
86
  end
99
87
 
100
- desc "ssh FUZZY_NAME", "SSH into a droplet"
101
- method_option "id",
102
- :type => :string,
103
- :aliases => "-i",
104
- :desc => "The ID of the droplet."
105
- method_option "name",
106
- :type => :string,
107
- :aliases => "-n",
108
- :desc => "The exact name of the droplet"
109
- method_option "ssh_port",
110
- :type => :string,
111
- :aliases => "-p",
112
- :desc => "The custom SSH Port to connect to"
113
- method_option "use_private_ip",
114
- :type => :boolean,
115
- :aliases => "-t",
116
- :desc => "Use Private IP while private IP is present",
117
- :default => false
118
- method_option "ssh_user",
119
- :type => :string,
120
- :aliases => "-u",
121
- :desc => "Specifies which user to log in as"
122
- method_option "ssh_opts",
123
- :type => :string,
124
- :aliases => "-o",
125
- :desc => "Custom SSH options"
126
- method_option "ssh_command",
127
- :type => :string,
128
- :aliases => [ "-c", "-y" ,],
129
- :desc => "Command to run on the droplet"
130
- method_option "wait",
131
- :type => :boolean,
132
- :aliases => '-w',
133
- :desc => 'Wait for droplet to become active before trying to SSH'
134
- def ssh(name=nil)
135
- Middleware.sequence_ssh_droplet.call({
136
- "tugboat_action" => __method__,
137
- "user_droplet_id" => options[:id],
138
- "user_droplet_name" => options[:name],
139
- "user_droplet_fuzzy_name" => name,
140
- "user_droplet_ssh_port" => options[:ssh_port],
141
- "user_droplet_ssh_user" => options[:ssh_user],
142
- "user_droplet_use_private_ip" => options[:use_private_ip],
143
- "user_droplet_ssh_opts" => options[:ssh_opts],
144
- "user_droplet_ssh_command" => options[:ssh_command],
145
- "user_droplet_ssh_wait" => options[:wait],
146
- "user_quiet" => options[:quiet],
147
- })
88
+ desc 'ssh FUZZY_NAME', 'SSH into a droplet'
89
+ method_option 'id',
90
+ type: :string,
91
+ aliases: '-i',
92
+ desc: 'The ID of the droplet.'
93
+ method_option 'name',
94
+ type: :string,
95
+ aliases: '-n',
96
+ desc: 'The exact name of the droplet'
97
+ method_option 'ssh_port',
98
+ type: :string,
99
+ aliases: '-p',
100
+ desc: 'The custom SSH Port to connect to'
101
+ method_option 'use_private_ip',
102
+ type: :boolean,
103
+ aliases: '-t',
104
+ desc: 'Use Private IP while private IP is present',
105
+ default: false
106
+ method_option 'ssh_user',
107
+ type: :string,
108
+ aliases: '-u',
109
+ desc: 'Specifies which user to log in as'
110
+ method_option 'ssh_opts',
111
+ type: :string,
112
+ aliases: '-o',
113
+ desc: 'Custom SSH options'
114
+ method_option 'ssh_command',
115
+ type: :string,
116
+ aliases: ['-c', '-y'],
117
+ desc: 'Command to run on the droplet'
118
+ method_option 'wait',
119
+ type: :boolean,
120
+ aliases: '-w',
121
+ desc: 'Wait for droplet to become active before trying to SSH'
122
+ def ssh(name = nil)
123
+ Middleware.sequence_ssh_droplet.call('tugboat_action' => __method__,
124
+ 'user_droplet_id' => options[:id],
125
+ 'user_droplet_name' => options[:name],
126
+ 'user_droplet_fuzzy_name' => name,
127
+ 'user_droplet_ssh_port' => options[:ssh_port],
128
+ 'user_droplet_ssh_user' => options[:ssh_user],
129
+ 'user_droplet_use_private_ip' => options[:use_private_ip],
130
+ 'user_droplet_ssh_opts' => options[:ssh_opts],
131
+ 'user_droplet_ssh_command' => options[:ssh_command],
132
+ 'user_droplet_ssh_wait' => options[:wait],
133
+ 'user_quiet' => options[:quiet])
148
134
  end
149
135
 
150
- desc "create NAME", "Create a droplet."
151
- method_option "size",
152
- :type => :string,
153
- :aliases => "-s",
154
- :desc => "The size slug of the droplet"
155
- method_option "image",
156
- :type => :string,
157
- :aliases => "-i",
158
- :desc => "The image slug of the droplet"
159
- method_option "region",
160
- :type => :string,
161
- :aliases => "-r",
162
- :desc => "The region slug of the droplet"
163
- method_option "keys",
164
- :type => :string,
165
- :aliases => "-k",
166
- :desc => "A comma separated list of SSH key ids to add to the droplet"
167
- method_option "private_networking",
168
- :type => :boolean,
169
- :aliases => "-p",
170
- :desc => "Enable private networking on the droplet"
171
- method_option "ip6",
172
- :type => :boolean,
173
- :aliases => "-l",
174
- :desc => "Enable IP6 on the droplet"
175
- method_option "user_data",
176
- :type => :string,
177
- :aliases => "-u",
178
- :desc => "Location of a file to read and use as user data"
179
- method_option "backups_enabled",
180
- :type => :boolean,
181
- :aliases => "-b",
182
- :desc => "Enable backups on the droplet"
136
+ desc 'create NAME', 'Create a droplet.'
137
+ method_option 'size',
138
+ type: :string,
139
+ aliases: '-s',
140
+ desc: 'The size slug of the droplet'
141
+ method_option 'image',
142
+ type: :string,
143
+ aliases: '-i',
144
+ desc: 'The image slug of the droplet'
145
+ method_option 'region',
146
+ type: :string,
147
+ aliases: '-r',
148
+ desc: 'The region slug of the droplet'
149
+ method_option 'keys',
150
+ type: :string,
151
+ aliases: '-k',
152
+ desc: 'A comma separated list of SSH key ids to add to the droplet'
153
+ method_option 'private_networking',
154
+ type: :boolean,
155
+ aliases: '-p',
156
+ desc: 'Enable private networking on the droplet'
157
+ method_option 'ip6',
158
+ type: :boolean,
159
+ aliases: '-l',
160
+ desc: 'Enable IP6 on the droplet'
161
+ method_option 'user_data',
162
+ type: :string,
163
+ aliases: '-u',
164
+ desc: 'Location of a file to read and use as user data'
165
+ method_option 'backups_enabled',
166
+ type: :boolean,
167
+ aliases: '-b',
168
+ desc: 'Enable backups on the droplet'
183
169
 
184
170
  def create(name)
185
- if name =~ /^(-{0,2}help|-{1,2}h)/
171
+ if name =~ %r{^(-{0,2}help|-{1,2}h)}
186
172
  help('create')
187
173
  return
188
174
  end
189
175
 
190
- Middleware.sequence_create_droplet.call({
191
- "tugboat_action" => __method__,
192
- "create_droplet_ssh_key_ids" => options[:keys],
193
- "create_droplet_size_slug" => options[:size],
194
- "create_droplet_image_slug" => options[:image],
195
- "create_droplet_region_slug" => options[:region],
196
- "create_droplet_private_networking" => options[:private_networking],
197
- "create_droplet_ip6" => options[:ip6],
198
- "create_droplet_user_data" => options[:user_data],
199
- "create_droplet_backups_enabled" => options[:backups_enabled],
200
- "create_droplet_name" => name,
201
- "user_quiet" => options[:quiet]
202
- })
176
+ Middleware.sequence_create_droplet.call('tugboat_action' => __method__,
177
+ 'create_droplet_ssh_key_ids' => options[:keys],
178
+ 'create_droplet_size_slug' => options[:size],
179
+ 'create_droplet_image_slug' => options[:image],
180
+ 'create_droplet_region_slug' => options[:region],
181
+ 'create_droplet_private_networking' => options[:private_networking],
182
+ 'create_droplet_ip6' => options[:ip6],
183
+ 'create_droplet_user_data' => options[:user_data],
184
+ 'create_droplet_backups_enabled' => options[:backups_enabled],
185
+ 'create_droplet_name' => name,
186
+ 'user_quiet' => options[:quiet])
203
187
  end
204
188
 
205
- desc "rebuild FUZZY_NAME IMAGE_NAME", "Rebuild a droplet."
206
- method_option "id",
207
- :type => :string,
208
- :aliases => "-i",
209
- :desc => "The ID of the droplet."
210
- method_option "name",
211
- :type => :string,
212
- :aliases => "-n",
213
- :desc => "The exact name of the droplet"
214
- method_option "confirm",
215
- :type => :boolean,
216
- :aliases => [ "-c", "-y" ,],
217
- :desc => "Skip confirmation of the action"
218
- method_option "image_id",
219
- :type => :numeric,
220
- :aliases => "-k",
221
- :desc => "The ID of the image"
222
- method_option "image_name",
223
- :type => :string,
224
- :aliases => "-m",
225
- :desc => "The exact name of the image"
226
- def rebuild(name=nil, image_name=nil)
227
- Middleware.sequence_rebuild_droplet.call({
228
- "tugboat_action" => __method__,
229
- "user_droplet_id" => options[:id],
230
- "user_droplet_name" => options[:name],
231
- "user_droplet_fuzzy_name" => name,
232
- "user_image_id" => options[:image_id],
233
- "user_image_name" => options[:image_name],
234
- "user_image_fuzzy_name" => image_name,
235
- "user_confirm_action" => options[:confirm],
236
- "user_quiet" => options[:quiet]
237
- })
189
+ desc 'rebuild FUZZY_NAME IMAGE_NAME', 'Rebuild a droplet.'
190
+ method_option 'id',
191
+ type: :string,
192
+ aliases: '-i',
193
+ desc: 'The ID of the droplet.'
194
+ method_option 'name',
195
+ type: :string,
196
+ aliases: '-n',
197
+ desc: 'The exact name of the droplet'
198
+ method_option 'confirm',
199
+ type: :boolean,
200
+ aliases: ['-c', '-y'],
201
+ desc: 'Skip confirmation of the action'
202
+ method_option 'image_id',
203
+ type: :numeric,
204
+ aliases: '-k',
205
+ desc: 'The ID of the image'
206
+ method_option 'image_name',
207
+ type: :string,
208
+ aliases: '-m',
209
+ desc: 'The exact name of the image'
210
+ def rebuild(name = nil, image_name = nil)
211
+ Middleware.sequence_rebuild_droplet.call('tugboat_action' => __method__,
212
+ 'user_droplet_id' => options[:id],
213
+ 'user_droplet_name' => options[:name],
214
+ 'user_droplet_fuzzy_name' => name,
215
+ 'user_image_id' => options[:image_id],
216
+ 'user_image_name' => options[:image_name],
217
+ 'user_image_fuzzy_name' => image_name,
218
+ 'user_confirm_action' => options[:confirm],
219
+ 'user_quiet' => options[:quiet])
238
220
  end
239
221
 
240
- desc "destroy FUZZY_NAME", "Destroy a droplet"
241
- method_option "id",
242
- :type => :string,
243
- :aliases => "-i",
244
- :desc => "The ID of the droplet."
245
- method_option "name",
246
- :type => :string,
247
- :aliases => "-n",
248
- :desc => "The exact name of the droplet"
249
- method_option "confirm",
250
- :type => :boolean,
251
- :aliases => [ "-c", "-y" ,],
252
- :desc => "Skip confirmation of the action"
253
- def destroy(name=nil)
254
- Middleware.sequence_destroy_droplet.call({
255
- "tugboat_action" => __method__,
256
- "user_droplet_id" => options[:id],
257
- "user_droplet_name" => options[:name],
258
- "user_confirm_action" => options[:confirm],
259
- "user_droplet_fuzzy_name" => name,
260
- "user_quiet" => options[:quiet]
261
- })
222
+ desc 'destroy FUZZY_NAME', 'Destroy a droplet'
223
+ method_option 'id',
224
+ type: :string,
225
+ aliases: '-i',
226
+ desc: 'The ID of the droplet.'
227
+ method_option 'name',
228
+ type: :string,
229
+ aliases: '-n',
230
+ desc: 'The exact name of the droplet'
231
+ method_option 'confirm',
232
+ type: :boolean,
233
+ aliases: ['-c', '-y'],
234
+ desc: 'Skip confirmation of the action'
235
+ def destroy(name = nil)
236
+ Middleware.sequence_destroy_droplet.call('tugboat_action' => __method__,
237
+ 'user_droplet_id' => options[:id],
238
+ 'user_droplet_name' => options[:name],
239
+ 'user_confirm_action' => options[:confirm],
240
+ 'user_droplet_fuzzy_name' => name,
241
+ 'user_quiet' => options[:quiet])
262
242
  end
263
243
 
264
- desc "destroy_image FUZZY_NAME", "Destroy an image"
265
- method_option "id",
266
- :type => :string,
267
- :aliases => "-i",
268
- :desc => "The ID of the image."
269
- method_option "name",
270
- :type => :string,
271
- :aliases => "-n",
272
- :desc => "The exact name of the image"
273
- method_option "confirm",
274
- :type => :boolean,
275
- :aliases => [ "-c", "-y" ,],
276
- :desc => "Skip confirmation of the action"
277
- def destroy_image(name=nil)
278
- Middleware.sequence_destroy_image.call({
279
- "tugboat_action" => __method__,
280
- "user_image_id" => options[:id],
281
- "user_image_name" => options[:name],
282
- "user_image_fuzzy_name" => name,
283
- "user_confirm_action" => options[:confirm],
284
- "user_quiet" => options[:quiet]
285
- })
244
+ desc 'destroy_image FUZZY_NAME', 'Destroy an image'
245
+ method_option 'id',
246
+ type: :string,
247
+ aliases: '-i',
248
+ desc: 'The ID of the image.'
249
+ method_option 'name',
250
+ type: :string,
251
+ aliases: '-n',
252
+ desc: 'The exact name of the image'
253
+ method_option 'confirm',
254
+ type: :boolean,
255
+ aliases: ['-c', '-y'],
256
+ desc: 'Skip confirmation of the action'
257
+ def destroy_image(name = nil)
258
+ Middleware.sequence_destroy_image.call('tugboat_action' => __method__,
259
+ 'user_image_id' => options[:id],
260
+ 'user_image_name' => options[:name],
261
+ 'user_image_fuzzy_name' => name,
262
+ 'user_confirm_action' => options[:confirm],
263
+ 'user_quiet' => options[:quiet])
286
264
  end
287
265
 
288
- desc "restart FUZZY_NAME", "Restart a droplet"
289
- method_option "id",
290
- :type => :string,
291
- :aliases => "-i",
292
- :desc => "The ID of the droplet."
293
- method_option "name",
294
- :type => :string,
295
- :aliases => "-n",
296
- :desc => "The exact name of the droplet"
297
- method_option "hard",
298
- :type => :boolean,
299
- :aliases => "-h",
300
- :desc => "Perform a hard restart"
301
- def restart(name=nil)
302
- Middleware.sequence_restart_droplet.call({
303
- "tugboat_action" => __method__,
304
- "user_droplet_id" => options[:id],
305
- "user_droplet_name" => options[:name],
306
- "user_droplet_hard" => options[:hard],
307
- "user_droplet_fuzzy_name" => name,
308
- "user_quiet" => options[:quiet]
309
- })
266
+ desc 'restart FUZZY_NAME', 'Restart a droplet'
267
+ method_option 'id',
268
+ type: :string,
269
+ aliases: '-i',
270
+ desc: 'The ID of the droplet.'
271
+ method_option 'name',
272
+ type: :string,
273
+ aliases: '-n',
274
+ desc: 'The exact name of the droplet'
275
+ method_option 'hard',
276
+ type: :boolean,
277
+ aliases: '-h',
278
+ desc: 'Perform a hard restart'
279
+ def restart(name = nil)
280
+ Middleware.sequence_restart_droplet.call('tugboat_action' => __method__,
281
+ 'user_droplet_id' => options[:id],
282
+ 'user_droplet_name' => options[:name],
283
+ 'user_droplet_hard' => options[:hard],
284
+ 'user_droplet_fuzzy_name' => name,
285
+ 'user_quiet' => options[:quiet])
310
286
  end
311
287
 
312
- desc "halt FUZZY_NAME", "Shutdown a droplet"
313
- method_option "id",
314
- :type => :string,
315
- :aliases => "-i",
316
- :desc => "The ID of the droplet."
317
- method_option "name",
318
- :type => :string,
319
- :aliases => "-n",
320
- :desc => "The exact name of the droplet"
321
- method_option "hard",
322
- :type => :boolean,
323
- :aliases => "-h",
324
- :desc => "Perform a hard shutdown"
325
- def halt(name=nil)
326
- Middleware.sequence_halt_droplet.call({
327
- "tugboat_action" => __method__,
328
- "user_droplet_id" => options[:id],
329
- "user_droplet_name" => options[:name],
330
- "user_droplet_hard" => options[:hard],
331
- "user_droplet_fuzzy_name" => name,
332
- "user_quiet" => options[:quiet]
333
- })
288
+ desc 'halt FUZZY_NAME', 'Shutdown a droplet'
289
+ method_option 'id',
290
+ type: :string,
291
+ aliases: '-i',
292
+ desc: 'The ID of the droplet.'
293
+ method_option 'name',
294
+ type: :string,
295
+ aliases: '-n',
296
+ desc: 'The exact name of the droplet'
297
+ method_option 'hard',
298
+ type: :boolean,
299
+ aliases: '-h',
300
+ desc: 'Perform a hard shutdown'
301
+ def halt(name = nil)
302
+ Middleware.sequence_halt_droplet.call('tugboat_action' => __method__,
303
+ 'user_droplet_id' => options[:id],
304
+ 'user_droplet_name' => options[:name],
305
+ 'user_droplet_hard' => options[:hard],
306
+ 'user_droplet_fuzzy_name' => name,
307
+ 'user_quiet' => options[:quiet])
334
308
  end
335
309
 
336
- desc "info FUZZY_NAME [OPTIONS]", "Show a droplet's information"
337
- method_option "id",
338
- :type => :string,
339
- :aliases => "-i",
340
- :desc => "The ID of the droplet."
341
- method_option "name",
342
- :type => :string,
343
- :aliases => "-n",
344
- :desc => "The exact name of the droplet"
345
- method_option "attribute",
346
- :type => :string,
347
- :aliases => "-a",
348
- :desc => "The name of the attribute to print."
349
- method_option "porcelain",
350
- :type => :boolean,
351
- :desc => "Give the output in an easy-to-parse format for scripts."
352
- def info(name=nil)
353
- Middleware.sequence_info_droplet.call({
354
- "tugboat_action" => __method__,
355
- "user_droplet_id" => options[:id],
356
- "user_droplet_name" => options[:name],
357
- "user_droplet_fuzzy_name" => name,
358
- "user_quiet" => options[:quiet],
359
- "user_attribute" => options[:attribute],
360
- "user_porcelain" => options[:porcelain]
361
- })
310
+ desc 'info FUZZY_NAME [OPTIONS]', "Show a droplet's information"
311
+ method_option 'id',
312
+ type: :string,
313
+ aliases: '-i',
314
+ desc: 'The ID of the droplet.'
315
+ method_option 'name',
316
+ type: :string,
317
+ aliases: '-n',
318
+ desc: 'The exact name of the droplet'
319
+ method_option 'attribute',
320
+ type: :string,
321
+ aliases: '-a',
322
+ desc: 'The name of the attribute to print.'
323
+ method_option 'porcelain',
324
+ type: :boolean,
325
+ desc: 'Give the output in an easy-to-parse format for scripts.'
326
+ def info(name = nil)
327
+ Middleware.sequence_info_droplet.call('tugboat_action' => __method__,
328
+ 'user_droplet_id' => options[:id],
329
+ 'user_droplet_name' => options[:name],
330
+ 'user_droplet_fuzzy_name' => name,
331
+ 'user_quiet' => options[:quiet],
332
+ 'user_attribute' => options[:attribute],
333
+ 'user_porcelain' => options[:porcelain])
362
334
  end
363
335
 
364
- desc "info_image FUZZY_NAME [OPTIONS]", "Show an image's information"
365
- method_option "id",
366
- :type => :string,
367
- :aliases => "-i",
368
- :desc => "The ID of the image."
369
- method_option "name",
370
- :type => :string,
371
- :aliases => "-n",
372
- :desc => "The exact name of the image"
373
- def info_image(name=nil)
374
- Middleware.sequence_info_image.call({
375
- "tugboat_action" => __method__,
376
- "user_image_id" => options[:id],
377
- "user_image_name" => options[:name],
378
- "user_image_fuzzy_name" => name,
379
- "user_quiet" => options[:quiet]
380
- })
336
+ desc 'info_image FUZZY_NAME [OPTIONS]', "Show an image's information"
337
+ method_option 'id',
338
+ type: :string,
339
+ aliases: '-i',
340
+ desc: 'The ID of the image.'
341
+ method_option 'name',
342
+ type: :string,
343
+ aliases: '-n',
344
+ desc: 'The exact name of the image'
345
+ def info_image(name = nil)
346
+ Middleware.sequence_info_image.call('tugboat_action' => __method__,
347
+ 'user_image_id' => options[:id],
348
+ 'user_image_name' => options[:name],
349
+ 'user_image_fuzzy_name' => name,
350
+ 'user_quiet' => options[:quiet])
381
351
  end
382
352
 
383
- desc "snapshot SNAPSHOT_NAME FUZZY_NAME [OPTIONS]", "Queue a snapshot of the droplet."
384
- method_option "id",
385
- :type => :string,
386
- :aliases => "-i",
387
- :desc => "The ID of the droplet."
388
- method_option "name",
389
- :type => :string,
390
- :aliases => "-n",
391
- :desc => "The exact name of the droplet"
392
- def snapshot(snapshot_name, name=nil)
393
- Middleware.sequence_snapshot_droplet.call({
394
- "tugboat_action" => __method__,
395
- "user_droplet_id" => options[:id],
396
- "user_droplet_name" => options[:name],
397
- "user_droplet_fuzzy_name" => name,
398
- "user_snapshot_name" => snapshot_name,
399
- "user_quiet" => options[:quiet]
400
- })
353
+ desc 'snapshot SNAPSHOT_NAME FUZZY_NAME [OPTIONS]', 'Queue a snapshot of the droplet.'
354
+ method_option 'id',
355
+ type: :string,
356
+ aliases: '-i',
357
+ desc: 'The ID of the droplet.'
358
+ method_option 'name',
359
+ type: :string,
360
+ aliases: '-n',
361
+ desc: 'The exact name of the droplet'
362
+ def snapshot(snapshot_name, name = nil)
363
+ Middleware.sequence_snapshot_droplet.call('tugboat_action' => __method__,
364
+ 'user_droplet_id' => options[:id],
365
+ 'user_droplet_name' => options[:name],
366
+ 'user_droplet_fuzzy_name' => name,
367
+ 'user_snapshot_name' => snapshot_name,
368
+ 'user_quiet' => options[:quiet])
401
369
  end
402
370
 
403
- desc "keys", "Show available SSH keys"
371
+ desc 'keys', 'Show available SSH keys'
404
372
  def keys
405
- Middleware.sequence_ssh_keys.call({
406
- "tugboat_action" => __method__,
407
- })
373
+ Middleware.sequence_ssh_keys.call('tugboat_action' => __method__)
408
374
  end
409
375
 
410
- desc "add-key KEY-NAME", "Upload an ssh public key to DigitalOcean, to be assigned to a droplet later"
376
+ desc 'add-key KEY-NAME', 'Upload an ssh public key to DigitalOcean, to be assigned to a droplet later'
411
377
  long_desc "This uploads a ssh-key to DigitalOcean, which you can then assign to a droplet at
412
378
  creation time so you can connect to it with the key rather than a password.
413
379
  "
414
- method_option "key",
415
- :type => :string,
416
- :aliases => "-k",
417
- :desc => "The string of the key"
418
- method_option "path",
419
- :type => :string,
420
- :aliases => "-p",
421
- :desc => "The path to the ssh key"
380
+ method_option 'key',
381
+ type: :string,
382
+ aliases: '-k',
383
+ desc: 'The string of the key'
384
+ method_option 'path',
385
+ type: :string,
386
+ aliases: '-p',
387
+ desc: 'The path to the ssh key'
422
388
  def add_key(name)
423
- Middleware.sequence_add_key.call({
424
- "tugboat_action" => __method__,
425
- "add_key_name" => name,
426
- "add_key_pub_key" => options[:key],
427
- "add_key_file_path" => options[:path],
428
- "user_quiet" => options[:quiet]
429
- })
389
+ Middleware.sequence_add_key.call('tugboat_action' => __method__,
390
+ 'add_key_name' => name,
391
+ 'add_key_pub_key' => options[:key],
392
+ 'add_key_file_path' => options[:path],
393
+ 'user_quiet' => options[:quiet])
430
394
  end
431
395
 
432
- desc "regions", "Show regions"
396
+ desc 'regions', 'Show regions'
433
397
  def regions
434
- Middleware.sequence_regions.call({
435
- "tugboat_action" => __method__,
436
- "user_quiet" => options[:quiet]
437
- })
398
+ Middleware.sequence_regions.call('tugboat_action' => __method__,
399
+ 'user_quiet' => options[:quiet])
438
400
  end
439
401
 
440
- desc "version", "Show version"
402
+ desc 'version', 'Show version'
441
403
  def version
442
404
  say "Tugboat #{Tugboat::VERSION}"
443
405
  end
444
406
 
445
- desc "sizes", "Show available droplet sizes"
407
+ desc 'sizes', 'Show available droplet sizes'
446
408
  def sizes
447
- Middleware.sequence_sizes.call({
448
- "tugboat_action" => __method__,
449
- "user_quiet" => options[:quiet]
450
- })
409
+ Middleware.sequence_sizes.call('tugboat_action' => __method__,
410
+ 'user_quiet' => options[:quiet])
451
411
  end
452
412
 
453
- desc "start FUZZY_NAME", "Start a droplet"
454
- method_option "id",
455
- :type => :string,
456
- :aliases => "-i",
457
- :desc => "The ID of the droplet."
458
- method_option "name",
459
- :type => :string,
460
- :aliases => "-n",
461
- :desc => "The exact name of the droplet"
462
- def start(name=nil)
463
- Middleware.sequence_start_droplet.call({
464
- "tugboat_action" => __method__,
465
- "user_droplet_id" => options[:id],
466
- "user_droplet_name" => options[:name],
467
- "user_droplet_fuzzy_name" => name,
468
- "user_quiet" => options[:quiet]
469
- })
413
+ desc 'start FUZZY_NAME', 'Start a droplet'
414
+ method_option 'id',
415
+ type: :string,
416
+ aliases: '-i',
417
+ desc: 'The ID of the droplet.'
418
+ method_option 'name',
419
+ type: :string,
420
+ aliases: '-n',
421
+ desc: 'The exact name of the droplet'
422
+ def start(name = nil)
423
+ Middleware.sequence_start_droplet.call('tugboat_action' => __method__,
424
+ 'user_droplet_id' => options[:id],
425
+ 'user_droplet_name' => options[:name],
426
+ 'user_droplet_fuzzy_name' => name,
427
+ 'user_quiet' => options[:quiet])
470
428
  end
471
429
 
472
- desc "resize FUZZY_NAME", "Resize a droplet"
473
- method_option "id",
474
- :type => :numeric,
475
- :aliases => "-i",
476
- :desc => "The ID of the droplet."
477
- method_option "name",
478
- :type => :string,
479
- :aliases => "-n",
480
- :desc => "The exact name of the droplet"
481
- method_option "size",
482
- :type => :string,
483
- :aliases => "-s",
484
- :required => true,
485
- :desc => "The size slug to resize the droplet to"
486
- def resize(name=nil)
487
- Middleware.sequence_resize_droplet.call({
488
- "tugboat_action" => __method__,
489
- "user_droplet_id" => options[:id],
490
- "user_droplet_name" => options[:name],
491
- "user_droplet_size" => options[:size],
492
- "user_droplet_fuzzy_name" => name,
493
- "user_quiet" => options[:quiet]
494
- })
430
+ desc 'resize FUZZY_NAME', 'Resize a droplet'
431
+ method_option 'id',
432
+ type: :numeric,
433
+ aliases: '-i',
434
+ desc: 'The ID of the droplet.'
435
+ method_option 'name',
436
+ type: :string,
437
+ aliases: '-n',
438
+ desc: 'The exact name of the droplet'
439
+ method_option 'size',
440
+ type: :string,
441
+ aliases: '-s',
442
+ required: true,
443
+ desc: 'The size slug to resize the droplet to'
444
+ def resize(name = nil)
445
+ Middleware.sequence_resize_droplet.call('tugboat_action' => __method__,
446
+ 'user_droplet_id' => options[:id],
447
+ 'user_droplet_name' => options[:name],
448
+ 'user_droplet_size' => options[:size],
449
+ 'user_droplet_fuzzy_name' => name,
450
+ 'user_quiet' => options[:quiet])
495
451
  end
496
452
 
497
- desc "password-reset FUZZY_NAME", "Reset root password"
498
- method_option "id",
499
- :type => :numeric,
500
- :aliases => "-i",
501
- :desc => "The ID of the droplet."
502
- method_option "name",
503
- :type => :string,
504
- :aliases => "-n",
505
- :desc => "The exact name of the droplet"
506
-
507
- def password_reset(name=nil)
508
- Middleware.sequence_password_reset.call({
509
- "tugboat_action" => __method__,
510
- "user_droplet_id" => options[:id],
511
- "user_droplet_name" => options[:name],
512
- "user_droplet_fuzzy_name" => name,
513
- "user_quiet" => options[:quiet]
514
- })
453
+ desc 'password-reset FUZZY_NAME', 'Reset root password'
454
+ method_option 'id',
455
+ type: :numeric,
456
+ aliases: '-i',
457
+ desc: 'The ID of the droplet.'
458
+ method_option 'name',
459
+ type: :string,
460
+ aliases: '-n',
461
+ desc: 'The exact name of the droplet'
462
+
463
+ def password_reset(name = nil)
464
+ Middleware.sequence_password_reset.call('tugboat_action' => __method__,
465
+ 'user_droplet_id' => options[:id],
466
+ 'user_droplet_name' => options[:name],
467
+ 'user_droplet_fuzzy_name' => name,
468
+ 'user_quiet' => options[:quiet])
515
469
  end
516
470
 
517
- desc "wait FUZZY_NAME", "Wait for a droplet to reach a state"
518
- method_option "id",
519
- :type => :numeric,
520
- :aliases => "-i",
521
- :desc => "The ID of the droplet."
522
- method_option "name",
523
- :type => :string,
524
- :aliases => "-n",
525
- :desc => "The exact name of the droplet"
526
- method_option "state",
527
- :type => :string,
528
- :aliases => "-s",
529
- :default => "active",
530
- :desc => "The state of the droplet to wait for"
531
-
532
- def wait(name=nil)
533
- Middleware.sequence_wait.call({
534
- "tugboat_action" => __method__,
535
- "user_droplet_id" => options[:id],
536
- "user_droplet_name" => options[:name],
537
- "user_droplet_desired_state" => options[:state],
538
- "user_droplet_fuzzy_name" => name,
539
- "user_quiet" => options[:quiet]
540
- })
471
+ desc 'wait FUZZY_NAME', 'Wait for a droplet to reach a state'
472
+ method_option 'id',
473
+ type: :numeric,
474
+ aliases: '-i',
475
+ desc: 'The ID of the droplet.'
476
+ method_option 'name',
477
+ type: :string,
478
+ aliases: '-n',
479
+ desc: 'The exact name of the droplet'
480
+ method_option 'state',
481
+ type: :string,
482
+ aliases: '-s',
483
+ default: 'active',
484
+ desc: 'The state of the droplet to wait for'
485
+
486
+ def wait(name = nil)
487
+ Middleware.sequence_wait.call('tugboat_action' => __method__,
488
+ 'user_droplet_id' => options[:id],
489
+ 'user_droplet_name' => options[:name],
490
+ 'user_droplet_desired_state' => options[:state],
491
+ 'user_droplet_fuzzy_name' => name,
492
+ 'user_quiet' => options[:quiet])
541
493
  end
542
494
  end
543
495
  end
544
-
545
-