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: 9502983a107c4791eb493f93759410db6d9ecc41
4
- data.tar.gz: cf82b16c85cc73962a3d6d4f52c1abd8095491ec
3
+ metadata.gz: 1b361551eab71f11e0f768d1e5dacd87de9bd9e5
4
+ data.tar.gz: 77a945d8327bd0d3e2792242f3874d2f73b130fd
5
5
  SHA512:
6
- metadata.gz: a2fff00158cb85df20de12fbc50a67cdf9ca96d7592b07e1b33c8e8053d67c27a9d6c47a1df84bfffe852b28fc0da8cc5263bf192d2edfc86d941528894bd806
7
- data.tar.gz: 96612331d3be0450592afbc8dc4a33feeea76595db89fe8ceee287d7126daaa4d2c9d0110feff6e0e83d595ddac3a033b1b5d52f5e07ebacecd26575846e125e
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 "#{pieces[1]} - #{pieces[2]} - #{a_tag['href']}"
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(/ - /)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-halfstaff'
3
- spec.version = '0.2.0'
3
+ spec.version = '0.2.1'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = %q{View the current US flag half-staff status.}
@@ -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 - http://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 - http://www.flagsexpress.com/Articles.asp?ID=545')
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 - http://www.flagsexpress.com/Articles.asp?ID=552')
37
- expect(replies[1]).to eq('ENTIRE UNITED STATES - Honoring Nancy Reagan - http://www.flagsexpress.com/Articles.asp?ID=550')
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-halfstaff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps