Skip to content

Commit

Permalink
Added short commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
onewheelskyward committed Feb 21, 2018
1 parent bd70d8a commit 3271860
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/lita/handlers/onewheel_youtube.rb
Expand Up @@ -8,6 +8,8 @@ class OnewheelYoutube < Handler
config :safe_search, required: false, default: 'medium'

route /^youtube\s+(.*)$/i, :search, command: true
route /^yt\s+(.*)$/i, :search, command: true
route /^y\s+(.*)$/i, :search, command: true

def search(response)
query = response.matches[0][0]
Expand Down
2 changes: 1 addition & 1 deletion lita-onewheel-youtube.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = 'lita-onewheel-youtube'
spec.version = '0.0.1'
spec.version = '0.1.0'
spec.authors = ['Andrew Kreps']
spec.email = ['andrew.kreps@gmail.com']
spec.description = 'An implementation of Google Custom Search Engine for searching Youtube in chat.'
Expand Down
2 changes: 2 additions & 0 deletions spec/lita/handlers/onewheel_youtube_spec.rb
Expand Up @@ -14,6 +14,8 @@
end

it { is_expected.to route_command('youtube something') }
it { is_expected.to route_command('y something') }
it { is_expected.to route_command('yt something') }

it 'does neat youtubey things' do
send_command 'youtube sledgehammer'
Expand Down

0 comments on commit 3271860

Please sign in to comment.