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.
- checksums.yaml +4 -4
- data/lib/CronR.rb +1 -3
- data/lib/CronR/Cron.rb +8 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5bf402529ecd7ebee8d859c478097caeb4c7cba
|
4
|
+
data.tar.gz: 7673acb5eff3379c352bfa2c000541b394e1199d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75736376f3bd20879fbc8c850b39efb20251b9e3e364fc393e8e9960597c05e0bb8895059419296042199d1660f92250e5d0c9f162dc8272057a470aac3e0a0f
|
7
|
+
data.tar.gz: 8e3711b87137ae5d03d7c58c721bbaf341f3c2b0d3b3bfd361d4149d3d31e16b2542cba1d339267828dcb975751e9f02b848b0a92aa4f69cb9d90bd532bbf3d7
|
data/lib/CronR.rb
CHANGED
@@ -6,9 +6,7 @@
|
|
6
6
|
|
7
7
|
module CronR
|
8
8
|
require 'active_support'
|
9
|
-
|
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
|
#
|
data/lib/CronR/Cron.rb
CHANGED
@@ -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
|
107
|
-
if
|
108
|
-
@
|
108
|
+
def time
|
109
|
+
if @timezone then
|
110
|
+
Time.use_zone(@timezone) {
|
111
|
+
Time.zone.now
|
112
|
+
}
|
109
113
|
else
|
110
|
-
|
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.
|
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-
|
11
|
+
date: 2014-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|