anilibria-api-ruby 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: 19108f3f24b1792bb2640d48a562bea69ff82c3d9ff3f372ae1efe7952cd8340
4
- data.tar.gz: 0eecd5734d837d98156619f3ac864fd154113478c515cfbee8535cd00af468ad
3
+ metadata.gz: 7e8f99d41325b4d8e4d22877388d0cdeb216acc3ee3f4ad57cd7c3076973d9e9
4
+ data.tar.gz: 2050b7e07d8dca2303ac52bc5097ff35ce39bb581f74533253c2caa46d7c64c6
5
5
  SHA512:
6
- metadata.gz: 34d6bbd2917aa045c0cf7c97a98b19dd6b8e07b9cc19629e322090d978e561e6c8156e9da9c0d4f303f4fa922a0131c87ae61f91fa561aa06de1682418f11e78
7
- data.tar.gz: fceeca87a3a2bcba908deaddca452b27fe38d2e65cb527d55efab0ac8cc8284f475102be8d5264114ee606cd99dd98e83f883264291fb4da78abe1d8a6bfc8c5
6
+ metadata.gz: 51ef2354baa68cba34551fff411ad549f3650423b961f89357d811f646bfa0885b178b98f394cfeff6cf463e03a2dc5af70e7756e62a87bcad02435949b6129f
7
+ data.tar.gz: ad841e35f03244b4f266288fa316ba4d43100003bdc9867d303e4dbde36ffec0a87c85f6efc441ccadaf0c42dd188f6af4593cf84f0492e79e1cb73865fcf248
data/Gemfile CHANGED
@@ -5,5 +5,4 @@ source 'https://rubygems.org'
5
5
  gemspec
6
6
 
7
7
  gem 'rake', '~> 13.0'
8
-
9
8
  gem 'rspec', '~> 3.0'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- anilibria-api-ruby (1.0.0)
4
+ anilibria-api-ruby (1.0.1)
5
5
  dry-struct (~> 1.4)
6
6
  faraday (~> 2)
7
7
 
data/README.md CHANGED
@@ -24,6 +24,8 @@ $ gem install anilibria-api-ruby
24
24
 
25
25
  ## Usage
26
26
 
27
+ ### Client
28
+
27
29
  Usage example:
28
30
 
29
31
  ```ruby
@@ -33,29 +35,31 @@ anilibria = Anilibria::Api::Client.new
33
35
 
34
36
  anilibria.get_years # => [1996, 1998, 2001, 2003, 2004, 2005, 2006, ...]
35
37
 
36
- title = anilibria.get_title(code: 'steinsgate') # => #<Anilibria::Api::Types::Title id=8674 code="steinsgate"...
38
+ title = anilibria.get_title(code: 'steinsgate') # => #<Anilibria::Api::Types::Title id=8674 ...
37
39
  title.names.en # => "Steins;Gate"
38
40
  ```
39
41
 
40
42
  `anilibria` object implements [AniLibria API methods](https://github.com/anilibria/docs/blob/master/api_v2.md#method-list) as is. All methods are available in *snake_case* notation. Same with the `title` object - it implements the [Title](https://github.com/anilibria/docs/blob/master/api_v2.md#возвращаемые-значения-при-запросе-информации-о-тайтле) specification.
41
43
 
42
- ## Authorization
44
+ ### Authorization
43
45
 
44
- The client supports authorization:
46
+ The gem supports authorization:
45
47
 
46
48
  ```ruby
47
- # session = anilibria.auth('wrongemail@example.com', 'WrongPassword') # => nil
48
- # session = anilibria.auth!('wrongemail@example.com', 'WrongPassword') # raises an error Anilibria::Api::Exceptions::AuthError
49
- session = anilibria.auth('correctemail@example.com', 'CorrectPassword') # returns the session string
49
+ # session = anilibria.auth('wrong@example.com', 'WrongPassword') # => nil
50
+
51
+ # session = anilibria.auth!('wrong@example.com', 'WrongPassword')
52
+ # (raises an error Anilibria::Api::Exceptions::AuthError)
53
+
54
+ session = anilibria.auth('correct@example.com', 'CorrectPassword') # returns the session string
50
55
 
51
56
  anilibria.add_favorite(title_id: 9114, session: session) # => true
52
57
 
53
58
  titles = anilibria.get_favorites(filter: 'id,code,names,description', session: session)
54
59
  # => [#<Anilibria::Api::Types::Title id=9114 code="shingeki-no-k...
55
-
56
60
  ```
57
61
 
58
- ## API Version
62
+ ### API Version
59
63
 
60
64
  You can get the currently used version of [AniLibria API](https://github.com/anilibria/docs/blob/master/api_v2.md):
61
65
 
@@ -25,6 +25,8 @@ module Anilibria
25
25
  end
26
26
  end
27
27
 
28
+ Faraday::Utils.default_space_encoding = '%20'
29
+
28
30
  DryTypes = Types::DryTypes
29
31
 
30
32
  API_VERSION = '2.13'.freeze
@@ -1,6 +1,6 @@
1
1
  module Anilibria
2
2
  module Api
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.0.1'.freeze
4
4
  public_constant :VERSION
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anilibria-api-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Kozachenko