Skip to content

Commit

Permalink
lita pls
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmycuadra committed Nov 13, 2013
0 parents commit 63b69a8
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
*.gem
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gemspec
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2013 Jimmy Cuadra

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# lita-pls

k

## Installation

Add lita-pls to your Lita instance's Gemfile:

``` ruby
gem "lita-pls"
```

## Usage

```
You: Lita pls
Lita: k
```

## License

[MIT](http://opensource.org/licenses/MIT)
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

task :default => :spec
1 change: 1 addition & 0 deletions lib/lita-pls.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require "lita/handlers/pls"
15 changes: 15 additions & 0 deletions lib/lita/handlers/pls.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require "lita"

module Lita
module Handlers
class Pls < Handler
route(/^pls/, :pls, command: true, help: { "pls" => "k" })

def pls(response)
response.reply("k")
end
end

Lita.register_handler(Pls)
end
end
21 changes: 21 additions & 0 deletions lita-pls.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Gem::Specification.new do |spec|
spec.name = "lita-pls"
spec.version = "0.0.1"
spec.authors = ["Jimmy Cuadra"]
spec.email = ["[email protected]"]
spec.description = %q{A Lita handler to respond to "Lita pls" correctly.}
spec.summary = %q{A Lita handler to respond to "Lita pls" correctly.}
spec.homepage = "https://github.com/jimmycuadra/lita-pls"
spec.license = "MIT"

spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_runtime_dependency "lita", "~> 2.6"

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec", ">= 2.14"
end
12 changes: 12 additions & 0 deletions spec/lita/handlers/pls_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require "spec_helper"

describe Lita::Handlers::Pls, lita_handler: true do
it { routes_command("pls").to(:pls) }

describe "pls" do
it "responds with k" do
send_command("pls")
expect(replies.last).to eq("k")
end
end
end
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require "lita-pls"
require "lita/rspec"

0 comments on commit 63b69a8

Please sign in to comment.