digitalocean 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +8 -2
- data/digitalocean.gemspec +1 -0
- data/lib/digitalocean.rb +13 -1
- data/lib/digitalocean/version.rb +1 -1
- data/spec/digitalocean_spec.rb +12 -7
- data/spec/spec_helper.rb +1 -0
- metadata +29 -31
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 60d4593d56d99ed1844900a7a4f3c4c8c9cb7910
|
4
|
+
data.tar.gz: 67b6b7d39e31cac7c579e4060531f4494c8d0e3e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f096eee1b792f7196277093fae7328cb74e97e74dd3c12d8069a445f86a1c0dbcf0a7242fb87a314f9647aeed1c27fc854469924673c6b5815f691f634de2775
|
7
|
+
data.tar.gz: b07e2e16d56a786db44d723c3ab2bc4fc39086cb1f4b9884c75b6f10e521350e9b56963754f36867171df44b2e0c373cdcf29b2469ec52ac5c3178995aaff10e
|
data/README.md
CHANGED
@@ -71,7 +71,7 @@ Digitalocean::Droplet.find("id_of_droplet")
|
|
71
71
|
### Create Droplet
|
72
72
|
|
73
73
|
```ruby
|
74
|
-
Digitalocean::Droplet.create({:name => droplet_name, :size_id => size_id, :image_id => image_id, :region_id => region_id)
|
74
|
+
Digitalocean::Droplet.create({:name => droplet_name, :size_id => size_id, :image_id => image_id, :region_id => region_id})
|
75
75
|
```
|
76
76
|
## Available Commands
|
77
77
|
|
@@ -114,7 +114,7 @@ Digitalocean::Size.find(size_id)
|
|
114
114
|
|
115
115
|
Digitalocean::SshKey.all
|
116
116
|
Digitalocean::SshKey.find(id)
|
117
|
-
Digitalocean::SshKey.create({name: name, ssh_pub_key: ssh_pub_key})
|
117
|
+
Digitalocean::SshKey.create({name: name, ssh_pub_key: ssh_pub_key}) # Keep in mind you have to use CGI::escape for your ssh_pub_key
|
118
118
|
|
119
119
|
Digitalocean::Event.find(id)
|
120
120
|
```
|
@@ -123,6 +123,12 @@ Digitalocean::Event.find(id)
|
|
123
123
|
|
124
124
|
There is a [digitalocean-rubygem-example](https://github.com/scottmotte/digitalocean-rubygem-example) to help jumpstart your development.
|
125
125
|
|
126
|
+
## Options
|
127
|
+
|
128
|
+
```ruby
|
129
|
+
Digitalocean.verify_ssl = false # optionally set this to false. defaults to true.
|
130
|
+
```
|
131
|
+
|
126
132
|
## Contributing
|
127
133
|
|
128
134
|
1. Fork it
|
data/digitalocean.gemspec
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.add_development_dependency "pry"
|
21
21
|
gem.add_development_dependency "rake"
|
22
22
|
gem.add_development_dependency "rspec"
|
23
|
+
gem.add_development_dependency "rspec-its"
|
23
24
|
|
24
25
|
gem.files = `git ls-files`.split($/)
|
25
26
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
data/lib/digitalocean.rb
CHANGED
@@ -121,6 +121,18 @@ module Digitalocean
|
|
121
121
|
"api_key_required"
|
122
122
|
end
|
123
123
|
|
124
|
+
def verify_ssl=(verify_ssl)
|
125
|
+
@verify_ssl = verify_ssl
|
126
|
+
setup_request!
|
127
|
+
|
128
|
+
@verify_ssl
|
129
|
+
end
|
130
|
+
|
131
|
+
def verify_ssl
|
132
|
+
return @verify_ssl if @verify_ssl != nil
|
133
|
+
true
|
134
|
+
end
|
135
|
+
|
124
136
|
def api_endpoint
|
125
137
|
"https://api.digitalocean.com"
|
126
138
|
end
|
@@ -192,7 +204,7 @@ module Digitalocean
|
|
192
204
|
def setup_request!
|
193
205
|
options = {
|
194
206
|
:headers => {'Accept' => "application/json"},
|
195
|
-
:ssl => {:verify =>
|
207
|
+
:ssl => {:verify => verify_ssl}
|
196
208
|
}
|
197
209
|
|
198
210
|
Digitalocean.request = ::Faraday::Connection.new(options) do |builder|
|
data/lib/digitalocean/version.rb
CHANGED
data/spec/digitalocean_spec.rb
CHANGED
@@ -4,26 +4,31 @@ describe Digitalocean do
|
|
4
4
|
subject(:digitalocean) { described_class }
|
5
5
|
|
6
6
|
before do
|
7
|
-
digitalocean.client_id
|
8
|
-
digitalocean.api_key
|
7
|
+
digitalocean.client_id = client_id
|
8
|
+
digitalocean.api_key = api_key
|
9
|
+
digitalocean.verify_ssl = verify_ssl
|
9
10
|
end
|
10
11
|
|
11
12
|
describe "defaults" do
|
12
13
|
let(:client_id) { nil }
|
13
14
|
let(:api_key) { nil}
|
15
|
+
let(:verify_ssl) { nil }
|
14
16
|
|
15
17
|
its(:api_endpoint) { should eq "https://api.digitalocean.com" }
|
16
18
|
its(:client_id) { should eq "client_id_required" }
|
17
19
|
its(:api_key) { should eq "api_key_required" }
|
20
|
+
its(:verify_ssl) { should eq true }
|
18
21
|
|
19
|
-
it { digitalocean::VERSION.should eq "1.
|
22
|
+
it { digitalocean::VERSION.should eq "1.2.0" }
|
20
23
|
end
|
21
24
|
|
22
25
|
describe "setting values" do
|
23
|
-
let(:client_id)
|
24
|
-
let(:api_key)
|
26
|
+
let(:client_id) { "1234" }
|
27
|
+
let(:api_key) { "adf3434938492fjkdfj" }
|
28
|
+
let(:verify_ssl) { false }
|
25
29
|
|
26
|
-
its(:client_id)
|
27
|
-
its(:api_key)
|
30
|
+
its(:client_id) { should eq client_id }
|
31
|
+
its(:api_key) { should eq api_key }
|
32
|
+
its(:verify_ssl) { should eq verify_ssl }
|
28
33
|
end
|
29
34
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: digitalocean
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- scottmotte
|
@@ -10,12 +9,11 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2014-
|
12
|
+
date: 2014-07-10 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: faraday
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
18
|
- - ~>
|
21
19
|
- !ruby/object:Gem::Version
|
@@ -23,7 +21,6 @@ dependencies:
|
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
25
|
- - ~>
|
29
26
|
- !ruby/object:Gem::Version
|
@@ -31,7 +28,6 @@ dependencies:
|
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: faraday_middleware
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
32
|
- - ~>
|
37
33
|
- !ruby/object:Gem::Version
|
@@ -39,7 +35,6 @@ dependencies:
|
|
39
35
|
type: :runtime
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
39
|
- - ~>
|
45
40
|
- !ruby/object:Gem::Version
|
@@ -47,7 +42,6 @@ dependencies:
|
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: recursive-open-struct
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
46
|
- - ~>
|
53
47
|
- !ruby/object:Gem::Version
|
@@ -55,7 +49,6 @@ dependencies:
|
|
55
49
|
type: :runtime
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
53
|
- - ~>
|
61
54
|
- !ruby/object:Gem::Version
|
@@ -63,65 +56,71 @@ dependencies:
|
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
57
|
name: foreman
|
65
58
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
59
|
requirements:
|
68
|
-
- -
|
60
|
+
- - '>='
|
69
61
|
- !ruby/object:Gem::Version
|
70
62
|
version: '0'
|
71
63
|
type: :development
|
72
64
|
prerelease: false
|
73
65
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
66
|
requirements:
|
76
|
-
- -
|
67
|
+
- - '>='
|
77
68
|
- !ruby/object:Gem::Version
|
78
69
|
version: '0'
|
79
70
|
- !ruby/object:Gem::Dependency
|
80
71
|
name: pry
|
81
72
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
73
|
requirements:
|
84
|
-
- -
|
74
|
+
- - '>='
|
85
75
|
- !ruby/object:Gem::Version
|
86
76
|
version: '0'
|
87
77
|
type: :development
|
88
78
|
prerelease: false
|
89
79
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
80
|
requirements:
|
92
|
-
- -
|
81
|
+
- - '>='
|
93
82
|
- !ruby/object:Gem::Version
|
94
83
|
version: '0'
|
95
84
|
- !ruby/object:Gem::Dependency
|
96
85
|
name: rake
|
97
86
|
requirement: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
87
|
requirements:
|
100
|
-
- -
|
88
|
+
- - '>='
|
101
89
|
- !ruby/object:Gem::Version
|
102
90
|
version: '0'
|
103
91
|
type: :development
|
104
92
|
prerelease: false
|
105
93
|
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
94
|
requirements:
|
108
|
-
- -
|
95
|
+
- - '>='
|
109
96
|
- !ruby/object:Gem::Version
|
110
97
|
version: '0'
|
111
98
|
- !ruby/object:Gem::Dependency
|
112
99
|
name: rspec
|
113
100
|
requirement: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
101
|
requirements:
|
116
|
-
- -
|
102
|
+
- - '>='
|
117
103
|
- !ruby/object:Gem::Version
|
118
104
|
version: '0'
|
119
105
|
type: :development
|
120
106
|
prerelease: false
|
121
107
|
version_requirements: !ruby/object:Gem::Requirement
|
122
|
-
none: false
|
123
108
|
requirements:
|
124
|
-
- -
|
109
|
+
- - '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rspec-its
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - '>='
|
125
124
|
- !ruby/object:Gem::Version
|
126
125
|
version: '0'
|
127
126
|
description: Ruby bindings for the Digital Ocean API.
|
@@ -157,27 +156,26 @@ files:
|
|
157
156
|
- spec/spec_helper.rb
|
158
157
|
homepage: http://github.com/scottmotte/digitalocean
|
159
158
|
licenses: []
|
159
|
+
metadata: {}
|
160
160
|
post_install_message:
|
161
161
|
rdoc_options: []
|
162
162
|
require_paths:
|
163
163
|
- lib
|
164
164
|
required_ruby_version: !ruby/object:Gem::Requirement
|
165
|
-
none: false
|
166
165
|
requirements:
|
167
|
-
- -
|
166
|
+
- - '>='
|
168
167
|
- !ruby/object:Gem::Version
|
169
168
|
version: '0'
|
170
169
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
|
-
none: false
|
172
170
|
requirements:
|
173
|
-
- -
|
171
|
+
- - '>='
|
174
172
|
- !ruby/object:Gem::Version
|
175
173
|
version: '0'
|
176
174
|
requirements: []
|
177
175
|
rubyforge_project:
|
178
|
-
rubygems_version:
|
176
|
+
rubygems_version: 2.0.3
|
179
177
|
signing_key:
|
180
|
-
specification_version:
|
178
|
+
specification_version: 4
|
181
179
|
summary: Ruby bindings for the Digital Ocean API.
|
182
180
|
test_files:
|
183
181
|
- spec/digitalocean/domain_spec.rb
|