bwapi 9.0.0.pre.364 → 9.0.0.pre.365

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +20 -10
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjJlMmJiYWUwMDE3ZjlhNmRmMDE5NGZmZWVlYWZiYmQ3MjQ3Y2YwYg==
4
+ Njc4YjUwZTIyNWQzMDFlMDQzMTE3MjQ1MmY1MDk2MTA0ZDgzNTFkOA==
5
5
  data.tar.gz: !binary |-
6
- YTIzMjA0ZWU3NmYxYjgxY2FlMjg5ZTc2ODg3MGVkNTgzYzYxZGJiYQ==
6
+ ZDRhNzU0ZmNiNjc4ODNmZDQxM2Q0NTlhZmJmNWYxOThkMTJkNzdlOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NmIyNGY1YzEzNTg2NmY5MGVjMDczNTg0ODlkNGU0MzZlYjdmOTBkZDliYzcx
10
- MDk1ZTU3NjMyMmVmMDNhNjdlMjY2MDYwY2MyYTM3YjMyYmI4NTRkMzFmN2E4
11
- NTEzMzE4MzcyYWE2MWI5MDc2YTg1ZTU2ZGU2MzZjZWQyOWFlZDI=
9
+ MTNmY2Q0NDQ5YzM2ZjU5NTEwOTVjNTFlYjkyMWEyNzEyMDg4ZWYwNzgxMjEy
10
+ M2ExMTc1MTVjYmZiMTllZWY1OWYzZDIwMGU3ZmQ0NDJiY2FiNDZkN2UxOWFi
11
+ NzM2ZTVlYjA4MTkzY2QzZWFhOWRhNDY1ZDU5OWM2ZDM1N2RhZDY=
12
12
  data.tar.gz: !binary |-
13
- ZDZlMTc5YTA5MDRiZjIwYmEwZjJmM2M0M2ZlZmI3NThkOTVhMjdiM2QwNzM2
14
- YTEyM2IxNTEwOTczYWFjYTc4NWE5NzY0NTE4N2FmMTI1Y2NlYzNhNjIxOWJi
15
- ZGRlNmQ4N2UwYmNhNWZhZjBhZGU0NTNmYTNhY2U0NjI1YzMxMGM=
13
+ YzkwYmIzYmY0NGM4NWI1MzQ4YzY5YmY2Yzc0ZGM4OWY2OTMxMmE2N2NlODMy
14
+ NmYzMzU4ZTVmNTY2N2M2Yjk4NTJlOGNhMDRkNjFiNjg5OGY2YWY2YjkwODZk
15
+ OGVmMDEzNGNhMWRhZDkwZDQyNTkwMmZiMGRkMDRkNTllNDk0MWM=
data/README.md CHANGED
@@ -23,48 +23,58 @@ bw.login
23
23
 
24
24
  The API returns the oauth/token response with your authentication details.
25
25
 
26
- ### Examples
26
+ ## Examples
27
27
 
28
28
  Once authenticated, you are then able to make additional requests. The bwapi gem will automatically add your clients access token to the request header. Please see some examples of API requests below:
29
29
 
30
- #### Get all projects
30
+ ### Request all projects
31
31
  ```ruby
32
32
  bw.projects
33
33
  => #<Hashie::Mash results=[#<Hashie::Mash clientId=1856278873 clientName="JC BWAPI Demo" creationDate="2013-07-24T17:56:31.074+0000" creatorUserId=158304410 defaultIndustry="general-(recommended)" defaultLangCodes=["en"] description=nil id=1856280126 links=#<Hashie::Mash queries="http://newapi.brandwatch.com//projects/1856280126/queries.json?access_token=bd405bd7-9d1f-4c3d-ab5c-64b77791ae7f"> name="Demo Project">] resultsPage=-1 resultsPageSize=-1 resultsTotal=-1>
34
34
  ```
35
35
 
36
- #### Get a specific project
36
+ ### Request a specific project
37
37
  ```ruby
38
38
  bw.project 1856280126
39
39
  => #<Hashie::Mash clientId=1856278873 clientName="JC BWAPI Demo" creationDate="2013-07-24T17:56:31.074+0000" creatorUserId=158304410 defaultIndustry="general-(recommended)" defaultLangCodes=["en"] description=nil id=1856280126 links=#<Hashie::Mash queries="http://newapi.brandwatch.com//projects/1856280126/queries.json?access_token=bd405bd7-9d1f-4c3d-ab5c-64b77791ae7f"> name="Demo Project">
40
40
  ```
41
41
 
42
- #### Get a project queries summary
42
+ ### Request a project queries summary
43
43
  ```ruby
44
44
  bw.queries_summary 1856280126
45
45
  => #<Hashie::Mash results=[#<Hashie::Mash id=1856280351 name="LA Lakers">] resultsPage=-1 resultsPageSize=-1 resultsTotal=-1>
46
46
  ```
47
47
 
48
- #### Get user information
48
+ ### Request user information
49
49
  ```ruby
50
50
  bw.me
51
51
  => #<Hashie::Mash client=#<Hashie::Mash id=1856278873 name="JC BWAPI Demo" parentId=-1 railsEnabled=false theme="brandwatch"> firstName="BWAPI" id=158304410 lastName="Demo" links=#<Hashie::Mash logout="http://newapi.brandwatch.com/logout?access_token=bd405bd7-9d1f-4c3d-ab5c-64b77791ae7f" user="http://newapi.brandwatch.com//user.json?access_token=bd405bd7-9d1f-4c3d-ab5c-64b77791ae7f"> tags=#<Hashie::Mash notify="true"> uiRole="admin" username="bwapi_demo=jonathan@brandwatch.com">
52
52
  ```
53
53
 
54
- ### Debug
55
- In order to see the requests and responses which are being requested and returned, you can enable debug by passing this in as an option when creating your client instance:
54
+ ## Debug Mode
55
+
56
+ In order to see additional logging and performance information you can enable debug mode by passing this in as an option when creating your client instance:
56
57
 
57
58
  ```ruby
58
59
  bw = BWAPI::Client.new(username: 'username@example.com', password: 'pa$$w0rd', debug: true)
59
60
  ```
60
61
 
61
- Once enabled a `bwapi.log` file will be created in the current directory. Please note that you can access the log from your client also:
62
+ ### Logging
63
+
64
+ Any log output will be written to STDOUT unless you define a logger:
62
65
 
63
66
  ```ruby
64
- bw.log.info 'logging information'
67
+ bw = BWAPI::Client.new(username: 'username@example.com', password: 'pa$$w0rd', debug: true, log: Logger.new('main.log'))
65
68
  ```
66
69
 
67
- The above will only work if you enabled debug when creating your client.
70
+ ### Performance
71
+
72
+ When debug mode is running each request/response is timed and stored, to view the stats call the performance method on the client instance:
73
+
74
+ ```ruby
75
+ bw.performance
76
+ {"post_oauth_token"=>[0.125019], "get_me"=> [0.048003, 0.034587, 0.038165, 0.10304]}
77
+ ```
68
78
 
69
79
  ## Contributing
70
80
  If you would like to contribute to this project please fork, create your new feature and then submit a PR merging into the `staging` branch. Once the feature is merged I'll update the version number and date in the gemspec and merge to master.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bwapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.0.pre.364
4
+ version: 9.0.0.pre.365
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Chrisp