digital_ocean 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46ba4ca9c73fd1fc0e1253633996ae2723e67420
4
- data.tar.gz: 95e24b5156c7a11d070f3cf40c5fdf3ff3f2390d
3
+ metadata.gz: e9b679f2953506f52ec911d908ae9fe544db9e09
4
+ data.tar.gz: eabc729485e8d0fdbd1c53c62aaab28b0cfa7271
5
5
  SHA512:
6
- metadata.gz: bcf46b6e489e9d5114dcd203470c098416f7fbda4f5924bb508012b840db6290b6c67a8705d86920e226361900709ae553079df19485764ce5ba1a3f6fed51c6
7
- data.tar.gz: b170d95918e61cbc00d53e2eab20706e74bd065cee3a762ff8803075d6d3c7f0f606020ab9cd350e2b99ba3914135e1b825027e8dde5ff7a8fed42744e472db7
6
+ metadata.gz: 3fab6a786da74aefcd02c3ec0d3f64d295c878dba8ab47dfe4faed018c85bd692107c79e78b1f7feeecaee411b32bf1008da52d7164e991ad5600b4f68f2abc5
7
+ data.tar.gz: ddd7fdb9fbb17336b0be289f02bdcaf4e2ef038619c5e98b959d132d4b76f861b1175b6efa61f9dabe189dbaff56095014bd65319a8f7a5de80a5fc3b31f7209
@@ -1,6 +1,11 @@
1
1
  ## unreleased
2
2
 
3
- * [Full Changelog](https://github.com/rmoriz/digital_ocean/compare/v1.2.0...master)
3
+ * [Full Changelog](https://github.com/rmoriz/digital_ocean/compare/v1.3.0...master)
4
+
5
+
6
+ ## 1.3.0 / 2013-12-30
7
+
8
+ * on droplet delete use ```scrub_data``` by default
4
9
 
5
10
 
6
11
  ## 1.2.0 / 2013-09-07
data/README.md CHANGED
@@ -251,3 +251,7 @@ Copyright © 2013 [Roland Moriz](https://roland.io), [Moriz GmbH](https://moriz.
251
251
 
252
252
  [![LinkedIn](http://www.linkedin.com/img/webpromo/btn_viewmy_160x25.png)](http://www.linkedin.com/in/rmoriz)
253
253
  [![Twitter](http://i.imgur.com/1kYFHlu.png)](https://twitter.com/rmoriz)
254
+
255
+
256
+ [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rmoriz/digital_ocean/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
257
+
@@ -29,9 +29,9 @@ Gem::Specification.new do |gem|
29
29
  gem.add_dependency 'rash'
30
30
 
31
31
  gem.add_development_dependency 'rspec', '~> 2.0'
32
- gem.add_development_dependency 'guard'
33
- gem.add_development_dependency 'guard-rspec'
34
- gem.add_development_dependency 'rb-fsevent'
32
+ #gem.add_development_dependency 'guard'
33
+ #gem.add_development_dependency 'guard-rspec'
34
+ #gem.add_development_dependency 'rb-fsevent'
35
35
 
36
36
  gem.add_development_dependency 'vcr', '~> 2.4'
37
37
  gem.add_development_dependency 'fakeweb', '~> 1.3.0'
@@ -42,6 +42,12 @@ module DigitalOcean
42
42
  end.body
43
43
  end
44
44
 
45
+ def edit_record(id, rec_id, opts = {})
46
+ @connection.get "/domains/#{id}/records/#{rec_id}/edit" do |query|
47
+ apply_params(query, opts)
48
+ end.body
49
+ end
50
+
45
51
  def delete_record(id, rec_id, opts = {})
46
52
  @connection.get("/domains/#{id}/records/#{rec_id}/destroy").body
47
53
  end
@@ -76,8 +76,11 @@ module DigitalOcean
76
76
  @connection.post("/droplets/#{id}/disable_backups").body
77
77
  end
78
78
 
79
- def delete(id)
80
- @connection.delete("/droplets/#{id}/destroy").body
79
+ def delete(id, params = {})
80
+ params[:scrub_data] = 1
81
+ @connection.delete("/droplets/#{id}/destroy") do |query|
82
+ apply_params(query, params)
83
+ end.body
81
84
  end
82
85
  end
83
86
  end
@@ -1,3 +1,3 @@
1
1
  module DigitalOcean
2
- VERSION = '1.2.0'
2
+ VERSION = '1.3.0'
3
3
  end
@@ -523,6 +523,21 @@ describe DigitalOcean::API, :vcr do
523
523
  end
524
524
  end
525
525
 
526
+ describe '#edit_record' do
527
+ let(:record_id) { 206982 }
528
+ let(:record_type) { 'A' }
529
+ let(:data) { '8.8.8.8' }
530
+ let(:payload) { {data: data, record_type: record_type} }
531
+ let(:response) {
532
+ subject.domains.edit_record record_domain_id, record_id, payload
533
+ }
534
+
535
+ it 'should be successful' do
536
+ puts response
537
+ response.status.should eql('OK')
538
+ end
539
+ end
540
+
526
541
  describe '#create_record' do
527
542
  let(:record_type) { 'TXT' }
528
543
  let(:name) { 'foo' }
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.digitalocean.com/domains/30163/records/206982/edit?client_id=client_id_XXXXXXXXXXXXXXXXXXX&api_key=api_key_YYYYYYYYYYYYYYYYYYYYY&data=8.8.8.8&record_type=A
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.7
12
+ response:
13
+ status:
14
+ code: 200
15
+ message:
16
+ headers:
17
+ server:
18
+ - nginx
19
+ date:
20
+ - Sun, 09 Jun 2013 15:30:49 GMT
21
+ content-type:
22
+ - application/json; charset=utf-8
23
+ transfer-encoding:
24
+ - chunked
25
+ connection:
26
+ - close
27
+ status:
28
+ - 200 OK
29
+ x-ua-compatible:
30
+ - IE=Edge,chrome=1
31
+ etag:
32
+ - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
33
+ cache-control:
34
+ - max-age=0, private, must-revalidate
35
+ x-request-id:
36
+ - c4b08ee185ca817df3f635fe74de08f1
37
+ x-runtime:
38
+ - '0.135435'
39
+ x-rack-cache:
40
+ - miss
41
+ body:
42
+ encoding: US-ASCII
43
+ string: ! '{"status":"OK","record":{"id":206982,"domain_id":30163,"record_type":"A","name":"@","data":"8.8.8.8","priority":null,"port":null,"weight":null}}'
44
+ http_version:
45
+ recorded_at: Sun, 09 Jun 2013 15:30:49 GMT
46
+ recorded_with: VCR 2.5.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: delete
5
- uri: https://api.digitalocean.com/droplets/106265/destroy?client_id=client_id_XXXXXXXXXXXXXXXXXXX&api_key=api_key_YYYYYYYYYYYYYYYYYYYYY
5
+ uri: https://api.digitalocean.com/droplets/106265/destroy?client_id=client_id_XXXXXXXXXXXXXXXXXXX&api_key=api_key_YYYYYYYYYYYYYYYYYYYYY&scrub_data=1
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -10,7 +10,7 @@ http_interactions:
10
10
  response:
11
11
  status:
12
12
  code: 200
13
- message:
13
+ message:
14
14
  headers:
15
15
  server:
16
16
  - nginx
@@ -45,6 +45,6 @@ http_interactions:
45
45
  body:
46
46
  encoding: US-ASCII
47
47
  string: ! '{"status":"OK","event_id":765555}'
48
- http_version:
48
+ http_version:
49
49
  recorded_at: Wed, 20 Feb 2013 11:05:27 GMT
50
50
  recorded_with: VCR 2.4.0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: digital_ocean
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roland Moriz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-07 00:00:00.000000000 Z
11
+ date: 2013-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -80,48 +80,6 @@ dependencies:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.0'
83
- - !ruby/object:Gem::Dependency
84
- name: guard
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - '>='
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '>='
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: guard-rspec
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - '>='
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - '>='
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rb-fsevent
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - '>='
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - '>='
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
83
  - !ruby/object:Gem::Dependency
126
84
  name: vcr
127
85
  requirement: !ruby/object:Gem::Requirement
@@ -255,6 +213,7 @@ files:
255
213
  - spec/vcr/cassettes/DigitalOcean_API/_domains/_create_record/should_return_record_id.yml
256
214
  - spec/vcr/cassettes/DigitalOcean_API/_domains/_delete/should_be_successful.yml
257
215
  - spec/vcr/cassettes/DigitalOcean_API/_domains/_delete_record/should_be_successful.yml
216
+ - spec/vcr/cassettes/DigitalOcean_API/_domains/_edit_record/should_be_successful.yml
258
217
  - spec/vcr/cassettes/DigitalOcean_API/_domains/_list/should_be_successful.yml
259
218
  - spec/vcr/cassettes/DigitalOcean_API/_domains/_list/should_return_a_list_of_all_domains.yml
260
219
  - spec/vcr/cassettes/DigitalOcean_API/_domains/_list_records/should_be_successful.yml
@@ -325,7 +284,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
325
284
  version: '0'
326
285
  requirements: []
327
286
  rubyforge_project:
328
- rubygems_version: 2.0.2
287
+ rubygems_version: 2.0.14
329
288
  signing_key:
330
289
  specification_version: 4
331
290
  summary: This gem wraps the DigitalOcean API documented at https://api.digitalocean.com/
@@ -340,6 +299,7 @@ test_files:
340
299
  - spec/vcr/cassettes/DigitalOcean_API/_domains/_create_record/should_return_record_id.yml
341
300
  - spec/vcr/cassettes/DigitalOcean_API/_domains/_delete/should_be_successful.yml
342
301
  - spec/vcr/cassettes/DigitalOcean_API/_domains/_delete_record/should_be_successful.yml
302
+ - spec/vcr/cassettes/DigitalOcean_API/_domains/_edit_record/should_be_successful.yml
343
303
  - spec/vcr/cassettes/DigitalOcean_API/_domains/_list/should_be_successful.yml
344
304
  - spec/vcr/cassettes/DigitalOcean_API/_domains/_list/should_return_a_list_of_all_domains.yml
345
305
  - spec/vcr/cassettes/DigitalOcean_API/_domains/_list_records/should_be_successful.yml