rufus-scheduler 3.1.9 → 3.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.txt +7 -0
- data/CREDITS.txt +1 -0
- data/README.md +0 -1
- data/lib/rufus/scheduler.rb +2 -2
- data/lib/rufus/scheduler/cronline.rb +8 -8
- data/lib/rufus/scheduler/jobs.rb +18 -11
- data/lib/rufus/scheduler/util.rb +6 -8
- data/lib/rufus/scheduler/zotime.rb +1 -1
- data/rufus-scheduler.gemspec +1 -1
- metadata +20 -45
- data/spec/basics_spec.rb +0 -54
- data/spec/cronline_spec.rb +0 -1113
- data/spec/error_spec.rb +0 -139
- data/spec/job_array_spec.rb +0 -39
- data/spec/job_at_spec.rb +0 -58
- data/spec/job_cron_spec.rb +0 -128
- data/spec/job_every_spec.rb +0 -104
- data/spec/job_in_spec.rb +0 -20
- data/spec/job_interval_spec.rb +0 -68
- data/spec/job_repeat_spec.rb +0 -357
- data/spec/job_spec.rb +0 -671
- data/spec/lock_custom_spec.rb +0 -47
- data/spec/lock_flock_spec.rb +0 -47
- data/spec/lock_lockfile_spec.rb +0 -61
- data/spec/lock_spec.rb +0 -59
- data/spec/parse_spec.rb +0 -263
- data/spec/schedule_at_spec.rb +0 -158
- data/spec/schedule_cron_spec.rb +0 -66
- data/spec/schedule_every_spec.rb +0 -109
- data/spec/schedule_in_spec.rb +0 -80
- data/spec/schedule_interval_spec.rb +0 -128
- data/spec/scheduler_spec.rb +0 -1067
- data/spec/spec_helper.rb +0 -128
- data/spec/threads_spec.rb +0 -96
- data/spec/zotime_spec.rb +0 -391
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b6294bd5d0ba45b0ae97cd681c4a915d3f4f15d
|
4
|
+
data.tar.gz: 1670414782d681e46791acd641524cde44aa8063
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 769cdd5e8e86acb0f4a7dfac068710a0cc12210604604cd7423ea896b9ce2bd68b4f7bd16932c9122577d1121ebc05db7e15af76403e63ff404a60e35d6c96f6
|
7
|
+
data.tar.gz: cf3b2a402f6bad0411cdba7e9ce8a62021de7cd90bbfb4db321cd3b11b19af28dee9a87c3d1d481957f73a766cd84200a4eaccceb804365003f276876fb798b9
|
data/CHANGELOG.txt
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
= rufus-scheduler CHANGELOG.txt
|
3
3
|
|
4
4
|
|
5
|
+
== rufus-scheduler - 3.1.10 released 2015-11-18
|
6
|
+
|
7
|
+
- allow for :first_in => 0, gh-179 by https://github.com/JonMcPherson
|
8
|
+
for https://github.com/Shopify/dashing/commit/ea3730fa4
|
9
|
+
- stop shipping specs in gem
|
10
|
+
|
11
|
+
|
5
12
|
== rufus-scheduler - 3.1.9 released 2015-11-12
|
6
13
|
|
7
14
|
- fix potential RuntimeError in CronLine#prev_second,
|
data/CREDITS.txt
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
== Contributors
|
6
6
|
|
7
|
+
- Jon McPherson (https://github.com/JonMcPherson) :first_in => 0 back
|
7
8
|
- Calinoiu Alexandru Nicolae (https://github.com/alexandru-calinoiu) CronLine#prev_second fix
|
8
9
|
- Alyssa Pohahau (https://github.com/alyssa) out of DST transition specs
|
9
10
|
- Claude Vessaz (https://github.com/claudeatsafe) ack #unscheduled_at in #scheduled?
|
data/README.md
CHANGED
@@ -123,7 +123,6 @@ Yes, issues can be reported in [rufus-scheduler issues](https://github.com/jmett
|
|
123
123
|
* [I want a refund](http://blog.nodejitsu.com/getting-refunds-on-open-source-projects)
|
124
124
|
* [Passenger and rufus-scheduler](http://stackoverflow.com/questions/18108719/debugging-rufus-scheduler/18156180#18156180)
|
125
125
|
* [Passenger and rufus-scheduler (2)](http://stackoverflow.com/questions/21861387/rufus-cron-job-not-working-in-apache-passenger#answer-21868555)
|
126
|
-
* [Unicorn and rufus-scheduler](https://jkraemer.net/running-rufus-scheduler-in-a-unicorn-rails-app)
|
127
126
|
|
128
127
|
|
129
128
|
## scheduling
|
data/lib/rufus/scheduler.rb
CHANGED
@@ -39,7 +39,7 @@ module Rufus
|
|
39
39
|
require 'rufus/scheduler/job_array'
|
40
40
|
require 'rufus/scheduler/locks'
|
41
41
|
|
42
|
-
VERSION = '3.1.
|
42
|
+
VERSION = '3.1.10'
|
43
43
|
|
44
44
|
#
|
45
45
|
# A common error class for rufus-scheduler
|
@@ -629,7 +629,7 @@ module Rufus
|
|
629
629
|
|
630
630
|
job = job_class.new(self, t, opts, block || callable)
|
631
631
|
|
632
|
-
|
632
|
+
fail ArgumentError.new(
|
633
633
|
"job frequency (#{job.frequency}) is higher than " +
|
634
634
|
"scheduler frequency (#{@frequency})"
|
635
635
|
) if job.respond_to?(:frequency) && job.frequency < @frequency
|
@@ -48,7 +48,7 @@ class Rufus::Scheduler
|
|
48
48
|
|
49
49
|
def initialize(line)
|
50
50
|
|
51
|
-
|
51
|
+
fail ArgumentError.new(
|
52
52
|
"not a string: #{line.inspect}"
|
53
53
|
) unless line.is_a?(String)
|
54
54
|
|
@@ -58,7 +58,7 @@ class Rufus::Scheduler
|
|
58
58
|
|
59
59
|
@timezone = items.pop if ZoTime.is_timezone?(items.last)
|
60
60
|
|
61
|
-
|
61
|
+
fail ArgumentError.new(
|
62
62
|
"not a valid cronline : '#{line}'"
|
63
63
|
) unless items.length == 5 or items.length == 6
|
64
64
|
|
@@ -73,7 +73,7 @@ class Rufus::Scheduler
|
|
73
73
|
|
74
74
|
[ @seconds, @minutes, @hours, @months ].each do |es|
|
75
75
|
|
76
|
-
|
76
|
+
fail ArgumentError.new(
|
77
77
|
"invalid cronline: '#{line}'"
|
78
78
|
) if es && es.find { |e| ! e.is_a?(Fixnum) }
|
79
79
|
end
|
@@ -327,7 +327,7 @@ class Rufus::Scheduler
|
|
327
327
|
|
328
328
|
if m = it.match(/^(.+)#(l|-?[12345])$/)
|
329
329
|
|
330
|
-
|
330
|
+
fail ArgumentError.new(
|
331
331
|
"ranges are not supported for monthdays (#{it})"
|
332
332
|
) if m[1].index('-')
|
333
333
|
|
@@ -340,7 +340,7 @@ class Rufus::Scheduler
|
|
340
340
|
expr = it.dup
|
341
341
|
WEEKDAYS.each_with_index { |a, i| expr.gsub!(/#{a}/, i.to_s) }
|
342
342
|
|
343
|
-
|
343
|
+
fail ArgumentError.new(
|
344
344
|
"invalid weekday expression (#{it})"
|
345
345
|
) if expr !~ /^0*[0-7](-0*[0-7])?$/
|
346
346
|
|
@@ -362,7 +362,7 @@ class Rufus::Scheduler
|
|
362
362
|
|
363
363
|
r = item.split(',').map { |i| parse_range(i.strip, min, max) }.flatten
|
364
364
|
|
365
|
-
|
365
|
+
fail ArgumentError.new(
|
366
366
|
"found duplicates in #{item.inspect}"
|
367
367
|
) if r.uniq.size < r.size
|
368
368
|
|
@@ -381,7 +381,7 @@ class Rufus::Scheduler
|
|
381
381
|
|
382
382
|
m = item.match(RANGE_REGEX)
|
383
383
|
|
384
|
-
|
384
|
+
fail ArgumentError.new(
|
385
385
|
"cannot parse #{item.inspect}"
|
386
386
|
) unless m
|
387
387
|
|
@@ -395,7 +395,7 @@ class Rufus::Scheduler
|
|
395
395
|
inc = m[3]
|
396
396
|
inc = inc ? inc.to_i : 1
|
397
397
|
|
398
|
-
|
398
|
+
fail ArgumentError.new(
|
399
399
|
"#{item.inspect} is not in range #{min}..#{max}"
|
400
400
|
) if sta < min || edn > max
|
401
401
|
|
data/lib/rufus/scheduler/jobs.rb
CHANGED
@@ -91,7 +91,7 @@ module Rufus
|
|
91
91
|
|
92
92
|
@id = determine_id
|
93
93
|
|
94
|
-
|
94
|
+
fail(
|
95
95
|
ArgumentError,
|
96
96
|
'missing block or callable to schedule',
|
97
97
|
caller[2..-1]
|
@@ -235,7 +235,7 @@ module Rufus
|
|
235
235
|
|
236
236
|
rescue StandardError => se
|
237
237
|
|
238
|
-
|
238
|
+
fail se unless do_rescue
|
239
239
|
|
240
240
|
return if se.is_a?(KillSignal) # discard
|
241
241
|
|
@@ -402,7 +402,7 @@ module Rufus
|
|
402
402
|
|
403
403
|
@times = opts[:times]
|
404
404
|
|
405
|
-
|
405
|
+
fail ArgumentError.new(
|
406
406
|
"cannot accept :times => #{@times.inspect}, not nil or an int"
|
407
407
|
) unless @times == nil || @times.is_a?(Fixnum)
|
408
408
|
|
@@ -416,27 +416,34 @@ module Rufus
|
|
416
416
|
|
417
417
|
def first_at=(first)
|
418
418
|
|
419
|
-
return @first_at = nil if first == nil
|
419
|
+
return (@first_at = nil) if first == nil
|
420
420
|
|
421
|
-
|
422
|
-
|
421
|
+
n0 = Time.now
|
422
|
+
n1 = n0 + 0.003
|
423
|
+
|
424
|
+
first = n0 if first == :now || first == :immediately || first == 0
|
423
425
|
|
424
426
|
@first_at = Rufus::Scheduler.parse_to_time(first)
|
427
|
+
@first_at = n1 if @first_at >= n0 && @first_at < n1
|
425
428
|
|
426
|
-
|
429
|
+
fail ArgumentError.new(
|
427
430
|
"cannot set first[_at|_in] in the past: " +
|
428
431
|
"#{first.inspect} -> #{@first_at.inspect}"
|
429
|
-
) if
|
432
|
+
) if @first_at < n0
|
433
|
+
|
434
|
+
@first_at
|
430
435
|
end
|
431
436
|
|
432
437
|
def last_at=(last)
|
433
438
|
|
434
439
|
@last_at = last ? Rufus::Scheduler.parse_to_time(last) : nil
|
435
440
|
|
436
|
-
|
441
|
+
fail ArgumentError.new(
|
437
442
|
"cannot set last[_at|_in] in the past: " +
|
438
443
|
"#{last.inspect} -> #{@last_at.inspect}"
|
439
444
|
) if last && @last_at < Time.now
|
445
|
+
|
446
|
+
@last_at
|
440
447
|
end
|
441
448
|
|
442
449
|
def trigger(time)
|
@@ -522,7 +529,7 @@ module Rufus
|
|
522
529
|
|
523
530
|
@frequency = Rufus::Scheduler.parse_in(@original)
|
524
531
|
|
525
|
-
|
532
|
+
fail ArgumentError.new(
|
526
533
|
"cannot schedule #{self.class} with a frequency " +
|
527
534
|
"of #{@frequency.inspect} (#{@original.inspect})"
|
528
535
|
) if @frequency <= 0
|
@@ -560,7 +567,7 @@ module Rufus
|
|
560
567
|
|
561
568
|
@interval = Rufus::Scheduler.parse_in(@original)
|
562
569
|
|
563
|
-
|
570
|
+
fail ArgumentError.new(
|
564
571
|
"cannot schedule #{self.class} with an interval " +
|
565
572
|
"of #{@interval.inspect} (#{@original.inspect})"
|
566
573
|
) if @interval <= 0
|
data/lib/rufus/scheduler/util.rb
CHANGED
@@ -38,7 +38,7 @@ module Rufus
|
|
38
38
|
parse_cron(o, opts) ||
|
39
39
|
parse_in(o, opts) || # covers 'every' schedule strings
|
40
40
|
parse_at(o, opts) ||
|
41
|
-
|
41
|
+
fail(ArgumentError.new("couldn't parse \"#{o}\""))
|
42
42
|
end
|
43
43
|
|
44
44
|
def self.parse_in(o, opts={})
|
@@ -53,7 +53,7 @@ module Rufus
|
|
53
53
|
rescue StandardError => se
|
54
54
|
|
55
55
|
return nil if opts[:no_error]
|
56
|
-
|
56
|
+
fail se
|
57
57
|
end
|
58
58
|
|
59
59
|
def self.parse_cron(o, opts)
|
@@ -63,7 +63,7 @@ module Rufus
|
|
63
63
|
rescue ArgumentError => ae
|
64
64
|
|
65
65
|
return nil if opts[:no_error]
|
66
|
-
|
66
|
+
fail ae
|
67
67
|
end
|
68
68
|
|
69
69
|
def self.parse_to_time(o)
|
@@ -72,7 +72,7 @@ module Rufus
|
|
72
72
|
t = parse(t) if t.is_a?(String)
|
73
73
|
t = Time.now + t if t.is_a?(Numeric)
|
74
74
|
|
75
|
-
|
75
|
+
fail ArgumentError.new(
|
76
76
|
"cannot turn #{o.inspect} to a point in time, doesn't make sense"
|
77
77
|
) unless t.is_a?(Time)
|
78
78
|
|
@@ -132,7 +132,7 @@ module Rufus
|
|
132
132
|
m = string.match(/^(-?)([\d\.#{DURATION_LETTERS}]+)$/)
|
133
133
|
|
134
134
|
return nil if m.nil? && opts[:no_error]
|
135
|
-
|
135
|
+
fail ArgumentError.new("cannot parse '#{string}'") if m.nil?
|
136
136
|
|
137
137
|
mod = m[1] == '-' ? -1.0 : 1.0
|
138
138
|
val = 0.0
|
@@ -150,9 +150,7 @@ module Rufus
|
|
150
150
|
elsif opts[:no_error]
|
151
151
|
return nil
|
152
152
|
else
|
153
|
-
|
154
|
-
"cannot parse '#{string}' (especially '#{s}')"
|
155
|
-
)
|
153
|
+
fail ArgumentError.new("cannot parse '#{string}' (especially '#{s}')")
|
156
154
|
end
|
157
155
|
break unless m && m[3]
|
158
156
|
s = m[3]
|
data/rufus-scheduler.gemspec
CHANGED
@@ -22,7 +22,7 @@ job scheduler for Ruby (at, cron, in and every jobs).
|
|
22
22
|
#s.files = `git ls-files`.split("\n")
|
23
23
|
s.files = Dir[
|
24
24
|
'Rakefile',
|
25
|
-
'lib/**/*.rb', 'spec/**/*.rb', 'test/**/*.rb',
|
25
|
+
'lib/**/*.rb', #'spec/**/*.rb', 'test/**/*.rb',
|
26
26
|
'*.gemspec', '*.txt', '*.rdoc', '*.md'
|
27
27
|
]
|
28
28
|
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rufus-scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Mettraux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.13.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.13.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: chronic
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: tzinfo
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: job scheduler for Ruby (at, cron, in and every jobs).
|
@@ -73,14 +73,7 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- CHANGELOG.txt
|
77
|
-
- CREDITS.txt
|
78
|
-
- LICENSE.txt
|
79
|
-
- README.md
|
80
76
|
- Rakefile
|
81
|
-
- TODO.txt
|
82
|
-
- lib/rufus-scheduler.rb
|
83
|
-
- lib/rufus/scheduler.rb
|
84
77
|
- lib/rufus/scheduler/cronline.rb
|
85
78
|
- lib/rufus/scheduler/job_array.rb
|
86
79
|
- lib/rufus/scheduler/jobs.rb
|
@@ -88,33 +81,15 @@ files:
|
|
88
81
|
- lib/rufus/scheduler/util.rb
|
89
82
|
- lib/rufus/scheduler/zones.rb
|
90
83
|
- lib/rufus/scheduler/zotime.rb
|
84
|
+
- lib/rufus/scheduler.rb
|
85
|
+
- lib/rufus-scheduler.rb
|
91
86
|
- rufus-scheduler.gemspec
|
92
|
-
-
|
93
|
-
-
|
94
|
-
-
|
95
|
-
- spec/job_array_spec.rb
|
96
|
-
- spec/job_at_spec.rb
|
97
|
-
- spec/job_cron_spec.rb
|
98
|
-
- spec/job_every_spec.rb
|
99
|
-
- spec/job_in_spec.rb
|
100
|
-
- spec/job_interval_spec.rb
|
101
|
-
- spec/job_repeat_spec.rb
|
102
|
-
- spec/job_spec.rb
|
103
|
-
- spec/lock_custom_spec.rb
|
104
|
-
- spec/lock_flock_spec.rb
|
105
|
-
- spec/lock_lockfile_spec.rb
|
106
|
-
- spec/lock_spec.rb
|
107
|
-
- spec/parse_spec.rb
|
108
|
-
- spec/schedule_at_spec.rb
|
109
|
-
- spec/schedule_cron_spec.rb
|
110
|
-
- spec/schedule_every_spec.rb
|
111
|
-
- spec/schedule_in_spec.rb
|
112
|
-
- spec/schedule_interval_spec.rb
|
113
|
-
- spec/scheduler_spec.rb
|
114
|
-
- spec/spec_helper.rb
|
115
|
-
- spec/threads_spec.rb
|
116
|
-
- spec/zotime_spec.rb
|
87
|
+
- CHANGELOG.txt
|
88
|
+
- CREDITS.txt
|
89
|
+
- LICENSE.txt
|
117
90
|
- t.txt
|
91
|
+
- TODO.txt
|
92
|
+
- README.md
|
118
93
|
homepage: http://github.com/jmettraux/rufus-scheduler
|
119
94
|
licenses:
|
120
95
|
- MIT
|
@@ -125,17 +100,17 @@ require_paths:
|
|
125
100
|
- lib
|
126
101
|
required_ruby_version: !ruby/object:Gem::Requirement
|
127
102
|
requirements:
|
128
|
-
- -
|
103
|
+
- - '>='
|
129
104
|
- !ruby/object:Gem::Version
|
130
105
|
version: '0'
|
131
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
107
|
requirements:
|
133
|
-
- -
|
108
|
+
- - '>='
|
134
109
|
- !ruby/object:Gem::Version
|
135
110
|
version: '0'
|
136
111
|
requirements: []
|
137
112
|
rubyforge_project: rufus
|
138
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.0.14
|
139
114
|
signing_key:
|
140
115
|
specification_version: 4
|
141
116
|
summary: job scheduler for Ruby (at, cron, in and every jobs)
|
data/spec/basics_spec.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
# Specifying rufus-scheduler
|
4
|
-
#
|
5
|
-
# Sun Jun 1 05:52:24 JST 2014
|
6
|
-
#
|
7
|
-
|
8
|
-
require 'spec_helper'
|
9
|
-
|
10
|
-
|
11
|
-
describe 'basics' do
|
12
|
-
|
13
|
-
def tts(time)
|
14
|
-
|
15
|
-
time.strftime('%Y-%m-%d %H:%M:%S %z') + (time.dst? ? ' dst' : '')
|
16
|
-
end
|
17
|
-
|
18
|
-
describe 'Time.new' do
|
19
|
-
|
20
|
-
it 'accepts a timezone final argument' do
|
21
|
-
|
22
|
-
if jruby? or ruby18?
|
23
|
-
|
24
|
-
expect(true).to be(true)
|
25
|
-
|
26
|
-
else
|
27
|
-
|
28
|
-
expect(
|
29
|
-
tts(Time.new(2014, 1, 1, 1, 0, 0, '+01:00'))
|
30
|
-
).to eq('2014-01-01 01:00:00 +0100')
|
31
|
-
expect(
|
32
|
-
tts(Time.new(2014, 8, 1, 1, 0, 0, '+01:00'))
|
33
|
-
).to eq('2014-08-01 01:00:00 +0100')
|
34
|
-
expect(
|
35
|
-
tts(Time.new(2014, 8, 1, 1, 0, 0, '+01:00'))
|
36
|
-
).to eq('2014-08-01 01:00:00 +0100')
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe 'Time.local' do
|
42
|
-
|
43
|
-
it 'works as expected' do
|
44
|
-
|
45
|
-
expect(
|
46
|
-
tts(in_zone('Europe/Berlin') { Time.local(2014, 1, 1, 1, 0, 0) })
|
47
|
-
).to eq('2014-01-01 01:00:00 +0100')
|
48
|
-
expect(
|
49
|
-
tts(in_zone('Europe/Berlin') { Time.local(2014, 8, 1, 1, 0, 0) })
|
50
|
-
).to eq('2014-08-01 01:00:00 +0200 dst')
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|