lita-onewheel-halfstaff 0.2.0 → 0.2.1
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: 1b361551eab71f11e0f768d1e5dacd87de9bd9e5
|
4
|
+
data.tar.gz: 77a945d8327bd0d3e2792242f3874d2f73b130fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18226bc8110f37834c64b3f6481dec4fe1fff0e5cf53faa00e8e40ed62a1a456a1116824f8cbffc6201906c11dd6d98e2982e9bdc22028c694153ad6f5e97fb3
|
7
|
+
data.tar.gz: f7e30d8f04550fd2263b8967cef5212b347608ae85f69e46faca29287f8ec3e1c326a773479f8dd00ccb55f149668020790f8638ef4e8a077aa6dfe4c423b3eb
|
@@ -36,13 +36,18 @@ module Lita
|
|
36
36
|
if is_at_half_staff(a_tag.text)
|
37
37
|
pieces = a_tag.text.split(/ - /)
|
38
38
|
Lita.logger.info 'Returning flag data'
|
39
|
-
results.push
|
39
|
+
results.push build_result_tet(pieces[1], pieces[2], a_tag['href'])
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
43
43
|
results
|
44
44
|
end
|
45
45
|
|
46
|
+
def build_result_tet(hwhen, where, link)
|
47
|
+
link.sub! /https*\:\/\//, ''
|
48
|
+
"#{hwhen} - #{where} - #{link}"
|
49
|
+
end
|
50
|
+
|
46
51
|
def is_at_half_staff(text)
|
47
52
|
half_staff = false
|
48
53
|
pieces = text.split(/ - /)
|
@@ -24,8 +24,8 @@ describe Lita::Handlers::OnewheelHalfstaff, lita_handler: true do
|
|
24
24
|
Timecop.freeze(Time.local(2016, 2, 26, 10, 5, 0)) do
|
25
25
|
send_command 'halfstaff'
|
26
26
|
expect(replies.count).to eq(2)
|
27
|
-
expect(replies[0]).to eq('KANSAS ONLY - Honoring the victims of the Hesston shootings -
|
28
|
-
expect(replies[1]).to eq('MINNESOTA ONLY - Honoring Marine Corps Sergeant and Delano, Minnesota resident Dillion J. Semolina -
|
27
|
+
expect(replies[0]).to eq('KANSAS ONLY - Honoring the victims of the Hesston shootings - www.flagsexpress.com/Articles.asp?ID=546')
|
28
|
+
expect(replies[1]).to eq('MINNESOTA ONLY - Honoring Marine Corps Sergeant and Delano, Minnesota resident Dillion J. Semolina - www.flagsexpress.com/Articles.asp?ID=545')
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -33,8 +33,8 @@ describe Lita::Handlers::OnewheelHalfstaff, lita_handler: true do
|
|
33
33
|
Timecop.freeze(Time.local(2016, 3, 9, 10, 5, 0)) do
|
34
34
|
send_command 'halfstaff'
|
35
35
|
expect(replies.count).to eq(2)
|
36
|
-
expect(replies[0]).to eq('COLORADO ONLY - Honoring Las Animas County Deputy Sheriff Travis Russell -
|
37
|
-
expect(replies[1]).to eq('ENTIRE UNITED STATES - Honoring Nancy Reagan -
|
36
|
+
expect(replies[0]).to eq('COLORADO ONLY - Honoring Las Animas County Deputy Sheriff Travis Russell - www.flagsexpress.com/Articles.asp?ID=552')
|
37
|
+
expect(replies[1]).to eq('ENTIRE UNITED STATES - Honoring Nancy Reagan - www.flagsexpress.com/Articles.asp?ID=550')
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|