ivapi 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rubocop.yml +11 -11
- data/.travis.yml +21 -10
- data/Gemfile +6 -5
- data/LICENSE +1 -1
- data/README.md +9 -9
- data/ivapi.gemspec +6 -7
- data/lib/ivapi/client/server.rb +13 -13
- data/lib/ivapi/version.rb +1 -1
- data/spec/spec_helper.rb +3 -5
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 93427d4d6fc8a64c97748850eb8a6be15959009e34652c30b504017d8e9af889
|
4
|
+
data.tar.gz: '0084fd3d8166682e08cd15bbfe78bf4aee922cc30fff91fee6655e00611b0f8b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f806c029ea495397be54aad4407161d28fd7db5c630712ac27b92c379dfb07be2f21cde883b3b17a12e581f07d37d8bcedb7409b266883c3984cd0799695b7bc
|
7
|
+
data.tar.gz: 8252f607f692b68eb9f213bf25bbd28944edaa30673ccffd13d55cb600c55921d1a0df1502879947d7c28a48fa7a7bca9c6413e41d0cbe70bb91ccd7ab90318b
|
data/.rubocop.yml
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.
|
2
|
+
TargetRubyVersion: 2.1
|
3
3
|
Include:
|
4
4
|
- '**/Rakefile'
|
5
5
|
- '**/Gemfile'
|
6
6
|
|
7
|
-
|
8
|
-
Enabled: false
|
9
|
-
|
10
|
-
Style/AlignParameters:
|
7
|
+
Layout/AlignParameters:
|
11
8
|
Enabled: true
|
12
9
|
EnforcedStyle: with_fixed_indentation
|
13
10
|
|
14
|
-
|
11
|
+
Layout/MultilineOperationIndentation:
|
15
12
|
Enabled: true
|
16
13
|
EnforcedStyle: indented
|
17
14
|
|
18
|
-
|
15
|
+
Layout/MultilineMethodCallIndentation:
|
19
16
|
Enabled: true
|
20
17
|
EnforcedStyle: indented
|
21
18
|
|
22
|
-
|
19
|
+
Layout/CaseIndentation:
|
23
20
|
Enabled: true
|
24
21
|
EnforcedStyle: end
|
25
22
|
|
26
|
-
|
23
|
+
Layout/EndAlignment:
|
27
24
|
Enabled: true
|
28
25
|
EnforcedStyleAlignWith: variable
|
29
26
|
|
30
27
|
Style/FrozenStringLiteralComment:
|
31
28
|
Enabled: false
|
32
29
|
|
30
|
+
Style/Documentation:
|
31
|
+
Enabled: false
|
32
|
+
|
33
33
|
Metrics/BlockLength:
|
34
|
-
|
35
|
-
- '
|
34
|
+
Exclude:
|
35
|
+
- 'spec/**/*_spec.rb'
|
data/.travis.yml
CHANGED
@@ -1,25 +1,36 @@
|
|
1
1
|
sudo: false
|
2
|
+
bundler_args: --without development
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
cache:
|
5
|
+
bundler: true
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
bundler_args: --without development
|
7
|
+
env:
|
8
|
+
global:
|
9
|
+
- CC_TEST_REPORTER_ID=660deb8e8362570711ce3f81fd8995f6957641ac856d44b9347028facbe5ef24
|
10
10
|
|
11
11
|
language: ruby
|
12
|
-
|
13
12
|
rvm:
|
14
|
-
- 2.0.0
|
15
13
|
- 2.1.0
|
16
14
|
- 2.2.0
|
17
15
|
- 2.3.0
|
18
16
|
- 2.4.0
|
17
|
+
- 2.5.0
|
19
18
|
- ruby-head
|
20
|
-
|
19
|
+
|
20
|
+
before_install:
|
21
|
+
- gem update --system
|
22
|
+
|
23
|
+
before_script:
|
24
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
25
|
+
- chmod +x ./cc-test-reporter
|
26
|
+
- ./cc-test-reporter before-build
|
27
|
+
|
28
|
+
script:
|
29
|
+
- bundle exec rspec
|
30
|
+
|
31
|
+
after_script:
|
32
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
21
33
|
|
22
34
|
matrix:
|
23
35
|
allow_failures:
|
24
36
|
- rvm: ruby-head
|
25
|
-
- rvm: jruby-head
|
data/Gemfile
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
+
group :development do
|
4
|
+
gem 'rubocop', '~> 0.53'
|
5
|
+
end
|
6
|
+
|
3
7
|
group :test do
|
4
|
-
gem 'codeclimate-test-reporter', '~> 1.0', require: false
|
5
|
-
gem 'coveralls', '~> 0.8', require: false
|
6
8
|
gem 'rake' # We need a rake gem for Travis CI.
|
7
|
-
gem 'rspec', '~> 3.
|
8
|
-
gem 'rubocop', '~> 0.49'
|
9
|
+
gem 'rspec', '~> 3.7'
|
9
10
|
gem 'simplecov', '~> 0.14', require: false
|
10
|
-
gem 'webmock', '~> 3.
|
11
|
+
gem 'webmock', '~> 3.3'
|
11
12
|
end
|
12
13
|
|
13
14
|
gemspec
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem which helps to communicate with Interneto vizija [https://www.iv.lt][iv.lt] ([https://wwww.dedikuoti.lt][dedikuoti.lt]) API.
|
4
4
|
|
5
|
-
[][rubygems]
|
6
|
+
[][travis]
|
7
|
+
[][gemnasium]
|
8
|
+
[][codeclimate]
|
9
|
+
[][codeclimate_coverage]
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
@@ -73,21 +73,21 @@ Ivapi.server.information
|
|
73
73
|
This library aims to support and is [tested against][travis] the following Ruby
|
74
74
|
versions:
|
75
75
|
|
76
|
-
* Ruby 2.0.0
|
77
76
|
* Ruby 2.1.0
|
78
77
|
* Ruby 2.2.0
|
79
78
|
* Ruby 2.3.0
|
80
79
|
* Ruby 2.4.0
|
80
|
+
* Ruby 2.5.0
|
81
81
|
|
82
82
|
## Copyright
|
83
|
-
Copyright (c) 2012-
|
83
|
+
Copyright (c) 2012-2018 Justas Palumickas.
|
84
84
|
See [LICENSE][license] for details.
|
85
85
|
|
86
86
|
[rubygems]: https://rubygems.org/gems/ivapi
|
87
|
-
[travis]:
|
87
|
+
[travis]: https://travis-ci.org/jpalumickas/ivapi
|
88
88
|
[gemnasium]: https://gemnasium.com/jpalumickas/ivapi
|
89
|
-
[coveralls]: https://coveralls.io/r/jpalumickas/ivapi
|
90
89
|
[codeclimate]: https://codeclimate.com/github/jpalumickas/ivapi
|
90
|
+
[codeclimate_coverage]: https://codeclimate.com/github/jpalumickas/ivapi/test_coverage
|
91
91
|
|
92
92
|
[iv.lt]: https://www.iv.lt
|
93
93
|
[dedikuoti.lt]: https://www.dedikuoti.lt
|
data/ivapi.gemspec
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
4
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
3
|
require 'ivapi/version'
|
6
4
|
|
@@ -9,11 +7,12 @@ Gem::Specification.new do |gem|
|
|
9
7
|
gem.author = 'Justas Palumickas'
|
10
8
|
gem.email = 'jpalumickas@gmail.com'
|
11
9
|
gem.description = 'Gem which helps to communicate with https://www.iv.lt API.'
|
12
|
-
gem.summary = 'Ruby wrapper for
|
10
|
+
gem.summary = 'Ruby wrapper for Interneto Vizija API.'
|
13
11
|
gem.homepage = 'https://github.com/jpalumickas/ivapi/'
|
14
12
|
gem.license = 'MIT'
|
15
|
-
gem.required_ruby_version = '>= 2.
|
16
|
-
gem.requirements << 'Interneto Vizija
|
13
|
+
gem.required_ruby_version = '>= 2.1.0'
|
14
|
+
gem.requirements << 'Interneto Vizija only allows to use API on their' \
|
15
|
+
'servers.'
|
17
16
|
|
18
17
|
gem.files = `git ls-files -z`.split("\x0")
|
19
18
|
gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
@@ -21,7 +20,7 @@ Gem::Specification.new do |gem|
|
|
21
20
|
gem.require_paths = ['lib']
|
22
21
|
|
23
22
|
gem.add_dependency 'faraday', '~> 0.10'
|
24
|
-
gem.add_dependency 'faraday_middleware', '~> 0.
|
23
|
+
gem.add_dependency 'faraday_middleware', '~> 0.10'
|
25
24
|
gem.add_dependency 'hashie', '~> 3.5.5'
|
26
25
|
|
27
26
|
gem.add_development_dependency 'bundler', '~> 1.6'
|
data/lib/ivapi/client/server.rb
CHANGED
@@ -35,16 +35,16 @@ module Ivapi
|
|
35
35
|
|
36
36
|
# Get server graphs.
|
37
37
|
#
|
38
|
-
# width
|
39
|
-
#
|
38
|
+
# width - The Integer of graphs width (max: 1000, optimal: 768).
|
39
|
+
# server_ip - The String of ip, from which graphs can be viewed.
|
40
40
|
#
|
41
41
|
# Returns the Hash of server graphs.
|
42
|
-
def graphs(width,
|
42
|
+
def graphs(width, server_ip)
|
43
43
|
params = {
|
44
44
|
command: 'server_graphs',
|
45
45
|
id: server_id,
|
46
46
|
width: width,
|
47
|
-
ip:
|
47
|
+
ip: server_ip
|
48
48
|
}
|
49
49
|
|
50
50
|
get('/json.php', params)
|
@@ -68,15 +68,15 @@ module Ivapi
|
|
68
68
|
|
69
69
|
# Send command to recreate the server.
|
70
70
|
#
|
71
|
-
#
|
72
|
-
# options
|
73
|
-
#
|
74
|
-
#
|
71
|
+
# server_os - The String of os (operating system) id.
|
72
|
+
# options - The Hash options (default: {}):
|
73
|
+
# :new_password - The String of new server
|
74
|
+
# password (min: 8, max: 64).
|
75
75
|
#
|
76
76
|
# Returns the Integer of task id.
|
77
|
-
def recreate(
|
77
|
+
def recreate(server_os, options = {})
|
78
78
|
params = options.merge(
|
79
|
-
command: 'server_recreate', id: server_id, os:
|
79
|
+
command: 'server_recreate', id: server_id, os: server_os
|
80
80
|
)
|
81
81
|
|
82
82
|
get('/json.php', params)
|
@@ -137,15 +137,15 @@ module Ivapi
|
|
137
137
|
|
138
138
|
# Moves additional IP to another server.
|
139
139
|
#
|
140
|
-
#
|
140
|
+
# server_ip - The String of additional IP.
|
141
141
|
# target_id - The String of another server id.
|
142
142
|
#
|
143
143
|
# Returns the Hash with information.
|
144
|
-
def move_ip(
|
144
|
+
def move_ip(server_ip, target_id)
|
145
145
|
params = {
|
146
146
|
command: 'server_move_ip',
|
147
147
|
id: server_id,
|
148
|
-
ip:
|
148
|
+
ip: server_ip,
|
149
149
|
target_id: target_id
|
150
150
|
}
|
151
151
|
|
data/lib/ivapi/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
require 'simplecov'
|
2
|
-
require 'coveralls'
|
3
2
|
|
4
3
|
SimpleCov.formatters = [
|
5
|
-
SimpleCov::Formatter::HTMLFormatter
|
6
|
-
Coveralls::SimpleCov::Formatter
|
4
|
+
SimpleCov::Formatter::HTMLFormatter
|
7
5
|
]
|
8
6
|
|
9
7
|
SimpleCov.start
|
@@ -12,7 +10,7 @@ require 'ivapi'
|
|
12
10
|
require 'rspec'
|
13
11
|
require 'webmock/rspec'
|
14
12
|
|
15
|
-
WebMock.disable_net_connect!(allow: ['
|
13
|
+
WebMock.disable_net_connect!(allow: ['codeclimate.com'])
|
16
14
|
|
17
15
|
RSpec.configure do |config|
|
18
16
|
config.expect_with :rspec do |c|
|
@@ -33,7 +31,7 @@ def stub_command(command, options = {})
|
|
33
31
|
end
|
34
32
|
|
35
33
|
def fixture_path
|
36
|
-
File.expand_path('
|
34
|
+
File.expand_path('fixtures', __dir__)
|
37
35
|
end
|
38
36
|
|
39
37
|
def fixture(file)
|
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.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justas Palumickas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.10'
|
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
|
-
version: '0.
|
40
|
+
version: '0.10'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: hashie
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,19 +150,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
150
150
|
requirements:
|
151
151
|
- - ">="
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: 2.
|
153
|
+
version: 2.1.0
|
154
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
156
|
- - ">="
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '0'
|
159
159
|
requirements:
|
160
|
-
- Interneto Vizija
|
160
|
+
- Interneto Vizija only allows to use API on theirservers.
|
161
161
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.6
|
162
|
+
rubygems_version: 2.7.6
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
|
-
summary: Ruby wrapper for
|
165
|
+
summary: Ruby wrapper for Interneto Vizija API.
|
166
166
|
test_files:
|
167
167
|
- spec/fixtures/account_bonuses.json
|
168
168
|
- spec/fixtures/account_credits.json
|