rabbit_jobs 0.8.12 → 0.8.13

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: 4c8cb143da75d23bf4bd92ce442eea19bf991de5
4
- data.tar.gz: 6bd63452825269ceed5953ebfbdd4fe513f8f9ce
3
+ metadata.gz: 30070350000176518b8d5fbd7a21218f53435401
4
+ data.tar.gz: aa41a3e52db8ac1884725ab38f43a9c581ff3aac
5
5
  SHA512:
6
- metadata.gz: 0f148ab724486db98c4780de6907277821ca5283947955c55dffaa1b9d472ac6148aeb0e93740ab86acc93ce107e4b2af0c78295539d542630a7dfdecff5847c
7
- data.tar.gz: f7d55af701f43c6ddafb412efd885bc248b12e05d8c5d55b9bdf51b3a9ef5cae4d53308359c9f3b4a78b1a1abd60b30569438e6bf1d3d44d826b427795b754a2
6
+ metadata.gz: 26dca9eed2630d1242097a8df69ae8b7b0eda657ee9649bd9cc57a4bd22749e5ea6eead34c255a64ca1f832f4f54e848983c24880aa645e59ea38ac3ac784d65
7
+ data.tar.gz: 519e1e0481fec96b00543365ad6446ddbb8c82bcaa875bc0ef398892da54d7b4035de63eae24695189f66fb55c78b077bf50e951cc616dda012d8b666ec0da74
@@ -19,8 +19,23 @@ module RabbitJobs
19
19
  true
20
20
  end
21
21
 
22
- def log_error(msg)
23
- RJ.logger.error msg
22
+ def log_error(msg_or_exception, payload = nil)
23
+ if msg_or_exception.is_a?(String)
24
+ RJ.logger.error msg_or_exception
25
+ else
26
+ RJ.logger.error msg_or_exception.message
27
+ RJ.logger.error _cleanup_backtrace(msg_or_exception.backtrace).join("\n")
28
+ end
29
+ end
30
+
31
+ def log_airbrake(msg_or_exception, payload)
32
+ if defined?(Airbrake)
33
+ if msg_or_exception.is_a?(String)
34
+ Airbrake.notify(RuntimeError.new(msg_or_exception))
35
+ else
36
+ Airbrake.notify(msg_or_exception)
37
+ end
38
+ end
24
39
  end
25
40
 
26
41
  def report_error(error_type, *args)
@@ -33,8 +48,7 @@ module RabbitJobs
33
48
  when :error
34
49
  ex, payload = args
35
50
  log_error "Cannot initialize job."
36
- log_error ex.message
37
- log_error _cleanup_backtrace(ex.backtrace).join("\n")
51
+ log_error ex, payload
38
52
  log_error "Data received: #{payload.inspect}"
39
53
  end
40
54
  end
@@ -98,6 +98,7 @@ module RabbitJobs
98
98
  RabbitJobs.logger.warn error.message
99
99
  RabbitJobs.logger.warn(self.to_ruby_string)
100
100
  RabbitJobs.logger.warn _cleanup_backtrace(error.backtrace).join("\n")
101
+ Airbrake.notify(error, session: {args: self.to_ruby_string}) if defined?(Airbrake)
101
102
  RabbitJobs::ErrorMailer.report_error(self, error) rescue nil
102
103
  end
103
104
  end
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  module RabbitJobs
4
- VERSION = "0.8.12"
4
+ VERSION = "0.8.13"
5
5
  end
data/lib/rabbit_jobs.rb CHANGED
@@ -78,7 +78,6 @@ module RabbitJobs
78
78
  }
79
79
  return true
80
80
  end
81
-
82
81
  end
83
82
 
84
83
  RJ = RabbitJobs
data/rabbit_jobs.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.require_paths = ["lib"]
17
17
  gem.version = RabbitJobs::VERSION
18
18
 
19
- gem.add_dependency "bunny", "0.9.0.rc2"
19
+ gem.add_dependency "bunny", "0.9.0.pre12"
20
20
  gem.add_dependency "rake"
21
21
  gem.add_dependency "rufus-scheduler", "~> 2.0"
22
22
  gem.add_dependency "rails", "~> 3.2"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabbit_jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.12
4
+ version: 0.8.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Lazureykis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-09 00:00:00.000000000 Z
11
+ date: 2013-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.9.0.rc2
19
+ version: 0.9.0.pre12
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.9.0.rc2
26
+ version: 0.9.0.pre12
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement