beeswaxapi 0.0.8 → 0.0.9

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: c2807d7a85e70a8fd03adf359bebdd737d872375db55af0e15a21c768e13eca8
4
- data.tar.gz: dfc51608b392029bbcc1d84e2180eca66aeebf67067bd5d599b055497282bbc6
3
+ metadata.gz: f864da1b76c76ca0709d9851fae8a28301f5390df3f0434851ff3c5a0ac9d3a5
4
+ data.tar.gz: 2ce8ae284bdc19dfe2bfe25758475d8a571b2e63c50717f2a8dedc95483589ce
5
5
  SHA512:
6
- metadata.gz: 42c6f4101e4a29bb40aa9cecda8ea59aa35cac837206b4a8827af449e5199e7b811c93a9efc51f0e5c1350bae78c127f97b257fad6292ac9f3ec14889080f7c4
7
- data.tar.gz: 25966274ef20d2a56e352bc8aec0cf727cc30d916f987698a1e7f47bab13a4a0c6bc19ea5a487d71da79e9f757c00595f2256c040ad58676ca142f8d43b32eda
6
+ metadata.gz: 0adc5f9b58776d21cb41ede4135e22ac89acaad79df5f407e9914a56c6005360b8168518cf6fb938a7cc7b70277f42d8b10c01d2b5bfadb588aeca3504daaaf1
7
+ data.tar.gz: 2fe420cf1ea6f94480c632d5f7b28349d8e386f48650da9d9eae785eaf93fba77e3b24bbeae129df5019d78b48f0d6ff3062ff7673bce38219d90263156345b5
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Beeswaxapi
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/beeswaxapi`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ This gem is a wrapper for Beeswax Buzz API.
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,7 +20,41 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ To start work with `Beeswaxapi` you need setup your config.
24
+
25
+ ### Configuration
26
+
27
+ Available configs:
28
+
29
+ - auth_strategy: by default `basic`. Can be changed to `cookies`.
30
+ - cookie\_file: path to file with cookies. Required for `cookies` auth\_strategy.
31
+ - base_uri: uri to beeswax api endpoint. Should be with `rest` path
32
+ - user_name: email of user
33
+ - password: password of user
34
+ - logger: this option enable logging
35
+
36
+ Example configuration for basic auth authentication:
37
+
38
+ ```
39
+ BeeswaxAPI::App.configure do |config|
40
+ config.auth_strategy = 'basic'
41
+ config.base_uri = 'https://sandbox.api.beeswax.com/rest'
42
+ config.user_name = 'user@mail.com'
43
+ config.password = 'password'
44
+ end
45
+ ```
46
+
47
+ Example configuration for cookies authentication:
48
+
49
+ ```
50
+ BeeswaxAPI::App.configure do |config|
51
+ config.auth_strategy = 'cookies'
52
+ config.cookie_file = '/path/to/cookies-file.txt'
53
+ config.base_uri = 'https://sandbox.api.beeswax.com/rest'
54
+ config.user_name = 'user@mail.com'
55
+ config.password = 'password'
56
+ end
57
+ ```
26
58
 
27
59
  ## Development
28
60
 
@@ -30,6 +62,10 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
30
62
 
31
63
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
64
 
65
+ ## Sources
66
+ Beeswax Buzz API: [https://docs.beeswax.com/docs]
67
+ (https://docs.beeswax.com/docs/getting-started)
68
+
33
69
  ## Contributing
34
70
 
35
71
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/beeswaxapi.
@@ -8,7 +8,11 @@ module BeeswaxAPI
8
8
 
9
9
  # NOTE: get method returns document in body
10
10
  if origin_response.request.options[:method] == :get
11
- Response.new(payload: parsed_response_body)
11
+ if parsed_response_body.key? :payload
12
+ Response.new(parsed_response_body)
13
+ else
14
+ Response.new(payload: parsed_response_body)
15
+ end
12
16
  else
13
17
  Response.new(parsed_response_body)
14
18
  end
@@ -1,3 +1,3 @@
1
1
  module BeeswaxAPI
2
- VERSION = '0.0.8'.freeze
2
+ VERSION = '0.0.9'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beeswaxapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valentyn Ostakh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-20 00:00:00.000000000 Z
11
+ date: 2017-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus