rubyviber 0.1.0 → 0.2.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: 9a4fe42bb44ab970485bb030593c069d6f72fdb6
4
- data.tar.gz: c346322e3953a169ba864f5d0233444eafa2d2a5
3
+ metadata.gz: c4fe60bd05e41c4c566dab8c010f94d9b394f132
4
+ data.tar.gz: f8bce7c9abd0e4505fffa59f2511c0dd12769e4b
5
5
  SHA512:
6
- metadata.gz: 8027b532b868f17bf09ff63b053c37cab7b10839fad0ebd5af7eee4aa197bb77544d1a8252f7c5af943f86c9322f70fc079987388fdf92e128bd151176106c0e
7
- data.tar.gz: 3ce7520ef2e2054b229e0ba0b4df176fb360f90939e756994534de16fef090343af78476f9b3e4e456c3ace69fcfe7125253a27efa7b5571d5e3f8cc177073a0
6
+ metadata.gz: bb419c14b9707e096092912fc1f9cf44616fb7ac82fd1bf6f1ae1fec84691ae32916fcefcaddb2c69c3069f9f3e5d2a2fd40cba6b46d58d772db7820ae826a8b
7
+ data.tar.gz: 8d858d170805d3952b7c25f2d90778cc7c8cc97d44b19165dcecac226c6b5b1ce54c444ead2d5057b4affde9ee7baf0362ca5c0131c32ce502c3d7e934006377
data/README.md CHANGED
@@ -57,7 +57,7 @@ Note that in case of errors, exception will be raised, so don't forget to handle
57
57
  Rubyviber Client has some options you can set, here's full list:
58
58
 
59
59
  ```ruby
60
- client = Rubyviber::Client.new 'TOKENHERE', adapter: Faraday.default_adapter, logging: true, raise_errors: true
60
+ client = Rubyviber::Client.new 'TOKENHERE', adapter: Faraday.default_adapter, logging: true, raise_errors: true, log_bodies: false
61
61
  ```
62
62
 
63
63
  Where:
@@ -66,6 +66,8 @@ Where:
66
66
 
67
67
  `logging` - true/false, enables/disables logging
68
68
 
69
+ `log_bodies` - true/false, enables/disables responce bodies logging. Works only if `logging: true`
70
+
69
71
  `raise_errors` - true/false, enables/disables error raising. If you disable this, you can check successfullness of request by verifying `ok` field in the parsed body
70
72
 
71
73
  ## TODO
@@ -3,12 +3,12 @@ require 'faraday_middleware'
3
3
 
4
4
  module Rubyviber
5
5
  class Client
6
- def initialize token, adapter: Faraday.default_adapter, logging: true, raise_errors: true
6
+ def initialize token, adapter: Faraday.default_adapter, logging: true, raise_errors: true, log_bodies: false
7
7
  @faraday = Faraday.new url: "https://chatapi.viber.com/pa/", headers: { "X-Viber-Auth-Token": token } do |faraday|
8
8
  faraday.request :multipart
9
9
 
10
10
  # Logging
11
- faraday.response :logger if logging
11
+ faraday.response(:logger, bodies: log_bodies) if logging
12
12
 
13
13
  # Json encoder
14
14
  faraday.use FaradayMiddleware::EncodeJson
@@ -1,3 +1,3 @@
1
1
  module Rubyviber
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyviber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Viktorov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-20 00:00:00.000000000 Z
11
+ date: 2017-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.5.2
108
+ rubygems_version: 2.6.11
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Rubyviber is a small Faraday-based library to communicate with Viber Bots