rollbar-api 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -1
- data/examples/list_account_users.rb +2 -0
- data/lib/rollbar-api.rb +1 -0
- data/lib/rollbar-api/logger.rb +10 -0
- data/lib/rollbar-api/request.rb +2 -2
- data/lib/rollbar-api/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87c19bc2e9b0ae90c07d36e50d07bca9b41293bc
|
4
|
+
data.tar.gz: 424c9a30b3f9b25c84eef41d40f840c5fbf4ed96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c5600791ed96b9920dd7241f2a3e77d565d88e1fabf6d62ec61156aebe55c8a7cb12920ccaa132fd14894f16a741c134d7fcfd739378e76b6fac486dad81a56
|
7
|
+
data.tar.gz: 1b17c52d06df3a2e4060d77127c178ed52f562aaebfc65ecd6b3662f09d1cb1f2aee088a66c091b39f4dfac37b947267a9dfa8511486a3ed9264b0e66527d035
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# rollbar-api [![CircleCI](https://circleci.com/gh/wealthsimple/rollbar-api.svg?style=svg)](https://circleci.com/gh/wealthsimple/rollbar-api) [![](https://
|
1
|
+
# rollbar-api [![CircleCI](https://circleci.com/gh/wealthsimple/rollbar-api.svg?style=svg)](https://circleci.com/gh/wealthsimple/rollbar-api) [![Gem Version](https://badge.fury.io/rb/rollbar-api.svg)](https://rubygems.org/gems/rollbar-api)
|
2
2
|
|
3
3
|
Rubygem for accessing Rollbar's full REST and RQL APIs.
|
4
4
|
|
@@ -93,6 +93,18 @@ account = RollbarApi::Account.find("my-organization")
|
|
93
93
|
users = account.get("/api/1/users")
|
94
94
|
```
|
95
95
|
|
96
|
+
## Logging
|
97
|
+
|
98
|
+
You can optionally override the logger with:
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
# Set it to your own custom logger
|
102
|
+
RollbarApi.logger = Rails.logger
|
103
|
+
|
104
|
+
# Disable logging altogether
|
105
|
+
RollbarApi.logger = Logger.new(nil)
|
106
|
+
```
|
107
|
+
|
96
108
|
## Development
|
97
109
|
|
98
110
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -5,6 +5,8 @@ require "rollbar-api"
|
|
5
5
|
account_name = ENV["ROLLBAR_ACCOUNT_NAME"] or raise "Must specify ROLLBAR_ACCOUNT_NAME in .env"
|
6
6
|
account_access_token = ENV["ROLLBAR_ACCOUNT_ACCESS_TOKEN"] or raise "Must specify ROLLBAR_ACCOUNT_ACCESS_TOKEN in .env"
|
7
7
|
|
8
|
+
RollbarApi.logger = Logger.new(nil)
|
9
|
+
|
8
10
|
account = RollbarApi::Account.configure(account_name, account_access_token)
|
9
11
|
|
10
12
|
users = account.get("/api/1/users")
|
data/lib/rollbar-api.rb
CHANGED
data/lib/rollbar-api/request.rb
CHANGED
@@ -16,7 +16,7 @@ module RollbarApi
|
|
16
16
|
request.url(path)
|
17
17
|
request.body = body_to_json(params) if params.present?
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
request.headers.merge!({
|
21
21
|
"Accept" => "application/json",
|
22
22
|
"Content-Type" => "application/json",
|
@@ -29,7 +29,7 @@ module RollbarApi
|
|
29
29
|
|
30
30
|
def connection
|
31
31
|
Faraday.new(url: "https://api.rollbar.com") do |faraday|
|
32
|
-
faraday.response :logger,
|
32
|
+
faraday.response :logger, RollbarApi.logger, bodies: false
|
33
33
|
faraday.adapter Faraday.default_adapter
|
34
34
|
faraday.use Faraday::Response::RaiseError
|
35
35
|
end
|
data/lib/rollbar-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rollbar-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Graham
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -184,6 +184,7 @@ files:
|
|
184
184
|
- examples/top_active_items.rb
|
185
185
|
- lib/rollbar-api.rb
|
186
186
|
- lib/rollbar-api/account.rb
|
187
|
+
- lib/rollbar-api/logger.rb
|
187
188
|
- lib/rollbar-api/project.rb
|
188
189
|
- lib/rollbar-api/request.rb
|
189
190
|
- lib/rollbar-api/resource.rb
|