droplet_kit 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/droplet_kit.gemspec +2 -2
- data/lib/droplet_kit/mappings/action_mapping.rb +1 -1
- data/lib/droplet_kit/mappings/image_action_mapping.rb +1 -1
- data/lib/droplet_kit/mappings/ssh_key_mapping.rb +1 -1
- data/lib/droplet_kit/models/region.rb +1 -1
- data/lib/droplet_kit/version.rb +1 -1
- data/spec/fixtures/actions/all.json +8 -2
- data/spec/fixtures/actions/find.json +8 -2
- data/spec/fixtures/droplets/list_actions.json +8 -2
- data/spec/fixtures/image_actions/all.json +7 -1
- data/spec/fixtures/image_actions/create.json +8 -2
- data/spec/fixtures/image_actions/find.json +8 -2
- data/spec/lib/droplet_kit/resources/action_resource_spec.rb +14 -3
- data/spec/lib/droplet_kit/resources/droplet_action_resource_spec.rb +16 -4
- data/spec/lib/droplet_kit/resources/droplet_resource_spec.rb +6 -1
- data/spec/lib/droplet_kit/resources/image_action_resource_spec.rb +14 -2
- metadata +31 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4573b2ad1d55aa0ad804badf5bce1b2614800b34
|
4
|
+
data.tar.gz: 02c8d03d60f9f1ef07aeddaf8a39005c58b1206e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5b1a994c2dbe57857d9ae95bdc61aba6704d3f6be89cf091cfe5ec0652e1e9eaf75796822bb527c85c901a5e44e59fe3f903174bd4d1de6bbf6c215c40522d8
|
7
|
+
data.tar.gz: ef0228046db08ff59a8d21053efb37ca0460a073304057efe83be3d9aac6684525b61f345068e68407815a9dc2a075129e5dc885540213013e11ff24c3172728
|
data/droplet_kit.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "droplet_kit"
|
8
8
|
spec.version = DropletKit::VERSION
|
9
9
|
spec.authors = ["Robert Ross"]
|
10
|
-
spec.email = ["
|
10
|
+
spec.email = ["rross@digitalocean.com"]
|
11
11
|
spec.summary = %q{Droplet Kit is the official Ruby library for DigitalOcean's API}
|
12
12
|
spec.description = %q{Droplet Kit is the official Ruby library for DigitalOcean's API}
|
13
13
|
spec.homepage = ""
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_dependency 'virtus', '~> 1.0.3'
|
24
24
|
spec.add_dependency "resource_kit", '~> 0.1.1'
|
25
|
-
spec.add_dependency "kartograph", '~> 0.2.
|
25
|
+
spec.add_dependency "kartograph", '~> 0.2.1'
|
26
26
|
spec.add_dependency "activesupport", '~> 4.1.6'
|
27
27
|
spec.add_dependency "faraday", '~> 0.9.1'
|
28
28
|
|
@@ -13,7 +13,7 @@ module DropletKit
|
|
13
13
|
property :completed_at, scopes: [:read]
|
14
14
|
property :resource_id, scopes: [:read]
|
15
15
|
property :resource_type, scopes: [:read]
|
16
|
-
property :region, scopes: [:read]
|
16
|
+
property :region, scopes: [:read], include: RegionMapping
|
17
17
|
property :region_slug, scopes: [:read]
|
18
18
|
end
|
19
19
|
end
|
@@ -13,7 +13,7 @@ module DropletKit
|
|
13
13
|
property :completed_at, scopes: [:read]
|
14
14
|
property :resource_id, scopes: [:read]
|
15
15
|
property :resource_type, scopes: [:read]
|
16
|
-
property :region, scopes: [:read]
|
16
|
+
property :region, scopes: [:read], include: RegionMapping
|
17
17
|
property :region_slug, scopes: [:read]
|
18
18
|
end
|
19
19
|
end
|
data/lib/droplet_kit/version.rb
CHANGED
@@ -8,8 +8,14 @@
|
|
8
8
|
"completed_at": null,
|
9
9
|
"resource_id": null,
|
10
10
|
"resource_type": "backend",
|
11
|
-
"
|
12
|
-
"
|
11
|
+
"region_slug": "nyc1",
|
12
|
+
"region": {
|
13
|
+
"name": "New York",
|
14
|
+
"slug": "nyc1",
|
15
|
+
"available": true,
|
16
|
+
"sizes": ["512mb"],
|
17
|
+
"features": ["virtio", "private_networking", "backups", "ipv6", "metadata"]
|
18
|
+
}
|
13
19
|
}
|
14
20
|
],
|
15
21
|
"meta": {
|
@@ -7,7 +7,13 @@
|
|
7
7
|
"completed_at": null,
|
8
8
|
"resource_id": null,
|
9
9
|
"resource_type": "backend",
|
10
|
-
"
|
11
|
-
"
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": ["512mb"],
|
16
|
+
"features": ["virtio", "private_networking", "backups", "ipv6", "metadata"]
|
17
|
+
}
|
12
18
|
}
|
13
19
|
}
|
@@ -8,8 +8,14 @@
|
|
8
8
|
"completed_at": null,
|
9
9
|
"resource_id": 24,
|
10
10
|
"resource_type": "droplet",
|
11
|
-
"
|
12
|
-
"
|
11
|
+
"region_slug": "nyc1",
|
12
|
+
"region": {
|
13
|
+
"name": "New York",
|
14
|
+
"slug": "nyc1",
|
15
|
+
"available": true,
|
16
|
+
"sizes": ["512mb"],
|
17
|
+
"features": ["virtio", "private_networking", "backups", "ipv6", "metadata"]
|
18
|
+
}
|
13
19
|
}
|
14
20
|
],
|
15
21
|
"meta": {
|
@@ -19,7 +19,13 @@
|
|
19
19
|
"completed_at": "2014-10-28T17:12:04Z",
|
20
20
|
"resource_id": 45646587,
|
21
21
|
"resource_type": "image",
|
22
|
-
"region":
|
22
|
+
"region": {
|
23
|
+
"name": "New York",
|
24
|
+
"slug": "nyc2",
|
25
|
+
"available": true,
|
26
|
+
"sizes": ["512mb"],
|
27
|
+
"features": ["virtio", "private_networking", "backups", "ipv6", "metadata"]
|
28
|
+
},
|
23
29
|
"region_slug": "nyc2"
|
24
30
|
}
|
25
31
|
],
|
@@ -7,7 +7,13 @@
|
|
7
7
|
"completed_at": null,
|
8
8
|
"resource_id": 449676391,
|
9
9
|
"resource_type": "image",
|
10
|
-
"
|
11
|
-
"
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": ["512mb"],
|
16
|
+
"features": ["virtio", "private_networking", "backups", "ipv6", "metadata"]
|
17
|
+
}
|
12
18
|
}
|
13
19
|
}
|
@@ -7,7 +7,13 @@
|
|
7
7
|
"completed_at": null,
|
8
8
|
"resource_id": 449676391,
|
9
9
|
"resource_type": "image",
|
10
|
-
"
|
11
|
-
"
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": ["512mb"],
|
16
|
+
"features": ["virtio", "private_networking", "backups", "ipv6", "metadata"]
|
17
|
+
}
|
12
18
|
}
|
13
19
|
}
|
@@ -26,8 +26,13 @@ RSpec.describe DropletKit::ActionResource do
|
|
26
26
|
expect(actions.first.completed_at).to eq(nil)
|
27
27
|
expect(actions.first.resource_id).to eq(nil)
|
28
28
|
expect(actions.first.resource_type).to eq("backend")
|
29
|
-
|
30
|
-
expect(actions.first.
|
29
|
+
|
30
|
+
expect(actions.first.region).to be_kind_of(DropletKit::Region)
|
31
|
+
expect(actions.first.region.slug).to eq('nyc1')
|
32
|
+
expect(actions.first.region.name).to eq('New York')
|
33
|
+
expect(actions.first.region.sizes).to include('512mb')
|
34
|
+
expect(actions.first.region.available).to be(true)
|
35
|
+
expect(actions.first.region.features).to include("virtio", "private_networking", "backups", "ipv6", "metadata")
|
31
36
|
end
|
32
37
|
end
|
33
38
|
|
@@ -53,8 +58,14 @@ RSpec.describe DropletKit::ActionResource do
|
|
53
58
|
expect(action.completed_at).to eq(nil)
|
54
59
|
expect(action.resource_id).to eq(nil)
|
55
60
|
expect(action.resource_type).to eq("backend")
|
56
|
-
expect(action.region).to eq("nyc1")
|
57
61
|
expect(action.region_slug).to eq("nyc1")
|
62
|
+
|
63
|
+
expect(action.region).to be_kind_of(DropletKit::Region)
|
64
|
+
expect(action.region.slug).to eq('nyc1')
|
65
|
+
expect(action.region.name).to eq('New York')
|
66
|
+
expect(action.region.sizes).to include('512mb')
|
67
|
+
expect(action.region.available).to be(true)
|
68
|
+
expect(action.region.features).to include("virtio", "private_networking", "backups", "ipv6", "metadata")
|
58
69
|
end
|
59
70
|
end
|
60
71
|
end
|
@@ -13,8 +13,14 @@ RSpec.describe DropletKit::DropletActionResource do
|
|
13
13
|
"completed_at" => nil,
|
14
14
|
"resource_id" => 12,
|
15
15
|
"resource_type" => "droplet",
|
16
|
-
"
|
17
|
-
"
|
16
|
+
"region_slug" => "nyc1",
|
17
|
+
"region" => {
|
18
|
+
"name" => "New York",
|
19
|
+
"slug" => "nyc1",
|
20
|
+
"available" => true,
|
21
|
+
"sizes" => ["512mb"],
|
22
|
+
"features" => ["virtio", "private_networking", "backups", "ipv6", "metadata"]
|
23
|
+
}
|
18
24
|
}
|
19
25
|
}.to_json
|
20
26
|
end
|
@@ -161,8 +167,14 @@ RSpec.describe DropletKit::DropletActionResource do
|
|
161
167
|
expect(returned_action.completed_at).to eq(nil)
|
162
168
|
expect(returned_action.resource_id).to eq(nil)
|
163
169
|
expect(returned_action.resource_type).to eq("backend")
|
164
|
-
expect(returned_action.
|
165
|
-
|
170
|
+
expect(returned_action.region_slug).to eq('nyc1')
|
171
|
+
|
172
|
+
expect(returned_action.region).to be_kind_of(DropletKit::Region)
|
173
|
+
expect(returned_action.region.slug).to eq('nyc1')
|
174
|
+
expect(returned_action.region.name).to eq('New York')
|
175
|
+
expect(returned_action.region.sizes).to include('512mb')
|
176
|
+
expect(returned_action.region.available).to be(true)
|
177
|
+
expect(returned_action.region.features).to include("virtio", "private_networking", "backups", "ipv6", "metadata")
|
166
178
|
end
|
167
179
|
end
|
168
180
|
end
|
@@ -191,7 +191,12 @@ RSpec.describe DropletKit::DropletResource do
|
|
191
191
|
expect(actions[0].completed_at).to eq(nil)
|
192
192
|
expect(actions[0].resource_id).to eq(24)
|
193
193
|
expect(actions[0].resource_type).to eq("droplet")
|
194
|
-
expect(actions[0].region).to
|
194
|
+
expect(actions[0].region).to be_kind_of(DropletKit::Region)
|
195
|
+
expect(actions[0].region.slug).to eq('nyc1')
|
196
|
+
expect(actions[0].region.name).to eq('New York')
|
197
|
+
expect(actions[0].region.sizes).to include('512mb')
|
198
|
+
expect(actions[0].region.available).to be(true)
|
199
|
+
expect(actions[0].region.features).to include("virtio", "private_networking", "backups", "ipv6", "metadata")
|
195
200
|
end
|
196
201
|
end
|
197
202
|
|
@@ -22,8 +22,14 @@ RSpec.describe DropletKit::ImageActionResource do
|
|
22
22
|
expect(action.completed_at).to eq(nil)
|
23
23
|
expect(action.resource_id).to eq(449676391)
|
24
24
|
expect(action.resource_type).to eq("image")
|
25
|
-
expect(action.region).to eq("nyc1")
|
26
25
|
expect(action.region_slug).to eq("nyc1")
|
26
|
+
|
27
|
+
expect(action.region).to be_kind_of(DropletKit::Region)
|
28
|
+
expect(action.region.slug).to eq('nyc1')
|
29
|
+
expect(action.region.name).to eq('New York')
|
30
|
+
expect(action.region.sizes).to include('512mb')
|
31
|
+
expect(action.region.available).to be(true)
|
32
|
+
expect(action.region.features).to include("virtio", "private_networking", "backups", "ipv6", "metadata")
|
27
33
|
end
|
28
34
|
end
|
29
35
|
|
@@ -67,8 +73,14 @@ RSpec.describe DropletKit::ImageActionResource do
|
|
67
73
|
expect(action.completed_at).to eq(nil)
|
68
74
|
expect(action.resource_id).to eq(449676391)
|
69
75
|
expect(action.resource_type).to eq("image")
|
70
|
-
expect(action.region).to eq("nyc1")
|
71
76
|
expect(action.region_slug).to eq("nyc1")
|
77
|
+
|
78
|
+
expect(action.region).to be_kind_of(DropletKit::Region)
|
79
|
+
expect(action.region.slug).to eq('nyc1')
|
80
|
+
expect(action.region.name).to eq('New York')
|
81
|
+
expect(action.region.sizes).to include('512mb')
|
82
|
+
expect(action.region.available).to be(true)
|
83
|
+
expect(action.region.features).to include("virtio", "private_networking", "backups", "ipv6", "metadata")
|
72
84
|
end
|
73
85
|
end
|
74
86
|
end
|
metadata
CHANGED
@@ -1,180 +1,179 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: droplet_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Ross
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.0.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.0.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: resource_kit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.1.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.1.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: kartograph
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.2.
|
47
|
+
version: 0.2.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.2.
|
54
|
+
version: 0.2.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: activesupport
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 4.1.6
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 4.1.6
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: faraday
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 0.9.1
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.9.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '1.6'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.6'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: 3.0.0
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ~>
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 3.0.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: pry
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - '>='
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: sinatra
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - ~>
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '1.4'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ~>
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '1.4'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: webmock
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ~>
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '1.18'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - ~>
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '1.18'
|
167
167
|
description: Droplet Kit is the official Ruby library for DigitalOcean's API
|
168
168
|
email:
|
169
|
-
- engineering@digitalocean.com
|
170
169
|
- rross@digitalocean.com
|
171
170
|
executables: []
|
172
171
|
extensions: []
|
173
172
|
extra_rdoc_files: []
|
174
173
|
files:
|
175
|
-
-
|
176
|
-
-
|
177
|
-
-
|
174
|
+
- .gitignore
|
175
|
+
- .rspec
|
176
|
+
- .travis.yml
|
178
177
|
- CHANGELOG.md
|
179
178
|
- Gemfile
|
180
179
|
- LICENSE.txt
|
@@ -290,12 +289,12 @@ require_paths:
|
|
290
289
|
- lib
|
291
290
|
required_ruby_version: !ruby/object:Gem::Requirement
|
292
291
|
requirements:
|
293
|
-
- -
|
292
|
+
- - '>='
|
294
293
|
- !ruby/object:Gem::Version
|
295
294
|
version: 2.0.0
|
296
295
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
297
296
|
requirements:
|
298
|
-
- -
|
297
|
+
- - '>='
|
299
298
|
- !ruby/object:Gem::Version
|
300
299
|
version: '0'
|
301
300
|
requirements: []
|