lita-onewheel-halfstaff 0.0.0 → 0.1.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 290901849c5e734b3db6f9f45f3b771a9e116bdb
|
4
|
+
data.tar.gz: 87537cc5a6b4c996628649f827d4b43be56f76f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c7c210d321db2ed0240a9eb4fe5d34d1448255c730743652f39c6e9b21291587f33ee761bcc9a29d0912b2445ef057d210d26bd2772a840fda194c0e39b5fd3
|
7
|
+
data.tar.gz: af6d929328681b4a2b0fcb2128f7548a30be041e2fafa98c4f635477a14c3c123a871602a60e5405c3944823be1fd56fede35ab87251e246f35476f866357af2
|
data/README.md
CHANGED
@@ -4,11 +4,11 @@ require 'restclient'
|
|
4
4
|
module Lita
|
5
5
|
module Handlers
|
6
6
|
class OnewheelHalfstaff < Handler
|
7
|
-
route /^
|
7
|
+
route /^half(staff|mast)$/,
|
8
8
|
:get_flag_status,
|
9
9
|
command: true
|
10
10
|
|
11
|
-
route /^
|
11
|
+
route /^half(staff|mast) history$/,
|
12
12
|
:get_history,
|
13
13
|
command: true
|
14
14
|
|
@@ -42,11 +42,11 @@ module Lita
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def is_at_half_staff(text)
|
45
|
-
Lita.logger.info "Checking for flag date match on #{text}"
|
46
45
|
half_staff = false
|
47
46
|
pieces = text.split(/ - /)
|
48
47
|
current_year = Date::today.year
|
49
48
|
if pieces[0].match(/#{current_year}/)
|
49
|
+
Lita.logger.info "Checking for flag date match on #{text}"
|
50
50
|
if date_matches = pieces[0].match(/(\w+\s+\d+,\s+\d+)/) # February 26, 2016
|
51
51
|
# Lita.logger.info 'Standard'
|
52
52
|
# Lita.logger.info date_matches[1]
|
@@ -10,6 +10,8 @@ describe Lita::Handlers::OnewheelHalfstaff, lita_handler: true do
|
|
10
10
|
|
11
11
|
it { is_expected.to route_command('halfstaff') }
|
12
12
|
it { is_expected.to route_command('halfstaff history') }
|
13
|
+
it { is_expected.to route_command('halfmast') }
|
14
|
+
it { is_expected.to route_command('halfmast history') }
|
13
15
|
|
14
16
|
it 'gives half-staff status' do
|
15
17
|
send_command 'halfstaff'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-onewheel-halfstaff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|