resque-kawai 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,6 +2,7 @@ Resque Kawai
2
2
  ============
3
3
 
4
4
  Syntax sugar for Resque consumers. Each consumer is a class, with clean interface, and custom logger.
5
+ Usefull when count of different events ~100 and more.
5
6
 
6
7
  ``` ruby
7
8
  gem 'resque-kawai'
data/lib/rq_queue.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
- require 'active_support/inflector'
2
+ require 'active_support'
3
+ require 'active_support/inflector' unless ''.respond_to?(:underscore)
3
4
  require 'resque'
4
5
  require 'logger'
5
6
 
@@ -27,6 +28,8 @@ class RqQueue
27
28
  def self.logger
28
29
  @logger ||= Logger.new(logger_path).tap do |logger|
29
30
  logger.formatter = lambda { |s, d, p, m| "#{d.strftime("%d.%m.%Y %H:%M:%S")} #{m}\n" }
31
+ Rails.logger = logger if defined?(Rails)
32
+ ActiveRecord::Base.logger = logger if defined?(ActiveRecord)
30
33
  end
31
34
  end
32
35
 
@@ -42,7 +45,7 @@ class RqQueue
42
45
  logger.info "done #{method_name}, #{"%.6f" % (Time.now - start_time)} s" if benchmark
43
46
 
44
47
  rescue => ex
45
- logger.error "Failed event: #{ex.message}"
48
+ logger.error "!Failed event: #{method_name} => #{ex.message}"
46
49
  raise ex
47
50
  end
48
51
 
data/lib/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  module Rq
3
- VERSION = "0.1"
3
+ VERSION = "0.1.1"
4
4
  end
data/resque-kawai.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
8
8
  s.authors = ["Makarchev Konstantin"]
9
9
  s.autorequire = %q{resque-kawai.rb}
10
10
 
11
- s.description = %q{Syntax sugar for Resque consumers. Each consumer is a class, with clean interface, and custom logger.}
12
- s.summary = %q{Syntax sugar for Resque consumers. Each consumer is a class, with clean interface, and custom logger.}
11
+ s.description = %q{Syntax sugar for Resque consumers. Each consumer is a class, with clean interface, and custom logger. Usefull when count of different events ~100 and more.}
12
+ s.summary = %q{Syntax sugar for Resque consumers. Each consumer is a class, with clean interface, and custom logger. Usefull when count of different events ~100 and more.}
13
13
 
14
14
  s.email = %q{kostya27@gmail.com}
15
15
  s.homepage = %q{http://github.com/kostya/resque-kawai}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-kawai
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire: resque-kawai.rb
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-21 00:00:00.000000000 Z
12
+ date: 2012-04-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &75846280 !ruby/object:Gem::Requirement
16
+ requirement: &73689890 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *75846280
24
+ version_requirements: *73689890
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: resque
27
- requirement: &75846060 !ruby/object:Gem::Requirement
27
+ requirement: &73689670 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *75846060
35
+ version_requirements: *73689670
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &75845850 !ruby/object:Gem::Requirement
38
+ requirement: &73689460 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,9 +43,9 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *75845850
46
+ version_requirements: *73689460
47
47
  description: Syntax sugar for Resque consumers. Each consumer is a class, with clean
48
- interface, and custom logger.
48
+ interface, and custom logger. Usefull when count of different events ~100 and more.
49
49
  email: kostya27@gmail.com
50
50
  executables: []
51
51
  extensions: []
@@ -90,5 +90,5 @@ rubygems_version: 1.8.16
90
90
  signing_key:
91
91
  specification_version: 3
92
92
  summary: Syntax sugar for Resque consumers. Each consumer is a class, with clean interface,
93
- and custom logger.
93
+ and custom logger. Usefull when count of different events ~100 and more.
94
94
  test_files: []