ivapi 1.5.0 → 1.6.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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -7
  3. data/.travis.yml +2 -2
  4. data/Gemfile +6 -4
  5. data/LICENSE +1 -1
  6. data/README.md +1 -3
  7. data/Rakefile +2 -0
  8. data/ivapi.gemspec +34 -20
  9. data/lib/ivapi.rb +3 -0
  10. data/lib/ivapi/authentication.rb +2 -0
  11. data/lib/ivapi/client.rb +2 -0
  12. data/lib/ivapi/client/account.rb +2 -0
  13. data/lib/ivapi/client/base.rb +2 -0
  14. data/lib/ivapi/client/hosting.rb +2 -0
  15. data/lib/ivapi/client/server.rb +2 -0
  16. data/lib/ivapi/configuration.rb +2 -0
  17. data/lib/ivapi/default.rb +4 -2
  18. data/lib/ivapi/error.rb +3 -1
  19. data/lib/ivapi/mash.rb +2 -0
  20. data/lib/ivapi/response/raise_error.rb +2 -0
  21. data/lib/ivapi/response/rename_keys.rb +2 -0
  22. data/lib/ivapi/version.rb +3 -1
  23. metadata +18 -70
  24. data/spec/fixtures/account_bonuses.json +0 -20
  25. data/spec/fixtures/account_credits.json +0 -1
  26. data/spec/fixtures/account_info.json +0 -42
  27. data/spec/fixtures/account_orders.json +0 -29
  28. data/spec/fixtures/account_services.json +0 -35
  29. data/spec/fixtures/hosting_info.json +0 -3
  30. data/spec/fixtures/server_change.json +0 -3
  31. data/spec/fixtures/server_domain.json +0 -3
  32. data/spec/fixtures/server_firewall.json +0 -3
  33. data/spec/fixtures/server_flush_iptables.json +0 -3
  34. data/spec/fixtures/server_graphs.json +0 -26
  35. data/spec/fixtures/server_info.json +0 -30
  36. data/spec/fixtures/server_move_ip.json +0 -4
  37. data/spec/fixtures/server_os.json +0 -132
  38. data/spec/fixtures/server_ptr.json +0 -4
  39. data/spec/fixtures/server_reboot.json +0 -3
  40. data/spec/fixtures/server_recreate.json +0 -3
  41. data/spec/fixtures/server_reset_password.json +0 -3
  42. data/spec/fixtures/server_tasks.json +0 -14
  43. data/spec/fixtures/version.json +0 -3
  44. data/spec/ivapi/client/account_spec.rb +0 -95
  45. data/spec/ivapi/client/hosting_spec.rb +0 -32
  46. data/spec/ivapi/client/server_spec.rb +0 -191
  47. data/spec/ivapi/client_spec.rb +0 -62
  48. data/spec/ivapi/error_spec.rb +0 -22
  49. data/spec/ivapi_spec.rb +0 -7
  50. data/spec/spec_helper.rb +0 -66
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93427d4d6fc8a64c97748850eb8a6be15959009e34652c30b504017d8e9af889
4
- data.tar.gz: '0084fd3d8166682e08cd15bbfe78bf4aee922cc30fff91fee6655e00611b0f8b'
3
+ metadata.gz: a94594dfbe4d3588486da99240f79e8babc94211b4daf66f13ce13f229f2eeb8
4
+ data.tar.gz: b6fc89ab8da8b6e843be0158d84255bdcbe4c8b13fde7605b5afa58bce6d78fd
5
5
  SHA512:
6
- metadata.gz: f806c029ea495397be54aad4407161d28fd7db5c630712ac27b92c379dfb07be2f21cde883b3b17a12e581f07d37d8bcedb7409b266883c3984cd0799695b7bc
7
- data.tar.gz: 8252f607f692b68eb9f213bf25bbd28944edaa30673ccffd13d55cb600c55921d1a0df1502879947d7c28a48fa7a7bca9c6413e41d0cbe70bb91ccd7ab90318b
6
+ metadata.gz: 02b011e5801601fa4b69762a2174bb637dae731f254f17bd55203026756b3149a10f80b5b16ef782b869ddeca9cd25e1a175232e0453d30be359fdffa71ed0c8
7
+ data.tar.gz: 7c94bd80b2ddb6c2699a75d303ae31844213352b8faf973f3935a436a8e0dc4fe2bc7d2061ac5b4f7ad86da7d47853eca99e1e7339a2cc1b3d04fc964143d4c2
@@ -1,8 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.1
3
- Include:
4
- - '**/Rakefile'
5
- - '**/Gemfile'
2
+ TargetRubyVersion: 2.3
6
3
 
7
4
  Layout/AlignParameters:
8
5
  Enabled: true
@@ -24,12 +21,10 @@ Layout/EndAlignment:
24
21
  Enabled: true
25
22
  EnforcedStyleAlignWith: variable
26
23
 
27
- Style/FrozenStringLiteralComment:
28
- Enabled: false
29
-
30
24
  Style/Documentation:
31
25
  Enabled: false
32
26
 
33
27
  Metrics/BlockLength:
34
28
  Exclude:
35
29
  - 'spec/**/*_spec.rb'
30
+ - '*.gemspec'
@@ -10,14 +10,14 @@ env:
10
10
 
11
11
  language: ruby
12
12
  rvm:
13
- - 2.1.0
14
- - 2.2.0
15
13
  - 2.3.0
16
14
  - 2.4.0
17
15
  - 2.5.0
16
+ - 2.6.0
18
17
  - ruby-head
19
18
 
20
19
  before_install:
20
+ - gem install bundler
21
21
  - gem update --system
22
22
 
23
23
  before_script:
data/Gemfile CHANGED
@@ -1,14 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  group :development do
4
- gem 'rubocop', '~> 0.53'
6
+ gem 'rubocop', '~> 0.66'
5
7
  end
6
8
 
7
9
  group :test do
8
10
  gem 'rake' # We need a rake gem for Travis CI.
9
- gem 'rspec', '~> 3.7'
10
- gem 'simplecov', '~> 0.14', require: false
11
- gem 'webmock', '~> 3.3'
11
+ gem 'rspec', '~> 3.8'
12
+ gem 'simplecov', '~> 0.16', require: false
13
+ gem 'webmock', '~> 3.5'
12
14
  end
13
15
 
14
16
  gemspec
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018 Justas Palumickas
3
+ Copyright (c) 2019 Justas Palumickas
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -4,7 +4,6 @@ Gem which helps to communicate with Interneto vizija [https://www.iv.lt][iv.lt]
4
4
 
5
5
  [![Gem Version](https://img.shields.io/gem/v/ivapi.svg?style=flat-square)][rubygems]
6
6
  [![Build Status](https://img.shields.io/travis/jpalumickas/ivapi.svg?style=flat-square)][travis]
7
- [![Dependency Status](https://img.shields.io/gemnasium/jpalumickas/ivapi.svg?style=flat-square)][gemnasium]
8
7
  [![Code Climate](https://img.shields.io/codeclimate/maintainability/jpalumickas/ivapi.svg?style=flat-square)][codeclimate]
9
8
  [![Test Coverage](https://img.shields.io/codeclimate/c/jpalumickas/ivapi.svg?style=flat-square)][codeclimate_coverage]
10
9
 
@@ -80,12 +79,11 @@ versions:
80
79
  * Ruby 2.5.0
81
80
 
82
81
  ## Copyright
83
- Copyright (c) 2012-2018 Justas Palumickas.
82
+ Copyright (c) 2012-2019 Justas Palumickas.
84
83
  See [LICENSE][license] for details.
85
84
 
86
85
  [rubygems]: https://rubygems.org/gems/ivapi
87
86
  [travis]: https://travis-ci.org/jpalumickas/ivapi
88
- [gemnasium]: https://gemnasium.com/jpalumickas/ivapi
89
87
  [codeclimate]: https://codeclimate.com/github/jpalumickas/ivapi
90
88
  [codeclimate_coverage]: https://codeclimate.com/github/jpalumickas/ivapi/test_coverage
91
89
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler'
2
4
  Bundler::GemHelper.install_tasks
3
5
 
@@ -1,30 +1,44 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'ivapi/version'
4
6
 
5
- Gem::Specification.new do |gem|
6
- gem.name = 'ivapi'
7
- gem.author = 'Justas Palumickas'
8
- gem.email = 'jpalumickas@gmail.com'
9
- gem.description = 'Gem which helps to communicate with https://www.iv.lt API.'
10
- gem.summary = 'Ruby wrapper for Interneto Vizija API.'
11
- gem.homepage = 'https://github.com/jpalumickas/ivapi/'
12
- gem.license = 'MIT'
13
- gem.required_ruby_version = '>= 2.1.0'
14
- gem.requirements << 'Interneto Vizija only allows to use API on their' \
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'ivapi'
9
+ spec.version = Ivapi::VERSION
10
+ spec.author = 'Justas Palumickas'
11
+ spec.email = 'jpalumickas@gmail.com'
12
+
13
+ spec.summary = 'Ruby wrapper for Interneto Vizija API.'
14
+ spec.description = 'Gem which helps to communicate with https://www.iv.lt ' \
15
+ 'API.'
16
+ spec.homepage = 'https://github.com/jpalumickas/ivapi'
17
+
18
+ spec.requirements << 'Interneto Vizija only allows to use API on their ' \
15
19
  'servers.'
16
20
 
17
- gem.files = `git ls-files -z`.split("\x0")
18
- gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
20
- gem.require_paths = ['lib']
21
+ spec.metadata = {
22
+ 'bug_tracker_uri' => 'https://github.com/jpalumickas/ivapi/issues',
23
+ 'changelog_uri' => 'https://github.com/jpalumickas/ivapi/releases',
24
+ 'source_code_uri' => 'https://github.com/jpalumickas/ivapi'
25
+ }
26
+
27
+ spec.license = 'MIT'
28
+
29
+ spec.files = `git ls-files -z`
30
+ .split("\x0")
31
+ .reject { |f| f.match(%r{^(test|spec|features)/}) }
21
32
 
22
- gem.add_dependency 'faraday', '~> 0.10'
23
- gem.add_dependency 'faraday_middleware', '~> 0.10'
24
- gem.add_dependency 'hashie', '~> 3.5.5'
33
+ spec.bindir = 'exe'
34
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
+ spec.require_paths = ['lib']
36
+ spec.required_ruby_version = '>= 2.3.0'
25
37
 
26
- gem.add_development_dependency 'bundler', '~> 1.6'
27
- gem.add_development_dependency 'rake', '~> 10.0'
38
+ spec.add_dependency 'faraday', '~> 0.10'
39
+ spec.add_dependency 'faraday_middleware', '~> 0.10'
40
+ spec.add_dependency 'hashie', '>= 3.5.5'
28
41
 
29
- gem.version = Ivapi::VERSION
42
+ spec.add_development_dependency 'bundler', '~> 2.0'
43
+ spec.add_development_dependency 'rake', '~> 12.0'
30
44
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'ivapi/client'
2
4
  require 'ivapi/default'
3
5
 
@@ -17,6 +19,7 @@ module Ivapi
17
19
 
18
20
  def method_missing(method_name, *args, &block)
19
21
  return super unless client.respond_to?(method_name)
22
+
20
23
  client.send(method_name, *args, &block)
21
24
  end
22
25
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ivapi
2
4
  module Authentication
3
5
  def authentication
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'ivapi/configuration'
2
4
  require 'ivapi/authentication'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ivapi
2
4
  class Client
3
5
  class Account < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ivapi
2
4
  class Client
3
5
  class Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ivapi
2
4
  class Client
3
5
  class Hosting < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ivapi
2
4
  class Client
3
5
  class Server < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'faraday'
2
4
  require 'ivapi/version'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'faraday_middleware'
2
4
  require 'ivapi/mash'
3
5
  require 'ivapi/response/raise_error'
@@ -8,10 +10,10 @@ module Ivapi
8
10
  # Default configuration options for {Client}
9
11
  module Default
10
12
  # Default API endpoint
11
- API_ENDPOINT = 'https://api.iv.lt'.freeze
13
+ API_ENDPOINT = 'https://api.iv.lt'
12
14
 
13
15
  # Default User Agent header string
14
- USER_AGENT = "Ivapi ruby gem v#{Ivapi::VERSION}".freeze
16
+ USER_AGENT = "Ivapi ruby gem v#{Ivapi::VERSION}"
15
17
 
16
18
  # Default Faraday middleware stack
17
19
  MIDDLEWARE = Faraday::RackBuilder.new do |builder|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ivapi
2
4
  class Error < StandardError
3
5
  # Returns the appropriate Ivapi::Error sublcass based
@@ -15,7 +17,7 @@ module Ivapi
15
17
  when 403 then Ivapi::Forbidden
16
18
  end
17
19
 
18
- klass.new(response) if klass
20
+ klass&.new(response)
19
21
  end
20
22
  end
21
23
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'hashie/mash'
2
4
 
3
5
  module Ivapi
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'faraday'
2
4
  require 'ivapi/error'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'faraday'
2
4
 
3
5
  module Ivapi
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ivapi
2
- VERSION = '1.5.0'.freeze
4
+ VERSION = '1.6.0'
3
5
  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.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justas Palumickas
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-12 00:00:00.000000000 Z
11
+ date: 2019-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -42,14 +42,14 @@ dependencies:
42
42
  name: hashie
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.5.5
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.5.5
55
55
  - !ruby/object:Gem::Dependency
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.6'
61
+ version: '2.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.6'
68
+ version: '2.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '10.0'
75
+ version: '12.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '10.0'
82
+ version: '12.0'
83
83
  description: Gem which helps to communicate with https://www.iv.lt API.
84
84
  email: jpalumickas@gmail.com
85
85
  executables: []
@@ -111,37 +111,13 @@ files:
111
111
  - lib/ivapi/response/raise_error.rb
112
112
  - lib/ivapi/response/rename_keys.rb
113
113
  - lib/ivapi/version.rb
114
- - spec/fixtures/account_bonuses.json
115
- - spec/fixtures/account_credits.json
116
- - spec/fixtures/account_info.json
117
- - spec/fixtures/account_orders.json
118
- - spec/fixtures/account_services.json
119
- - spec/fixtures/hosting_info.json
120
- - spec/fixtures/server_change.json
121
- - spec/fixtures/server_domain.json
122
- - spec/fixtures/server_firewall.json
123
- - spec/fixtures/server_flush_iptables.json
124
- - spec/fixtures/server_graphs.json
125
- - spec/fixtures/server_info.json
126
- - spec/fixtures/server_move_ip.json
127
- - spec/fixtures/server_os.json
128
- - spec/fixtures/server_ptr.json
129
- - spec/fixtures/server_reboot.json
130
- - spec/fixtures/server_recreate.json
131
- - spec/fixtures/server_reset_password.json
132
- - spec/fixtures/server_tasks.json
133
- - spec/fixtures/version.json
134
- - spec/ivapi/client/account_spec.rb
135
- - spec/ivapi/client/hosting_spec.rb
136
- - spec/ivapi/client/server_spec.rb
137
- - spec/ivapi/client_spec.rb
138
- - spec/ivapi/error_spec.rb
139
- - spec/ivapi_spec.rb
140
- - spec/spec_helper.rb
141
- homepage: https://github.com/jpalumickas/ivapi/
114
+ homepage: https://github.com/jpalumickas/ivapi
142
115
  licenses:
143
116
  - MIT
144
- metadata: {}
117
+ metadata:
118
+ bug_tracker_uri: https://github.com/jpalumickas/ivapi/issues
119
+ changelog_uri: https://github.com/jpalumickas/ivapi/releases
120
+ source_code_uri: https://github.com/jpalumickas/ivapi
145
121
  post_install_message:
146
122
  rdoc_options: []
147
123
  require_paths:
@@ -150,44 +126,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
126
  requirements:
151
127
  - - ">="
152
128
  - !ruby/object:Gem::Version
153
- version: 2.1.0
129
+ version: 2.3.0
154
130
  required_rubygems_version: !ruby/object:Gem::Requirement
155
131
  requirements:
156
132
  - - ">="
157
133
  - !ruby/object:Gem::Version
158
134
  version: '0'
159
135
  requirements:
160
- - Interneto Vizija only allows to use API on theirservers.
161
- rubyforge_project:
162
- rubygems_version: 2.7.6
136
+ - Interneto Vizija only allows to use API on their servers.
137
+ rubygems_version: 3.0.2
163
138
  signing_key:
164
139
  specification_version: 4
165
140
  summary: Ruby wrapper for Interneto Vizija API.
166
- test_files:
167
- - spec/fixtures/account_bonuses.json
168
- - spec/fixtures/account_credits.json
169
- - spec/fixtures/account_info.json
170
- - spec/fixtures/account_orders.json
171
- - spec/fixtures/account_services.json
172
- - spec/fixtures/hosting_info.json
173
- - spec/fixtures/server_change.json
174
- - spec/fixtures/server_domain.json
175
- - spec/fixtures/server_firewall.json
176
- - spec/fixtures/server_flush_iptables.json
177
- - spec/fixtures/server_graphs.json
178
- - spec/fixtures/server_info.json
179
- - spec/fixtures/server_move_ip.json
180
- - spec/fixtures/server_os.json
181
- - spec/fixtures/server_ptr.json
182
- - spec/fixtures/server_reboot.json
183
- - spec/fixtures/server_recreate.json
184
- - spec/fixtures/server_reset_password.json
185
- - spec/fixtures/server_tasks.json
186
- - spec/fixtures/version.json
187
- - spec/ivapi/client/account_spec.rb
188
- - spec/ivapi/client/hosting_spec.rb
189
- - spec/ivapi/client/server_spec.rb
190
- - spec/ivapi/client_spec.rb
191
- - spec/ivapi/error_spec.rb
192
- - spec/ivapi_spec.rb
193
- - spec/spec_helper.rb
141
+ test_files: []