background_lite 0.4 → 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.
Files changed (2) hide show
  1. data/lib/background_lite/background.rb +6 -4
  2. metadata +35 -6
@@ -1,6 +1,8 @@
1
1
  require 'digest/sha1'
2
2
  require 'logger'
3
3
  require 'benchmark'
4
+ require 'active_support/core_ext/class/attribute_accessors'
5
+ require 'active_support/core_ext/module/attribute_accessors'
4
6
 
5
7
  # This module holds methods for background handling
6
8
  module BackgroundLite
@@ -27,13 +29,13 @@ module BackgroundLite
27
29
  cattr_accessor :slow_threshold
28
30
 
29
31
  def self.config #:nodoc:
30
- @config ||= YAML.load(File.read("#{Rails.root}/config/background.yml")) rescue { RAILS_ENV => {} }
32
+ @config ||= YAML.load(File.read("#{Rails.root}/config/background.yml")) rescue { Rails.env => {} }
31
33
  end
32
34
 
33
35
  def self.default_config #:nodoc:
34
36
  @default_config ||= begin
35
- if config[RAILS_ENV]
36
- (config[RAILS_ENV]['default'] || config['default'] || {})
37
+ if config[Rails.env]
38
+ (config[Rails.env]['default'] || config['default'] || {})
37
39
  else
38
40
  (config['default'] || {})
39
41
  end
@@ -55,7 +57,7 @@ module BackgroundLite
55
57
  if configuration.blank?
56
58
  default_config
57
59
  else
58
- loaded_config = ((config[RAILS_ENV] || {})[configuration] || {})
60
+ loaded_config = ((config[Rails.env] || {})[configuration] || {})
59
61
  default_config.merge(loaded_config.symbolize_keys || {})
60
62
  end
61
63
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: background_lite
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 4
9
- version: "0.4"
8
+ - 5
9
+ version: "0.5"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Thomas Kadauke
@@ -14,10 +14,39 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2013-01-30 00:00:00 +01:00
17
+ date: 2013-12-17 00:00:00 +01:00
18
18
  default_executable:
19
- dependencies: []
20
-
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: activesupport
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 2
31
+ - 3
32
+ - 0
33
+ version: 2.3.0
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: gemmer
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 0
47
+ version: "0"
48
+ type: :development
49
+ version_requirements: *id002
21
50
  description:
22
51
  email: thomas.kadauke@googlemail.com
23
52
  executables: