bwapi 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/bwapi/client.rb +2 -0
- data/lib/bwapi/configuration.rb +6 -6
- data/lib/bwapi/version.rb +1 -1
- data/spec/bwapi/client_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3936b94ac927e859883ba94f57b5bf9ce4e3ab07
|
4
|
+
data.tar.gz: aac7ec6084fc89f77b0c1146342e5163884f74bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 692fc31e5e59426305db9b9593d373feb9c69f170b03ce872d9313dad9d7704a4b678ad17f5a31b300e644139b091a1468513e7227a30acc2d60c73de790c1dd
|
7
|
+
data.tar.gz: 59d707d2fb356c5d9c5a9be6e555ec6e9627e5138f431cacf288475bfa3910b96ba7c5c40e1dcac8033f431456d5480c189323b876592dda9d2e4d741625383b
|
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
[](http://badge.fury.io/rb/bwapi)
|
1
2
|
[](https://travis-ci.org/jonathanchrisp/bwapi)
|
2
3
|
[](https://gemnasium.com/jonathanchrisp/bwapi)
|
3
4
|
[](https://codeclimate.com/github/jonathanchrisp/bwapi)
|
data/lib/bwapi/client.rb
CHANGED
@@ -6,6 +6,7 @@ require 'bwapi/client/admin'
|
|
6
6
|
require 'bwapi/client/brandwatch'
|
7
7
|
require 'bwapi/client/client'
|
8
8
|
require 'bwapi/client/error_codes'
|
9
|
+
require 'bwapi/client/filters'
|
9
10
|
require 'bwapi/client/logout'
|
10
11
|
require 'bwapi/client/me'
|
11
12
|
require 'bwapi/client/oauth'
|
@@ -41,6 +42,7 @@ module BWAPI
|
|
41
42
|
include BWAPI::Client::Brandwatch
|
42
43
|
include BWAPI::Client::Client
|
43
44
|
include BWAPI::Client::ErrorCodes
|
45
|
+
include BWAPI::Client::Filters
|
44
46
|
include BWAPI::Client::Logout
|
45
47
|
include BWAPI::Client::Me
|
46
48
|
include BWAPI::Client::OAuth
|
data/lib/bwapi/configuration.rb
CHANGED
@@ -21,7 +21,7 @@ module BWAPI
|
|
21
21
|
].freeze
|
22
22
|
|
23
23
|
DEFAULT_ADAPTER = Faraday.default_adapter
|
24
|
-
DEFAULT_API_ENDPOINT = 'https://newapi.brandwatch.com/'
|
24
|
+
DEFAULT_API_ENDPOINT = ENV['BWAPI_API_ENDPOINT'] || 'https://newapi.brandwatch.com/'
|
25
25
|
DEFAULT_CLIENT_ID = 'brandwatch-api-client'
|
26
26
|
DEFAULT_USER_AGENT = "BWAPI Ruby Gem #{BWAPI::VERSION}".freeze
|
27
27
|
DEFAULT_NETRC_FILE = File.join(ENV['HOME'], '.netrc')
|
@@ -38,6 +38,11 @@ module BWAPI
|
|
38
38
|
yield self
|
39
39
|
end
|
40
40
|
|
41
|
+
# Convert option_keys to hash and return
|
42
|
+
def options
|
43
|
+
OPTION_KEYS.inject({}){|o,k|o.merge!(k => send(k))}
|
44
|
+
end
|
45
|
+
|
41
46
|
# Reset the configuration options
|
42
47
|
def reset
|
43
48
|
self.adapter = DEFAULT_ADAPTER
|
@@ -54,10 +59,5 @@ module BWAPI
|
|
54
59
|
self.netrc = false
|
55
60
|
self.netrc_file = DEFAULT_NETRC_FILE
|
56
61
|
end
|
57
|
-
|
58
|
-
# Convert option_keys to hash and return
|
59
|
-
def options
|
60
|
-
OPTION_KEYS.inject({}){|o,k|o.merge!(k => send(k))}
|
61
|
-
end
|
62
62
|
end
|
63
63
|
end
|
data/lib/bwapi/version.rb
CHANGED
data/spec/bwapi/client_spec.rb
CHANGED
@@ -92,7 +92,7 @@ describe BWAPI::Client do
|
|
92
92
|
|
93
93
|
describe 'api_endpoint' do
|
94
94
|
it 'should have a default api_endpoint value' do
|
95
|
-
expect(BWAPI::Client.new.api_endpoint).to eql("
|
95
|
+
expect(BWAPI::Client.new.api_endpoint).to eql("https://newapi.brandwatch.com/")
|
96
96
|
end
|
97
97
|
|
98
98
|
it 'should allow a user to set a api_endpoint value' do
|