lita-sonos-commander 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 +7 -0
 - data/.gitignore +22 -0
 - data/.rspec +1 -0
 - data/.travis.yml +8 -0
 - data/Gemfile +3 -0
 - data/LICENSE +21 -0
 - data/README.md +22 -0
 - data/Rakefile +6 -0
 - data/example/client.rb +21 -0
 - data/lib/lita-sonos-commander.rb +12 -0
 - data/lib/lita/handlers/sonos_commander.rb +74 -0
 - data/lita-sonos-commander.gemspec +27 -0
 - data/locales/en.yml +4 -0
 - data/spec/lita/handlers/sonos_commander_spec.rb +61 -0
 - data/spec/spec_helper.rb +13 -0
 - metadata +187 -0
 
    
        checksums.yaml
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA1:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 55efde944b8f8f55076c00839759350d66dd869d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: c983877fd0ba9b854dcee313c250b0f5b306b14e
         
     | 
| 
      
 5 
     | 
    
         
            +
            SHA512:
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: a51ab068605b560102c40fc6d806eefccdc3407682f82760672d977f3d08bb04e9182b3b888e7af49abda24bb0a88dacc9b431adf4a897cdd980e7ab46b1e5d0
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: cf4e1b01326609908b1301d099c036c6bac58709421ecf098d73d86b07f0defb7334b7803693c55b2767c3e61c36218fe1626c31609674d7bd91a0d65aa8cfc4
         
     | 
    
        data/.gitignore
    ADDED
    
    
    
        data/.rspec
    ADDED
    
    | 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --format=doc
         
     | 
    
        data/.travis.yml
    ADDED
    
    
    
        data/Gemfile
    ADDED
    
    
    
        data/LICENSE
    ADDED
    
    | 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            MIT License
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Copyright (c) 2017 Daniel Pritchett ⚡
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining a copy
         
     | 
| 
      
 6 
     | 
    
         
            +
            of this software and associated documentation files (the "Software"), to deal
         
     | 
| 
      
 7 
     | 
    
         
            +
            in the Software without restriction, including without limitation the rights
         
     | 
| 
      
 8 
     | 
    
         
            +
            to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         
     | 
| 
      
 9 
     | 
    
         
            +
            copies of the Software, and to permit persons to whom the Software is
         
     | 
| 
      
 10 
     | 
    
         
            +
            furnished to do so, subject to the following conditions:
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be included in all
         
     | 
| 
      
 13 
     | 
    
         
            +
            copies or substantial portions of the Software.
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         
     | 
| 
      
 16 
     | 
    
         
            +
            IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         
     | 
| 
      
 17 
     | 
    
         
            +
            FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         
     | 
| 
      
 18 
     | 
    
         
            +
            AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         
     | 
| 
      
 19 
     | 
    
         
            +
            LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         
     | 
| 
      
 20 
     | 
    
         
            +
            OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         
     | 
| 
      
 21 
     | 
    
         
            +
            SOFTWARE.
         
     | 
    
        data/README.md
    ADDED
    
    | 
         @@ -0,0 +1,22 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # lita-sonos-commander
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            [](https://travis-ci.org/dpritchett/lita-sonos-commander)
         
     | 
| 
      
 4 
     | 
    
         
            +
            [](https://coveralls.io/r/dpritchett/lita-sonos-commander)
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            TODO: Add a description of the plugin.
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            ## Installation
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            Add lita-sonos-commander to your Lita instance's Gemfile:
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            ``` ruby
         
     | 
| 
      
 13 
     | 
    
         
            +
            gem "lita-sonos-commander"
         
     | 
| 
      
 14 
     | 
    
         
            +
            ```
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            ## Configuration
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            TODO: Describe any configuration attributes the plugin exposes.
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            ## Usage
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            TODO: Describe the plugin's features and how to use them.
         
     | 
    
        data/Rakefile
    ADDED
    
    
    
        data/example/client.rb
    ADDED
    
    | 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'faye/websocket'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'eventmachine'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            EM.run {
         
     | 
| 
      
 5 
     | 
    
         
            +
            #  ws = Faye::WebSocket::Client.new('ws://localhost:9292')
         
     | 
| 
      
 6 
     | 
    
         
            +
              ws = Faye::WebSocket::Client.new('ws://localhost:8080/sonos/listen')
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
              ws.on :open do |event|
         
     | 
| 
      
 9 
     | 
    
         
            +
                p [:open]
         
     | 
| 
      
 10 
     | 
    
         
            +
                ws.send('Hello, world!')
         
     | 
| 
      
 11 
     | 
    
         
            +
              end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
              ws.on :message do |event|
         
     | 
| 
      
 14 
     | 
    
         
            +
                p [:message, event.data]
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              ws.on :close do |event|
         
     | 
| 
      
 18 
     | 
    
         
            +
                p [:close, event.code, event.reason]
         
     | 
| 
      
 19 
     | 
    
         
            +
                ws = nil
         
     | 
| 
      
 20 
     | 
    
         
            +
              end
         
     | 
| 
      
 21 
     | 
    
         
            +
            }
         
     | 
| 
         @@ -0,0 +1,12 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require "lita"
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Lita.load_locales Dir[File.expand_path(
         
     | 
| 
      
 4 
     | 
    
         
            +
              File.join("..", "..", "locales", "*.yml"), __FILE__
         
     | 
| 
      
 5 
     | 
    
         
            +
            )]
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            require "lita/handlers/sonos_commander"
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            Lita::Handlers::SonosCommander.template_root File.expand_path(
         
     | 
| 
      
 10 
     | 
    
         
            +
              File.join("..", "..", "templates"),
         
     | 
| 
      
 11 
     | 
    
         
            +
             __FILE__
         
     | 
| 
      
 12 
     | 
    
         
            +
            )
         
     | 
| 
         @@ -0,0 +1,74 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'pry'
         
     | 
| 
      
 2 
     | 
    
         
            +
            module Lita
         
     | 
| 
      
 3 
     | 
    
         
            +
              module Handlers
         
     | 
| 
      
 4 
     | 
    
         
            +
                class SonosCommander < Handler
         
     | 
| 
      
 5 
     | 
    
         
            +
                  # insert handler code here
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                  require 'faye/websocket'
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
                  http.get '/sonos/listen', :sonos_connector
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                  route /^sonos (.+)/, :send_to_sonos
         
     | 
| 
      
 13 
     | 
    
         
            +
                  route /^explore/, :call_explorer
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                  on :loaded, :register_faye
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                  def middlewares
         
     | 
| 
      
 18 
     | 
    
         
            +
                    robot.registry.config.http.middleware
         
     | 
| 
      
 19 
     | 
    
         
            +
                  end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                  App = lambda do |env|
         
     | 
| 
      
 22 
     | 
    
         
            +
                    if Faye::WebSocket.websocket?(env)
         
     | 
| 
      
 23 
     | 
    
         
            +
                      ws = Faye::WebSocket.new(env)
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                      ws.on :message do |event|
         
     | 
| 
      
 26 
     | 
    
         
            +
                        ws.send(event.data)
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                        sleep 2
         
     | 
| 
      
 29 
     | 
    
         
            +
                        ws.send "WE DID IT TWITCH"
         
     | 
| 
      
 30 
     | 
    
         
            +
                      end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                      ws.on :close do |event|
         
     | 
| 
      
 33 
     | 
    
         
            +
                        p [:close, event.code, event.reason]
         
     | 
| 
      
 34 
     | 
    
         
            +
                        ws = nil
         
     | 
| 
      
 35 
     | 
    
         
            +
                      end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                      # Return async Rack response
         
     | 
| 
      
 38 
     | 
    
         
            +
                      ws.rack_response
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                    else
         
     | 
| 
      
 41 
     | 
    
         
            +
                      # Normal HTTP request
         
     | 
| 
      
 42 
     | 
    
         
            +
                      [200, {'Content-Type' => 'text/plain'}, ['Hello']]
         
     | 
| 
      
 43 
     | 
    
         
            +
                    end
         
     | 
| 
      
 44 
     | 
    
         
            +
                  end
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
                  def register_faye(arg)
         
     | 
| 
      
 47 
     | 
    
         
            +
                    middleware = robot.registry.config.http.middleware
         
     | 
| 
      
 48 
     | 
    
         
            +
                    result = middleware.use App
         
     | 
| 
      
 49 
     | 
    
         
            +
            #        binding.pry
         
     | 
| 
      
 50 
     | 
    
         
            +
                  end
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
                  def send_to_sonos(message)
         
     | 
| 
      
 53 
     | 
    
         
            +
                    #binding.pry
         
     | 
| 
      
 54 
     | 
    
         
            +
                  end
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                  def call_explorer(_message); explorer; end
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
      
 58 
     | 
    
         
            +
                  def explorer
         
     | 
| 
      
 59 
     | 
    
         
            +
                    middleware = robot.registry.config.http.middleware
         
     | 
| 
      
 60 
     | 
    
         
            +
                  end
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
                  def sonos_connector(request, response)
         
     | 
| 
      
 63 
     | 
    
         
            +
                    #binding.pry
         
     | 
| 
      
 64 
     | 
    
         
            +
                    middlewares.each do |mw|
         
     | 
| 
      
 65 
     | 
    
         
            +
                    #  binding.pry
         
     | 
| 
      
 66 
     | 
    
         
            +
                      mw.middleware.call(request.env)
         
     | 
| 
      
 67 
     | 
    
         
            +
                    end
         
     | 
| 
      
 68 
     | 
    
         
            +
                  end
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
                  Lita.register_handler(self)
         
     | 
| 
      
 72 
     | 
    
         
            +
                end
         
     | 
| 
      
 73 
     | 
    
         
            +
              end
         
     | 
| 
      
 74 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,27 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Gem::Specification.new do |spec|
         
     | 
| 
      
 2 
     | 
    
         
            +
              spec.name          = 'lita-sonos-commander'
         
     | 
| 
      
 3 
     | 
    
         
            +
              spec.version       = '0.1.0'
         
     | 
| 
      
 4 
     | 
    
         
            +
              spec.authors       = ['Daniel J. Pritchett']
         
     | 
| 
      
 5 
     | 
    
         
            +
              spec.email         = ['dpritchett@gmail.com']
         
     | 
| 
      
 6 
     | 
    
         
            +
              spec.description   = 'Control your Sonos with Lita chatbot commands'
         
     | 
| 
      
 7 
     | 
    
         
            +
              spec.summary       = 'Control your Sonos with Lita chatbot commands'
         
     | 
| 
      
 8 
     | 
    
         
            +
              spec.homepage      = 'https://github.com/dpritchett/lita-sonos-commander'
         
     | 
| 
      
 9 
     | 
    
         
            +
              spec.license       = 'MIT'
         
     | 
| 
      
 10 
     | 
    
         
            +
              spec.metadata      = { 'lita_plugin_type' => 'handler' }
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              spec.files         = `git ls-files`.split($/)
         
     | 
| 
      
 13 
     | 
    
         
            +
              spec.executables   = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
         
     | 
| 
      
 14 
     | 
    
         
            +
              spec.test_files    = spec.files.grep(%r{^(test|spec|features)/})
         
     | 
| 
      
 15 
     | 
    
         
            +
              spec.require_paths = ['lib']
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              spec.add_runtime_dependency 'lita', '>= 4.7'
         
     | 
| 
      
 18 
     | 
    
         
            +
              spec.add_runtime_dependency 'faye-websocket', '~> 0.10.7'
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
              spec.add_development_dependency 'bundler', '~> 1.3'
         
     | 
| 
      
 21 
     | 
    
         
            +
              spec.add_development_dependency 'pry-byebug'
         
     | 
| 
      
 22 
     | 
    
         
            +
              spec.add_development_dependency 'rake'
         
     | 
| 
      
 23 
     | 
    
         
            +
              spec.add_development_dependency 'rack-test'
         
     | 
| 
      
 24 
     | 
    
         
            +
              spec.add_development_dependency 'rspec', '>= 3.0.0'
         
     | 
| 
      
 25 
     | 
    
         
            +
              spec.add_development_dependency 'simplecov'
         
     | 
| 
      
 26 
     | 
    
         
            +
              spec.add_development_dependency 'coveralls'
         
     | 
| 
      
 27 
     | 
    
         
            +
            end
         
     | 
    
        data/locales/en.yml
    ADDED
    
    
| 
         @@ -0,0 +1,61 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'pry'
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'date'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            describe Lita::Handlers::SonosCommander, lita_handler: true do
         
     | 
| 
      
 6 
     | 
    
         
            +
              let(:robot) { Lita::Robot.new(registry) }
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
              subject { described_class.new(robot) }
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
              # START:routes
         
     | 
| 
      
 11 
     | 
    
         
            +
              describe 'routes' do
         
     | 
| 
      
 12 
     | 
    
         
            +
                it {
         
     | 
| 
      
 13 
     | 
    
         
            +
                  is_expected.to route_http(:get, '/sonos/listen')
         
     | 
| 
      
 14 
     | 
    
         
            +
                    .to(:sonos_connector)
         
     | 
| 
      
 15 
     | 
    
         
            +
                }
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                it { is_expected.to route('Lita sonos alpha bravo')
         
     | 
| 
      
 18 
     | 
    
         
            +
                  .to(:send_to_sonos) }
         
     | 
| 
      
 19 
     | 
    
         
            +
              end
         
     | 
| 
      
 20 
     | 
    
         
            +
              # END:routes
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
              describe 'exploratory' do
         
     | 
| 
      
 23 
     | 
    
         
            +
                it "let's play" do
         
     | 
| 
      
 24 
     | 
    
         
            +
                  subject.explorer
         
     | 
| 
      
 25 
     | 
    
         
            +
                end
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
              # START:save_message
         
     | 
| 
      
 28 
     | 
    
         
            +
              describe ':save_message' do
         
     | 
| 
      
 29 
     | 
    
         
            +
                let(:body) { 'hello, alexa!' }
         
     | 
| 
      
 30 
     | 
    
         
            +
                it 'saves a message and acknowledges' do
         
     | 
| 
      
 31 
     | 
    
         
            +
                  result = subject.save_message(username: 'dpritchett', message: body)
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                  expect(result.fetch(:message)).to eq body
         
     | 
| 
      
 34 
     | 
    
         
            +
                end
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                it { is_expected.to route_event(:save_alexa_message).to(:save_message) }
         
     | 
| 
      
 37 
     | 
    
         
            +
              end
         
     | 
| 
      
 38 
     | 
    
         
            +
              # END:save_message
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
              # START:alexify
         
     | 
| 
      
 41 
     | 
    
         
            +
              describe ':alexify' do
         
     | 
| 
      
 42 
     | 
    
         
            +
                let(:message) do
         
     | 
| 
      
 43 
     | 
    
         
            +
                  subject.save_message username: 'daniel', message: 'test message'
         
     | 
| 
      
 44 
     | 
    
         
            +
                end
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
                it 'should return a hash with an alexa-specific shape' do
         
     | 
| 
      
 47 
     | 
    
         
            +
                  result = subject.alexify(message)
         
     | 
| 
      
 48 
     | 
    
         
            +
                  expect(result.fetch(:mainText)).to eq('test message')
         
     | 
| 
      
 49 
     | 
    
         
            +
                end
         
     | 
| 
      
 50 
     | 
    
         
            +
              end
         
     | 
| 
      
 51 
     | 
    
         
            +
              # END:alexify
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
              it 'can grab a message from chat and store it' do
         
     | 
| 
      
 54 
     | 
    
         
            +
                send_message "lita newsfeed hello there #{DateTime.now}"
         
     | 
| 
      
 55 
     | 
    
         
            +
                response = replies.last
         
     | 
| 
      
 56 
     | 
    
         
            +
                expect(response =~ /hello there/i).to be_truthy
         
     | 
| 
      
 57 
     | 
    
         
            +
                expect(response =~ /Saved message for Alexa/).to be_truthy
         
     | 
| 
      
 58 
     | 
    
         
            +
              end
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
            end
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
    
        data/spec/spec_helper.rb
    ADDED
    
    | 
         @@ -0,0 +1,13 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require "simplecov"
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
         
     | 
| 
      
 4 
     | 
    
         
            +
              SimpleCov::Formatter::HTMLFormatter,
         
     | 
| 
      
 5 
     | 
    
         
            +
            ]
         
     | 
| 
      
 6 
     | 
    
         
            +
            SimpleCov.start { add_filter "/spec/" }
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            require "lita-sonos-commander"
         
     | 
| 
      
 9 
     | 
    
         
            +
            require "lita/rspec"
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            # A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
         
     | 
| 
      
 12 
     | 
    
         
            +
            # was generated with Lita 4, the compatibility mode should be left disabled.
         
     | 
| 
      
 13 
     | 
    
         
            +
            Lita.version_3_compatibility_mode = false
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,187 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: lita-sonos-commander
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.0
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - Daniel J. Pritchett
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 10 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2018-04-26 00:00:00.000000000 Z
         
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: lita
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '4.7'
         
     | 
| 
      
 20 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 21 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 22 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 23 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 25 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '4.7'
         
     | 
| 
      
 27 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 28 
     | 
    
         
            +
              name: faye-websocket
         
     | 
| 
      
 29 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 30 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 31 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 33 
     | 
    
         
            +
                    version: 0.10.7
         
     | 
| 
      
 34 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 35 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 36 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 37 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 38 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 39 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 40 
     | 
    
         
            +
                    version: 0.10.7
         
     | 
| 
      
 41 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 42 
     | 
    
         
            +
              name: bundler
         
     | 
| 
      
 43 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 44 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 45 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 46 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 47 
     | 
    
         
            +
                    version: '1.3'
         
     | 
| 
      
 48 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 49 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 50 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 51 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 52 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 53 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 54 
     | 
    
         
            +
                    version: '1.3'
         
     | 
| 
      
 55 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 56 
     | 
    
         
            +
              name: pry-byebug
         
     | 
| 
      
 57 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 58 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 59 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 60 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 61 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 62 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 63 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 64 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 65 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 66 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 67 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 68 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 69 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 70 
     | 
    
         
            +
              name: rake
         
     | 
| 
      
 71 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 72 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 73 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 74 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 75 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 76 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 77 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 78 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 79 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 80 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 81 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 82 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 83 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 84 
     | 
    
         
            +
              name: rack-test
         
     | 
| 
      
 85 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 86 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 87 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 88 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 89 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 90 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 91 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 92 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 93 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 94 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 95 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 96 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 97 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 98 
     | 
    
         
            +
              name: rspec
         
     | 
| 
      
 99 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 100 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 101 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 102 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 103 
     | 
    
         
            +
                    version: 3.0.0
         
     | 
| 
      
 104 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 105 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 106 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 107 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 108 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 109 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 110 
     | 
    
         
            +
                    version: 3.0.0
         
     | 
| 
      
 111 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 112 
     | 
    
         
            +
              name: simplecov
         
     | 
| 
      
 113 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 114 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 115 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 116 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 117 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 118 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 119 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 120 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 121 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 122 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 123 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 124 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 125 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 126 
     | 
    
         
            +
              name: coveralls
         
     | 
| 
      
 127 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 128 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 129 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 130 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 131 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 132 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 133 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 134 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 135 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 136 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 137 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 138 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 139 
     | 
    
         
            +
            description: Control your Sonos with Lita chatbot commands
         
     | 
| 
      
 140 
     | 
    
         
            +
            email:
         
     | 
| 
      
 141 
     | 
    
         
            +
            - dpritchett@gmail.com
         
     | 
| 
      
 142 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 143 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 144 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 145 
     | 
    
         
            +
            files:
         
     | 
| 
      
 146 
     | 
    
         
            +
            - ".gitignore"
         
     | 
| 
      
 147 
     | 
    
         
            +
            - ".rspec"
         
     | 
| 
      
 148 
     | 
    
         
            +
            - ".travis.yml"
         
     | 
| 
      
 149 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 150 
     | 
    
         
            +
            - LICENSE
         
     | 
| 
      
 151 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 152 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 153 
     | 
    
         
            +
            - example/client.rb
         
     | 
| 
      
 154 
     | 
    
         
            +
            - lib/lita-sonos-commander.rb
         
     | 
| 
      
 155 
     | 
    
         
            +
            - lib/lita/handlers/sonos_commander.rb
         
     | 
| 
      
 156 
     | 
    
         
            +
            - lita-sonos-commander.gemspec
         
     | 
| 
      
 157 
     | 
    
         
            +
            - locales/en.yml
         
     | 
| 
      
 158 
     | 
    
         
            +
            - spec/lita/handlers/sonos_commander_spec.rb
         
     | 
| 
      
 159 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     | 
| 
      
 160 
     | 
    
         
            +
            homepage: https://github.com/dpritchett/lita-sonos-commander
         
     | 
| 
      
 161 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 162 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 163 
     | 
    
         
            +
            metadata:
         
     | 
| 
      
 164 
     | 
    
         
            +
              lita_plugin_type: handler
         
     | 
| 
      
 165 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 166 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 167 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 168 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 169 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 170 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 171 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 172 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 173 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 174 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 175 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 176 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 177 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 178 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 179 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 180 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 181 
     | 
    
         
            +
            rubygems_version: 2.5.1
         
     | 
| 
      
 182 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 183 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 184 
     | 
    
         
            +
            summary: Control your Sonos with Lita chatbot commands
         
     | 
| 
      
 185 
     | 
    
         
            +
            test_files:
         
     | 
| 
      
 186 
     | 
    
         
            +
            - spec/lita/handlers/sonos_commander_spec.rb
         
     | 
| 
      
 187 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     |