linode 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -2,7 +2,9 @@ Linode Ruby API
2
2
 
3
3
  INSTALLATION:
4
4
 
5
- % sudo gem install rick-linode
5
+ Make sure gemcutter.org is in your gem sources list, then:
6
+
7
+ % sudo gem install linode
6
8
 
7
9
  To run tests you will need both rspec and mocha installed.
8
10
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.4
1
+ 0.6.0
@@ -0,0 +1,3 @@
1
+ class Linode::Stackscript < Linode
2
+ has_method :update, :create, :list, :delete
3
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{linode}
8
- s.version = "0.5.4"
8
+ s.version = "0.6.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rick Bradley"]
12
- s.date = %q{2009-12-20}
12
+ s.date = %q{2010-03-27}
13
13
  s.description = %q{This is a wrapper around Linode's automation facilities.}
14
14
  s.email = %q{rick@rickbradley.com}
15
15
  s.extra_rdoc_files = [
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
31
31
  "lib/linode/linode/disk.rb",
32
32
  "lib/linode/linode/ip.rb",
33
33
  "lib/linode/linode/job.rb",
34
+ "lib/linode/stackscript.rb",
34
35
  "lib/linode/test.rb",
35
36
  "lib/linode/user.rb",
36
37
  "linode.gemspec",
@@ -42,6 +43,7 @@ Gem::Specification.new do |s|
42
43
  "spec/linode/linode/ip_spec.rb",
43
44
  "spec/linode/linode/job_spec.rb",
44
45
  "spec/linode/linode_spec.rb",
46
+ "spec/linode/stackscript_spec.rb",
45
47
  "spec/linode/test_spec.rb",
46
48
  "spec/linode/user_spec.rb",
47
49
  "spec/linode_spec.rb",
@@ -51,7 +53,7 @@ Gem::Specification.new do |s|
51
53
  s.homepage = %q{http://github.com/rick/linode}
52
54
  s.rdoc_options = ["--charset=UTF-8"]
53
55
  s.require_paths = ["lib"]
54
- s.rubygems_version = %q{1.3.5}
56
+ s.rubygems_version = %q{1.3.6}
55
57
  s.summary = %q{a Ruby wrapper for the Linode API}
56
58
  s.test_files = [
57
59
  "spec/linode/avail_spec.rb",
@@ -62,6 +64,7 @@ Gem::Specification.new do |s|
62
64
  "spec/linode/linode/ip_spec.rb",
63
65
  "spec/linode/linode/job_spec.rb",
64
66
  "spec/linode/linode_spec.rb",
67
+ "spec/linode/stackscript_spec.rb",
65
68
  "spec/linode/test_spec.rb",
66
69
  "spec/linode/user_spec.rb",
67
70
  "spec/linode_spec.rb",
@@ -0,0 +1,44 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
2
+ require 'linode'
3
+
4
+ describe Linode::Stackscript do
5
+ before :each do
6
+ @api_key = 'foo'
7
+ @linode = Linode::Stackscript.new(:api_key => @api_key)
8
+ end
9
+
10
+ it 'should be a Linode instance' do
11
+ @linode.class.should < Linode
12
+ end
13
+
14
+ %w(update create list delete).each do |action|
15
+ it "should allow accessing the #{action} API" do
16
+ @linode.should respond_to(action.to_sym)
17
+ end
18
+
19
+ describe "when accessing the #{action} API" do
20
+ it 'should allow a data hash' do
21
+ lambda { @linode.send(action.to_sym, {}) }.should_not raise_error(ArgumentError)
22
+ end
23
+
24
+ it 'should not require arguments' do
25
+ lambda { @linode.send(action.to_sym) }.should_not raise_error(ArgumentError)
26
+ end
27
+
28
+ it "should request the stackscript.#{action} action" do
29
+ @linode.expects(:send_request).with {|api_action, data| api_action == "stackscript.#{action}" }
30
+ @linode.send(action.to_sym)
31
+ end
32
+
33
+ it 'should provide the data hash when making its request' do
34
+ @linode.expects(:send_request).with {|api_action, data| data = { :foo => :bar } }
35
+ @linode.send(action.to_sym, {:foo => :bar})
36
+ end
37
+
38
+ it 'should return the result of the request' do
39
+ @linode.expects(:send_request).returns(:bar => :baz)
40
+ @linode.send(action.to_sym).should == { :bar => :baz }
41
+ end
42
+ end
43
+ end
44
+ end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 6
8
+ - 0
9
+ version: 0.6.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - Rick Bradley
@@ -9,19 +14,23 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-12-20 00:00:00 +05:30
17
+ date: 2010-03-27 00:00:00 -05:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: httparty
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 4
30
+ - 4
23
31
  version: 0.4.4
24
- version:
32
+ type: :runtime
33
+ version_requirements: *id001
25
34
  description: This is a wrapper around Linode's automation facilities.
26
35
  email: rick@rickbradley.com
27
36
  executables: []
@@ -46,6 +55,7 @@ files:
46
55
  - lib/linode/linode/disk.rb
47
56
  - lib/linode/linode/ip.rb
48
57
  - lib/linode/linode/job.rb
58
+ - lib/linode/stackscript.rb
49
59
  - lib/linode/test.rb
50
60
  - lib/linode/user.rb
51
61
  - linode.gemspec
@@ -57,6 +67,7 @@ files:
57
67
  - spec/linode/linode/ip_spec.rb
58
68
  - spec/linode/linode/job_spec.rb
59
69
  - spec/linode/linode_spec.rb
70
+ - spec/linode/stackscript_spec.rb
60
71
  - spec/linode/test_spec.rb
61
72
  - spec/linode/user_spec.rb
62
73
  - spec/linode_spec.rb
@@ -75,18 +86,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
86
  requirements:
76
87
  - - ">="
77
88
  - !ruby/object:Gem::Version
89
+ segments:
90
+ - 0
78
91
  version: "0"
79
- version:
80
92
  required_rubygems_version: !ruby/object:Gem::Requirement
81
93
  requirements:
82
94
  - - ">="
83
95
  - !ruby/object:Gem::Version
96
+ segments:
97
+ - 0
84
98
  version: "0"
85
- version:
86
99
  requirements: []
87
100
 
88
101
  rubyforge_project:
89
- rubygems_version: 1.3.5
102
+ rubygems_version: 1.3.6
90
103
  signing_key:
91
104
  specification_version: 3
92
105
  summary: a Ruby wrapper for the Linode API
@@ -99,6 +112,7 @@ test_files:
99
112
  - spec/linode/linode/ip_spec.rb
100
113
  - spec/linode/linode/job_spec.rb
101
114
  - spec/linode/linode_spec.rb
115
+ - spec/linode/stackscript_spec.rb
102
116
  - spec/linode/test_spec.rb
103
117
  - spec/linode/user_spec.rb
104
118
  - spec/linode_spec.rb