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: 582efd3589c1f029b3b6bfa7cd74cc695732b0f4
4
- data.tar.gz: 65c32fd452d656d93a8cdace64aa96db589cdbd8
3
+ metadata.gz: 290901849c5e734b3db6f9f45f3b771a9e116bdb
4
+ data.tar.gz: 87537cc5a6b4c996628649f827d4b43be56f76f1
5
5
  SHA512:
6
- metadata.gz: 654f8dec79366a93e00c79a7a3ac10320029383f20ea92d745212bd0580eb5bbde7d5a912832bf3f5108fb99cce9dcb794b06e08d532ab2470815b84be0ba6d3
7
- data.tar.gz: 2babac5de926d26f2d7afb5509d4cda1d1ed3c9f88d80ce1e7e10886b21cffcb64219bbb0cb5499603b7901363f912dc501b876067ca8003c819a0e91f461842
6
+ metadata.gz: 6c7c210d321db2ed0240a9eb4fe5d34d1448255c730743652f39c6e9b21291587f33ee761bcc9a29d0912b2445ef057d210d26bd2772a840fda194c0e39b5fd3
7
+ data.tar.gz: af6d929328681b4a2b0fcb2128f7548a30be041e2fafa98c4f635477a14c3c123a871602a60e5405c3944823be1fd56fede35ab87251e246f35476f866357af2
data/README.md CHANGED
@@ -16,5 +16,6 @@ gem 'lita-onewheel-halfstaff'
16
16
  ## Usage
17
17
 
18
18
  !halfstaff - get current half staff notices.
19
+
19
20
  !halfstaff history - Get a link to the history of flying flags half-mast.
20
21
 
@@ -4,11 +4,11 @@ require 'restclient'
4
4
  module Lita
5
5
  module Handlers
6
6
  class OnewheelHalfstaff < Handler
7
- route /^halfstaff$/,
7
+ route /^half(staff|mast)$/,
8
8
  :get_flag_status,
9
9
  command: true
10
10
 
11
- route /^halfstaff history$/,
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]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-halfstaff'
3
- spec.version = '0.0.0'
3
+ spec.version = '0.1.0'
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.}
@@ -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.0.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-28 00:00:00.000000000 Z
11
+ date: 2016-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita