airbrake 3.1.16 → 3.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3798079c271cc435d260126593812bce5241b775
4
- data.tar.gz: 353de11bf6b78ce210e1163edf899687ecef0db8
3
+ metadata.gz: dfc2885576a30927690a4535d69e4ca351010c80
4
+ data.tar.gz: d46ef484b70f08951c33fff46079c8a08317c2be
5
5
  SHA512:
6
- metadata.gz: 81be18beb2bc90e89260cc06a5f9295bddf54c7c717fea75d9731ed13d6883f8d93a01671fcfc38bd48f5d4244f2bbf1833e92de34e7492f74e884e7104beb49
7
- data.tar.gz: 64e0c784c018f7e285b0b2bbbd8a2dae954ca97e0db04c8a1279d5ae01116ec34ddc72c0548de09def0da51339db94985b294710aa8ef4fa4aa06e08182a2c1f
6
+ metadata.gz: 2194af5fb0d2c3610728f6ddcacc260aa366d6b30e4311c452ff8f54815f43b71aa05c632bef75d3ff447c40a2d45399393d40a4b21c09d30234db6ad3423def
7
+ data.tar.gz: 736d7e758269212bbdbb0440c1aa8d436489f16de8813aa8b3778efad5ad0dbe9be69494514e9b18b20d1c07fa2a149af58630f24b22efb5ce229db3ad6d053d
data/CHANGELOG CHANGED
@@ -1,3 +1,85 @@
1
+ Version 3.1.17 - 2014-05-20 21:00:25 -0700
2
+ ===============================================================================
3
+
4
+ Alex Tomlins (1):
5
+ Only send notices if configured with api_key
6
+
7
+ Ali Faiz (22):
8
+ Add tasks specific for using appraisal to test different versions
9
+ Ensure that integration tests can use the same helpers as unit tests
10
+ Fix errors causing features to fail
11
+ Add sqlite3 for Rails 3.2 & 4.0 appraisal gems
12
+ Fix integrations with Rails 3.0 by locking sucker_punch to v1.0.2.
13
+ Update README.md
14
+ Merge pull request #285 from airbrake/adjust-ci-integration
15
+ Merge pull request #281 from jhawthorn/fix_actioncontroller_metal
16
+ Merge pull request #268 from alphagov/disable_unless_configured
17
+ Merge pull request #287 from itolmach/master
18
+ Add apikey to certain cucumber tests for changes for configured
19
+ Merge pull request #288 from airbrake/fix-apikey-related-tests
20
+ Merge pull request #277 from polleverywhere/rails3_filter_parameters
21
+ Merge pull request #262 from roqua/mv-regex-filters
22
+ Fix filtering checks in cucumber tests by checking for 'key=' instead of blind check
23
+ Make separate step for the cucumber test that checks for filtered keys
24
+ Merge pull request #289 from airbrake/fix-regex-filtering
25
+ Write verbose output when configuration prevents sending notices to Airbrake.
26
+ Merge pull request #294 from Nitrodist/ensure-rake-integration
27
+ Merge pull request #295 from airbrake/add-context-when-notice-not-sent
28
+ Merge pull request #293 from Nitrodist/use-minitest-4
29
+ Use tag date instead of trying to sort on tag name
30
+
31
+ Ivan Tolmachev (3):
32
+ added airbrakeman notifier ruby illustration
33
+ illustration added, take 2
34
+ Added Airbrakeman Notifier Illustration
35
+
36
+ John Hawthorn (1):
37
+ fix middleware for AC::Metal on rails 3.2
38
+
39
+ Version 3.1.16 - 2014-03-11 13:34:51 -0700
40
+ ===============================================================================
41
+
42
+ Joseph Silvashy (5):
43
+ Merge pull request #267 from nberger/fix-typo-in-rails3-tasks
44
+ Update license for Rackspace
45
+ Merge pull request #255 from viperdezigns/capistrano3
46
+ Bump to 3.1.14
47
+ Bump to 3.1.16
48
+
49
+ Mark Campbell (2):
50
+ Add minitest 4.x as an explicit dependency
51
+ Ensure rake integration is enabled when rescue_rake_exceptions is true
52
+
53
+ Marten Veldthuis (3):
54
+ Add support for regexp filters
55
+ Refactor cgi_data filtering to use `filter_key?`
56
+ Add a default rack env filter for variables matching "secret" or "password".
57
+
58
+ Mike Foley (2):
59
+ Add backwards compatibility for filter_parameters in Rails3
60
+ Add tests, minor refactor for Rails 3 functionality
61
+
62
+ Nicolas Berger (1):
63
+ Fix typo: Rack -> Rake
64
+
65
+ Richard Pernikoff (3):
66
+ execute instead of run
67
+ get full revision hash and send correct repo url
68
+ execute the rake task within the release_path instead of running cd release_path.
69
+
70
+ ViperDezigns (1):
71
+ Merge pull request #2 from tunespeak/capistrano3
72
+
73
+ spodlecki (7):
74
+ adding capistrano 3
75
+ attempting err fixes
76
+ release_path
77
+ making repo name a env var
78
+ adding airbrake escape user method
79
+ logger.info doesn't exist, seems Cap uses info() now
80
+ execute instead of run
81
+
82
+
1
83
  Version 3.1.15 - 2014-01-03 14:37:38 +0100
2
84
  ===============================================================================
3
85
 
@@ -1275,5 +1357,6 @@ Nick Quaranto (3):
1275
1357
 
1276
1358
 
1277
1359
 
1360
+
1278
1361
 
1279
1362
 
data/README.md CHANGED
@@ -1,16 +1,20 @@
1
1
  Airbrake
2
2
  ========
3
3
 
4
- [![Circle CI](https://circleci.com/gh/airbrake/airbrake/tree/master.png?circle_token=66cb9cfc6d20f550a2dbde522f5f0f9f81bd653b)](https://circleci.com/gh/airbrake/airbrake)
4
+ [![Circle CI](https://circleci.com/gh/airbrake/airbrake/tree/master.png?circle-token=66cb9cfc6d20f550a2dbde522f5f0f9f81bd653b)](https://circleci.com/gh/airbrake/airbrake)
5
5
  [![Code Climate](https://codeclimate.com/github/airbrake/airbrake.png)](https://codeclimate.com/github/airbrake/airbrake)
6
6
  [![Coverage Status](https://coveralls.io/repos/airbrake/airbrake/badge.png?branch=master)](https://coveralls.io/r/airbrake/airbrake?branch=master)
7
7
  [![Dependency Status](https://gemnasium.com/airbrake/airbrake.png)](https://gemnasium.com/airbrake/airbrake)
8
8
 
9
+ <img src="http://f.cl.ly/items/3Q163w1r2K1J1b030k0g/ruby%2009.19.32.jpg" width=800px>
10
+
9
11
  This is the notifier gem for integrating apps with [Airbrake](http://airbrake.io).
10
12
 
11
13
  When an uncaught exception occurs, Airbrake will POST the relevant data
12
14
  to the Airbrake server specified in your environment.
13
15
 
16
+ <img scr="http://f.cl.ly/items/142j0Z2u0R1Y2L0L3D26/ruby.jpg" width=800px;>
17
+
14
18
  Help
15
19
  ----
16
20
 
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'rubygems'
2
- require "bundler/setup"
2
+ require 'bundler/setup'
3
3
  require 'appraisal'
4
4
  require 'rake'
5
5
  require 'rake/testtask'
@@ -15,7 +15,11 @@ require './lib/airbrake/version'
15
15
 
16
16
  Coveralls::RakeTask.new
17
17
 
18
- task :default => ["test:unit", "test:integration"]
18
+ appraisal_environments = %w(rails-4.0 rails-3.2 rails-3.1 rails-3.0 rake sinatra rack)
19
+ task default: %w( test:unit coveralls:push) +
20
+ appraisal_environments.map {|ae| "test:integration:#{ae.gsub(/[\-\.]/, '_')}"} +
21
+ appraisal_environments.map {|ae| "test:cucumber:#{ae.gsub(/[\-\.]/, '_')}"}
22
+
19
23
 
20
24
  namespace :test do
21
25
  Rake::TestTask.new(:unit) do |t|
@@ -24,13 +28,24 @@ namespace :test do
24
28
  t.verbose = true
25
29
  end
26
30
 
27
- desc "Integration tests for all versions of Rails."
28
- task :integration do
29
- system 'INTEGRATION=true rake appraisal:rails-3.2 integration_test'\
30
- '&& INTEGRATION=true rake appraisal:rails-3.1 integration_test'\
31
- '&& INTEGRATION=true rake appraisal:rails-3.0 integration_test'\
32
- '&& rake coveralls:push'\
33
- '&& INTEGRATION=true rake appraisal cucumber'
31
+ desc "Integration tests Rake, Sinatra, Rack and for all versions of Rails"
32
+ namespace :integration do
33
+ appraisal_environments.each do |appraisal_env|
34
+ task appraisal_env.gsub(/[\-\.]/, '_').to_sym do
35
+ ENV['INTEGRATION'] = 'true'
36
+ system "appraisal #{appraisal_env} rake integration_test" or exit!(1)
37
+ end
38
+ end
39
+ end
40
+
41
+ desc "Cucumber tests Rake, Sinatra, Rack and for all versions of Rails"
42
+ namespace :cucumber do
43
+ appraisal_environments.each do |appraisal_env|
44
+ task appraisal_env.gsub(/[\-\.]/, '_').to_sym do
45
+ ENV['INTEGRATION'] = 'true'
46
+ system "appraisal #{appraisal_env} rake cucumber" or exit!(1)
47
+ end
48
+ end
34
49
  end
35
50
  end
36
51
 
@@ -88,7 +103,7 @@ EOF
88
103
  Version #{version} - #{Time.now}
89
104
  ===============================================================================
90
105
 
91
- #{`git log $(git tag | grep -v rc | sort --version-sort | tail -1)..HEAD | git shortlog`}
106
+ #{`git log $(git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags | tail -1)..HEAD | git shortlog`}
92
107
  #{old}
93
108
  EOF
94
109
  end
@@ -28,11 +28,12 @@ Gem::Specification.new do |s|
28
28
  s.add_development_dependency("appraisal")
29
29
  s.add_development_dependency("rspec-rails")
30
30
  s.add_development_dependency("girl_friday")
31
- s.add_development_dependency("sucker_punch")
31
+ s.add_development_dependency("sucker_punch", "1.0.2")
32
32
  s.add_development_dependency("shoulda-matchers")
33
33
  s.add_development_dependency("shoulda-context")
34
34
  s.add_development_dependency("pry")
35
35
  s.add_development_dependency("coveralls")
36
+ s.add_development_dependency("minitest", ["~> 4.0"])
36
37
 
37
38
  s.authors = ["Airbrake"]
38
39
  s.email = %q{support@airbrake.io}
@@ -4,6 +4,7 @@ Feature: Rescue errors in Rails middleware
4
4
  And I cd to "rails_root"
5
5
  And I configure the notifier to use the following configuration lines:
6
6
  """
7
+ config.api_key = "myapikey"
7
8
  config.logger = Logger.new STDOUT
8
9
  """
9
10
  And I configure the Airbrake shim
@@ -134,6 +134,7 @@ Feature: Install the Gem in a Rails application
134
134
  And I run `rails generate airbrake -k myapikey -t`
135
135
  When I configure the notifier to use the following configuration lines:
136
136
  """
137
+ config.api_key = "myapikey"
137
138
  config.logger = Logger.new STDOUT
138
139
  """
139
140
  And I configure the application to filter parameter "secret"
@@ -255,9 +255,9 @@ end
255
255
 
256
256
  Then /^the Airbrake notification should not contain any of the sensitive Rack variables$/ do
257
257
  sensitive_rack_data_regex = FILTERED_RACK_VARS.map do |var|
258
- Regexp.quote(var)
258
+ var.instance_of?(Regexp) ? var : Regexp.quote(var)
259
259
  end.join("|")
260
- step %{the last notice sent should not contain "#{sensitive_rack_data_regex}"}
260
+ step %{the last notice sent should not contain keys with "#{sensitive_rack_data_regex}"}
261
261
  end
262
262
 
263
263
  Then /^the last notice sent should contain "([^\"]*)"$/ do |data|
@@ -270,6 +270,11 @@ Then /^the last notice sent should not contain "([^\"]*)"$/ do |data|
270
270
  last_notice.should_not match(%r{#{data}})
271
271
  end
272
272
 
273
+ Then /^the last notice sent should not contain keys with "([^\"]*)"$/ do |data|
274
+ last_notice = File.read(LAST_NOTICE)
275
+ last_notice.should_not match(%r{key\=\"(#{data})\"})
276
+ end
277
+
273
278
  Then /^the Airbrake notification should contain the framework information$/ do
274
279
  step %{the last notice sent should contain "Rails: #{ENV["RAILS_VERSION"]}"}
275
280
  end
@@ -30,8 +30,10 @@ end
30
30
  def reload_rack_filters
31
31
  original_filters = File.read(ORIGINAL_RACK_FILTERS)
32
32
 
33
+ Dir.mkdir(TEMP_DIR) unless Dir.exist?(TEMP_DIR)
34
+
33
35
  File.write(File.join(TEMP_DIR, "rack_filters.rb"),
34
- original_filters.lines[1..-2].join("\n"))
36
+ original_filters.lines.to_a[1..-2].join("\n"))
35
37
 
36
38
  require File.join(TEMP_DIR, "rack_filters.rb")
37
39
  end
@@ -123,33 +123,32 @@ module RailsHelpers
123
123
  end
124
124
 
125
125
  def perform_request(uri, environment = 'production')
126
- request_script = <<-SCRIPT
127
- require File.expand_path('../config/environment', __FILE__)
128
-
129
- env = Rack::MockRequest.env_for(#{uri.inspect})
130
- response = RailsRoot::Application.call(env)
131
-
132
-
133
- response = response.last if response.last.is_a?(ActionDispatch::Response)
134
-
135
- if response.is_a?(Array)
136
- puts "Status: " + response.first.to_s
137
- puts "Headers: " + response.second.to_s
138
- if response.last.respond_to?(:each)
139
- # making it work even with Rack::BodyProxy
140
- body = ""
141
- response.last.each do |chunk|
142
- body << chunk
143
- end
144
- response.pop
145
- response << body
146
- end
147
- puts "Body: " + response.last.to_s
148
- else
149
- puts response.body
150
- end
151
- SCRIPT
152
- File.open(File.join(rails_root, 'request.rb'), 'w') { |file| file.write(request_script) }
126
+ request_script = <<-SCRIPT
127
+ require File.expand_path('../config/environment', __FILE__)
128
+
129
+ env = Rack::MockRequest.env_for(#{uri.inspect})
130
+ response = RailsRoot::Application.call(env)
131
+
132
+ response = response.last if response.last.is_a?(ActionDispatch::Response)
133
+
134
+ if response.is_a?(Array)
135
+ puts "Status: " + response.first.to_s
136
+ puts "Headers: " + response.second.to_s
137
+ if response.last.respond_to?(:each)
138
+ # making it work even with Rack::BodyProxy
139
+ body = ""
140
+ response.last.each do |chunk|
141
+ body << chunk
142
+ end
143
+ response.pop
144
+ response << body
145
+ end
146
+ puts "Body: " + response.last.to_s
147
+ else
148
+ puts response.body
149
+ end
150
+ SCRIPT
151
+ File.open(File.join(rails_root, 'request.rb'), 'w') { |file| file.write(request_script) }
153
152
  end
154
153
 
155
154
  end
@@ -22,6 +22,7 @@ Feature: Inform the user of the airbrake notice that was just created
22
22
  Scenario: Rescue an exception in a controller with a custom error string
23
23
  When I configure the notifier to use the following configuration lines:
24
24
  """
25
+ config.api_key = "myapikey"
25
26
  config.user_information = 'Error #{{ error_id }}'
26
27
  """
27
28
  And I run `rails generate airbrake -k myapikey`
@@ -61,6 +61,12 @@ module Airbrake
61
61
  write_verbose_log("Notice details: \n#{notice}")
62
62
  end
63
63
 
64
+ def report_notice_not_sent_for_configuration
65
+ write_verbose_log("Notice was not sent due to configuration: \
66
+ \n Environment Monitored? #{configuration.public?} \
67
+ \n API key set? #{configuration.configured?}")
68
+ end
69
+
64
70
  # Returns the Ruby version, Rails version, and current Rails environment
65
71
  def environment_info
66
72
  info = "[Ruby: #{RUBY_VERSION}]"
@@ -147,13 +153,15 @@ module Airbrake
147
153
  private
148
154
 
149
155
  def send_notice(notice)
150
- if configuration.public?
156
+ if configuration.configured? && configuration.public?
151
157
  if configuration.async?
152
158
  configuration.async.call(notice)
153
159
  nil # make sure we never set env["airbrake.error_id"] for async notices
154
160
  else
155
161
  sender.send_to_airbrake(notice)
156
162
  end
163
+ else
164
+ report_notice_not_sent_for_configuration
157
165
  end
158
166
  end
159
167
 
@@ -256,6 +256,12 @@ module Airbrake
256
256
  to_hash.merge(hash)
257
257
  end
258
258
 
259
+ # Determines if the notifier will send notices.
260
+ # @return [Boolean] Returns +true+ if an api string exists, +false+ otherwise.
261
+ def configured?
262
+ !api_key.nil? && !api_key.empty?
263
+ end
264
+
259
265
  # Determines if the notifier will send notices.
260
266
  # @return [Boolean] Returns +false+ if in a development environment, +true+ otherwise.
261
267
  def public?
@@ -298,6 +304,13 @@ module Airbrake
298
304
  use_default_or_this
299
305
  end
300
306
 
307
+ def rescue_rake_exceptions=(val)
308
+ if val && !defined?(Airbrake::RakeHandler)
309
+ raise LoadError, "you must require 'airbrake/rake_handler' to rescue from rake exceptions"
310
+ end
311
+ @rescue_rake_exceptions = val
312
+ end
313
+
301
314
  def js_api_key
302
315
  @js_api_key || self.api_key
303
316
  end
@@ -42,15 +42,22 @@ module Airbrake
42
42
  def airbrake_filter_if_filtering(hash)
43
43
  return hash if ! hash.is_a?(Hash)
44
44
 
45
-
46
45
  if respond_to?(:filter_parameters) # Rails 2
47
46
  filter_parameters(hash)
48
- # elsif defined?(ActionDispatch::Http::ParameterFilter) # Rails 3
49
- # ActionDispatch::Http::ParameterFilter.new(::Rails.application.config.filter_parameters).filter(hash)
47
+ elsif rails3?
48
+ filter_rails3_parameters(hash)
50
49
  else
51
50
  hash
52
51
  end
52
+ end
53
+
54
+ def rails3?
55
+ defined?(::Rails.version) && ::Rails.version =~ /\A3/
56
+ end
53
57
 
58
+ def filter_rails3_parameters(hash)
59
+ ActionDispatch::Http::ParameterFilter.new(
60
+ ::Rails.application.config.filter_parameters).filter(hash)
54
61
  end
55
62
 
56
63
  def airbrake_session_data
@@ -25,12 +25,13 @@ module Airbrake
25
25
 
26
26
  private
27
27
 
28
- def after_airbrake_handler(env, exception)
29
- if defined? env["action_controller.instance"].
30
- rescue_action_in_public_without_airbrake
28
+ def controller(env)
29
+ env["action_controller.instance"]
30
+ end
31
31
 
32
- env["action_controller.instance"].
33
- rescue_action_in_public_without_airbrake(exception)
32
+ def after_airbrake_handler(env, exception)
33
+ if controller(env).respond_to?(:rescue_action_in_public_without_airbrake)
34
+ controller(env).rescue_action_in_public_without_airbrake(exception)
34
35
  end
35
36
  end
36
37
 
@@ -43,8 +44,11 @@ module Airbrake
43
44
  end
44
45
 
45
46
  def request_data(env)
46
- env["action_controller.instance"].try(:airbrake_request_data) ||
47
+ if controller(env).respond_to?(:airbrake_request_data)
48
+ controller(env).airbrake_request_data
49
+ else
47
50
  {:rack_env => env}
51
+ end
48
52
  end
49
53
 
50
54
  def ignored_user_agent?(env)
@@ -55,21 +55,28 @@ module Airbrake
55
55
 
56
56
  def clean_rack_request_data
57
57
  if @cgi_data
58
- Airbrake::FILTERED_RACK_VARS.each do |var|
59
- @cgi_data.delete var
58
+ @cgi_data.keys.each do |key|
59
+ if filter_key?(key, Airbrake::FILTERED_RACK_VARS)
60
+ @cgi_data.delete key
61
+ end
60
62
  end
61
63
  end
62
64
  end
63
65
 
64
- def filter_key?(key)
65
- @filters.any? do |filter|
66
- key.to_s.eql?(filter.to_s)
66
+ def filter_key?(key, filters)
67
+ filters.any? do |filter|
68
+ case filter
69
+ when Regexp
70
+ filter.match(key)
71
+ else
72
+ key.to_s.eql?(filter.to_s)
73
+ end
67
74
  end
68
75
  end
69
76
 
70
77
  def filter(hash)
71
78
  hash.each do |key, value|
72
- if filter_key?(key)
79
+ if filter_key?(key, @filters)
73
80
  hash[key] = "[FILTERED]"
74
81
  elsif value.respond_to?(:to_hash)
75
82
  filter(hash[key])
@@ -35,5 +35,10 @@ module Airbrake
35
35
  rack.input
36
36
  )
37
37
 
38
- FILTERED_RACK_VARS = SENSITIVE_RACK_VARS + RACK_VARS_CONTAINING_INSTANCES
38
+ SENSITIVE_ENV_VARS = [
39
+ /secret/i,
40
+ /password/i
41
+ ]
42
+
43
+ FILTERED_RACK_VARS = SENSITIVE_RACK_VARS + SENSITIVE_ENV_VARS + RACK_VARS_CONTAINING_INSTANCES
39
44
  end
@@ -1,3 +1,3 @@
1
1
  module Airbrake
2
- VERSION = "3.1.16"
2
+ VERSION = "3.1.17".freeze
3
3
  end
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="UTF-8"?><notice version="2.4"><api-key>myapikey</api-key><notifier><name>Airbrake Notifier</name><version>3.1.16</version><url>https://github.com/airbrake/airbrake</url></notifier><error><class>AirbrakeTestingException</class><message>AirbrakeTestingException:
2
+ Testing airbrake via "rake airbrake:test". If you can see this, it works.</message><backtrace><line number="377" file="[GEM_ROOT]/gems/activesupport-4.0.4/lib/active_support/callbacks.rb" method="_run__860778729963979009__process_action__callbacks"/><line number="80" file="[GEM_ROOT]/gems/activesupport-4.0.4/lib/active_support/callbacks.rb" method="run_callbacks"/><line number="17" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/abstract_controller/callbacks.rb" method="process_action"/><line number="29" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_controller/metal/rescue.rb" method="process_action"/><line number="31" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_controller/metal/instrumentation.rb" method="block in process_action"/><line number="159" file="[GEM_ROOT]/gems/activesupport-4.0.4/lib/active_support/notifications.rb" method="block in instrument"/><line number="20" file="[GEM_ROOT]/gems/activesupport-4.0.4/lib/active_support/notifications/instrumenter.rb" method="instrument"/><line number="159" file="[GEM_ROOT]/gems/activesupport-4.0.4/lib/active_support/notifications.rb" method="instrument"/><line number="30" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_controller/metal/instrumentation.rb" method="process_action"/><line number="250" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_controller/metal/params_wrapper.rb" method="process_action"/><line number="136" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/abstract_controller/base.rb" method="process"/><line number="44" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/abstract_controller/rendering.rb" method="process"/><line number="195" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_controller/metal.rb" method="dispatch"/><line number="13" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_controller/metal/rack_delegation.rb" method="dispatch"/><line number="231" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_controller/metal.rb" method="block in action"/><line number="80" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/routing/route_set.rb" method="call"/><line number="80" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/routing/route_set.rb" method="dispatch"/><line number="48" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/routing/route_set.rb" method="call"/><line number="71" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/journey/router.rb" method="block in call"/><line number="59" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/journey/router.rb" method="each"/><line number="59" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/journey/router.rb" method="call"/><line number="674" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/routing/route_set.rb" method="call"/><line number="23" file="[GEM_ROOT]/gems/rack-1.5.2/lib/rack/etag.rb" method="call"/><line number="25" file="[GEM_ROOT]/gems/rack-1.5.2/lib/rack/conditionalget.rb" method="call"/><line number="11" file="[GEM_ROOT]/gems/rack-1.5.2/lib/rack/head.rb" method="call"/><line number="27" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/middleware/params_parser.rb" method="call"/><line number="241" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/middleware/flash.rb" method="call"/><line number="225" file="[GEM_ROOT]/gems/rack-1.5.2/lib/rack/session/abstract/id.rb" method="context"/><line number="220" file="[GEM_ROOT]/gems/rack-1.5.2/lib/rack/session/abstract/id.rb" method="call"/><line number="486" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/middleware/cookies.rb" method="call"/><line number="29" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/middleware/callbacks.rb" method="block in call"/><line number="373" file="[GEM_ROOT]/gems/activesupport-4.0.4/lib/active_support/callbacks.rb" method="_run__4065767142482523156__call__callbacks"/><line number="80" file="[GEM_ROOT]/gems/activesupport-4.0.4/lib/active_support/callbacks.rb" method="run_callbacks"/><line number="27" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/middleware/callbacks.rb" method="call"/><line number="76" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/middleware/remote_ip.rb" method="call"/><line number="38" file="[GEM_ROOT]/gems/railties-4.0.4/lib/rails/rack/logger.rb" method="call_app"/><line number="20" file="[GEM_ROOT]/gems/railties-4.0.4/lib/rails/rack/logger.rb" method="block in call"/><line number="68" file="[GEM_ROOT]/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb" method="block in tagged"/><line number="26" file="[GEM_ROOT]/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb" method="tagged"/><line number="68" file="[GEM_ROOT]/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb" method="tagged"/><line number="20" file="[GEM_ROOT]/gems/railties-4.0.4/lib/rails/rack/logger.rb" method="call"/><line number="21" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/middleware/request_id.rb" method="call"/><line number="21" file="[GEM_ROOT]/gems/rack-1.5.2/lib/rack/methodoverride.rb" method="call"/><line number="17" file="[GEM_ROOT]/gems/rack-1.5.2/lib/rack/runtime.rb" method="call"/><line number="83" file="[GEM_ROOT]/gems/activesupport-4.0.4/lib/active_support/cache/strategy/local_cache.rb" method="call"/><line number="64" file="[GEM_ROOT]/gems/actionpack-4.0.4/lib/action_dispatch/middleware/static.rb" method="call"/><line number="112" file="[GEM_ROOT]/gems/rack-1.5.2/lib/rack/sendfile.rb" method="call"/><line number="511" file="[GEM_ROOT]/gems/railties-4.0.4/lib/rails/engine.rb" method="call"/><line number="97" file="[GEM_ROOT]/gems/railties-4.0.4/lib/rails/application.rb" method="call"/><line number="240" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/task.rb" method="call"/><line number="240" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/task.rb" method="block in execute"/><line number="235" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/task.rb" method="each"/><line number="235" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/task.rb" method="execute"/><line number="179" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/task.rb" method="block in invoke_with_call_chain"/><line number="211" file="/Users/alifaiz/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb" method="mon_synchronize"/><line number="172" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/task.rb" method="invoke_with_call_chain"/><line number="165" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/task.rb" method="invoke"/><line number="150" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/application.rb" method="invoke_task"/><line number="106" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/application.rb" method="block (2 levels) in top_level"/><line number="106" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/application.rb" method="each"/><line number="106" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/application.rb" method="block in top_level"/><line number="115" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/application.rb" method="run_with_threads"/><line number="100" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/application.rb" method="top_level"/><line number="78" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/application.rb" method="block in run"/><line number="176" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/application.rb" method="standard_exception_handling"/><line number="75" file="[GEM_ROOT]/gems/rake-10.2.2/lib/rake/application.rb" method="run"/><line number="33" file="[GEM_ROOT]/gems/rake-10.2.2/bin/rake" method="&lt;top (required)&gt;"/><line number="23" file="[GEM_ROOT]/bin/rake" method="load"/><line number="23" file="[GEM_ROOT]/bin/rake" method="&lt;main&gt;"/><line number="15" file="[GEM_ROOT]/bin/ruby_executable_hooks" method="eval"/><line number="15" file="[GEM_ROOT]/bin/ruby_executable_hooks" method="&lt;main&gt;"/></backtrace></error><request><url>http://www.example.com/verify</url><component>application</component><action>verify</action><params><var key="action">verify</var><var key="controller">application</var></params><cgi-data><var key="rack.version">["1", "2"]</var><var key="rack.multithread">true</var><var key="rack.multiprocess">true</var><var key="rack.run_once">false</var><var key="REQUEST_METHOD">GET</var><var key="SERVER_NAME">www.example.com</var><var key="SERVER_PORT">80</var><var key="QUERY_STRING"></var><var key="PATH_INFO">/verify</var><var key="rack.url_scheme">http</var><var key="HTTPS">off</var><var key="SCRIPT_NAME"></var><var key="CONTENT_LENGTH">0</var><var key="ORIGINAL_FULLPATH">/verify</var><var key="ORIGINAL_SCRIPT_NAME"></var><var key="action_dispatch.parameter_filter">["password"]</var><var key="action_dispatch.redirect_filter">[]</var><var key="action_dispatch.show_exceptions">false</var><var key="action_dispatch.show_detailed_exceptions">true</var><var key="ROUTES_2160658760_SCRIPT_NAME"></var><var key="action_dispatch.request_id">5d547c87-a383-4a63-9c0c-cfcdd16ff368</var><var key="action_dispatch.remote_ip"></var><var key="action_dispatch.request.path_parameters"><var key="action">verify</var><var key="controller">application</var></var><var key="action_dispatch.request.content_type"></var><var key="action_dispatch.request.request_parameters"></var><var key="rack.request.query_string"></var><var key="rack.request.query_hash"></var><var key="action_dispatch.request.query_parameters"></var><var key="action_dispatch.request.parameters"><var key="action">verify</var><var key="controller">application</var></var><var key="action_dispatch.request.formats">["text/html"]</var></cgi-data></request><server-environment><project-root>/Users/alifaiz/Work/Exceptional/airbrake-gem/tmp/rails_root</project-root><environment-name>test</environment-name><hostname>ali-mb.local</hostname></server-environment><framework>Rails: 4.0.4</framework></notice>
@@ -40,6 +40,11 @@ class ConfigurationTest < Test::Unit::TestCase
40
40
  assert config.async.respond_to?(:call)
41
41
  end
42
42
 
43
+ should "raise error for rake integration if rake handler isn't loaded" do
44
+ config = Airbrake::Configuration.new
45
+ assert_raises(LoadError) { config.rescue_rake_exceptions = true }
46
+ end
47
+
43
48
  should "set provided-callable for async {}" do
44
49
  config = Airbrake::Configuration.new
45
50
  config.async {|notice| :ok}
@@ -183,6 +188,27 @@ class ConfigurationTest < Test::Unit::TestCase
183
188
  assert_same_elements %w(development test cucumber), config.development_environments
184
189
  end
185
190
 
191
+ context "configured?" do
192
+ setup do
193
+ @config = Airbrake::Configuration.new
194
+ end
195
+
196
+ should "be true if given an api_key" do
197
+ @config.api_key = "1234"
198
+ assert @config.configured?
199
+ end
200
+
201
+ should "be false with a nil api_key" do
202
+ @config.api_key = nil
203
+ assert !@config.configured?
204
+ end
205
+
206
+ should "be false with a blank api_key" do
207
+ @config.api_key = ''
208
+ assert !@config.configured?
209
+ end
210
+ end
211
+
186
212
  should "be public in a public environment" do
187
213
  config = Airbrake::Configuration.new
188
214
  config.development_environments = %w(development)
@@ -54,5 +54,24 @@ class ControllerMethodsTest < Test::Unit::TestCase
54
54
  assert_equal no_session, {:session => 'no session found'}
55
55
  end
56
56
  end
57
- end
58
57
 
58
+ context "Rails 3" do
59
+ setup do
60
+ @controller = TestController.new
61
+ ::Rails = Object.new
62
+ ::Rails.stubs(:version).returns("3.2.17")
63
+ end
64
+ should "respond to rails3? with true" do
65
+ assert @controller.send(:rails3?)
66
+ end
67
+ should "call filter_rails3_parameters" do
68
+ hash = {:a => "b"}
69
+ filtered_hash = {:c => "d"}
70
+
71
+ @controller.expects(:filter_rails3_parameters).with(hash).
72
+ returns(filtered_hash)
73
+ assert_equal filtered_hash,
74
+ @controller.send(:airbrake_filter_if_filtering, hash)
75
+ end
76
+ end
77
+ end
@@ -88,7 +88,7 @@ module TestMethods
88
88
  end
89
89
  end
90
90
 
91
- class Test::Unit::TestCase
91
+ module TestHelpers
92
92
  def stub_sender
93
93
  stub('sender', :send_to_airbrake => nil)
94
94
  end
@@ -183,6 +183,10 @@ class Test::Unit::TestCase
183
183
  end
184
184
  end
185
185
 
186
+ class Test::Unit::TestCase
187
+ include ::TestHelpers
188
+ end
189
+
186
190
  module DefinesConstants
187
191
  def setup
188
192
  @defined_constants = []
@@ -131,6 +131,7 @@ end
131
131
  class ActionControllerCatcherTest < ActionDispatch::IntegrationTest
132
132
 
133
133
  include DefinesConstants
134
+ include TestHelpers
134
135
 
135
136
  def setup
136
137
  super
@@ -269,6 +270,13 @@ class ActionControllerCatcherTest < ActionDispatch::IntegrationTest
269
270
  assert_caught_and_not_sent
270
271
  end
271
272
 
273
+ def test_not_deliver_notices_from_exceptions_with_no_api_key
274
+ Airbrake.configuration.api_key = nil
275
+ @app = AirbrakeTestController.action(:boom)
276
+ get '/'
277
+ assert_caught_and_not_sent
278
+ end
279
+
272
280
  def test_not_deliver_notices_from_actions_that_dont_raise
273
281
  @app = AirbrakeTestController.action(:hello)
274
282
  get '/'
@@ -187,7 +187,7 @@ class NotifierTest < Test::Unit::TestCase
187
187
  config_opts = { 'one' => 'two', 'three' => 'four' }
188
188
  stub_notice!
189
189
  stub_sender!
190
- Airbrake.configuration = stub('config', :merge => config_opts, :public? => true,:async? => nil)
190
+ Airbrake.configuration = stub('config', :merge => config_opts, :configured? => true, :public? => true,:async? => nil)
191
191
 
192
192
  Airbrake.notify(exception)
193
193
 
@@ -64,6 +64,17 @@ class ParamsCleanerTest < Test::Unit::TestCase
64
64
  assert_equal({"abc" => "123"}, clean_params.cgi_data)
65
65
  end
66
66
 
67
+ should "remove secrets from cgi_data" do
68
+ original = {
69
+ "aws_secret_key" => "secret",
70
+ "service_password" => "password",
71
+ "abc" => "123"
72
+ }
73
+
74
+ clean_params = clean(:cgi_data => original)
75
+ assert_equal({"abc" => "123"}, clean_params.cgi_data)
76
+ end
77
+
67
78
  should "filter parameters" do
68
79
  assert_filters_hash(:parameters)
69
80
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.16
4
+ version: 3.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbrake
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-11 00:00:00.000000000 Z
11
+ date: 2014-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -210,16 +210,16 @@ dependencies:
210
210
  name: sucker_punch
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - '>='
213
+ - - '='
214
214
  - !ruby/object:Gem::Version
215
- version: '0'
215
+ version: 1.0.2
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - '>='
220
+ - - '='
221
221
  - !ruby/object:Gem::Version
222
- version: '0'
222
+ version: 1.0.2
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: shoulda-matchers
225
225
  requirement: !ruby/object:Gem::Requirement
@@ -276,6 +276,20 @@ dependencies:
276
276
  - - '>='
277
277
  - !ruby/object:Gem::Version
278
278
  version: '0'
279
+ - !ruby/object:Gem::Dependency
280
+ name: minitest
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - ~>
284
+ - !ruby/object:Gem::Version
285
+ version: '4.0'
286
+ type: :development
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - ~>
291
+ - !ruby/object:Gem::Version
292
+ version: '4.0'
279
293
  description:
280
294
  email: support@airbrake.io
281
295
  executables:
@@ -283,12 +297,42 @@ executables:
283
297
  extensions: []
284
298
  extra_rdoc_files: []
285
299
  files:
300
+ - CHANGELOG
301
+ - Gemfile
302
+ - Guardfile
303
+ - INSTALL
304
+ - LICENSE
305
+ - README.md
306
+ - README_FOR_HEROKU_ADDON.md
307
+ - Rakefile
308
+ - TESTED_AGAINST
309
+ - airbrake.gemspec
310
+ - bin/airbrake
311
+ - features/metal.feature
312
+ - features/rack.feature
313
+ - features/rails.feature
314
+ - features/rails_with_js_notifier.feature
315
+ - features/rake.feature
316
+ - features/sinatra.feature
317
+ - features/step_definitions/file_steps.rb
318
+ - features/step_definitions/rack_steps.rb
319
+ - features/step_definitions/rails_application_steps.rb
320
+ - features/step_definitions/rake_steps.rb
321
+ - features/support/airbrake_shim.rb.template
322
+ - features/support/aruba.rb
323
+ - features/support/env.rb
324
+ - features/support/matchers.rb
325
+ - features/support/rails.rb
326
+ - features/support/rake/Rakefile
327
+ - features/user_informer.feature
286
328
  - generators/airbrake/airbrake_generator.rb
287
329
  - generators/airbrake/lib/insert_commands.rb
288
330
  - generators/airbrake/lib/rake_commands.rb
289
331
  - generators/airbrake/templates/airbrake_tasks.rake
290
332
  - generators/airbrake/templates/capistrano_hook.rb
291
333
  - generators/airbrake/templates/initializer.rb
334
+ - install.rb
335
+ - lib/airbrake.rb
292
336
  - lib/airbrake/backtrace.rb
293
337
  - lib/airbrake/capistrano.rb
294
338
  - lib/airbrake/capistrano3.rb
@@ -303,12 +347,12 @@ files:
303
347
  - lib/airbrake/jobs/send_job.rb
304
348
  - lib/airbrake/notice.rb
305
349
  - lib/airbrake/rack.rb
350
+ - lib/airbrake/rails.rb
306
351
  - lib/airbrake/rails/action_controller_catcher.rb
307
352
  - lib/airbrake/rails/controller_methods.rb
308
353
  - lib/airbrake/rails/error_lookup.rb
309
354
  - lib/airbrake/rails/javascript_notifier.rb
310
355
  - lib/airbrake/rails/middleware.rb
311
- - lib/airbrake/rails.rb
312
356
  - lib/airbrake/rails3_tasks.rb
313
357
  - lib/airbrake/railtie.rb
314
358
  - lib/airbrake/rake_handler.rb
@@ -316,43 +360,32 @@ files:
316
360
  - lib/airbrake/sender.rb
317
361
  - lib/airbrake/shared_tasks.rb
318
362
  - lib/airbrake/sinatra.rb
319
- - lib/airbrake/tasks/airbrake.cap
320
363
  - lib/airbrake/tasks.rb
364
+ - lib/airbrake/tasks/airbrake.cap
321
365
  - lib/airbrake/user_informer.rb
322
366
  - lib/airbrake/utils/params_cleaner.rb
323
367
  - lib/airbrake/utils/rack_filters.rb
324
368
  - lib/airbrake/version.rb
325
- - lib/airbrake.rb
326
369
  - lib/airbrake_tasks.rb
327
370
  - lib/rails/generators/airbrake/airbrake_generator.rb
328
371
  - lib/templates/javascript_notifier_configuration
329
372
  - lib/templates/javascript_notifier_loader
330
373
  - lib/templates/rescue.erb
331
374
  - rails/init.rb
375
+ - resources/README.md
332
376
  - resources/airbrake_3_0.json
333
377
  - resources/ca-bundle.crt
334
- - resources/README.md
378
+ - resources/notice.xml
335
379
  - script/integration_test.rb
336
- - airbrake.gemspec
337
- - CHANGELOG
338
- - Gemfile
339
- - Guardfile
340
- - INSTALL
341
- - LICENSE
342
- - Rakefile
343
- - README_FOR_HEROKU_ADDON.md
344
- - README.md
345
- - TESTED_AGAINST
346
- - install.rb
347
380
  - test/airbrake_tasks_test.rb
348
381
  - test/backtrace_test.rb
349
382
  - test/capistrano_test.rb
350
383
  - test/configuration_test.rb
351
384
  - test/controller_methods_test.rb
352
385
  - test/helper.rb
386
+ - test/integration.rb
353
387
  - test/integration/catcher_test.rb
354
388
  - test/integration/javascript_notifier_test.rb
355
- - test/integration.rb
356
389
  - test/logger_test.rb
357
390
  - test/notice_test.rb
358
391
  - test/notifier_test.rb
@@ -364,24 +397,6 @@ files:
364
397
  - test/sender_test.rb
365
398
  - test/support/response_shim.xml
366
399
  - test/user_informer_test.rb
367
- - features/metal.feature
368
- - features/rack.feature
369
- - features/rails.feature
370
- - features/rails_with_js_notifier.feature
371
- - features/rake.feature
372
- - features/sinatra.feature
373
- - features/step_definitions/file_steps.rb
374
- - features/step_definitions/rack_steps.rb
375
- - features/step_definitions/rails_application_steps.rb
376
- - features/step_definitions/rake_steps.rb
377
- - features/support/airbrake_shim.rb.template
378
- - features/support/aruba.rb
379
- - features/support/env.rb
380
- - features/support/matchers.rb
381
- - features/support/rails.rb
382
- - features/support/rake/Rakefile
383
- - features/user_informer.feature
384
- - bin/airbrake
385
400
  homepage: http://www.airbrake.io
386
401
  licenses: []
387
402
  metadata: {}
@@ -401,7 +416,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
401
416
  version: '0'
402
417
  requirements: []
403
418
  rubyforge_project:
404
- rubygems_version: 2.1.11
419
+ rubygems_version: 2.2.0
405
420
  signing_key:
406
421
  specification_version: 4
407
422
  summary: Send your application errors to our hosted service and reclaim your inbox.
@@ -443,4 +458,3 @@ test_files:
443
458
  - features/support/rails.rb
444
459
  - features/support/rake/Rakefile
445
460
  - features/user_informer.feature
446
- has_rdoc: