CronR 0.1.3 → 0.1.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/CronR.rb +1 -3
  3. data/lib/CronR/Cron.rb +8 -5
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a1719f4f0e6a188a70f6d59b64ddbf34473b483
4
- data.tar.gz: 7d39b1d6b5ff56fce2e87f734e83044428297c40
3
+ metadata.gz: e5bf402529ecd7ebee8d859c478097caeb4c7cba
4
+ data.tar.gz: 7673acb5eff3379c352bfa2c000541b394e1199d
5
5
  SHA512:
6
- metadata.gz: eb8c9af4a9f78b3b67493eb79bb41929d8e497c1f181c96b461f811394382f6f598463b43b277f2280dcf8fa2ee920ccf36db17afbe67db27a220eb1f6dc71c9
7
- data.tar.gz: 52ab1ff535f70a486b048fba374cfc17b664b4ad74e9aead1fad4b1fb0634d08deecb919caa361aa567927505ccc98f2c1a3e7795d9b7cfddfe6a321c5a63e9c
6
+ metadata.gz: 75736376f3bd20879fbc8c850b39efb20251b9e3e364fc393e8e9960597c05e0bb8895059419296042199d1660f92250e5d0c9f162dc8272057a470aac3e0a0f
7
+ data.tar.gz: 8e3711b87137ae5d03d7c58c721bbaf341f3c2b0d3b3bfd361d4149d3d31e16b2542cba1d339267828dcb975751e9f02b848b0a92aa4f69cb9d90bd532bbf3d7
@@ -6,9 +6,7 @@
6
6
 
7
7
  module CronR
8
8
  require 'active_support'
9
- #require 'active_support/time_with_zone'
10
- #require 'active_support/values/time_zone'
11
- require 'active_support/core_ext/time/zones'
9
+ require 'active_support/core_ext/time'
12
10
 
13
11
  # Hack! - set Time::DATE_FORMATS if not there already.
14
12
  #
@@ -84,6 +84,7 @@ module CronR
84
84
 
85
85
  attr_reader :thread,:mutex,:stopped,:suspended
86
86
  attr_accessor :debug,:queue
87
+ attr_accessor :timezone
87
88
 
88
89
  # *items should consist of 0 or more items of form:
89
90
  # [job_id(string),CronJob.new(...),thing]
@@ -97,18 +98,20 @@ module CronR
97
98
  self.push(job)
98
99
  }
99
100
  @mutex = Mutex.new
101
+ @timezone = nil
100
102
  end
101
103
 
102
104
  # Get current time.
103
105
  #
104
106
  # If passed a block, the block will be used to get the time.
105
107
 
106
- def time &block
107
- if block_given? then
108
- @time = block
108
+ def time
109
+ if @timezone then
110
+ Time.use_zone(@timezone) {
111
+ Time.zone.now
112
+ }
109
113
  else
110
- @time ||= lambda{Time.now}
111
- @time.call
114
+ Time.now
112
115
  end
113
116
  end
114
117
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: CronR
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bush
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-19 00:00:00.000000000 Z
11
+ date: 2014-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport