tugboat 2.2.4 → 3.0.0
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +284 -274
- data/README.md +1 -1
- data/features/cassettes/config/Array_of_SSH_Keys_in_Config.yml +1 -1
- data/features/cassettes/config/Single_SSH_key_as_number_in_config.yml +1 -1
- data/lib/tugboat.rb +4 -0
- data/lib/tugboat/middleware/create_droplet.rb +1 -1
- data/lib/tugboat/middleware/custom_logger.rb +3 -1
- data/lib/tugboat/middleware/inject_client.rb +3 -0
- data/lib/tugboat/middleware/list_regions.rb +2 -2
- data/lib/tugboat/middleware/list_sizes.rb +2 -2
- data/lib/tugboat/version.rb +1 -1
- data/license/dependency_decisions.yml +6 -0
- data/spec/cli/authorize_cli_spec.rb +2 -2
- data/spec/cli/create_cli_spec.rb +10 -10
- data/spec/cli/debug_cli_spec.rb +4 -4
- data/spec/cli/destroy_cli_spec.rb +14 -14
- data/spec/cli/destroy_image_cli_spec.rb +8 -8
- data/spec/cli/droplets_cli_spec.rb +13 -13
- data/spec/cli/env_variable_spec.rb +2 -2
- data/spec/cli/halt_cli_spec.rb +15 -15
- data/spec/cli/images_cli_spec.rb +6 -6
- data/spec/cli/info_cli_spec.rb +32 -32
- data/spec/cli/info_image_cli_spec.rb +13 -13
- data/spec/cli/keys_cli_spec.rb +1 -1
- data/spec/cli/password_reset_cli_spec.rb +13 -13
- data/spec/cli/rebuild_cli_spec.rb +48 -48
- data/spec/cli/regions_cli_spec.rb +3 -3
- data/spec/cli/resize_cli_spec.rb +12 -12
- data/spec/cli/restart_cli_spec.rb +12 -12
- data/spec/cli/sizes_cli_spec.rb +2 -2
- data/spec/cli/snapshot_cli_spec.rb +11 -11
- data/spec/cli/ssh_cli_spec.rb +6 -6
- data/spec/cli/start_cli_spec.rb +11 -11
- data/spec/cli/verify_cli_spec.rb +3 -3
- data/spec/cli/wait_cli_spec.rb +11 -11
- data/spec/middleware/check_credentials_spec.rb +1 -1
- data/spec/middleware/inject_client_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -0
- data/tugboat.gemspec +3 -1
- metadata +34 -6
data/README.md
CHANGED
@@ -311,7 +311,7 @@ D, [2015-12-06T12:04:27.149334 #92772] DEBUG -- : Request Headers:
|
|
311
311
|
----------------
|
312
312
|
Authorization : Bearer [TOKEN REDACTED]
|
313
313
|
Content-Type : application/json
|
314
|
-
User-Agent : Faraday v0.
|
314
|
+
User-Agent : Faraday v0.9.2
|
315
315
|
|
316
316
|
Request Body:
|
317
317
|
-------------
|
data/lib/tugboat.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'barge'
|
2
|
+
require 'droplet_kit'
|
2
3
|
require File.expand_path('../custom_logger', __FILE__)
|
3
4
|
|
4
5
|
module Tugboat
|
@@ -11,8 +12,10 @@ module Tugboat
|
|
11
12
|
@access_token = env['config'].access_token
|
12
13
|
|
13
14
|
env['barge'] = Barge::Client.new(access_token: @access_token)
|
15
|
+
env['droplet_kit'] = DropletKit::Client.new(access_token: @access_token)
|
14
16
|
|
15
17
|
env['barge'].faraday.use CustomLogger if ENV['DEBUG']
|
18
|
+
env['droplet_kit'].connection.use CustomLogger if ENV['DEBUG']
|
16
19
|
|
17
20
|
@app.call(env)
|
18
21
|
end
|
@@ -2,8 +2,8 @@ module Tugboat
|
|
2
2
|
module Middleware
|
3
3
|
class ListRegions < Base
|
4
4
|
def call(env)
|
5
|
-
ocean = env['
|
6
|
-
regions = ocean.
|
5
|
+
ocean = env['droplet_kit']
|
6
|
+
regions = ocean.regions.all.sort_by(&:name)
|
7
7
|
|
8
8
|
say 'Regions:'
|
9
9
|
regions.each do |region|
|
data/lib/tugboat/version.rb
CHANGED
@@ -78,3 +78,9 @@
|
|
78
78
|
:why: The OSL license is a copyleft license
|
79
79
|
:versions: []
|
80
80
|
:when: 2017-03-18 22:06:15.540105000 Z
|
81
|
+
- - :approve
|
82
|
+
- minitest
|
83
|
+
- :who:
|
84
|
+
:why: MIT licensed but in the README, can remove when this PR merged - https://github.com/seattlerb/minitest/pull/665
|
85
|
+
:versions: []
|
86
|
+
:when: 2017-06-22 15:25:27.212303000 Z
|
@@ -11,7 +11,7 @@ describe Tugboat::CLI do
|
|
11
11
|
|
12
12
|
it 'asks the right questions and checks credentials' do
|
13
13
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
14
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
14
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
15
15
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
16
16
|
|
17
17
|
expect($stdout).to receive(:print).exactly(6).times
|
@@ -60,7 +60,7 @@ describe Tugboat::CLI do
|
|
60
60
|
|
61
61
|
it 'sets defaults if no input given' do
|
62
62
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
63
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => %r{Bearer}, 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
63
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => %r{Bearer}, 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
64
64
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
65
65
|
|
66
66
|
expect($stdout).to receive(:print).exactly(6).times
|
data/spec/cli/create_cli_spec.rb
CHANGED
@@ -7,55 +7,55 @@ describe Tugboat::CLI do
|
|
7
7
|
it 'with a name, uses defaults from configuration' do
|
8
8
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets').
|
9
9
|
with(body: '{"name":"foo","size":"512mb","image":"ubuntu-14-04-x64","region":"nyc2","ssh_keys":["1234"],"private_networking":"false","backups_enabled":"false","ipv6":"false","user_data":null}',
|
10
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
10
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
11
11
|
to_return(status: 200, body: fixture('create_droplet'), headers: {})
|
12
12
|
|
13
13
|
cli.create(droplet_name)
|
14
14
|
|
15
15
|
expect($stdout.string).to eq <<-eos
|
16
|
-
Queueing creation of droplet '#{droplet_name}'...Droplet created!
|
16
|
+
Queueing creation of droplet '#{droplet_name}'...Droplet created! Droplet ID is 3164494
|
17
17
|
eos
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'with args does not use defaults from configuration' do
|
21
21
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets').
|
22
22
|
with(body: '{"name":"example.com","size":"1gb","image":"ubuntu-12-04-x64","region":"nyc3","ssh_keys":["foo_bar_key"],"private_networking":"false","backups_enabled":"false","ipv6":"false","user_data":null}',
|
23
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
23
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
24
24
|
to_return(status: 200, body: fixture('create_droplet'), headers: {})
|
25
25
|
|
26
26
|
cli.options = cli.options.merge(image: 'ubuntu-12-04-x64', size: '1gb', region: 'nyc3', keys: 'foo_bar_key')
|
27
27
|
cli.create('example.com')
|
28
28
|
|
29
29
|
expect($stdout.string).to eq <<-eos
|
30
|
-
Queueing creation of droplet 'example.com'...Droplet created!
|
30
|
+
Queueing creation of droplet 'example.com'...Droplet created! Droplet ID is 3164494
|
31
31
|
eos
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'with ip6 enable args' do
|
35
35
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets').
|
36
36
|
with(body: '{"name":"example.com","size":"512mb","image":"ubuntu-14-04-x64","region":"nyc2","ssh_keys":["1234"],"private_networking":"false","backups_enabled":"false","ipv6":"true","user_data":null}',
|
37
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
37
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
38
38
|
to_return(status: 200, body: fixture('create_droplet'), headers: {})
|
39
39
|
|
40
40
|
cli.options = cli.options.merge(ip6: 'true')
|
41
41
|
cli.create('example.com')
|
42
42
|
|
43
43
|
expect($stdout.string).to eq <<-eos
|
44
|
-
Queueing creation of droplet 'example.com'...Droplet created!
|
44
|
+
Queueing creation of droplet 'example.com'...Droplet created! Droplet ID is 3164494
|
45
45
|
eos
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'with user data args' do
|
49
49
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets').
|
50
50
|
with(body: '{"name":"example.com","size":"512mb","image":"ubuntu-14-04-x64","region":"nyc2","ssh_keys":["1234"],"private_networking":"false","backups_enabled":"false","ipv6":"false","user_data":"#!/bin/bash\\n\\necho \\"Hello world\\""}',
|
51
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
51
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
52
52
|
to_return(status: 200, body: fixture('create_droplet'), headers: {})
|
53
53
|
|
54
54
|
cli.options = cli.options.merge(user_data: project_path + '/spec/fixtures/user_data.sh')
|
55
55
|
cli.create('example.com')
|
56
56
|
|
57
57
|
expect($stdout.string).to eq <<-eos
|
58
|
-
Queueing creation of droplet 'example.com'...Droplet created!
|
58
|
+
Queueing creation of droplet 'example.com'...Droplet created! Droplet ID is 3164494
|
59
59
|
eos
|
60
60
|
end
|
61
61
|
|
@@ -98,13 +98,13 @@ eos
|
|
98
98
|
it 'does not clobber named droplets that contain the word help' do
|
99
99
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets').
|
100
100
|
with(body: '{"name":"somethingblahblah--help","size":"512mb","image":"ubuntu-14-04-x64","region":"nyc2","ssh_keys":["1234"],"private_networking":"false","backups_enabled":"false","ipv6":"false","user_data":null}',
|
101
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
101
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
102
102
|
to_return(status: 200, body: fixture('create_droplet'), headers: {})
|
103
103
|
|
104
104
|
cli.create('somethingblahblah--help')
|
105
105
|
|
106
106
|
expect($stdout.string).to eq <<-eos
|
107
|
-
Queueing creation of droplet 'somethingblahblah--help'...Droplet created!
|
107
|
+
Queueing creation of droplet 'somethingblahblah--help'...Droplet created! Droplet ID is 3164494
|
108
108
|
eos
|
109
109
|
end
|
110
110
|
end
|
data/spec/cli/debug_cli_spec.rb
CHANGED
@@ -14,11 +14,11 @@ describe Tugboat::CLI do
|
|
14
14
|
|
15
15
|
it 'gives full faraday logs' do
|
16
16
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
17
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
17
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
18
18
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
19
19
|
|
20
20
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
21
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
21
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
22
22
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
23
23
|
|
24
24
|
cli.droplets
|
@@ -41,11 +41,11 @@ describe Tugboat::CLI do
|
|
41
41
|
|
42
42
|
it 'gives full faraday logs with redacted API keys' do
|
43
43
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
44
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
44
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
45
45
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
46
46
|
|
47
47
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
48
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
48
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
49
49
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
50
50
|
cli.droplets
|
51
51
|
|
@@ -6,15 +6,15 @@ describe Tugboat::CLI do
|
|
6
6
|
describe 'destroy' do
|
7
7
|
it 'destroys a droplet with a fuzzy name' do
|
8
8
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
9
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
9
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
10
10
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
11
11
|
|
12
12
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
13
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
13
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
14
14
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
15
15
|
|
16
16
|
stub_request(:delete, 'https://api.digitalocean.com/v2/droplets/6918990').
|
17
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
17
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
18
18
|
to_return(status: 204, body: '', headers: {})
|
19
19
|
|
20
20
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -28,11 +28,11 @@ eos
|
|
28
28
|
|
29
29
|
it 'destroys a droplet with an id' do
|
30
30
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets/6918990?per_page=200').
|
31
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
31
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
32
32
|
to_return(status: 200, body: fixture('show_droplet'), headers: {})
|
33
33
|
|
34
34
|
stub_request(:delete, 'https://api.digitalocean.com/v2/droplets/6918990').
|
35
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
35
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
36
36
|
to_return(status: 204, body: '', headers: {})
|
37
37
|
|
38
38
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -47,15 +47,15 @@ Droplet id provided. Finding Droplet...done\e[0m, 6918990 (example.com)\nWarning
|
|
47
47
|
|
48
48
|
it 'destroys a droplet with a name' do
|
49
49
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
50
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
50
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
51
51
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
52
52
|
|
53
53
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
54
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
54
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
55
55
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
56
56
|
|
57
57
|
stub_request(:delete, 'https://api.digitalocean.com/v2/droplets/6918990').
|
58
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
58
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
59
59
|
to_return(status: 204, body: '', headers: {})
|
60
60
|
|
61
61
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -70,15 +70,15 @@ Droplet name provided. Finding droplet ID...done\e[0m, 6918990 (example.com)\nWa
|
|
70
70
|
|
71
71
|
it 'destroys a droplet with confirm flag set' do
|
72
72
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
73
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
73
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
74
74
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
75
75
|
|
76
76
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
77
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
77
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
78
78
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
79
79
|
|
80
80
|
stub_request(:delete, 'https://api.digitalocean.com/v2/droplets/6918990').
|
81
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
81
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
82
82
|
to_return(status: 204, body: '', headers: {})
|
83
83
|
|
84
84
|
cli.options = cli.options.merge(name: 'example.com', confirm: true)
|
@@ -92,14 +92,14 @@ Queuing destroy for 6918990 (example.com)...Deletion Successful!
|
|
92
92
|
|
93
93
|
it 'does not destroy a droplet if no is chosen' do
|
94
94
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
95
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
95
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
96
96
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
97
97
|
|
98
98
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
99
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
99
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
100
100
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
101
101
|
|
102
|
-
$stdin.
|
102
|
+
expect($stdin).to receive(:gets).and_return('n')
|
103
103
|
|
104
104
|
expect { cli.destroy('example.com') }.to raise_error(SystemExit)
|
105
105
|
|
@@ -6,11 +6,11 @@ describe Tugboat::CLI do
|
|
6
6
|
describe 'destroy image' do
|
7
7
|
it 'destroys an image with a fuzzy name' do
|
8
8
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
9
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
9
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
10
10
|
to_return(status: 200, body: fixture('show_images_global'), headers: {})
|
11
11
|
|
12
12
|
stub_request(:delete, 'https://api.digitalocean.com/v2/images/6376601').
|
13
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
13
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
14
14
|
to_return(status: 204, body: '', headers: {})
|
15
15
|
|
16
16
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -24,11 +24,11 @@ Image fuzzy name provided. Finding image ID...done\e[0m, 6376601 (My application
|
|
24
24
|
|
25
25
|
it 'destroys an image with an id' do
|
26
26
|
stub_request(:get, 'https://api.digitalocean.com/v2/images/6376601?per_page=200').
|
27
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
27
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
28
28
|
to_return(status: 200, body: fixture('show_image'), headers: {})
|
29
29
|
|
30
30
|
stub_request(:delete, 'https://api.digitalocean.com/v2/images/6376601').
|
31
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
31
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
32
32
|
to_return(status: 204, body: '', headers: {})
|
33
33
|
|
34
34
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -43,11 +43,11 @@ Image id provided. Finding Image...done\e[0m, 6376601 (My application image)\nWa
|
|
43
43
|
|
44
44
|
it 'destroys an image with a name' do
|
45
45
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
46
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
46
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
47
47
|
to_return(status: 200, body: fixture('show_images_global'), headers: {})
|
48
48
|
|
49
49
|
stub_request(:delete, 'https://api.digitalocean.com/v2/images/6376601').
|
50
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
50
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
51
51
|
to_return(status: 204, body: '', headers: {})
|
52
52
|
|
53
53
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -60,11 +60,11 @@ Image id provided. Finding Image...done\e[0m, 6376601 (My application image)\nWa
|
|
60
60
|
|
61
61
|
it 'destroys an image with confirm flag set' do
|
62
62
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
63
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
63
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
64
64
|
to_return(status: 200, body: fixture('show_images_global'), headers: {})
|
65
65
|
|
66
66
|
stub_request(:delete, 'https://api.digitalocean.com/v2/images/6376601').
|
67
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
67
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
68
68
|
to_return(status: 204, body: '', headers: {})
|
69
69
|
|
70
70
|
cli.options = cli.options.merge(name: 'My application image')
|
@@ -6,11 +6,11 @@ describe Tugboat::CLI do
|
|
6
6
|
describe 'droplets' do
|
7
7
|
it 'shows a list when droplets exist' do
|
8
8
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
9
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
9
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
10
10
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
11
11
|
|
12
12
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
13
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
13
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
14
14
|
to_return(status: 200, body: fixture('show_droplets'), headers: { 'Content-Type' => 'application/json' })
|
15
15
|
|
16
16
|
cli.droplets
|
@@ -26,11 +26,11 @@ example3.com (ip: 104.236.32.173, status: \e[31moff\e[0m, region: nyc3, id: 3164
|
|
26
26
|
|
27
27
|
it 'shows a private IP if droplet in list has private IP' do
|
28
28
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
29
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
29
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
30
30
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
31
31
|
|
32
32
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
33
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
33
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
34
34
|
to_return(status: 200, body: fixture('show_droplets_private_ip'), headers: { 'Content-Type' => 'application/json' })
|
35
35
|
|
36
36
|
cli.droplets
|
@@ -46,11 +46,11 @@ example3.com (ip: 104.236.32.173, status: \e[31moff\e[0m, region: nyc3, id: 3164
|
|
46
46
|
|
47
47
|
it 'returns an error message when no droplets exist' do
|
48
48
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
49
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
49
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
50
50
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
51
51
|
|
52
52
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
53
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
53
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
54
54
|
to_return(status: 200, body: fixture('show_droplets_empty'), headers: { 'Content-Type' => 'application/json' })
|
55
55
|
|
56
56
|
cli.droplets
|
@@ -65,11 +65,11 @@ Try creating one with \e[32m`tugboat create`\e[0m
|
|
65
65
|
|
66
66
|
it 'shows no output when --quiet is set' do
|
67
67
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
68
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
68
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
69
69
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
70
70
|
|
71
71
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
72
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
72
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
73
73
|
to_return(status: 200, body: fixture('show_droplets'), headers: { 'Content-Type' => 'application/json' })
|
74
74
|
|
75
75
|
cli.options = cli.options.merge(quiet: true)
|
@@ -83,11 +83,11 @@ Try creating one with \e[32m`tugboat create`\e[0m
|
|
83
83
|
|
84
84
|
it 'includes urls when --include-urls is set' do
|
85
85
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
86
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
86
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
87
87
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
88
88
|
|
89
89
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
90
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
90
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
91
91
|
to_return(status: 200, body: fixture('show_droplets'), headers: { 'Content-Type' => 'application/json' })
|
92
92
|
|
93
93
|
cli.options = cli.options.merge('include_urls' => true)
|
@@ -104,15 +104,15 @@ example3.com (ip: 104.236.32.173, status: \e[31moff\e[0m, region: nyc3, id: 3164
|
|
104
104
|
|
105
105
|
it 'paginates when multiple pages are returned' do
|
106
106
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
107
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
107
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
108
108
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
109
109
|
|
110
110
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
111
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
111
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
112
112
|
to_return(status: 200, body: fixture('show_droplets_paginated_first'), headers: { 'Content-Type' => 'application/json' })
|
113
113
|
|
114
114
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=2&per_page=200').
|
115
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
115
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
116
116
|
to_return(status: 200, body: fixture('show_droplets_paginated_last'), headers: { 'Content-Type' => 'application/json' })
|
117
117
|
|
118
118
|
cli.options = cli.options.merge('include_urls' => true)
|