lita-standups 1.0.2 → 1.0.3

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: 0c6fb95c83938f29cf9d4a66cd0de5d358c326fd
4
- data.tar.gz: 6e782535b601fd6c64975ad03ed71f1f7ee99e37
3
+ metadata.gz: 9150d72ab74a0bd9956df37c29028e6d506aa89a
4
+ data.tar.gz: c014370721a2908ef58d345e1ddc65f03e9df005
5
5
  SHA512:
6
- metadata.gz: b916ab7c0626b48c9c72659588c69f905d5e4f5bbe6a6a5367250b2b072b3951d3ab834ea3e12b8f851a9113ff19f59c10445594f10b54975b28c7b8914ba9c6
7
- data.tar.gz: c57430753b2cce21b4f5a67150f86a164a69cac87e6448a819370e7ae7928ed6d3bca2369aec69616165bded7c2d9261dbf874d3672c8c0b0651e629cb5ced6e
6
+ metadata.gz: fecd14554ccd128b44d5fdd385ef57dd8c1555e3eea5c5c33f3a5995437454c8062da4d0697c871ff4e7304f2ffae9f558aa34ebfe97c64bb94adbd1f206f874
7
+ data.tar.gz: 4671f26d54cb3b3292fb9cf448eb843cbf0c5ce7bb09245befe18f851bdabb8e2901a7ce54bfce23a199dea8312d156fafd57227d090a3b500ff4addd20ba854
@@ -2,6 +2,9 @@ module Lita
2
2
  module Handlers
3
3
  class Standups < Handler
4
4
 
5
+ route(/^debug standups$/, :debug_standups,
6
+ command: true)
7
+
5
8
  route(/^list standups$/, :list_standups,
6
9
  command: true,
7
10
  help: { 'list standups' => 'list configured standups' })
@@ -149,6 +152,25 @@ module Lita
149
152
  Lita::Standups.const_defined?(name) ? Lita::Standups.const_get(name) : super
150
153
  end
151
154
 
155
+ def debug_standups(request)
156
+ request.reply "*Standups*"
157
+ Models::Standup.all.each do |standup|
158
+ request.reply ">>> \n" + standup.description
159
+ request.reply "```\n#{standup.inspect}\n```"
160
+ end
161
+
162
+ request.reply "*Scheduled Standups*"
163
+ Models::StandupSchedule.all.each do |schedule|
164
+ request.reply ">>> \n" + schedule.description
165
+ request.reply "```\n#{schedule.inspect}\n```"
166
+ end
167
+
168
+ request.reply "*Rufus Schedule*"
169
+ request.reply robot.jobs_info.map{|j| "```\n" + j.join("\n") + "\n```" }.join("\n\n")
170
+
171
+ request.reply "*Server time*: #{Time.now}"
172
+ end
173
+
152
174
  Lita.register_handler(self)
153
175
  end
154
176
  end
@@ -65,6 +65,19 @@ module Lita
65
65
  end
66
66
  end
67
67
 
68
+ def jobs_info
69
+ scheduler.jobs.map do |job|
70
+ [
71
+ "Type: #{job.class}",
72
+ "ID: #{job.job_id}",
73
+ "Tags: #{job.tags.join(', ')}",
74
+ ("Options: #{job.opts.except(:tags).inspect}" if job.opts.except(:tags).size > 0),
75
+ "Next Run: #{job.next_time} (#{job.next_time - Time.now} seconds from now)",
76
+ "Schedule: #{job.try(:original)}"
77
+ ].compact
78
+ end
79
+ end
80
+
68
81
  # :nocov:
69
82
  def run
70
83
  schedule_standups
@@ -23,7 +23,8 @@ module Lita
23
23
  time.hour,
24
24
  "*",
25
25
  "*",
26
- (weekly? ? day_of_week_index : "*")
26
+ (weekly? ? day_of_week_index : "*"),
27
+ "UTC"
27
28
  ].join(" ")
28
29
  end
29
30
 
@@ -13,7 +13,7 @@ module Lita
13
13
  if: ->(wizard) { value_for(:repeat) == 'weekly' }
14
14
 
15
15
  step :time,
16
- label: 'At what time? (ex 9am)',
16
+ label: 'At what time? (ex 9am - time will be considered GMT time)',
17
17
  validate: /^([1-9]|1[0-2]|0[1-9])?(:[0-5][0-9])?\s?([aApP][mM])?$/
18
18
 
19
19
  step :recipients,
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-standups'
3
- spec.version = '1.0.2'
3
+ spec.version = '1.0.3'
4
4
  spec.authors = ['Cristian Bica']
5
5
  spec.email = ['cristian.bica@gmail.com']
6
6
  spec.description = 'Lita standups'
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.2
4
+ version: 1.0.3
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-27 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita