toadhopper-sinatra 1.0.5 → 2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [Hoptoad](http://www.hoptoadapp.com/) meets [Sinatra](http://www.sinatrarb.com/).
1
+ [Airbrake](http://www.airbrakeapp.com/) meets [Sinatra](http://www.sinatrarb.com/).
2
2
 
3
3
  _____ ,
4
4
  / \______ |\ __
@@ -22,7 +22,7 @@ For usage see example.rb. To install:
22
22
 
23
23
  ## Development
24
24
 
25
- Install Bundler 0.9.x, then:
25
+ Install Bundler, then:
26
26
 
27
27
  % git clone git://github.com/toolmantim/toadhopper-sinatra.git
28
28
  % cd toadhopper-sinatra
data/example.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'sinatra'
2
2
  require 'sinatra/toadhopper'
3
3
 
4
- set :toadhopper, :api_key => "apikey", :filters => /password/
4
+ set :airbrake, :api_key => "apikey", :filters => /password/
5
5
 
6
6
  post "/register" do
7
7
  session[:user_id] = 42
@@ -9,6 +9,6 @@ post "/register" do
9
9
  end
10
10
 
11
11
  error do
12
- post_error_to_hoptoad!
12
+ post_error_to_airbrake!
13
13
  "Ouch, that hurt."
14
14
  end
@@ -7,13 +7,13 @@ module Sinatra
7
7
 
8
8
  module Helpers
9
9
  # Reports the current sinatra error to Hoptoad
10
- def post_error_to_hoptoad!
11
- unless toadhopper_api_key
12
- STDERR.puts "Toadhopper api key not set, e.g. set :toadhopper, :api_key => 'my api key'"
10
+ def post_error_to_airbrake!
11
+ unless airbrake_api_key
12
+ STDERR.puts "Airbrake api key not set, e.g. set :airbrake, :api_key => 'my api key'"
13
13
  return
14
14
  end
15
- toadhopper = ::Toadhopper.new(toadhopper_api_key, toadhopper_options)
16
- toadhopper.filters = toadhopper_filters if toadhopper_filters
15
+ toadhopper = ::Toadhopper.new(airbrake_api_key, airbrake_options)
16
+ toadhopper.filters = airbrake_filters if airbrake_filters
17
17
  toadhopper.post!(
18
18
  env['sinatra.error'],
19
19
  {
@@ -31,20 +31,20 @@ module Sinatra
31
31
  )
32
32
  end
33
33
  private
34
- def toadhopper_filters
35
- settings.toadhopper[:filters]
34
+ def airbrake_filters
35
+ settings.airbrake[:filters]
36
36
  end
37
- def toadhopper_api_key
38
- settings.toadhopper[:api_key]
37
+ def airbrake_api_key
38
+ settings.airbrake[:api_key]
39
39
  end
40
- def toadhopper_options
41
- settings.toadhopper.reject {|k,_| [:api_key, :filters].include?(k)}
40
+ def airbrake_options
41
+ settings.airbrake.reject {|k,_| [:api_key, :filters].include?(k)}
42
42
  end
43
43
  end
44
44
 
45
45
  def self.registered(app)
46
46
  app.helpers Toadhopper::Helpers
47
- app.set :toadhopper, {}
47
+ app.set :airbrake, {}
48
48
  end
49
49
 
50
50
  end
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module Toadhopper
3
- VERSION = "1.0.5"
3
+ VERSION = "2.0"
4
4
  end
5
5
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.extra_rdoc_files = ['README.md', 'LICENSE', 'example.rb']
21
21
 
22
22
  s.add_dependency 'sinatra'
23
- s.add_dependency 'toadhopper', '~> 1.0'
23
+ s.add_dependency 'toadhopper', '~> 2.0'
24
24
 
25
25
  s.add_development_dependency 'rake'
26
26
  s.add_development_dependency 'exemplor'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: toadhopper-sinatra
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.5
5
+ version: "2.0"
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tim Lucas
@@ -32,7 +32,7 @@ dependencies:
32
32
  requirements:
33
33
  - - ~>
34
34
  - !ruby/object:Gem::Version
35
- version: "1.0"
35
+ version: "2.0"
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: *id002
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- hash: 4607978065630765247
119
+ hash: -2506588135648544577
120
120
  segments:
121
121
  - 0
122
122
  version: "0"
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  requirements:
126
126
  - - ">="
127
127
  - !ruby/object:Gem::Version
128
- hash: 4607978065630765247
128
+ hash: -2506588135648544577
129
129
  segments:
130
130
  - 0
131
131
  version: "0"