knife-digital_ocean 2.4.2 → 2.5.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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +11 -0
  3. data/.travis.yml +2 -1
  4. data/CHANGELOG.md +10 -0
  5. data/README.md +37 -3
  6. data/knife-digital_ocean.gemspec +1 -2
  7. data/lib/chef/knife/digital_ocean_base.rb +3 -1
  8. data/lib/chef/knife/digital_ocean_domain_record_edit.rb +4 -1
  9. data/lib/chef/knife/digital_ocean_droplet_create.rb +4 -1
  10. data/lib/chef/knife/digital_ocean_droplet_destroy.rb +13 -7
  11. data/lib/chef/knife/digital_ocean_droplet_power.rb +7 -7
  12. data/lib/chef/knife/digital_ocean_droplet_powercycle.rb +4 -4
  13. data/lib/chef/knife/digital_ocean_droplet_reboot.rb +4 -4
  14. data/lib/chef/knife/digital_ocean_droplet_rebuild.rb +11 -8
  15. data/lib/chef/knife/digital_ocean_droplet_rename.rb +7 -7
  16. data/lib/chef/knife/digital_ocean_droplet_resize.rb +7 -7
  17. data/lib/chef/knife/digital_ocean_droplet_snapshot.rb +1 -1
  18. data/lib/chef/knife/digital_ocean_region_list.rb +1 -1
  19. data/lib/chef/knife/digital_ocean_size_list.rb +1 -1
  20. data/lib/chef/knife/digital_ocean_sshkey_create.rb +6 -3
  21. data/lib/knife-digital_ocean.rb +1 -0
  22. data/lib/knife-digital_ocean/version.rb +1 -1
  23. data/spec/fixtures/vcr_cassettes/domain_list.yml +1 -1
  24. data/spec/fixtures/vcr_cassettes/domain_record_list.yml +1 -1
  25. data/spec/fixtures/vcr_cassettes/region.yml +1 -1
  26. data/spec/fixtures/vcr_cassettes/sizes.yml +1 -1
  27. data/spec/fixtures/vcr_cassettes/sshkey.yml +1 -1
  28. data/spec/lib/chef/knife/digital_ocean_account_info_spec.rb +4 -3
  29. data/spec/lib/chef/knife/digital_ocean_domain_create_spec.rb +1 -2
  30. data/spec/lib/chef/knife/digital_ocean_domain_list_spec.rb +0 -1
  31. data/spec/lib/chef/knife/digital_ocean_domain_record_create_spec.rb +1 -2
  32. data/spec/lib/chef/knife/digital_ocean_domain_record_list_spec.rb +0 -1
  33. data/spec/lib/chef/knife/digital_ocean_droplet_create_spec.rb +0 -4
  34. data/spec/lib/chef/knife/digital_ocean_droplet_list_spec.rb +0 -1
  35. data/spec/lib/chef/knife/digital_ocean_droplet_power_spec.rb +0 -1
  36. data/spec/lib/chef/knife/digital_ocean_droplet_powercycle_spec.rb +0 -1
  37. data/spec/lib/chef/knife/digital_ocean_droplet_reboot_spec.rb +0 -1
  38. data/spec/lib/chef/knife/digital_ocean_droplet_rebuild_spec.rb +0 -1
  39. data/spec/lib/chef/knife/digital_ocean_droplet_rename_spec.rb +0 -1
  40. data/spec/lib/chef/knife/digital_ocean_droplet_resize_spec.rb +0 -1
  41. data/spec/lib/chef/knife/digital_ocean_droplet_snapshot_spec.rb +0 -1
  42. data/spec/lib/chef/knife/digital_ocean_image_list_spec.rb +0 -1
  43. data/spec/lib/chef/knife/digital_ocean_region_list_spec.rb +0 -1
  44. data/spec/lib/chef/knife/digital_ocean_size_list_spec.rb +0 -1
  45. data/spec/lib/chef/knife/digital_ocean_sshkey_create_spec.rb +1 -2
  46. data/spec/lib/chef/knife/digital_ocean_sshkey_list_spec.rb +0 -1
  47. data/spec/spec_helper.rb +1 -1
  48. metadata +6 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b94613209612fd460d8d235900ed74151028719
4
- data.tar.gz: d0bb086298e3fe1ec7470d9b4bcc5c023b6269d9
3
+ metadata.gz: 40163c61e89b1e5d4eaa012a5923eab7a6ddc928
4
+ data.tar.gz: efe07cc6b432eae199dc2e2e3bd421ba290deb71
5
5
  SHA512:
6
- metadata.gz: 45960baf3ed94dabfb3cb236bc4f356a4180388f737a1def56d39e4afccd8dd7d8182a8a3a70fd70a3971e13635db9f126899264a1269326e57f1bb85539f1d3
7
- data.tar.gz: 4fbd19312ecf22b6aad3c5e25c39a0de452d7f87137ee19b78ccd2037b46fe7890d68a2ef2d5d408b47fbc30f960be70831cd4e5d49a4dcbfca1142ca815b36f
6
+ metadata.gz: 7e607c8f249fb7eb2991cccfc4fcdbe70376367dbb3f300ca2375b635f5ac5dae7331cb9ded4c1a4f6655fa1569c2663a546561ace85f64d725dc21000511a7a
7
+ data.tar.gz: c3af42a24737b8ab49c73557e24c15959ce4be5a1eb7571b4b59f412a1ff2f67de32f4c041c4334ffccae04b879649e33e33fd23113639a2d58776afe872937f
@@ -0,0 +1,11 @@
1
+ Metrics/LineLength:
2
+ Max: 120
3
+
4
+ Style/Documentation:
5
+ Enabled: false
6
+
7
+ Metrics/MethodLength:
8
+ Max: 26
9
+
10
+ Style/AlignParameters:
11
+ Enabled: false
@@ -1,8 +1,9 @@
1
+ sudo: false
1
2
  language: ruby
2
3
  rvm:
3
- - 2.0.0
4
4
  - 2.1.0
5
5
  - 2.2.2
6
+ - 2.2.3
6
7
  env:
7
8
  - DIGITALOCEAN_ACCESS_TOKEN="fake_access_token"
8
9
  script: bundle exec rake spec
@@ -1,3 +1,13 @@
1
+ # 2.5.0 / unreleased
2
+
3
+ * fix vcr cassettes (droplet_kit pagination)
4
+ * drop support for Ruby 2.0.0
5
+ * fix to work with chef 12.5.x
6
+ * update droplet_kit dependency to 1.3.x
7
+ * fixed some rubocop issues (some are still pending)
8
+ * we will drop support for chef 10 and chef 11 soon,
9
+ please upgrade to chef 12 ASAP!
10
+
1
11
  # 2.4.2 / 2015-07-04
2
12
 
3
13
  * Fix knife digital_ocean droplet destroy
data/README.md CHANGED
@@ -12,12 +12,24 @@ You can also use [knife-solo](http://matschaffer.github.com/knife-solo/) or [kni
12
12
 
13
13
  This knife plugin uses the [droplet_kit](https://github.com/digitalocean/droplet_kit) rubygem.
14
14
 
15
+ Knife::DigitalOcean supports Chef 12, legacy support for older Chefs
16
+ will be removed with 3.x.x by the end of 2015.
17
+
15
18
  ## Installation
16
19
 
20
+ ### when using ChefDK
21
+
22
+ ```shell
23
+ ➜ chef gem install knife-digital_ocean
24
+ ```
25
+
26
+ ### in typical Ruby setup
27
+
17
28
  ```shell
18
29
  ➜ gem install knife-digital_ocean
19
30
  ```
20
31
 
32
+
21
33
  ## Overview
22
34
 
23
35
  This plugin provides the following sub-commands:
@@ -467,7 +479,7 @@ example.com 1800
467
479
  #### Create a domain record
468
480
 
469
481
  ```shell
470
- ➜ knife digital_ocean domain record create -D example.com -T cname -N www -a @
482
+ ➜ knife digital_ocean domain record create -D example.com -T CNAME -N www -a @
471
483
  ```
472
484
 
473
485
  #### Destroy a domain record
@@ -504,6 +516,28 @@ UUID Email Droplet Limit Email V
504
516
  4. Push to the branch (`git push origin my-new-feature`)
505
517
  5. Create new Pull Request
506
518
 
519
+
520
+ ### Tests
521
+
522
+ To run tests, please declare the `DIGITALOCEAN_ACCESS_TOKEN`
523
+ environment variable, e.g.:
524
+
525
+ ```shell
526
+ export DIGITALOCEAN_ACCESS_TOKEN="fake_access_token"
527
+ rspec
528
+ ```
529
+
530
+
531
+ ### RuboCop / Ruby Style Guide
532
+
533
+ We want to make sure that our code complies with the Ruby Style Guide:
534
+
535
+ see:
536
+
537
+ - https://github.com/bbatsov/ruby-style-guide
538
+ - https://github.com/bbatsov/rubocop
539
+
540
+
507
541
  ### Contributors
508
542
 
509
543
  * [Teemu Matilainen](https://github.com/tmatilai)
@@ -517,6 +551,6 @@ Apache 2.0 (like Chef itself), see LICENSE.txt file.
517
551
 
518
552
  ## Copyright
519
553
 
520
- Copyright © 2014 [Roland Moriz](https://roland.io), [Moriz GmbH](https://moriz.de/)
521
- Copyright © 2014 [Greg Fitzgerald](https://github.com/gregf)
554
+ Copyright © 2015 [Roland Moriz](https://roland.io), [Moriz GmbH](https://moriz.de/)
555
+ Copyright © 2015 [Greg Fitzgerald](https://github.com/gregf)
522
556
 
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
14
14
  gem.license = 'Apache 2.0'
15
15
 
16
16
  gem.add_dependency 'chef', '>= 10.18'
17
- gem.add_dependency 'droplet_kit', '~> 1.2.0'
17
+ gem.add_dependency 'droplet_kit', '~> 1.3.0'
18
18
 
19
19
  gem.add_development_dependency 'rspec', '~> 3.1'
20
20
  gem.add_development_dependency 'rubocop', '~> 0.27'
@@ -30,7 +30,6 @@ Gem::Specification.new do |gem|
30
30
  gem.add_development_dependency 'simplecov'
31
31
  gem.add_development_dependency 'simplecov-console'
32
32
 
33
-
34
33
  gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
35
34
  gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
36
35
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
@@ -18,6 +18,7 @@ class Chef
18
18
  def self.load_deps
19
19
  require 'droplet_kit'
20
20
  require 'json'
21
+ require 'chef/mixin/shell_out'
21
22
  end
22
23
 
23
24
  def self.included(includer)
@@ -55,7 +56,8 @@ class Chef
55
56
 
56
57
  keys.each do |k|
57
58
  if locate_config_value(k).nil?
58
- errors << "You did not provide a valid '#{k}' value. Please set knife[:#{k}] in your knife.rb or pass as an option."
59
+ errors << "You did not provide a valid '#{k}' value. " \
60
+ "Please set knife[:#{k}] in your knife.rb or pass as an option."
59
61
  end
60
62
  end
61
63
 
@@ -80,7 +80,10 @@ class Chef
80
80
  name: locate_config_value(:name),
81
81
  data: locate_config_value(:data)
82
82
  )
83
- result = client.domain_records.update domain_record, for_domain: locate_config_value(:domain), id: locate_config_value(:record)
83
+ result = client.domain_records.update(domain_record,
84
+ for_domain: locate_config_value(:domain),
85
+ id: locate_config_value(:record)
86
+ )
84
87
  ui.info 'OK' if result == true || ui.error(JSON.parse(result)['message'])
85
88
  end
86
89
  end
@@ -25,7 +25,10 @@ class Chef
25
25
  # Knife loads subcommands automatically, so we can just check if the
26
26
  # class exists.
27
27
  Chef::Knife::SoloBootstrap.load_deps if defined? Chef::Knife::SoloBootstrap
28
- Chef::Knife::ZeroBootstrap.load_deps if defined? Chef::Knife::ZeroBootstrap
28
+ if defined? Chef::Knife::ZeroBootstrap
29
+ Chef::Knife::ZeroBootstrap.load_deps
30
+ self.options = Chef::Knife::ZeroBootstrap.options.merge(options)
31
+ end
29
32
  end
30
33
 
31
34
  banner 'knife digital_ocean droplet create (options)'
@@ -20,14 +20,14 @@ class Chef
20
20
  banner 'knife digital_ocean droplet destroy (options)'
21
21
 
22
22
  option :server,
23
- short: '-S ID',
24
- long: '--server ID',
25
- description: 'The server id'
23
+ short: '-S ID',
24
+ long: '--server ID',
25
+ description: 'The server id'
26
26
 
27
27
  option :all,
28
- short: '-a',
29
- long: '--all',
30
- description: '!WARNING! UNRECOVERABLE Destroy all droplets.'
28
+ short: '-a',
29
+ long: '--all',
30
+ description: '!WARNING! UNRECOVERABLE Destroy all droplets.'
31
31
 
32
32
  def run
33
33
  $stdout.sync = true
@@ -40,7 +40,13 @@ class Chef
40
40
  droplets_ids = [locate_config_value(:server)]
41
41
  elsif locate_config_value(:all)
42
42
  ui.error('Warning all servers will be lost unless you exit with ctrl-c now!')
43
- 15.times { |x| print x; print 13.chr; sleep 1 }
43
+
44
+ 15.times do |x|
45
+ print x
46
+ print 13.chr
47
+ sleep 1
48
+ end
49
+
44
50
  droplets_ids = client.droplets.all.map(&:id)
45
51
  else
46
52
  ui.error 'You need to specify either a --server id or --all'
@@ -20,14 +20,14 @@ class Chef
20
20
  banner 'knife digital_ocean droplet power (options)'
21
21
 
22
22
  option :action,
23
- short: '-a ACTION',
24
- long: '--action ACTION',
25
- description: 'Power Action On/Off'
23
+ short: '-a ACTION',
24
+ long: '--action ACTION',
25
+ description: 'Power Action On/Off'
26
26
 
27
27
  option :id,
28
- short: '-I ID',
29
- long: '--droplet-id ID',
30
- description: 'Droplet ID'
28
+ short: '-I ID',
29
+ long: '--droplet-id ID',
30
+ description: 'Droplet ID'
31
31
 
32
32
  def run
33
33
  $stdout.sync = true
@@ -61,6 +61,6 @@ class Chef
61
61
 
62
62
  wait_for_status(result)
63
63
  end
64
- end
64
+ end
65
65
  end
66
66
  end
@@ -20,9 +20,9 @@ class Chef
20
20
  banner 'knife digital_ocean droplet powercycle (options)'
21
21
 
22
22
  option :id,
23
- short: '-I ID',
24
- long: '--droplet-id ID',
25
- description: 'Droplet ID'
23
+ short: '-I ID',
24
+ long: '--droplet-id ID',
25
+ description: 'Droplet ID'
26
26
 
27
27
  def run
28
28
  $stdout.sync = true
@@ -43,6 +43,6 @@ class Chef
43
43
 
44
44
  wait_for_status(result, status: 'active')
45
45
  end
46
- end
46
+ end
47
47
  end
48
48
  end
@@ -20,9 +20,9 @@ class Chef
20
20
  banner 'knife digital_ocean droplet reboot (options)'
21
21
 
22
22
  option :id,
23
- short: '-I ID',
24
- long: '--droplet-id ID',
25
- description: 'Droplet ID'
23
+ short: '-I ID',
24
+ long: '--droplet-id ID',
25
+ description: 'Droplet ID'
26
26
 
27
27
  def run
28
28
  $stdout.sync = true
@@ -43,6 +43,6 @@ class Chef
43
43
 
44
44
  wait_for_status(result)
45
45
  end
46
- end
46
+ end
47
47
  end
48
48
  end
@@ -20,14 +20,14 @@ class Chef
20
20
  banner 'knife digital_ocean droplet rebuild (options)'
21
21
 
22
22
  option :image,
23
- short: '-i IMAGE',
24
- long: '--image-id IMAGE',
25
- description: 'Image ID'
23
+ short: '-i IMAGE',
24
+ long: '--image-id IMAGE',
25
+ description: 'Image ID'
26
26
 
27
27
  option :id,
28
- short: '-I ID',
29
- long: '--droplet-id ID',
30
- description: 'Droplet ID'
28
+ short: '-I ID',
29
+ long: '--droplet-id ID',
30
+ description: 'Droplet ID'
31
31
 
32
32
  def run
33
33
  $stdout.sync = true
@@ -44,7 +44,10 @@ class Chef
44
44
  exit 1
45
45
  end
46
46
 
47
- result = client.droplet_actions.rebuild(droplet_id: locate_config_value(:id), image: locate_config_value(:image))
47
+ result = client.droplet_actions.rebuild(
48
+ droplet_id: locate_config_value(:id),
49
+ image: locate_config_value(:image)
50
+ )
48
51
 
49
52
  unless result.class == DropletKit::Action
50
53
  ui.error JSON.parse(result)['message']
@@ -53,6 +56,6 @@ class Chef
53
56
 
54
57
  wait_for_status(result, status: 'active')
55
58
  end
56
- end
59
+ end
57
60
  end
58
61
  end
@@ -20,14 +20,14 @@ class Chef
20
20
  banner 'knife digital_ocean droplet rename (options)'
21
21
 
22
22
  option :name,
23
- short: '-N NAME',
24
- long: '--droplet-name NAME',
25
- description: 'Name of droplet'
23
+ short: '-N NAME',
24
+ long: '--droplet-name NAME',
25
+ description: 'Name of droplet'
26
26
 
27
27
  option :id,
28
- short: '-I ID',
29
- long: '--droplet-id ID',
30
- description: 'Droplet ID'
28
+ short: '-I ID',
29
+ long: '--droplet-id ID',
30
+ description: 'Droplet ID'
31
31
 
32
32
  def run
33
33
  $stdout.sync = true
@@ -53,6 +53,6 @@ class Chef
53
53
 
54
54
  wait_for_status(result)
55
55
  end
56
- end
56
+ end
57
57
  end
58
58
  end
@@ -20,14 +20,14 @@ class Chef
20
20
  banner 'knife digital_ocean droplet resize (options)'
21
21
 
22
22
  option :size,
23
- short: '-s SIZE',
24
- long: '--size SIZE',
25
- description: 'Power Action On/Off'
23
+ short: '-s SIZE',
24
+ long: '--size SIZE',
25
+ description: 'Power Action On/Off'
26
26
 
27
27
  option :id,
28
- short: '-I ID',
29
- long: '--droplet-id ID',
30
- description: 'Droplet ID'
28
+ short: '-I ID',
29
+ long: '--droplet-id ID',
30
+ description: 'Droplet ID'
31
31
 
32
32
  def run
33
33
  $stdout.sync = true
@@ -53,6 +53,6 @@ class Chef
53
53
 
54
54
  wait_for_status(result)
55
55
  end
56
- end
56
+ end
57
57
  end
58
58
  end
@@ -53,6 +53,6 @@ class Chef
53
53
 
54
54
  wait_for_status(result, status: 'active')
55
55
  end
56
- end
56
+ end
57
57
  end
58
58
  end
@@ -25,7 +25,7 @@ class Chef
25
25
  validate!
26
26
 
27
27
  region_list = [
28
- ui.color('Name', :bold),
28
+ ui.color('Name', :bold),
29
29
  ui.color('Slug', :bold)
30
30
  ]
31
31
 
@@ -25,7 +25,7 @@ class Chef
25
25
  validate!
26
26
 
27
27
  size_list = [
28
- ui.color('Slug', :bold)
28
+ ui.color('Slug', :bold)
29
29
  ]
30
30
 
31
31
  sizes = client.sizes.all
@@ -36,16 +36,19 @@ class Chef
36
36
  validate!
37
37
 
38
38
  unless locate_config_value(:name)
39
- ui.error('SSH Key name cannot be empty. => -N <sshkey-name>')
39
+ ui.error('SSH Key name cannot be empty. => -n <sshkey-name>')
40
40
  exit 1
41
41
  end
42
42
 
43
43
  unless locate_config_value(:public_key)
44
- ui.error('SSH key file needs to be specified. => -I <public_key>')
44
+ ui.error('SSH key file needs to be specified. => -i <public_key>')
45
45
  exit 1
46
46
  end
47
47
 
48
- ssh_key = DropletKit::SSHKey.new name: locate_config_value(:name), public_key: File.read(File.expand_path(locate_config_value(:public_key)))
48
+ ssh_key = DropletKit::SSHKey.new(
49
+ name: locate_config_value(:name),
50
+ public_key: File.read(File.expand_path(locate_config_value(:public_key)))
51
+ )
49
52
  result = client.ssh_keys.create(ssh_key)
50
53
  ui.info 'OK' if result.class == DropletKit::SSHKey || ui.error(JSON.parse(result)['message'])
51
54
  end
@@ -1,3 +1,4 @@
1
+ # rubocop:disable Style/FileName
1
2
  require 'knife-digital_ocean/version'
2
3
 
3
4
  module Knife
@@ -1,5 +1,5 @@
1
1
  module Knife
2
2
  module DigitalOcean
3
- VERSION = '2.4.2'
3
+ VERSION = '2.5.0'
4
4
  end
5
5
  end
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.digitalocean.com/v2/domains
5
+ uri: https://api.digitalocean.com/v2/domains?page=1&per_page=20
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.digitalocean.com/v2/domains/kitchen-digital.org/records
5
+ uri: https://api.digitalocean.com/v2/domains/kitchen-digital.org/records?page=1&per_page=20
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.digitalocean.com/v2/regions
5
+ uri: https://api.digitalocean.com/v2/regions?page=1&per_page=20
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.digitalocean.com/v2/sizes
5
+ uri: https://api.digitalocean.com/v2/sizes?page=1&per_page=20
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.digitalocean.com/v2/account/keys
5
+ uri: https://api.digitalocean.com/v2/account/keys?page=1&per_page=20
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanAccountInfo do
4
-
5
4
  subject { Chef::Knife::DigitalOceanAccountInfo.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -22,14 +21,16 @@ describe Chef::Knife::DigitalOceanAccountInfo do
22
21
 
23
22
  it 'should output the column headers' do
24
23
  VCR.use_cassette('accountinfo') do
25
- expect(subject).to receive(:puts).with(/^UUID\s+Email\s+Droplet Limit\s+Email Verified\n/)
24
+ expect(subject).to receive(:puts)
25
+ .with(/^UUID\s+Email\s+Droplet Limit\s+Email Verified\n/)
26
26
  subject.run
27
27
  end
28
28
  end
29
29
 
30
30
  it 'should output a list of the available Digital Ocean account info' do
31
31
  VCR.use_cassette('accountinfo') do
32
- expect(subject).to receive(:puts).with(/\b49e2e737d3a7407a042bb7e88f4da8629166f2b9\s+greg@gregf.org\s+20\s+true\s+\n/)
32
+ expect(subject).to receive(:puts)
33
+ .with(/\b49e2e737d3a7407a042bb7e88f4da8629166f2b9\s+greg@gregf.org\s+20\s+true\s+\n/)
33
34
  subject.run
34
35
  end
35
36
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanDomainCreate do
4
-
5
4
  subject { Chef::Knife::DigitalOceanDomainCreate.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -29,7 +28,7 @@ describe Chef::Knife::DigitalOceanDomainCreate do
29
28
  end
30
29
  end
31
30
 
32
- # TODO Figure out why this is now failing
31
+ # TODO: Figure out why this is now failing
33
32
  # it 'should return OK' do
34
33
  # VCR.use_cassette('domain_create') do
35
34
  # expect($stdout).to receive(:puts).with('OK')
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanDomainList do
4
-
5
4
  subject { Chef::Knife::DigitalOceanDomainList.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanDomainRecordCreate do
4
-
5
4
  subject { Chef::Knife::DigitalOceanDomainRecordCreate.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -31,7 +30,7 @@ describe Chef::Knife::DigitalOceanDomainRecordCreate do
31
30
  end
32
31
  end
33
32
 
34
- # TODO Figure out why this is now failing
33
+ # TODO: Figure out why this is now failing
35
34
  # it 'should return OK' do
36
35
  # VCR.use_cassette('domain_record_create') do
37
36
  # expect($stdout).to receive(:puts).with('OK')
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanDomainRecordList do
4
-
5
4
  subject { Chef::Knife::DigitalOceanDomainRecordList.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -5,7 +5,6 @@ def mock_api_response(data = {})
5
5
  end
6
6
 
7
7
  describe Chef::Knife::DigitalOceanDropletCreate do
8
-
9
8
  subject do
10
9
  s = Chef::Knife::DigitalOceanDropletCreate.new
11
10
  allow(s).to receive(:client).and_return double(DropletKit::Droplet)
@@ -82,7 +81,6 @@ describe Chef::Knife::DigitalOceanDropletCreate do
82
81
  end
83
82
 
84
83
  context 'bootstrapping for knife-solo' do
85
-
86
84
  let(:custom_config) do
87
85
  {
88
86
  solo: true
@@ -126,7 +124,6 @@ describe Chef::Knife::DigitalOceanDropletCreate do
126
124
  expect { subject.run }.to raise_error(SystemExit)
127
125
  end
128
126
  end
129
-
130
127
  end
131
128
 
132
129
  context 'no bootstrapping' do
@@ -199,5 +196,4 @@ describe Chef::Knife::DigitalOceanDropletCreate do
199
196
  expect(bootstrap.config[:ssh_port]).to eql(ssh_port)
200
197
  end
201
198
  end
202
-
203
199
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanDropletList do
4
-
5
4
  subject { Chef::Knife::DigitalOceanDropletList.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanDropletPower do
4
-
5
4
  subject { Chef::Knife::DigitalOceanDropletPower.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanDropletPowercycle do
4
-
5
4
  subject { Chef::Knife::DigitalOceanDropletPowercycle.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanDropletReboot do
4
-
5
4
  subject { Chef::Knife::DigitalOceanDropletReboot.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanDropletRebuild do
4
-
5
4
  subject { Chef::Knife::DigitalOceanDropletRebuild.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanDropletRename do
4
-
5
4
  subject { Chef::Knife::DigitalOceanDropletRename.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanDropletResize do
4
-
5
4
  subject { Chef::Knife::DigitalOceanDropletResize.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanDropletSnapshot do
4
-
5
4
  subject { Chef::Knife::DigitalOceanDropletSnapshot.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanImageList do
4
-
5
4
  subject { Chef::Knife::DigitalOceanImageList.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanRegionList do
4
-
5
4
  subject do
6
5
  s = Chef::Knife::DigitalOceanRegionList.new
7
6
  s
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanSizeList do
4
-
5
4
  subject do
6
5
  s = Chef::Knife::DigitalOceanSizeList.new
7
6
  s
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanSshkeyCreate do
4
-
5
4
  subject { Chef::Knife::DigitalOceanSshkeyCreate.new }
6
5
 
7
6
  let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
@@ -29,7 +28,7 @@ describe Chef::Knife::DigitalOceanSshkeyCreate do
29
28
  end
30
29
  end
31
30
 
32
- # TODO Figure out why this is now failing
31
+ # TODO: Figure out why this is now failing
33
32
  # it 'should return OK' do
34
33
  # VCR.use_cassette('sshkey_create') do
35
34
  # expect($stdout).to receive(:puts).with('OK')
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chef::Knife::DigitalOceanSshkeyList do
4
-
5
4
  subject do
6
5
  s = Chef::Knife::DigitalOceanSshkeyList.new
7
6
  s
@@ -61,7 +61,7 @@ SimpleCov.start
61
61
 
62
62
  # Cleverly borrowed from knife-rackspace, thank you!
63
63
  def filter_headers(interaction, pattern, placeholder)
64
- [interaction.request.headers, interaction.response.headers].each do | headers |
64
+ [interaction.request.headers, interaction.response.headers].each do |headers|
65
65
  sensitive_tokens = headers.select { |key| key.to_s.match(pattern) }
66
66
  sensitive_tokens.each do |key, _value|
67
67
  headers[key] = placeholder
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-digital_ocean
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.2
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roland Moriz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-04 00:00:00.000000000 Z
12
+ date: 2016-04-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 1.2.0
34
+ version: 1.3.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 1.2.0
41
+ version: 1.3.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rspec
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -232,6 +232,7 @@ files:
232
232
  - ".coveralls.yml"
233
233
  - ".gitignore"
234
234
  - ".rspec"
235
+ - ".rubocop.yml"
235
236
  - ".travis.yml"
236
237
  - CHANGELOG.md
237
238
  - Gemfile
@@ -334,7 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
335
  version: '0'
335
336
  requirements: []
336
337
  rubyforge_project:
337
- rubygems_version: 2.4.5
338
+ rubygems_version: 2.5.1
338
339
  signing_key:
339
340
  specification_version: 4
340
341
  summary: A plugin for chef's knife to manage instances of DigitalOcean servers