bwapi 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bwapi.gemspec +1 -1
- data/lib/bwapi/authentication.rb +10 -2
- data/lib/bwapi/client/oauth.rb +6 -4
- data/lib/bwapi/client/projects/data.rb +1 -1
- data/lib/bwapi/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: 759540aa830b0a9e9db3692eb7145635bb1fd1d1
|
4
|
+
data.tar.gz: 9de95b3eb2ae7a48406086a578d452c0b49d0d77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec34847fa2de9b1541f811ecfb49b96df89c8dffe6e695b339587c2431ec2cbc384dccf496a11d272212f1b1e63112c4d507436c82b6680025845cc39aaebea1
|
7
|
+
data.tar.gz: 955d642868b0f26c9a9eaee68d62e6292535e2e241c8ad0067929eb3e63d0a46f8f618bb52de891f99df5b6e29be446d5eaf54368cc14850bb49af6901cb6375
|
data/bwapi.gemspec
CHANGED
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + "/lib/bwapi/version"
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'bwapi'
|
5
5
|
s.version = BWAPI::VERSION
|
6
|
-
s.date = '2013-09-
|
6
|
+
s.date = '2013-09-17'
|
7
7
|
s.summary = 'Brandwatch v2 API Wrapper'
|
8
8
|
s.description = 'A Ruby wrapper for the Brandwatch v2 API'
|
9
9
|
s.author = 'Jonathan Chrisp'
|
data/lib/bwapi/authentication.rb
CHANGED
@@ -15,14 +15,22 @@ module BWAPI
|
|
15
15
|
#
|
16
16
|
# @return [Boolean] Application client status
|
17
17
|
def application_client?
|
18
|
-
client_id == 'brandwatch-application-client'
|
18
|
+
if client_id == 'brandwatch-application-client'
|
19
|
+
true
|
20
|
+
else
|
21
|
+
false
|
22
|
+
end
|
19
23
|
end
|
20
24
|
|
21
25
|
# Check if user is a brandwatch-api-client type
|
22
26
|
#
|
23
27
|
# @return [Boolean] Application client status
|
24
28
|
def api_client?
|
25
|
-
client_id == 'brandwatch-api-client'
|
29
|
+
if client_id == 'brandwatch-api-client'
|
30
|
+
true
|
31
|
+
else
|
32
|
+
false
|
33
|
+
end
|
26
34
|
end
|
27
35
|
|
28
36
|
# Set username and password via netrc
|
data/lib/bwapi/client/oauth.rb
CHANGED
@@ -7,7 +7,7 @@ module BWAPI
|
|
7
7
|
#
|
8
8
|
# @param opts [Hash] options hash of parameters
|
9
9
|
# @option opts [String] username User name of user
|
10
|
-
# @option opts [String] password
|
10
|
+
# @option opts [String] password Password of the user
|
11
11
|
# @option opts [String] grant_type Grant type of user
|
12
12
|
# @option opts [String] client_secret Client secret
|
13
13
|
# @option opts [String] client_id Client id
|
@@ -16,7 +16,7 @@ module BWAPI
|
|
16
16
|
opts = {
|
17
17
|
username: username,
|
18
18
|
password: password,
|
19
|
-
grant_type: 'password',
|
19
|
+
grant_type: grant_type ? grant_type : 'password',
|
20
20
|
client_secret: client_secret,
|
21
21
|
client_id: client_id,
|
22
22
|
force_urlencoded: true
|
@@ -30,14 +30,16 @@ module BWAPI
|
|
30
30
|
#
|
31
31
|
# @param opts [Hash] options hash of parameters
|
32
32
|
# @option opts [String] username User name of user
|
33
|
-
# @option opts [String] password
|
33
|
+
# @option opts [String] password Password of the user
|
34
34
|
# @option opts [String] grant_type Grant type of user
|
35
|
+
# @option opts [String] refresh_token Users refresh token
|
35
36
|
# @option opts [String] client_id Client id
|
36
37
|
# @option opts [String] force_urlencoded Force urlencoded
|
37
|
-
def oauth_refresh_token opts={}
|
38
|
+
def oauth_refresh_token opts={}
|
38
39
|
opts = {
|
39
40
|
username: username,
|
40
41
|
password: password,
|
42
|
+
|
41
43
|
refresh_token: refresh_token,
|
42
44
|
grant_type: 'refresh_token',
|
43
45
|
client_id: client_id,
|
data/lib/bwapi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bwapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Chrisp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
194
|
version: '0'
|
195
195
|
requirements: []
|
196
196
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.0.
|
197
|
+
rubygems_version: 2.0.5
|
198
198
|
signing_key:
|
199
199
|
specification_version: 4
|
200
200
|
summary: Brandwatch v2 API Wrapper
|