lita-standups 1.0.4 → 1.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bce898c5814239a3c4365ee17b25a6f33d32c15
4
- data.tar.gz: ff853a3d3c7fbc949f628843544b1934b4387151
3
+ metadata.gz: f94dfdcc06a0232ad2d416d28d519b82c1feb176
4
+ data.tar.gz: 846bbb535b2bd535b7ee792f65da6bb4e1d0802e
5
5
  SHA512:
6
- metadata.gz: aa123eaf67a5604fae7b3f6453a484600c482e4f2a874069be985ada2a64d36fef046a9d2f9f528e2519af226d44cda9dd95486e9369ba88ddac1884808b9aa6
7
- data.tar.gz: e2039e7f9a092873b2f2a027b3b5c14a5081a6eb2d9932878d116332e6b8d43d89236accd903a62338da15921ee345192bd3cac1a6c9a82644b14e6a11edd3ce
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
@@ -65,6 +65,7 @@ module Lita
65
65
  end
66
66
  end
67
67
 
68
+ # :nocov:
68
69
  def jobs_info
69
70
  scheduler.jobs.map do |job|
70
71
  [
@@ -78,7 +79,6 @@ module Lita
78
79
  end
79
80
  end
80
81
 
81
- # :nocov:
82
82
  def run
83
83
  schedule_standups
84
84
  super
@@ -23,11 +23,17 @@ module Lita
23
23
  time.hour,
24
24
  "*",
25
25
  "*",
26
- (weekly? ? day_of_week_index : "*"),
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)',
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-standups'
3
- spec.version = '1.0.4'
3
+ spec.version = '1.0.5'
4
4
  spec.authors = ['Cristian Bica']
5
5
  spec.email = ['cristian.bica@gmail.com']
6
6
  spec.description = 'Lita standups'
@@ -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
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-06-30 00:00:00.000000000 Z
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.4.5.1
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: