colombo 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/lib/colombo.rb +2 -0
- data/lib/colombo/container.rb +40 -0
- data/lib/colombo/droplet.rb +1 -10
- data/lib/colombo/droplets.rb +2 -16
- data/lib/colombo/image.rb +1 -8
- data/lib/colombo/images.rb +2 -16
- data/lib/colombo/region.rb +1 -9
- data/lib/colombo/regions.rb +2 -16
- data/lib/colombo/resource.rb +15 -0
- data/lib/colombo/size.rb +1 -9
- data/lib/colombo/sizes.rb +2 -6
- data/lib/colombo/ssh_key.rb +10 -8
- data/lib/colombo/ssh_keys.rb +3 -16
- data/lib/colombo/version.rb +1 -1
- data/test/colombo/ssh_keys_test.rb +149 -29
- data/test/colombo/test_helper.rb +1 -1
- metadata +16 -14
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/colombo.rb
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Colombo
|
4
|
+
class Container < Array
|
5
|
+
|
6
|
+
def find(image_id)
|
7
|
+
|
8
|
+
image = self.select{ |i| i.id == image_id }.first
|
9
|
+
|
10
|
+
return image if not image.nil?
|
11
|
+
|
12
|
+
response = @client.request(:get, "/images/#{image_id}") do |response|
|
13
|
+
image = Image.new(@client, self, response['image'])
|
14
|
+
self << image
|
15
|
+
end
|
16
|
+
|
17
|
+
return image
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
def method_missing(method, *args, &block)
|
22
|
+
if method.to_s =~ /^find_by_(.*)/
|
23
|
+
p "found: #{method} - #{$1}"
|
24
|
+
p "args: #{args[0]}"
|
25
|
+
run_find_by_attr($1, *args)
|
26
|
+
else
|
27
|
+
super
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def run_find_by_attr(method, *args)
|
32
|
+
self.select{ |item| item.send(method.to_sym) == args[0] }.first
|
33
|
+
end
|
34
|
+
|
35
|
+
def find(id)
|
36
|
+
find_by_id(id)
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
data/lib/colombo/droplet.rb
CHANGED
@@ -1,20 +1,11 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Colombo
|
4
|
-
class Droplet
|
4
|
+
class Droplet < Resource
|
5
5
|
|
6
6
|
attr_accessor :id, :name, :image_id, :size_id, :region_id
|
7
7
|
attr_accessor :backups_active, :ip_address, :status
|
8
8
|
|
9
|
-
def initialize(client, droplets, droplet_hash)
|
10
|
-
@client = client
|
11
|
-
if droplet_hash
|
12
|
-
droplet_hash.each do |key, value|
|
13
|
-
__send__("#{key}=", value) if self.respond_to?( key.to_sym )
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
9
|
def reboot
|
19
10
|
@client.request(:get, "/droplets/#{self.id}/reboot/") do |response|
|
20
11
|
return response['event_id']
|
data/lib/colombo/droplets.rb
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
require "colombo/droplet"
|
4
4
|
|
5
5
|
module Colombo
|
6
|
-
class Droplets <
|
6
|
+
class Droplets < Container
|
7
7
|
|
8
8
|
def initialize(client)
|
9
9
|
@client = client
|
10
10
|
@client.request(:get, '/droplets/', {}) do |response|
|
11
11
|
response['droplets'].each do |droplet|
|
12
|
-
self << Droplet.new(@client,
|
12
|
+
self << Droplet.new(@client, droplet)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -30,19 +30,5 @@ module Colombo
|
|
30
30
|
|
31
31
|
end
|
32
32
|
|
33
|
-
def find(droplet_id)
|
34
|
-
|
35
|
-
droplet = self.select{ |d| d.id == droplet_id }.first
|
36
|
-
|
37
|
-
return droplet if not droplet.nil?
|
38
|
-
|
39
|
-
response = @client.request(:get, "/droplets/#{droplet_id}") do |response|
|
40
|
-
droplet = Droplet.new(@client, self, response['droplet'])
|
41
|
-
self << droplet
|
42
|
-
end
|
43
|
-
|
44
|
-
return droplet
|
45
|
-
end
|
46
|
-
|
47
33
|
end
|
48
34
|
end
|
data/lib/colombo/image.rb
CHANGED
@@ -1,16 +1,9 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
module Colombo
|
3
|
-
class Image
|
3
|
+
class Image < Resource
|
4
4
|
|
5
5
|
attr_accessor :id, :name, :distribution
|
6
6
|
|
7
|
-
def initialize(client, images, image_hash)
|
8
|
-
@client = client
|
9
|
-
image_hash.each do |key, value|
|
10
|
-
__send__("#{key}=", value) if self.respond_to?( key.to_sym )
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
7
|
def destroy(confirm=false)
|
15
8
|
return unless confirm
|
16
9
|
@client.request(:get, "/images/#{self.id}/destroy/") do |response|
|
data/lib/colombo/images.rb
CHANGED
@@ -3,30 +3,16 @@
|
|
3
3
|
require "colombo/image"
|
4
4
|
|
5
5
|
module Colombo
|
6
|
-
class Images <
|
6
|
+
class Images < Container
|
7
7
|
|
8
8
|
def initialize(client)
|
9
9
|
@client = client
|
10
10
|
@client.request(:get, '/images/', {}) do |response|
|
11
11
|
response['images'].each do |image|
|
12
|
-
self << Image.new(@client,
|
12
|
+
self << Image.new(@client, image)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def find(image_id)
|
18
|
-
|
19
|
-
image = self.select{ |i| i.id == image_id }.first
|
20
|
-
|
21
|
-
return image if not image.nil?
|
22
|
-
|
23
|
-
response = @client.request(:get, "/images/#{image_id}") do |response|
|
24
|
-
image = Image.new(@client, self, response['image'])
|
25
|
-
self << image
|
26
|
-
end
|
27
|
-
|
28
|
-
return image
|
29
|
-
end
|
30
|
-
|
31
17
|
end
|
32
18
|
end
|
data/lib/colombo/region.rb
CHANGED
@@ -1,16 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
module Colombo
|
3
|
-
class Region
|
3
|
+
class Region < Resource
|
4
4
|
|
5
5
|
attr_accessor :id, :name
|
6
6
|
|
7
|
-
def initialize(client, regions, region_hash)
|
8
|
-
@client = client
|
9
|
-
@regions = regions
|
10
|
-
region_hash.each do |key, value|
|
11
|
-
__send__("#{key}=", value) if self.respond_to?( key.to_sym )
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
7
|
end
|
16
8
|
end
|
data/lib/colombo/regions.rb
CHANGED
@@ -3,30 +3,16 @@
|
|
3
3
|
require "colombo/region"
|
4
4
|
|
5
5
|
module Colombo
|
6
|
-
class Regions <
|
6
|
+
class Regions < Container
|
7
7
|
|
8
8
|
def initialize(client)
|
9
9
|
@client = client
|
10
10
|
@client.request(:get, '/regions/', {}) do |response|
|
11
11
|
response['regions'].each do |region|
|
12
|
-
self[ region['id'].to_i ] = Region.new(@client,
|
12
|
+
self[ region['id'].to_i ] = Region.new(@client, region)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def find(region_id)
|
18
|
-
|
19
|
-
region = self.select{ |r| r.id == region_id }.first
|
20
|
-
|
21
|
-
return region if not region.nil?
|
22
|
-
|
23
|
-
response = @client.request(:get, "/regions/#{region_id}") do |response|
|
24
|
-
region = Region.new(@client, self, response['region'])
|
25
|
-
self << region
|
26
|
-
end
|
27
|
-
|
28
|
-
return region
|
29
|
-
end
|
30
|
-
|
31
17
|
end
|
32
18
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Colombo
|
4
|
+
class Resource
|
5
|
+
|
6
|
+
def initialize(client, attr_hash)
|
7
|
+
@client = client
|
8
|
+
if attr_hash
|
9
|
+
attr_hash.each do |key, value|
|
10
|
+
__send__("#{key}=", value) if self.respond_to?( key.to_sym )
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/colombo/size.rb
CHANGED
@@ -1,16 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
module Colombo
|
3
|
-
class Size
|
3
|
+
class Size < Resource
|
4
4
|
|
5
5
|
attr_accessor :id, :name
|
6
6
|
|
7
|
-
def initialize(client, sizes, size_hash)
|
8
|
-
@client = client
|
9
|
-
@sizes = sizes
|
10
|
-
size_hash.each do |key, value|
|
11
|
-
__send__("#{key}=", value) if self.respond_to?( key.to_sym )
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
7
|
end
|
16
8
|
end
|
data/lib/colombo/sizes.rb
CHANGED
@@ -3,20 +3,16 @@
|
|
3
3
|
require "colombo/size"
|
4
4
|
|
5
5
|
module Colombo
|
6
|
-
class Sizes <
|
6
|
+
class Sizes < Container
|
7
7
|
|
8
8
|
def initialize(client)
|
9
9
|
@client = client
|
10
10
|
@client.request(:get, '/sizes/', {}) do |response|
|
11
11
|
response['sizes'].each do |size|
|
12
|
-
self << Size.new(@client,
|
12
|
+
self << Size.new(@client, size)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def find(size_id)
|
18
|
-
self.select{ |s| s.id == size_id }.first
|
19
|
-
end
|
20
|
-
|
21
17
|
end
|
22
18
|
end
|
data/lib/colombo/ssh_key.rb
CHANGED
@@ -1,16 +1,9 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
module Colombo
|
3
|
-
class SshKey
|
3
|
+
class SshKey < Resource
|
4
4
|
|
5
5
|
attr_accessor :id, :name, :ssh_pub_key
|
6
6
|
|
7
|
-
def initialize(client, ssh_keys, ssh_key_hash)
|
8
|
-
@client = client
|
9
|
-
ssh_key_hash.each do |key, value|
|
10
|
-
__send__("#{key}=", value) if self.respond_to?( key.to_sym )
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
7
|
def destroy
|
15
8
|
@client.request(:get, "/ssh_keys/#{self.id}/destroy/") do |response|
|
16
9
|
return true
|
@@ -18,6 +11,15 @@ module Colombo
|
|
18
11
|
return false
|
19
12
|
end
|
20
13
|
|
14
|
+
def ssh_pub_key
|
15
|
+
return unless self.id
|
16
|
+
return @ssh_pub_key if @ssh_pub_key
|
17
|
+
@client.request(:get, "/ssh_keys/#{self.id}/") do |response|
|
18
|
+
@ssh_pub_key = response['ssh_key']['ssh_pub_key']
|
19
|
+
end
|
20
|
+
@ssh_pub_key
|
21
|
+
end
|
22
|
+
|
21
23
|
def update(options={})
|
22
24
|
params = {
|
23
25
|
:ssh_pub_key => options[:ssh_pub_key]
|
data/lib/colombo/ssh_keys.rb
CHANGED
@@ -3,30 +3,17 @@
|
|
3
3
|
require "colombo/ssh_key"
|
4
4
|
|
5
5
|
module Colombo
|
6
|
-
class SshKeys <
|
6
|
+
class SshKeys < Container
|
7
7
|
|
8
8
|
def initialize(client)
|
9
9
|
@client = client
|
10
10
|
@client.request(:get, '/ssh_keys/', {}) do |response|
|
11
11
|
response['ssh_keys'].each do |ssh_key|
|
12
|
-
self << SshKey.new(@client,
|
12
|
+
self << SshKey.new(@client, ssh_key)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def find(ssh_key_id)
|
18
|
-
ssh_key = self.select{ |o| o == ssh_key_id }.first
|
19
|
-
|
20
|
-
return ssh_key if ssh_key
|
21
|
-
|
22
|
-
response = @client.request(:get, "/ssh_keys/#{ssh_key_id}") do |response|
|
23
|
-
ssh_key = SshKey.new(@client, self, response['ssh_key'])
|
24
|
-
self << ssh_key
|
25
|
-
end
|
26
|
-
|
27
|
-
return ssh_key
|
28
|
-
end
|
29
|
-
|
30
17
|
def create(options={})
|
31
18
|
|
32
19
|
params = {
|
@@ -37,7 +24,7 @@ module Colombo
|
|
37
24
|
ssh_key = nil
|
38
25
|
|
39
26
|
response = @client.request(:get, "/ssh_keys/new/", params) do |response|
|
40
|
-
ssh_key = SshKey.new(@client,
|
27
|
+
ssh_key = SshKey.new(@client, response['ssh_key'])
|
41
28
|
self << ssh_key
|
42
29
|
end
|
43
30
|
|
data/lib/colombo/version.rb
CHANGED
@@ -2,34 +2,22 @@
|
|
2
2
|
|
3
3
|
require File.expand_path('../test_helper.rb', __FILE__)
|
4
4
|
|
5
|
-
|
6
|
-
:alpha
|
7
|
-
end
|
5
|
+
describe Colombo::SshKeys do
|
8
6
|
|
9
|
-
|
7
|
+
i_suck_and_my_tests_are_order_dependent!
|
10
8
|
|
11
9
|
before do
|
12
|
-
|
13
|
-
|
10
|
+
Colombo.reset
|
14
11
|
Colombo.configure do |c|
|
15
12
|
c.api_key = ENV['DO_API_KEY']
|
16
13
|
c.client_id = ENV['DO_CLIENT_ID']
|
17
14
|
end
|
18
|
-
|
19
15
|
@client = Colombo::Client.new
|
20
16
|
end
|
21
17
|
|
22
|
-
it '
|
23
|
-
|
24
|
-
VCR.use_cassette('
|
25
|
-
@client.ssh_keys.wont_be_nil
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'add ssh key' do
|
31
|
-
|
32
|
-
VCR.use_cassette('add ssh key') do
|
18
|
+
it 'add key' do
|
19
|
+
$stdout.puts "1 - add key"
|
20
|
+
VCR.use_cassette('sshkeys-add_key') do
|
33
21
|
|
34
22
|
ssh_key = @client.ssh_keys.create({
|
35
23
|
:name => COLOMBO_SSH_KEY_NAME,
|
@@ -37,23 +25,29 @@ describe 'SshKeys' do
|
|
37
25
|
})
|
38
26
|
|
39
27
|
ssh_key.must_be_instance_of(Colombo::SshKey)
|
40
|
-
|
41
28
|
ssh_key.name.must_equal COLOMBO_SSH_KEY_NAME
|
42
|
-
|
43
29
|
ssh_key.ssh_pub_key.must_equal COLOMBO_SSH_KEY
|
44
30
|
end
|
31
|
+
end
|
45
32
|
|
33
|
+
it 'list ssh keys' do
|
34
|
+
$stdout.puts "2 - list ssh keys"
|
35
|
+
VCR.use_cassette('sshkeys-list_keys') do
|
36
|
+
@client.ssh_keys.wont_be_empty
|
37
|
+
end
|
46
38
|
end
|
47
39
|
|
48
40
|
it 'find ssh key by id' do
|
49
41
|
|
50
|
-
|
42
|
+
$stdout.puts "3 - find ssh key by id"
|
43
|
+
|
44
|
+
VCR.use_cassette('sshkeys-find_ssh_keys_by_id') do
|
51
45
|
|
52
46
|
# fetch the key list from digital ocean
|
53
47
|
ssh_keys = @client.ssh_keys
|
54
48
|
|
55
49
|
# find the key with COLOMBO_SSH_KEY_NAME inside the digital ocean colection
|
56
|
-
do_key = ssh_keys.select{ |
|
50
|
+
do_key = ssh_keys.select{ |key| key.name == COLOMBO_SSH_KEY_NAME }.first
|
57
51
|
|
58
52
|
# check if the key was found
|
59
53
|
do_key.must_be_instance_of(Colombo::SshKey)
|
@@ -74,9 +68,22 @@ describe 'SshKeys' do
|
|
74
68
|
|
75
69
|
end
|
76
70
|
|
71
|
+
it 'find by name' do
|
72
|
+
$stdout.puts "4 - find by name"
|
73
|
+
|
74
|
+
VCR.use_cassette('sshkeys-find_by_name') do
|
75
|
+
p @client.ssh_keys
|
76
|
+
ssh_key = @client.ssh_keys.find_by_name( COLOMBO_SSH_KEY_NAME )
|
77
|
+
ssh_key.must_be_instance_of(Colombo::SshKey)
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
77
82
|
it 'update key' do
|
78
83
|
|
79
|
-
|
84
|
+
$stdout.puts "5 - update key"
|
85
|
+
|
86
|
+
VCR.use_cassette('sshkeys_update_key') do
|
80
87
|
# fetch the key list from digital ocean
|
81
88
|
ssh_keys = @client.ssh_keys
|
82
89
|
|
@@ -91,8 +98,12 @@ describe 'SshKeys' do
|
|
91
98
|
|
92
99
|
end
|
93
100
|
|
101
|
+
|
94
102
|
it 'destroy ssh key' do
|
95
|
-
|
103
|
+
|
104
|
+
$stdout.puts "6 - destroy ssh key"
|
105
|
+
|
106
|
+
VCR.use_cassette('sshkeys_destroy_ssh_key') do
|
96
107
|
# fetch the key list from digital ocean
|
97
108
|
ssh_keys = @client.ssh_keys
|
98
109
|
|
@@ -105,11 +116,120 @@ describe 'SshKeys' do
|
|
105
116
|
|
106
117
|
end
|
107
118
|
|
108
|
-
VCR.use_cassette('are all keys destroyed?') do
|
109
|
-
@client.ssh_keys.select{ |key| key.name == COLOMBO_SSH_KEY_NAME }.must_be_empty
|
110
|
-
end
|
111
|
-
|
112
|
-
|
113
119
|
end
|
114
120
|
|
121
|
+
|
115
122
|
end
|
123
|
+
|
124
|
+
# it 'add key' do
|
125
|
+
|
126
|
+
# $stdout.puts "1 - sshkeys_add_key"
|
127
|
+
|
128
|
+
# VCR.use_cassette('sskkeys_add_ssh_key') do
|
129
|
+
|
130
|
+
# ssh_key = @client.ssh_keys.create({
|
131
|
+
# :name => COLOMBO_SSH_KEY_NAME,
|
132
|
+
# :ssh_pub_key => COLOMBO_SSH_KEY
|
133
|
+
# })
|
134
|
+
|
135
|
+
# ssh_key.must_be_instance_of(Colombo::SshKey)
|
136
|
+
|
137
|
+
# ssh_key.name.must_equal COLOMBO_SSH_KEY_NAME
|
138
|
+
|
139
|
+
# ssh_key.ssh_pub_key.must_equal COLOMBO_SSH_KEY
|
140
|
+
# end
|
141
|
+
|
142
|
+
# end
|
143
|
+
|
144
|
+
# it 'list ssh keys' do
|
145
|
+
|
146
|
+
# $stdout.puts "2 - list ssh keys"
|
147
|
+
|
148
|
+
# VCR.use_cassette('sshkeys_list_keys') do
|
149
|
+
# @client.ssh_keys.wont_be_empty
|
150
|
+
# end
|
151
|
+
|
152
|
+
# end
|
153
|
+
|
154
|
+
|
155
|
+
# it 'find ssh key by id' do
|
156
|
+
|
157
|
+
# $stdout.puts "3 - find ssh key by id"
|
158
|
+
|
159
|
+
# VCR.use_cassette('sshkeys_find_ssh_keys_by_id') do
|
160
|
+
|
161
|
+
# # fetch the key list from digital ocean
|
162
|
+
# ssh_keys = @client.ssh_keys
|
163
|
+
|
164
|
+
# $stdout.puts "============ keys ========="
|
165
|
+
# $stdout.puts ssh_keys.inspect
|
166
|
+
|
167
|
+
|
168
|
+
# # find the key with COLOMBO_SSH_KEY_NAME inside the digital ocean colection
|
169
|
+
# do_key = ssh_keys.find_by_name(COLOMBO_SSH_KEY_NAME)
|
170
|
+
# $stdout.puts "============ find by name ========="
|
171
|
+
# $stdout.puts do_key
|
172
|
+
|
173
|
+
# # check if the key was found
|
174
|
+
# do_key.must_be_instance_of(Colombo::SshKey)
|
175
|
+
|
176
|
+
# # let's try find the key in the collection
|
177
|
+
# ssh_key = @client.ssh_keys.find( do_key.id )
|
178
|
+
|
179
|
+
# # check if it's a ssh_key
|
180
|
+
# ssh_key.must_be_instance_of(Colombo::SshKey)
|
181
|
+
|
182
|
+
# # check if the values are correct
|
183
|
+
# ssh_key.name.must_equal COLOMBO_SSH_KEY_NAME
|
184
|
+
|
185
|
+
# # check if the values are correct
|
186
|
+
# ssh_key.ssh_pub_key.must_equal COLOMBO_SSH_KEY
|
187
|
+
|
188
|
+
# end
|
189
|
+
|
190
|
+
# end
|
191
|
+
|
192
|
+
# it 'update key' do
|
193
|
+
|
194
|
+
# $stdout.puts "4 - update key"
|
195
|
+
|
196
|
+
# VCR.use_cassette('sshkeys_update_key') do
|
197
|
+
# # fetch the key list from digital ocean
|
198
|
+
# ssh_keys = @client.ssh_keys
|
199
|
+
|
200
|
+
# # find the key with COLOMBO_SSH_KEY_NAME inside the digital ocean colection
|
201
|
+
# do_key = ssh_keys.select{ |k| k.name==COLOMBO_SSH_KEY_NAME }.first
|
202
|
+
|
203
|
+
# # check if the key was found and is a SshKey
|
204
|
+
# do_key.must_be_instance_of(Colombo::SshKey)
|
205
|
+
|
206
|
+
# do_key.update(:ssh_pub_key => COLOMBO_SSH_KEY ).must_equal true
|
207
|
+
# end
|
208
|
+
|
209
|
+
# end
|
210
|
+
|
211
|
+
# it 'destroy ssh key' do
|
212
|
+
|
213
|
+
# $stdout.puts "5 - destroy ssh key"
|
214
|
+
|
215
|
+
# VCR.use_cassette('sshkeys_destory_ssh_key') do
|
216
|
+
# # fetch the key list from digital ocean
|
217
|
+
# ssh_keys = @client.ssh_keys
|
218
|
+
|
219
|
+
# # find the key with COLOMBO_SSH_KEY_NAME inside the digital ocean colection
|
220
|
+
# ssh_keys.each do |ssh_key|
|
221
|
+
# if ssh_key.name==COLOMBO_SSH_KEY_NAME
|
222
|
+
# ssh_key.destroy().must_equal true
|
223
|
+
# end
|
224
|
+
# end
|
225
|
+
|
226
|
+
# end
|
227
|
+
|
228
|
+
# VCR.use_cassette('sshkeys_are_dummy_keys_destroyed?') do
|
229
|
+
# @client.ssh_keys.select{ |key| key.name == COLOMBO_SSH_KEY_NAME }.must_be_empty
|
230
|
+
# end
|
231
|
+
|
232
|
+
# end
|
233
|
+
|
234
|
+
|
235
|
+
# end
|
data/test/colombo/test_helper.rb
CHANGED
@@ -16,7 +16,7 @@ COLOMBO_REGION_ID = 1 # NY
|
|
16
16
|
COLOMBO_IMAGE_ID = 42735 # Ubuntu
|
17
17
|
COLOMBO_SIZE_ID = 63 # 1GB
|
18
18
|
COLOMBO_SSH_KEY_NAME = 'colombo gem'
|
19
|
-
COLOMBO_SSH_KEY = 'ssh-dss AAAAB3NzaC1kc3MAAACBAK5uLwicCrFEpaVKBzkWxC7RQn+smg5ZQb5keh9RQKo8AszFTol5npgUAr0JWmqKIHv7nof0HndO86x9iIqNjq3vrz9CIVcFfZM7poKBJZ27Hv3v0fmSKfAc6eGdx8eM9UkZe1gzcLXK8UP2HaeY1Y4LlaHXS5tPi/dXooFVgiA7AAAAFQCQl6LZo/
|
19
|
+
COLOMBO_SSH_KEY = 'ssh-dss AAAAB3NzaC1kc3MAAACBAK5uLwicCrFEpaVKBzkWxC7RQn+smg5ZQb5keh9RQKo8AszFTol5npgUAr0JWmqKIHv7nof0HndO86x9iIqNjq3vrz9CIVcFfZM7poKBJZ27Hv3v0fmSKfAc6eGdx8eM9UkZe1gzcLXK8UP2HaeY1Y4LlaHXS5tPi/dXooFVgiA7AAAAFQCQl6LZo/VYB9VgPEZzOmsmQevnswBBBIBCNKGsVP5eZ+IJklXheUyzxuL75i04OOtEGW6MO5TymKMwTZlU9r4ukuwxty+T9Ot2LqlNRnLSPQAjb0vplasZ8Ix45JOpRbuSvPovryn7rvS7//klu9hIkFAAQ/AZfGTw+696EjFBg4F5tN6MGMA6KrTQVLXeuYcZeRXwE5t5lwAAAIEAl2xYh098bozJUANQ82DiZznjHc5FW76Xm1apEqsZtVRFuh3V9nc7QNcBekhmHp5Z0sHthXCm1XqnFbkRCdFlX02NpgtNs7OcKpaJP47N8C+C/Yrf8qK/Wt3fExrL2ZLX5XD2tiotugSkwZJMW5Bv0mtjrNt0Q7P45rZjNNTag2c= user@host'
|
20
20
|
|
21
21
|
|
22
22
|
require File.expand_path('../../../lib/colombo.rb', __FILE__)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: colombo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -36,11 +36,11 @@ cert_chain:
|
|
36
36
|
TGVnalVadkdRSEdmSHN0bDdkd2lCVWluZ1UvMldOTFIKMXBIQThXeGsxVVJi
|
37
37
|
Nmxxa2NRdERZbDkyU3FTSk1FY0s0Wk0zRmwrRFM0RXBtM1BINTZlWjR3Qlha
|
38
38
|
REhMRUNuTwpubjhCMXUyKwotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
39
|
-
date: 2013-
|
39
|
+
date: 2013-04-15 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rest-client
|
43
|
-
requirement: &
|
43
|
+
requirement: &70219260478960 !ruby/object:Gem::Requirement
|
44
44
|
none: false
|
45
45
|
requirements:
|
46
46
|
- - ~>
|
@@ -48,10 +48,10 @@ dependencies:
|
|
48
48
|
version: 1.6.7
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
|
-
version_requirements: *
|
51
|
+
version_requirements: *70219260478960
|
52
52
|
- !ruby/object:Gem::Dependency
|
53
53
|
name: minitest
|
54
|
-
requirement: &
|
54
|
+
requirement: &70219260478060 !ruby/object:Gem::Requirement
|
55
55
|
none: false
|
56
56
|
requirements:
|
57
57
|
- - ! '>='
|
@@ -59,10 +59,10 @@ dependencies:
|
|
59
59
|
version: '0'
|
60
60
|
type: :development
|
61
61
|
prerelease: false
|
62
|
-
version_requirements: *
|
62
|
+
version_requirements: *70219260478060
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: webmock
|
65
|
-
requirement: &
|
65
|
+
requirement: &70219260476820 !ruby/object:Gem::Requirement
|
66
66
|
none: false
|
67
67
|
requirements:
|
68
68
|
- - ! '>='
|
@@ -70,10 +70,10 @@ dependencies:
|
|
70
70
|
version: '0'
|
71
71
|
type: :development
|
72
72
|
prerelease: false
|
73
|
-
version_requirements: *
|
73
|
+
version_requirements: *70219260476820
|
74
74
|
- !ruby/object:Gem::Dependency
|
75
75
|
name: vcr
|
76
|
-
requirement: &
|
76
|
+
requirement: &70219260476160 !ruby/object:Gem::Requirement
|
77
77
|
none: false
|
78
78
|
requirements:
|
79
79
|
- - ! '>='
|
@@ -81,10 +81,10 @@ dependencies:
|
|
81
81
|
version: '0'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
|
-
version_requirements: *
|
84
|
+
version_requirements: *70219260476160
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: turn
|
87
|
-
requirement: &
|
87
|
+
requirement: &70219260159900 !ruby/object:Gem::Requirement
|
88
88
|
none: false
|
89
89
|
requirements:
|
90
90
|
- - ! '>='
|
@@ -92,10 +92,10 @@ dependencies:
|
|
92
92
|
version: '0'
|
93
93
|
type: :development
|
94
94
|
prerelease: false
|
95
|
-
version_requirements: *
|
95
|
+
version_requirements: *70219260159900
|
96
96
|
- !ruby/object:Gem::Dependency
|
97
97
|
name: rake
|
98
|
-
requirement: &
|
98
|
+
requirement: &70219260159320 !ruby/object:Gem::Requirement
|
99
99
|
none: false
|
100
100
|
requirements:
|
101
101
|
- - ! '>='
|
@@ -103,7 +103,7 @@ dependencies:
|
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
|
-
version_requirements: *
|
106
|
+
version_requirements: *70219260159320
|
107
107
|
description: A simple ruby client for Digital Ocean API
|
108
108
|
email:
|
109
109
|
- lmmendes@gmail.com
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- lib/colombo.rb
|
121
121
|
- lib/colombo/client.rb
|
122
122
|
- lib/colombo/configuration.rb
|
123
|
+
- lib/colombo/container.rb
|
123
124
|
- lib/colombo/droplet.rb
|
124
125
|
- lib/colombo/droplets.rb
|
125
126
|
- lib/colombo/exception.rb
|
@@ -128,6 +129,7 @@ files:
|
|
128
129
|
- lib/colombo/region.rb
|
129
130
|
- lib/colombo/regions.rb
|
130
131
|
- lib/colombo/request.rb
|
132
|
+
- lib/colombo/resource.rb
|
131
133
|
- lib/colombo/size.rb
|
132
134
|
- lib/colombo/sizes.rb
|
133
135
|
- lib/colombo/ssh_key.rb
|
metadata.gz.sig
CHANGED
Binary file
|