linode 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG +4 -0
- data/README.md +1 -1
- data/lib/linode.rb +5 -1
- data/lib/linode/version.rb +3 -0
- data/linode.gemspec +5 -1
- data/spec/linode_spec.rb +22 -0
- metadata +4 -4
- data/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 35a7714afddcf990557b0657041978ab0decbed2d6c9508831720fa4b92fb9c1
|
4
|
+
data.tar.gz: e09c87c6c46dcb126c114d539aee4b197ebbdf706709b4ae014163a4a721cd76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae777d81c9fabcdc9a7a50a82fb5e43f019e24a5d0e81d0a07e227117cc163accdd6a559480e65dd8e2167e6539c2f9c3601524840087ea9fdff9afc14125ae1
|
7
|
+
data.tar.gz: 3d5b0647a90653577d4c4742ab6bfa7333da90bd8f6006f66b15fbec944ec4e1cbdaaa74374c94a6afd14e8cf36ad9f611053b940dc51bea53622f753304d00c
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
## NOTICE
|
4
4
|
|
5
|
-
Please welcome [Marques Johansson](https://github.com/displague) and [
|
5
|
+
Please welcome [Marques Johansson](https://github.com/displague) and [Robert DeRose](https://github.com/RobertDeRose),
|
6
6
|
both of Linode, as new maintainers of the ruby Linode API library!
|
7
7
|
|
8
8
|
## INSTALLATION:
|
data/lib/linode.rb
CHANGED
@@ -104,7 +104,11 @@ class Linode
|
|
104
104
|
|
105
105
|
def post(data)
|
106
106
|
logger.info "POST #{api_url.to_s} body:#{data.inspect}" if logger
|
107
|
-
HTTParty.post(api_url, :body => data).parsed_response
|
107
|
+
HTTParty.post(api_url, :body => data, :headers => { 'User-Agent' => user_agent }).parsed_response
|
108
|
+
end
|
109
|
+
|
110
|
+
def user_agent
|
111
|
+
"linode/#{Linode::VERSION} ruby/#{RUBY_VERSION}"
|
108
112
|
end
|
109
113
|
|
110
114
|
def error?(response)
|
data/linode.gemspec
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
require 'linode/version'
|
2
6
|
|
3
7
|
Gem::Specification.new do |s|
|
4
8
|
s.name = "linode"
|
5
|
-
s.version =
|
9
|
+
s.version = Linode::VERSION
|
6
10
|
s.description = "This is a wrapper around Linode's automation facilities."
|
7
11
|
s.summary = "a Ruby wrapper for the Linode API"
|
8
12
|
s.authors = ["Rick Bradley"]
|
data/spec/linode_spec.rb
CHANGED
@@ -83,6 +83,9 @@ describe 'Linode' do
|
|
83
83
|
:api_responseFormat => 'json',
|
84
84
|
:username => @username,
|
85
85
|
:password => @password
|
86
|
+
},
|
87
|
+
:headers => {
|
88
|
+
'User-Agent' => "linode/#{Linode::VERSION} ruby/#{RUBY_VERSION}"
|
86
89
|
}
|
87
90
|
).returns(@json)
|
88
91
|
@linode.api_key
|
@@ -110,6 +113,9 @@ describe 'Linode' do
|
|
110
113
|
:username => @username,
|
111
114
|
:password => @password,
|
112
115
|
:label => 'foobar'
|
116
|
+
},
|
117
|
+
:headers => {
|
118
|
+
'User-Agent' => "linode/#{Linode::VERSION} ruby/#{RUBY_VERSION}"
|
113
119
|
}
|
114
120
|
).returns(@json)
|
115
121
|
|
@@ -127,6 +133,9 @@ describe 'Linode' do
|
|
127
133
|
:username => @username,
|
128
134
|
:password => @password,
|
129
135
|
:expires => 5
|
136
|
+
},
|
137
|
+
:headers => {
|
138
|
+
'User-Agent' => "linode/#{Linode::VERSION} ruby/#{RUBY_VERSION}"
|
130
139
|
}
|
131
140
|
).returns(@json)
|
132
141
|
|
@@ -144,6 +153,9 @@ describe 'Linode' do
|
|
144
153
|
:username => @username,
|
145
154
|
:password => @password,
|
146
155
|
:expires => 0
|
156
|
+
},
|
157
|
+
:headers => {
|
158
|
+
'User-Agent' => "linode/#{Linode::VERSION} ruby/#{RUBY_VERSION}"
|
147
159
|
}
|
148
160
|
).returns(@json)
|
149
161
|
|
@@ -160,6 +172,9 @@ describe 'Linode' do
|
|
160
172
|
:api_responseFormat => 'json',
|
161
173
|
:username => @username,
|
162
174
|
:password => @password
|
175
|
+
},
|
176
|
+
:headers => {
|
177
|
+
'User-Agent' => "linode/#{Linode::VERSION} ruby/#{RUBY_VERSION}"
|
163
178
|
}
|
164
179
|
).returns(@json)
|
165
180
|
|
@@ -245,6 +260,13 @@ describe 'Linode' do
|
|
245
260
|
@linode.send_request('test.echo', { })
|
246
261
|
end
|
247
262
|
|
263
|
+
it 'should include a custom User-Agent when making its request' do
|
264
|
+
HTTParty.expects(:post).with { |path, args|
|
265
|
+
args[:headers]['User-Agent'] == "linode/#{Linode::VERSION} ruby/#{RUBY_VERSION}"
|
266
|
+
}.returns(@json)
|
267
|
+
@linode.send_request('test.echo', { })
|
268
|
+
end
|
269
|
+
|
248
270
|
it 'should set the designated request method as the HTTP API action' do
|
249
271
|
HTTParty.expects(:post).with { |path, args|
|
250
272
|
args[:body][:api_action] == 'test.echo'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rick Bradley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -80,7 +80,6 @@ files:
|
|
80
80
|
- MIT-LICENSE
|
81
81
|
- README.md
|
82
82
|
- Rakefile
|
83
|
-
- VERSION
|
84
83
|
- autotest/discover.rb
|
85
84
|
- lib/linode.rb
|
86
85
|
- lib/linode/account.rb
|
@@ -99,6 +98,7 @@ files:
|
|
99
98
|
- lib/linode/stackscript.rb
|
100
99
|
- lib/linode/test.rb
|
101
100
|
- lib/linode/user.rb
|
101
|
+
- lib/linode/version.rb
|
102
102
|
- linode.gemspec
|
103
103
|
- spec/linode/account_spec.rb
|
104
104
|
- spec/linode/avail_spec.rb
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.7.9
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: a Ruby wrapper for the Linode API
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.9.1
|