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 +4 -4
- data/README.md +3 -1
- data/lib/rubyviber/client.rb +2 -2
- data/lib/rubyviber/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4fe60bd05e41c4c566dab8c010f94d9b394f132
|
4
|
+
data.tar.gz: f8bce7c9abd0e4505fffa59f2511c0dd12769e4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/rubyviber/client.rb
CHANGED
@@ -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
|
11
|
+
faraday.response(:logger, bodies: log_bodies) if logging
|
12
12
|
|
13
13
|
# Json encoder
|
14
14
|
faraday.use FaradayMiddleware::EncodeJson
|
data/lib/rubyviber/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|