rollbar 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ **0.9.2**
4
+ - Added [Capistrano integration](https://github.com/rollbar/rollbar-gem/pull/27)
5
+
3
6
  **0.9.1**
4
7
  - Add support to play nicely with Better Errors.
5
8
 
data/README.md CHANGED
@@ -139,6 +139,27 @@ For even more asynchrony, you can configure the gem to write to a file instead o
139
139
  For this to work, you'll also need to set up rollbar-agent--see its docs for details.
140
140
 
141
141
 
142
+ ## Deploy Tracking with Capistrano
143
+
144
+ Add the following to `deploy.rb`:
145
+
146
+ ```ruby
147
+ require 'rollbar/capistrano'
148
+ set :rollbar_token, 'your-rollbar-project-access-token'
149
+ ```
150
+
151
+ Available options:
152
+
153
+ - `rollbar_token` - the same project access token as you used for the `rails generate rollbar` command; find it in `config/initializers/rollbar.rb`. (It's repeated here for performance reasons, so the rails environment doesn't have to be initialized.)
154
+ - `rollbar_env` - deploy environment name, `rails_env` by default
155
+
156
+ For `capistrano/multistage`, try:
157
+
158
+ ```ruby
159
+ set(:rollbar_env) { stage }
160
+ ```
161
+
162
+
142
163
  ## Using with Goalie
143
164
 
144
165
  If you're using [Goalie](https://github.com/obvio171/goalie) for custom error pages, you may need to explicitly add `require 'goalie'` to `config/application.rb` (in addition to `require 'goalie/rails'`) so that the monkeypatch will work. (This will be obvious if it is needed because your app won't start up: you'll see a cryptic error message about `Goalie::CustomErrorPages.render_exception` not being defined.)
data/THANKS CHANGED
@@ -1,6 +1,7 @@
1
1
  Huge thanks to the following contributors (by github username). For the most up-to-date list, see https://github.com/rollbar/rollbar-gem/graphs/contributors
2
2
 
3
3
  arr-ee
4
+ dimko
4
5
  firstbanco
5
6
  JoshuaOSHickman
6
7
  kavu
@@ -8,4 +9,4 @@ magnolia-fan
8
9
  mipearson
9
10
  trisweb
10
11
  tysontate
11
- wbond
12
+ wbond
@@ -0,0 +1,50 @@
1
+ require 'capistrano'
2
+
3
+ module Rollbar
4
+ module Capistrano
5
+ def self.load_into(configuration)
6
+ configuration.load do
7
+ after 'deploy', 'rollbar:deploy'
8
+ after 'deploy:migrations', 'rollbar:deploy'
9
+ after 'deploy:cold', 'rollbar:deploy'
10
+
11
+ namespace :rollbar do
12
+ desc 'Send the deployment notification to Rollbar.'
13
+ task :deploy, :except => { :no_release => true } do
14
+ require 'net/http'
15
+ require 'rubygems'
16
+ require 'json'
17
+
18
+ _cset(:rollbar_user) { ENV['USER'] || ENV['USERNAME'] }
19
+ _cset(:rollbar_env) { fetch(:rails_env, 'production') }
20
+ _cset(:rollbar_token) { abort("Please specify the Rollbar access token, set :rollbar_token, 'your token'") }
21
+
22
+ unless configuration.dry_run
23
+ uri = URI.parse('https://api.rollbar.com/api/1/deploy/')
24
+
25
+ params = {
26
+ :local_username => rollbar_user,
27
+ :access_token => rollbar_token,
28
+ :environment => rollbar_env,
29
+ :revision => current_revision
30
+ }
31
+
32
+ request = Net::HTTP::Post.new(uri.request_uri)
33
+ request.body = JSON.dump(params)
34
+
35
+ Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http|
36
+ http.request(request)
37
+ end
38
+ end
39
+
40
+ logger.info('Rollbar notification complete')
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ if Capistrano::Configuration.instance
49
+ Rollbar::Capistrano.load_into(Capistrano::Configuration.instance)
50
+ end
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  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.1
4
+ version: 0.9.2
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-03-05 00:00:00.000000000 Z
12
+ date: 2013-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -127,6 +127,7 @@ files:
127
127
  - lib/generators/rollbar/templates/initializer.rb
128
128
  - lib/rollbar.rb
129
129
  - lib/rollbar/better_errors.rb
130
+ - lib/rollbar/capistrano.rb
130
131
  - lib/rollbar/configuration.rb
131
132
  - lib/rollbar/delayed_job.rb
132
133
  - lib/rollbar/exception_reporter.rb
@@ -281,4 +282,3 @@ test_files:
281
282
  - spec/rollbar_spec.rb
282
283
  - spec/spec_helper.rb
283
284
  - spec/support/devise.rb
284
- has_rdoc: