resque-bus 0.3.3 → 0.3.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/lib/resque-bus.rb CHANGED
@@ -138,9 +138,16 @@ module ResqueBus
138
138
  original_timezone = false
139
139
  original_locale = false
140
140
 
141
- I18n.locale = attributes["bus_locale"] if defined?(I18n) && I18n.respond_to?(:locale=)
142
- Time.zone = attributes["bus_timezone"] if defined?(Time) && Time.respond_to?(:zone=)
141
+ if attributes["bus_locale"] && defined?(I18n) && I18n.respond_to?(:locale=)
142
+ original_locale = I18n.locale if I18n.respond_to?(:locale)
143
+ I18n.locale = attributes["bus_locale"]
144
+ end
143
145
 
146
+ if attributes["bus_timezone"] && defined?(Time) && Time.respond_to?(:zone=)
147
+ original_timezone = Time.zone if Time.respond_to?(:zone)
148
+ Time.zone = attributes["bus_timezone"]
149
+ end
150
+
144
151
  yield
145
152
  ensure
146
153
  I18n.locale = original_locale unless original_locale == false
@@ -1,5 +1,5 @@
1
1
  module Resque
2
2
  module Bus
3
- VERSION = "0.3.3"
3
+ VERSION = "0.3.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.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: 2013-11-11 00:00:00.000000000 Z
12
+ date: 2014-03-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: resque
@@ -233,3 +233,4 @@ test_files:
233
233
  - spec/subscriber_spec.rb
234
234
  - spec/subscription_list_spec.rb
235
235
  - spec/subscription_spec.rb
236
+ has_rdoc: