rollbar 0.9.10 → 0.9.11
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/README.md +4 -4
- data/lib/rollbar/configuration.rb +1 -0
- data/lib/rollbar/version.rb +1 -1
- data/spec/controllers/home_controller_spec.rb +17 -3
- data/spec/rollbar_spec.rb +14 -1
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -18,9 +18,9 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
Then, run the following command from your rails root:
|
20
20
|
|
21
|
-
$ rails generate rollbar
|
21
|
+
$ rails generate rollbar your-rollbar-post_server_item-token
|
22
22
|
|
23
|
-
That will create the file `config/initializers/rollbar.rb`, which holds the configuration values (currently just your access token).
|
23
|
+
That will create the file `config/initializers/rollbar.rb`, which holds the configuration values (currently just your access token). Make sure you're using the `post_server_item` access token.
|
24
24
|
|
25
25
|
If you want to store your access token outside of your repo, run the same command without arguments:
|
26
26
|
|
@@ -28,11 +28,11 @@ If you want to store your access token outside of your repo, run the same comman
|
|
28
28
|
|
29
29
|
Then, create an environment variable `ROLLBAR_ACCESS_TOKEN` and set it to your server-side access token.
|
30
30
|
|
31
|
-
$ export ROLLBAR_ACCESS_TOKEN=
|
31
|
+
$ export ROLLBAR_ACCESS_TOKEN=your-rollbar-post_server_item-token
|
32
32
|
|
33
33
|
or
|
34
34
|
|
35
|
-
$ heroku config:add ROLLBAR_ACCESS_TOKEN=
|
35
|
+
$ heroku config:add ROLLBAR_ACCESS_TOKEN=your-rollbar-post_server_item-token
|
36
36
|
|
37
37
|
if you are using Heroku.
|
38
38
|
|
@@ -35,6 +35,7 @@ module Rollbar
|
|
35
35
|
@default_logger = lambda { Logger.new(STDERR) }
|
36
36
|
@enabled = nil # set to true when configure is called
|
37
37
|
@endpoint = DEFAULT_ENDPOINT
|
38
|
+
@environment = 'production'
|
38
39
|
@exception_level_filters = {
|
39
40
|
'ActiveRecord::RecordNotFound' => 'warning',
|
40
41
|
'AbstractController::ActionNotFound' => 'warning',
|
data/lib/rollbar/version.rb
CHANGED
@@ -5,14 +5,28 @@ describe HomeController do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
reset_configuration
|
8
|
+
Rollbar::Rails.initialize
|
8
9
|
Rollbar.configure do |config|
|
9
10
|
config.access_token = 'aaaabbbbccccddddeeeeffff00001111'
|
10
|
-
config.environment = ::Rails.env
|
11
|
-
config.root = ::Rails.root
|
12
|
-
config.framework = "Rails: #{::Rails::VERSION::STRING}"
|
13
11
|
config.logger = logger_mock
|
14
12
|
end
|
15
13
|
end
|
14
|
+
|
15
|
+
context "rollbar base_data" do
|
16
|
+
it 'should have the Rails environment' do
|
17
|
+
data = Rollbar.send(:base_data)
|
18
|
+
data[:environment].should == ::Rails.env
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an overridden environment' do
|
22
|
+
Rollbar.configure do |config|
|
23
|
+
config.environment = 'dev'
|
24
|
+
end
|
25
|
+
|
26
|
+
data = Rollbar.send(:base_data)
|
27
|
+
data[:environment].should == 'dev'
|
28
|
+
end
|
29
|
+
end
|
16
30
|
|
17
31
|
context "rollbar controller methods" do
|
18
32
|
# TODO run these for a a more-real request
|
data/spec/rollbar_spec.rb
CHANGED
@@ -413,6 +413,20 @@ describe Rollbar do
|
|
413
413
|
data[:language].should == 'ruby'
|
414
414
|
data[:framework].should match(/^Rails/)
|
415
415
|
end
|
416
|
+
|
417
|
+
it 'should have a default production environment' do
|
418
|
+
data = Rollbar.send(:base_data)
|
419
|
+
data[:environment].should == 'production'
|
420
|
+
end
|
421
|
+
|
422
|
+
it 'should have an overridden environment' do
|
423
|
+
Rollbar.configure do |config|
|
424
|
+
config.environment = 'development'
|
425
|
+
end
|
426
|
+
|
427
|
+
data = Rollbar.send(:base_data)
|
428
|
+
data[:environment].should == 'development'
|
429
|
+
end
|
416
430
|
end
|
417
431
|
|
418
432
|
context 'server_data' do
|
@@ -462,7 +476,6 @@ describe Rollbar do
|
|
462
476
|
# special test access token
|
463
477
|
config.access_token = test_access_token
|
464
478
|
config.logger = ::Rails.logger
|
465
|
-
config.environment = ::Rails.env
|
466
479
|
config.root = ::Rails.root
|
467
480
|
config.framework = "Rails: #{::Rails::VERSION::STRING}"
|
468
481
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rollbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|