resqovery 0.0.4 → 0.0.5

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/lib/resqovery.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'resqovery/railtie'
1
+ require 'resqovery/railtie' if defined?(Rails)
2
2
 
3
3
  module Resque
4
4
 
@@ -1,14 +1,23 @@
1
1
  require 'resqovery'
2
2
 
3
3
  module Resqovery
4
-
5
- class << self; attr_accessor :defaults; end
4
+
5
+ class << self
6
+ attr_accessor :defaults;
6
7
 
7
- class Railtie < Rails::Railtie
8
- initializer 'resqovery.configure' do |app|
9
- Resqovery.defaults = { :model_name => 'ResqueJob' }
10
- if app.config.respond_to?(:resqovery_defaults)
11
- Resqovery.defaults.merge!(app.config.resqovery_defaults)
8
+ def configure
9
+ yield(defaults)
10
+ end
11
+
12
+ end
13
+ Resqovery.defaults = { :model_name => 'ResqueJob' }
14
+
15
+ if Rails.version =~ /^3\./
16
+ class Railtie < Rails::Railtie
17
+ initializer 'resqovery.configure' do |app|
18
+ if app.config.respond_to?(:resqovery_defaults)
19
+ Resqovery.defaults.merge!(app.config.resqovery_defaults)
20
+ end
12
21
  end
13
22
  end
14
23
  end
@@ -1,3 +1,3 @@
1
1
  module Resqovery
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resqovery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
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-12-07 00:00:00.000000000 Z
12
+ date: 2012-12-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails