ivapi 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -6
- data/Guardfile +0 -1
- data/ivapi.gemspec +4 -2
- data/lib/ivapi/version.rb +1 -1
- data/spec/ivapi/client/account_spec.rb +2 -2
- data/spec/ivapi/client/server_spec.rb +2 -2
- data/spec/ivapi/client_spec.rb +0 -5
- data/spec/spec_helper.rb +5 -3
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3704ad2937ba6b37d65c6f8976f497eeb40149c
|
4
|
+
data.tar.gz: 810078e930b6e4e40655464f9a57e6988c75469c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6cef814269bfc57666583a9c54b3e17e95e268f9f9cba7967adb8d7e99329648b9c7d6fd3d71c2f7cb1de7174a76c17a3a18b0d367a4641c0a90a57c7dee649
|
7
|
+
data.tar.gz: 3d57bb6aec486764d8a43af600145bcc4dda6ede94123251d4d37fb849d327909f5eb24d21928eef421d9e235021d9cbeaf1a38289394113eb01ff531655df9c
|
data/Gemfile
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'rake'
|
4
|
-
|
5
3
|
group :test do
|
6
|
-
gem 'json', '~> 1.8.1', platforms: [:jruby]
|
7
4
|
gem 'rspec', '~> 3.1.0'
|
8
|
-
gem 'simplecov', '~> 0.9.
|
9
|
-
gem 'webmock', '~> 1.
|
10
|
-
gem 'coveralls', '~> 0.7.
|
5
|
+
gem 'simplecov', '~> 0.9.1', require: false
|
6
|
+
gem 'webmock', '~> 1.20.4'
|
7
|
+
gem 'coveralls', '~> 0.7.2', require: false
|
11
8
|
gem 'guard-rspec', '~> 4.3.1'
|
12
9
|
end
|
13
10
|
|
data/Guardfile
CHANGED
data/ivapi.gemspec
CHANGED
@@ -7,10 +7,12 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.name = 'ivapi'
|
8
8
|
gem.author = 'Justas Palumickas'
|
9
9
|
gem.email = 'jpalumickas@gmail.com'
|
10
|
-
gem.description =
|
11
|
-
gem.summary =
|
10
|
+
gem.description = 'Gem which helps to communicate with http://www.iv.lt API.'
|
11
|
+
gem.summary = 'Ruby wrapper for working with Interneto Vizija API.'
|
12
12
|
gem.homepage = 'https://github.com/jpalumickas/ivapi/'
|
13
13
|
gem.license = 'MIT'
|
14
|
+
gem.required_ruby_version = '>= 1.9.3'
|
15
|
+
gem.requirements << 'Interneto Vizija allow to use API only on them servers.'
|
14
16
|
|
15
17
|
gem.files = `git ls-files -z`.split("\x0")
|
16
18
|
gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
data/lib/ivapi/version.rb
CHANGED
@@ -15,7 +15,7 @@ describe Ivapi::Client::Account do
|
|
15
15
|
describe 'account information' do
|
16
16
|
before(:each) do
|
17
17
|
stub_command('account_info')
|
18
|
-
|
18
|
+
.to_return(json_response('account_info.json'))
|
19
19
|
@info = Ivapi.account.information
|
20
20
|
end
|
21
21
|
|
@@ -64,7 +64,7 @@ describe Ivapi::Client::Account do
|
|
64
64
|
describe 'account bonuses' do
|
65
65
|
before(:each) do
|
66
66
|
stub_command('account_bonuses', count: 10)
|
67
|
-
|
67
|
+
.to_return(json_response('account_bonuses.json'))
|
68
68
|
@account_bonuses = Ivapi.account.bonuses
|
69
69
|
@bonus = @account_bonuses[2]
|
70
70
|
end
|
@@ -61,7 +61,7 @@ describe Ivapi::Client::Server do
|
|
61
61
|
it 'should return server tasks with specified options' do
|
62
62
|
stub_command('server_tasks', id: 3, count: 1, task_id: 1)
|
63
63
|
.to_return(json_response('server_tasks.json'))
|
64
|
-
server_tasks = Ivapi.client.server(3).tasks(1,
|
64
|
+
server_tasks = Ivapi.client.server(3).tasks(1, task_id: 1)
|
65
65
|
expect(server_tasks.first.params.domain).to eq('server.example.com')
|
66
66
|
end
|
67
67
|
|
@@ -92,7 +92,7 @@ describe Ivapi::Client::Server do
|
|
92
92
|
describe 'server recreate server' do
|
93
93
|
before(:each) do
|
94
94
|
stub_command('server_recreate', id: 3, os: 'debian-6.0-x86_64')
|
95
|
-
|
95
|
+
.to_return(json_response('server_recreate.json'))
|
96
96
|
@recreate_response = Ivapi.server.recreate('debian-6.0-x86_64')
|
97
97
|
end
|
98
98
|
|
data/spec/ivapi/client_spec.rb
CHANGED
@@ -7,11 +7,6 @@ describe Ivapi::Client do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
it 'works with basic auth and password' do
|
10
|
-
url = 'https://api.iv.lt/json.php?nick=foo&password=bar&command=version'
|
11
|
-
|
12
|
-
stub_request(:get, url)
|
13
|
-
.to_return(status: 200, body: '{"commits":[]}', headers: {})
|
14
|
-
|
15
10
|
expect { Ivapi::Client.new(username: 'foo', password: 'bar') }
|
16
11
|
.not_to raise_exception
|
17
12
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -57,9 +57,11 @@ def iv_url(url)
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def iv_command_url(command)
|
60
|
+
data = { command: command }
|
61
|
+
|
60
62
|
if @client && @client.authenticated?
|
61
|
-
|
62
|
-
else
|
63
|
-
iv_url("?command=#{command}")
|
63
|
+
data.merge(nick: @client.username, password: @client.password)
|
64
64
|
end
|
65
|
+
|
66
|
+
iv_url('/json.php?' + URI.encode_www_form(data))
|
65
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ivapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justas Palumickas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '10.0'
|
111
|
-
description:
|
111
|
+
description: Gem which helps to communicate with http://www.iv.lt API.
|
112
112
|
email: jpalumickas@gmail.com
|
113
113
|
executables: []
|
114
114
|
extensions: []
|
@@ -169,18 +169,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
169
169
|
requirements:
|
170
170
|
- - ">="
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version:
|
172
|
+
version: 1.9.3
|
173
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
174
174
|
requirements:
|
175
175
|
- - ">="
|
176
176
|
- !ruby/object:Gem::Version
|
177
177
|
version: '0'
|
178
|
-
requirements:
|
178
|
+
requirements:
|
179
|
+
- Interneto Vizija allow to use API only on them servers.
|
179
180
|
rubyforge_project:
|
180
|
-
rubygems_version: 2.
|
181
|
+
rubygems_version: 2.4.4
|
181
182
|
signing_key:
|
182
183
|
specification_version: 4
|
183
|
-
summary:
|
184
|
+
summary: Ruby wrapper for working with Interneto Vizija API.
|
184
185
|
test_files:
|
185
186
|
- spec/fixtures/account_bonuses.json
|
186
187
|
- spec/fixtures/account_info.json
|