lita-standups 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/standups.rb +2 -0
- data/lib/lita/standups/mixins/robot.rb +1 -1
- data/lib/lita/standups/models/standup_schedule.rb +15 -1
- data/lib/lita/standups/wizards/schedule_standup.rb +2 -2
- data/lita-standups.gemspec +1 -1
- data/spec/lita/standups/models/standup_schedule_spec.rb +7 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f94dfdcc06a0232ad2d416d28d519b82c1feb176
|
4
|
+
data.tar.gz: 846bbb535b2bd535b7ee792f65da6bb4e1d0802e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81985b2dc5f53b90f0c7706ea127856f42f66164bc1a14a0059f4624f5adc0c59dd2772039169e6dff0dd98613782d42daea5a858094b9f1dcb1fb43e592c336
|
7
|
+
data.tar.gz: 5520729553bbed89e8d3dd04363eef41fcdfc61c1e190417cff37e0058ff29ed123a1dc60d43c6ab80fe4d10be8e1877e02d77c88720169b606200bc98a79603
|
@@ -152,6 +152,7 @@ module Lita
|
|
152
152
|
Lita::Standups.const_defined?(name) ? Lita::Standups.const_get(name) : super
|
153
153
|
end
|
154
154
|
|
155
|
+
# :nocov:
|
155
156
|
def debug_standups(request)
|
156
157
|
request.reply "*Standups*"
|
157
158
|
Models::Standup.all.each do |standup|
|
@@ -170,6 +171,7 @@ module Lita
|
|
170
171
|
|
171
172
|
request.reply "*Server time*: #{Time.now}"
|
172
173
|
end
|
174
|
+
# :nocov:
|
173
175
|
|
174
176
|
Lita.register_handler(self)
|
175
177
|
end
|
@@ -23,11 +23,17 @@ module Lita
|
|
23
23
|
time.hour,
|
24
24
|
"*",
|
25
25
|
"*",
|
26
|
-
|
26
|
+
cron_line_week,
|
27
27
|
"UTC"
|
28
28
|
].join(" ")
|
29
29
|
end
|
30
30
|
|
31
|
+
def cron_line_week
|
32
|
+
return "*" if daily?
|
33
|
+
return "1,2,3,4,5" if workdays?
|
34
|
+
return day_of_week_index if weekly?
|
35
|
+
end
|
36
|
+
|
31
37
|
def day_of_week_index
|
32
38
|
%w(sunday monday tuesday wednesday thursday friday saturday).index(day_of_week)
|
33
39
|
end
|
@@ -47,10 +53,18 @@ module Lita
|
|
47
53
|
].join("\n")
|
48
54
|
end
|
49
55
|
|
56
|
+
def daily?
|
57
|
+
repeat == "daily"
|
58
|
+
end
|
59
|
+
|
50
60
|
def weekly?
|
51
61
|
repeat == "weekly"
|
52
62
|
end
|
53
63
|
|
64
|
+
def workdays?
|
65
|
+
repeat == "workdays"
|
66
|
+
end
|
67
|
+
|
54
68
|
end
|
55
69
|
end
|
56
70
|
end
|
@@ -4,8 +4,8 @@ module Lita
|
|
4
4
|
class ScheduleStandup < Lita::Wizard
|
5
5
|
|
6
6
|
step :repeat,
|
7
|
-
label: 'How often? (daily, weekly)',
|
8
|
-
options: %w(daily weekly)
|
7
|
+
label: 'How often? (daily, weekly, workdays)',
|
8
|
+
options: %w(daily weekly workdays)
|
9
9
|
|
10
10
|
step :day_of_week,
|
11
11
|
label: 'What day of week? (monday ... sunday)',
|
data/lita-standups.gemspec
CHANGED
@@ -15,13 +15,18 @@ describe Lita::Standups::Models::StandupSchedule do
|
|
15
15
|
subject { described_class[1] }
|
16
16
|
|
17
17
|
it "should generate a cron line for a daily schedule" do
|
18
|
-
expect(subject.cron_line).to eq("0 9 * * *")
|
18
|
+
expect(subject.cron_line).to eq("0 9 * * * UTC")
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should generate a cron line for a weekly schedule" do
|
22
22
|
subject.repeat = "weekly"
|
23
23
|
subject.day_of_week = "tuesday"
|
24
|
-
expect(subject.cron_line).to eq("0 9 * * 2")
|
24
|
+
expect(subject.cron_line).to eq("0 9 * * 2 UTC")
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should generate a cron line for a workdays schedule" do
|
28
|
+
subject.repeat = "workdays"
|
29
|
+
expect(subject.cron_line).to eq("0 9 * * 1,2,3,4,5 UTC")
|
25
30
|
end
|
26
31
|
|
27
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-standups
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cristian Bica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -295,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
295
295
|
version: '0'
|
296
296
|
requirements: []
|
297
297
|
rubyforge_project:
|
298
|
-
rubygems_version: 2.
|
298
|
+
rubygems_version: 2.5.1
|
299
299
|
signing_key:
|
300
300
|
specification_version: 4
|
301
301
|
summary: Lita standups
|
@@ -307,4 +307,3 @@ test_files:
|
|
307
307
|
- spec/lita/standups/models/standup_schedule_spec.rb
|
308
308
|
- spec/spec_helper.rb
|
309
309
|
- spec/support/fixtures.rb
|
310
|
-
has_rdoc:
|