airbrake 3.1.3 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,19 @@
1
+ Version 3.1.4 - 2012-09-11 04:31:51 +0200
2
+ ===============================================================================
3
+
4
+ Ben Arent (1):
5
+ Update to MIT license to reflect new ownership.
6
+
7
+ Hrvoje Šimić (4):
8
+ remove activesupport from runtime dependencies
9
+ use different logger for async notices
10
+ Merge pull request #118 from exviva/load_initializer_conditionally
11
+ symbolize user's keys
12
+
13
+ Olek Janiszewski (1):
14
+ Fallback to loading whole environment if initializer does not exist
15
+
16
+
1
17
  Version 3.1.3 - 2012-09-05 18:58:27 +0200
2
18
  ===============================================================================
3
19
 
@@ -889,3 +905,4 @@ Nick Quaranto (3):
889
905
 
890
906
 
891
907
 
908
+
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007, Tammer Saleh, Thoughtbot, Inc.
1
+ Copyright (c) 2007 - 2012, Exceptional DBA Airbrake.io
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
data/airbrake.gemspec CHANGED
@@ -13,7 +13,6 @@ Gem::Specification.new do |s|
13
13
  s.test_files = Dir.glob("{test,spec,features}/**/*")
14
14
 
15
15
  s.add_runtime_dependency("builder")
16
- s.add_runtime_dependency("activesupport")
17
16
  s.add_runtime_dependency("girl_friday")
18
17
 
19
18
  s.add_development_dependency("actionpack", "~> 2.3.8")
data/lib/airbrake.rb CHANGED
@@ -2,7 +2,7 @@ require "girl_friday"
2
2
  require 'net/http'
3
3
  require 'net/https'
4
4
  require 'rubygems'
5
- require 'active_support/core_ext/object/blank'
5
+ require 'airbrake/utils/blank'
6
6
  require 'airbrake/version'
7
7
  require 'airbrake/configuration'
8
8
  require 'airbrake/notice'
@@ -251,13 +251,10 @@ module Airbrake
251
251
  end
252
252
  alias_method :async?, :async
253
253
 
254
- def async=(value)
255
- # use default GirlFriday-async for 'true' value
256
- @async = if value == true
257
- default_async_processor
258
- else
259
- value
260
- end
254
+ def async=(use_default_or_this)
255
+ @async = use_default_or_this == true ?
256
+ default_async_processor :
257
+ use_default_or_this
261
258
  end
262
259
 
263
260
  def js_api_key
@@ -73,10 +73,10 @@ module Airbrake
73
73
  end
74
74
 
75
75
  def airbrake_current_user
76
- user = current_user || current_member
76
+ user = begin current_user rescue current_member end
77
77
  user.attributes.select do |k, v|
78
78
  /^(id|name|username|email)$/ === k unless v.blank?
79
- end
79
+ end.symbolize_keys
80
80
  rescue NoMethodError, NameError
81
81
  {}
82
82
  end
@@ -8,6 +8,18 @@ namespace :airbrake do
8
8
  ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) :
9
9
  Logger.new(STDOUT)
10
10
 
11
+ def wait_for_threads
12
+ # if using multiple threads, we have to wait for
13
+ # them to finish
14
+ if GirlFriday.status.empty?
15
+ Thread.list.each do |thread|
16
+ thread.join unless thread == Thread.current
17
+ end
18
+ else
19
+ GirlFriday.shutdown!
20
+ end
21
+ end
22
+
11
23
  Rails.logger.level = Logger::DEBUG
12
24
  Airbrake.configure(true) do |config|
13
25
  config.logger = Rails.logger
@@ -80,5 +92,7 @@ namespace :airbrake do
80
92
  env = Rack::MockRequest.env_for("/verify")
81
93
 
82
94
  Rails.application.call(env)
95
+
96
+ wait_for_threads
83
97
  end
84
98
  end
@@ -15,7 +15,7 @@ module Airbrake
15
15
 
16
16
  config.after_initialize do
17
17
  Airbrake.configure(true) do |config|
18
- config.logger ||= ::Rails.logger
18
+ config.logger ||= config.async? ? ::Logger.new(STDERR) : ::Rails.logger
19
19
  config.environment_name ||= ::Rails.env
20
20
  config.project_root ||= ::Rails.root
21
21
  config.framework = "Rails: #{::Rails::VERSION::STRING}"
@@ -2,7 +2,17 @@ namespace :airbrake do
2
2
  desc "Notify Airbrake of a new deploy."
3
3
  task :deploy do
4
4
  require 'airbrake_tasks'
5
- load File.join(Rails.root, 'config', 'initializers','airbrake.rb') if defined?(Rails.root)
5
+
6
+ if defined?(Rails.root)
7
+ initializer_file = Rails.root.join('config', 'initializers','airbrake.rb')
8
+
9
+ if initializer_file.exist?
10
+ load initializer_file
11
+ else
12
+ Rake::Task[:environment].invoke
13
+ end
14
+ end
15
+
6
16
  AirbrakeTasks.deploy(:rails_env => ENV['TO'],
7
17
  :scm_revision => ENV['REVISION'],
8
18
  :scm_repository => ENV['REPO'],
@@ -0,0 +1,53 @@
1
+ # stolen from ActiveSupport
2
+
3
+ class Object
4
+ def blank?
5
+ respond_to?(:empty?) ? empty? : !self
6
+ end
7
+
8
+ def present?
9
+ !blank?
10
+ end
11
+
12
+ def presence
13
+ self if present?
14
+ end
15
+ end
16
+
17
+ class NilClass
18
+ def blank?
19
+ true
20
+ end
21
+ end
22
+
23
+ class FalseClass
24
+ def blank?
25
+ true
26
+ end
27
+ end
28
+
29
+ class TrueClass
30
+ def blank?
31
+ false
32
+ end
33
+ end
34
+
35
+ class Array
36
+ alias_method :blank?, :empty?
37
+ end
38
+
39
+ class Hash
40
+ alias_method :blank?, :empty?
41
+ end
42
+
43
+ class String
44
+ def blank?
45
+ self !~ /[^[:space:]]/
46
+ end
47
+ end
48
+
49
+ class Numeric
50
+ def blank?
51
+ false
52
+ end
53
+ end
@@ -1,3 +1,3 @@
1
1
  module Airbrake
2
- VERSION = "3.1.3".freeze
2
+ VERSION = "3.1.4".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.1.4
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: 2012-09-06 00:00:00.000000000 Z
12
+ date: 2012-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder
@@ -27,22 +27,6 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
- - !ruby/object:Gem::Dependency
31
- name: activesupport
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
30
  - !ruby/object:Gem::Dependency
47
31
  name: girl_friday
48
32
  requirement: !ruby/object:Gem::Requirement
@@ -329,6 +313,7 @@ files:
329
313
  - lib/airbrake/shared_tasks.rb
330
314
  - lib/airbrake/tasks.rb
331
315
  - lib/airbrake/user_informer.rb
316
+ - lib/airbrake/utils/blank.rb
332
317
  - lib/airbrake/version.rb
333
318
  - lib/airbrake.rb
334
319
  - lib/airbrake_tasks.rb