ivapi 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ccef803f20c35fa09a66bc472342282d966c31d6
4
- data.tar.gz: a306403ac7b753e92cd7b9cb2f49e3f94d0b968e
3
+ metadata.gz: 1812f258195ad8e60796f3d69c8ceb2970e3dfe8
4
+ data.tar.gz: cb36492270d13fb6cc574c35eed4598cd9bea76c
5
5
  SHA512:
6
- metadata.gz: 0c4f5cb3b66c36c3d3ce4a0b9d84c8743990137e973e4af001dc87f80327bde016e9c3d0ab81023cdbeef6e1ff71f897f36511bcb997a7ba3ec3a7c8d77e56f0
7
- data.tar.gz: 95486712bd6daa41449a25f2662b8befaa230c13d8997f055f890d9ea37d486879cc165c9097c8750b5939d4a18cb6edb737d4ab63837155d58bc0c07e682a11
6
+ metadata.gz: c6c5598e4ad005d0863ffffb2604650e2d30d3479984de63151b3ec6a5d77b895ed8da5219d1f12188bd177508a4576c7e91f773253b8d5e71389af2c1bc91b9
7
+ data.tar.gz: a3c5d180ef3c0d73561aca64757b0c5dff266c547c967214e8a8b2945bd01f696f45ce02fd16a55ef14978aea13bf22d0f48f18f631c4d8f7f6baa81f3061df0
data/.rubocop.yml CHANGED
@@ -1,2 +1,35 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.0
3
+ Include:
4
+ - '**/Rakefile'
5
+ - '**/Gemfile'
6
+
1
7
  Style/Documentation:
2
8
  Enabled: false
9
+
10
+ Style/AlignParameters:
11
+ Enabled: true
12
+ EnforcedStyle: with_fixed_indentation
13
+
14
+ Style/MultilineOperationIndentation:
15
+ Enabled: true
16
+ EnforcedStyle: indented
17
+
18
+ Style/MultilineMethodCallIndentation:
19
+ Enabled: true
20
+ EnforcedStyle: indented
21
+
22
+ Style/CaseIndentation:
23
+ Enabled: true
24
+ EnforcedStyle: end
25
+
26
+ Lint/EndAlignment:
27
+ Enabled: true
28
+ EnforcedStyleAlignWith: variable
29
+
30
+ Style/FrozenStringLiteralComment:
31
+ Enabled: false
32
+
33
+ Metrics/BlockLength:
34
+ ExcludedMethods:
35
+ - 'describe'
data/.travis.yml CHANGED
@@ -18,10 +18,8 @@ rvm:
18
18
  - 2.4.0
19
19
  - ruby-head
20
20
  - jruby-head
21
- - rbx-2
22
21
 
23
22
  matrix:
24
23
  allow_failures:
25
24
  - rvm: ruby-head
26
25
  - rvm: jruby-head
27
- - rvm: rbx-2
data/Gemfile CHANGED
@@ -1,21 +1,13 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- group :development do
4
- gem 'guard-rspec', '~> 4.7'
5
- end
6
-
7
3
  group :test do
8
4
  gem 'codeclimate-test-reporter', '~> 1.0', require: false
9
5
  gem 'coveralls', '~> 0.8', require: false
10
6
  gem 'rake' # We need a rake gem for Travis CI.
11
- gem 'rspec', '~> 3.5'
12
- gem 'simplecov', '~> 0.12', require: false
13
- gem 'webmock', '~> 2.3'
14
- end
15
-
16
- platforms :rbx do
17
- gem 'psych'
18
- gem 'rubysl', '~> 2.0'
7
+ gem 'rspec', '~> 3.6'
8
+ gem 'rubocop', '~> 0.49'
9
+ gem 'simplecov', '~> 0.14', require: false
10
+ gem 'webmock', '~> 3.0'
19
11
  end
20
12
 
21
13
  gemspec
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ivapi
2
2
 
3
- Gem which helps to communicate with Interneto vizija [http://iv.lt][iv.lt] ([http://dedikuoti.lt][dedikuoti.lt]) API.
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
5
  [![Gem Version](http://img.shields.io/gem/v/ivapi.svg?style=flat-square)][rubygems]
6
6
  [![Build Status](http://img.shields.io/travis/jpalumickas/ivapi.svg?style=flat-square)][travis]
@@ -12,15 +12,20 @@ Gem which helps to communicate with Interneto vizija [http://iv.lt][iv.lt] ([htt
12
12
 
13
13
  Add this line to your application's Gemfile:
14
14
 
15
- gem 'ivapi'
15
+ ```rb
16
+ gem 'ivapi'
17
+ ```
16
18
 
17
19
  And then execute:
18
-
19
- $ bundle
20
+ ```sh
21
+ $ bundle
22
+ ```
20
23
 
21
24
  Or install it yourself as:
22
25
 
23
- $ gem install ivapi
26
+ ```sh
27
+ $ gem install ivapi
28
+ ```
24
29
 
25
30
  ## Usage
26
31
 
@@ -51,7 +56,7 @@ Ivapi.account.information
51
56
  ```
52
57
 
53
58
  Orders
54
- ```
59
+ ```rb
55
60
  Ivapi.account.orders
56
61
  ```
57
62
 
@@ -66,7 +71,7 @@ Ivapi.server.information
66
71
  ## Supported Ruby Versions
67
72
 
68
73
  This library aims to support and is [tested against][travis] the following Ruby
69
- implementations:
74
+ versions:
70
75
 
71
76
  * Ruby 2.0.0
72
77
  * Ruby 2.1.0
@@ -84,6 +89,6 @@ See [LICENSE][license] for details.
84
89
  [coveralls]: https://coveralls.io/r/jpalumickas/ivapi
85
90
  [codeclimate]: https://codeclimate.com/github/jpalumickas/ivapi
86
91
 
87
- [iv.lt]: http://www.iv.lt
88
- [dedikuoti.lt]: http://www.dedikuoti.lt
92
+ [iv.lt]: https://www.iv.lt
93
+ [dedikuoti.lt]: https://www.dedikuoti.lt
89
94
  [license]: https://raw.githubusercontent.com/jpalumickas/ivapi/master/LICENSE
data/ivapi.gemspec CHANGED
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'ivapi/version'
@@ -7,11 +8,11 @@ Gem::Specification.new do |gem|
7
8
  gem.name = 'ivapi'
8
9
  gem.author = 'Justas Palumickas'
9
10
  gem.email = 'jpalumickas@gmail.com'
10
- gem.description = 'Gem which helps to communicate with http://www.iv.lt API.'
11
+ gem.description = 'Gem which helps to communicate with https://www.iv.lt API.'
11
12
  gem.summary = 'Ruby wrapper for working with Interneto Vizija API.'
12
13
  gem.homepage = 'https://github.com/jpalumickas/ivapi/'
13
14
  gem.license = 'MIT'
14
- gem.required_ruby_version = '>= 1.9.3'
15
+ gem.required_ruby_version = '>= 2.0.0'
15
16
  gem.requirements << 'Interneto Vizija allow to use API only on them servers.'
16
17
 
17
18
  gem.files = `git ls-files -z`.split("\x0")
@@ -19,11 +20,9 @@ Gem::Specification.new do |gem|
19
20
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
20
21
  gem.require_paths = ['lib']
21
22
 
22
- gem.add_dependency 'addressable', '~> 2.5'
23
23
  gem.add_dependency 'faraday', '~> 0.10'
24
- gem.add_dependency 'faraday_middleware', '~> 0.10'
25
- gem.add_dependency 'hashie', '~> 3.4'
26
- gem.add_dependency 'multi_json', '~> 1.12'
24
+ gem.add_dependency 'faraday_middleware', '~> 0.11'
25
+ gem.add_dependency 'hashie', '~> 3.5.5'
27
26
 
28
27
  gem.add_development_dependency 'bundler', '~> 1.6'
29
28
  gem.add_development_dependency 'rake', '~> 10.0'
data/lib/ivapi/client.rb CHANGED
@@ -11,7 +11,7 @@ module Ivapi
11
11
  include Ivapi::Authentication
12
12
  include Ivapi::Configuration
13
13
 
14
- attr_reader *Ivapi::Configuration.keys
14
+ attr_reader(*Ivapi::Configuration.keys)
15
15
 
16
16
  def initialize(options = {})
17
17
  # Use options passed in, but fall back to module defaults
@@ -4,18 +4,18 @@ require 'ivapi/version'
4
4
  module Ivapi
5
5
  module Configuration
6
6
  attr_accessor :username, :password, :user_agent, :connection_options,
7
- :web_endpoint, :api_endpoint, :server_id, :hosting_id
7
+ :web_endpoint, :api_endpoint, :server_id, :hosting_id
8
8
 
9
9
  def self.keys
10
- @keys ||= [
11
- :api_endpoint,
12
- :username,
13
- :middleware,
14
- :password,
15
- :user_agent,
16
- :connection_options,
17
- :server_id,
18
- :hosting_id
10
+ @keys ||= %i[
11
+ api_endpoint
12
+ username
13
+ middleware
14
+ password
15
+ user_agent
16
+ connection_options
17
+ server_id
18
+ hosting_id
19
19
  ]
20
20
  end
21
21
 
data/lib/ivapi/default.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'faraday_middleware'
2
+ require 'ivapi/mash'
2
3
  require 'ivapi/response/raise_error'
3
4
  require 'ivapi/response/rename_keys'
4
5
  require 'ivapi/version'
@@ -17,7 +18,7 @@ module Ivapi
17
18
  builder.request :json
18
19
 
19
20
  builder.use FaradayMiddleware::FollowRedirects
20
- builder.use FaradayMiddleware::Mashify
21
+ builder.use FaradayMiddleware::Mashify, mash_class: Ivapi::Mash
21
22
  builder.use Ivapi::Response::RenameKeys
22
23
  builder.use FaradayMiddleware::ParseJson
23
24
  builder.use Ivapi::Response::RaiseError
data/lib/ivapi/error.rb CHANGED
@@ -10,10 +10,10 @@ module Ivapi
10
10
  status = response[:status].to_i
11
11
 
12
12
  klass = case status
13
- when 400 then Ivapi::BadRequest
14
- when 401 then Ivapi::Unauthorized
15
- when 403 then Ivapi::Forbidden
16
- end
13
+ when 400 then Ivapi::BadRequest
14
+ when 401 then Ivapi::Unauthorized
15
+ when 403 then Ivapi::Forbidden
16
+ end
17
17
 
18
18
  klass.new(response) if klass
19
19
  end
data/lib/ivapi/mash.rb ADDED
@@ -0,0 +1,7 @@
1
+ require 'hashie/mash'
2
+
3
+ module Ivapi
4
+ class Mash < Hashie::Mash
5
+ disable_warnings
6
+ end
7
+ end
@@ -4,7 +4,7 @@ module Ivapi
4
4
  # Faraday response middleware
5
5
  module Response
6
6
  class RenameKeys < Faraday::Response::Middleware
7
- UNUSED_KEYS = %w(ac_ us_ bo_ or_ se_ ta_ in_).freeze
7
+ UNUSED_KEYS = %w[ac_ us_ bo_ or_ se_ ta_ in_].freeze
8
8
 
9
9
  private
10
10
 
data/lib/ivapi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ivapi
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
data/spec/ivapi_spec.rb CHANGED
@@ -2,12 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe Ivapi do
4
4
  it 'responds to config' do
5
- expect(Ivapi.respond_to?(:configure)).to be_truthy
5
+ expect(Ivapi.respond_to?(:account)).to be_truthy
6
6
  end
7
-
8
- # describe '.new' do
9
- # it 'is a Ivapi::Client' do
10
- # expect(Ivapi.new).to be_a Ivapi::Client
11
- # end
12
- # end
13
7
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ivapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.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: 2017-01-04 00:00:00.000000000 Z
11
+ date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: addressable
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.5'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '2.5'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: faraday
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -44,42 +30,28 @@ dependencies:
44
30
  requirements:
45
31
  - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: '0.10'
33
+ version: '0.11'
48
34
  type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: '0.10'
40
+ version: '0.11'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: hashie
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
45
  - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: '3.4'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '3.4'
69
- - !ruby/object:Gem::Dependency
70
- name: multi_json
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '1.12'
47
+ version: 3.5.5
76
48
  type: :runtime
77
49
  prerelease: false
78
50
  version_requirements: !ruby/object:Gem::Requirement
79
51
  requirements:
80
52
  - - "~>"
81
53
  - !ruby/object:Gem::Version
82
- version: '1.12'
54
+ version: 3.5.5
83
55
  - !ruby/object:Gem::Dependency
84
56
  name: bundler
85
57
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +80,7 @@ dependencies:
108
80
  - - "~>"
109
81
  - !ruby/object:Gem::Version
110
82
  version: '10.0'
111
- description: Gem which helps to communicate with http://www.iv.lt API.
83
+ description: Gem which helps to communicate with https://www.iv.lt API.
112
84
  email: jpalumickas@gmail.com
113
85
  executables: []
114
86
  extensions: []
@@ -121,7 +93,6 @@ files:
121
93
  - ".travis.yml"
122
94
  - CONTRIBUTING.md
123
95
  - Gemfile
124
- - Guardfile
125
96
  - LICENSE
126
97
  - README.md
127
98
  - Rakefile
@@ -136,6 +107,7 @@ files:
136
107
  - lib/ivapi/configuration.rb
137
108
  - lib/ivapi/default.rb
138
109
  - lib/ivapi/error.rb
110
+ - lib/ivapi/mash.rb
139
111
  - lib/ivapi/response/raise_error.rb
140
112
  - lib/ivapi/response/rename_keys.rb
141
113
  - lib/ivapi/version.rb
@@ -178,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
178
150
  requirements:
179
151
  - - ">="
180
152
  - !ruby/object:Gem::Version
181
- version: 1.9.3
153
+ version: 2.0.0
182
154
  required_rubygems_version: !ruby/object:Gem::Requirement
183
155
  requirements:
184
156
  - - ">="
@@ -187,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
159
  requirements:
188
160
  - Interneto Vizija allow to use API only on them servers.
189
161
  rubyforge_project:
190
- rubygems_version: 2.6.8
162
+ rubygems_version: 2.6.12
191
163
  signing_key:
192
164
  specification_version: 4
193
165
  summary: Ruby wrapper for working with Interneto Vizija API.
data/Guardfile DELETED
@@ -1,12 +0,0 @@
1
- # More info at https://github.com/guard/guard#readme
2
-
3
- guard 'bundler' do
4
- watch('Gemfile')
5
- watch(/^.+\.gemspec/)
6
- end
7
-
8
- guard 'rspec' do
9
- watch(%r{^spec/.+_spec\.rb$})
10
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
11
- watch('spec/spec_helper.rb') { 'spec' }
12
- end