lita-rimshot 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +35 -0
- data/.rspec +2 -0
- data/.rubocop.yml +6 -0
- data/.travis.yml +10 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +42 -0
- data/Rakefile +13 -0
- data/lib/lita/handlers/rimshot.rb +26 -0
- data/lib/lita-rimshot/version.rb +7 -0
- data/lib/lita-rimshot.rb +25 -0
- data/lita-rimshot.gemspec +33 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/unit/lita/handlers/rimshot_spec.rb +41 -0
- data/spec/unit/lita-rimshot/version_spec.rb +11 -0
- metadata +174 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 281b161c1a39833b735416c2cf97b86173c4936f
|
4
|
+
data.tar.gz: 8398c2240ea2ed69a81d764d6fa72d70c9f024e8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b37fa0ac530369d8acee9ffc3eb7b7b84e149d51b7862c6318dd189d318d06ade7450a6fbfbe4746f9d65486f55fcac2d82aa7376d3cbe9b7a2179a441222d02
|
7
|
+
data.tar.gz: e9f81b300d748de8a1c9c55f398e08fc4ee5850d0357b94580ad1abb574ab8fed6604b9548e461ac0eff7d48a54571446b35e65897356fc586ecfe486d010b6b
|
data/.gitignore
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/test/tmp/
|
9
|
+
/test/version_tmp/
|
10
|
+
/tmp/
|
11
|
+
Gemfile.lock
|
12
|
+
|
13
|
+
## Specific to RubyMotion:
|
14
|
+
.dat*
|
15
|
+
.repl_history
|
16
|
+
build/
|
17
|
+
|
18
|
+
## Documentation cache and generated files:
|
19
|
+
/.yardoc/
|
20
|
+
/_yardoc/
|
21
|
+
/doc/
|
22
|
+
/rdoc/
|
23
|
+
|
24
|
+
## Environment normalisation:
|
25
|
+
/.bundle/
|
26
|
+
/lib/bundler/man/
|
27
|
+
|
28
|
+
# for a library or gem, you might want to ignore these files since the code is
|
29
|
+
# intended to run in multiple environments; otherwise, check them in:
|
30
|
+
# Gemfile.lock
|
31
|
+
# .ruby-version
|
32
|
+
# .ruby-gemset
|
33
|
+
|
34
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
35
|
+
.rvmrc
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Tim Heckman
|
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,42 @@
|
|
1
|
+
lita-rimshot
|
2
|
+
============
|
3
|
+
[![Build Status](https://img.shields.io/travis/theckman/lita-rimshot/master.svg)](https://travis-ci.org/theckman/lita-rimshot)
|
4
|
+
[![MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://tldrlegal.com/license/mit-license)
|
5
|
+
[![RubyGems :: RMuh Gem Version](http://img.shields.io/gem/v/lita-rimshot.svg)](https://rubygems.org/gems/lita-rimshot)
|
6
|
+
[![Coveralls Coverage](https://img.shields.io/coveralls/theckman/lita-rimshot/master.svg)](https://coveralls.io/r/theckman/lita-rimshot)
|
7
|
+
[![Code Climate](https://img.shields.io/codeclimate/github/theckman/lita-rimshot.svg)](https://codeclimate.com/github/theckman/lita-rimshot)
|
8
|
+
[![Gemnasium](https://img.shields.io/gemnasium/theckman/lita-rimshot.svg)](https://gemnasium.com/theckman/lita-rimshot)
|
9
|
+
|
10
|
+
Make a joke, get a rimshot...
|
11
|
+
|
12
|
+
LICENSE
|
13
|
+
-------
|
14
|
+
[lita-rimshot](https://github.com/theckman/lita-rimshot) is released under
|
15
|
+
the [MIT](http://opensource.org/licenses/MIT) license. The full license is
|
16
|
+
provided in the `LICENSE` file.
|
17
|
+
|
18
|
+
CONTRIBUTING
|
19
|
+
------------
|
20
|
+
Something wrong or you want to submit an improvement? Fork the repo, make your
|
21
|
+
changes on a feature branch, write some tests, and submit a pull request. I
|
22
|
+
only ask that the commits have useful information and use proper/complete
|
23
|
+
sentences.
|
24
|
+
|
25
|
+
INSTALLATION
|
26
|
+
------------
|
27
|
+
Add this line to your Lita bot's Gemfile:
|
28
|
+
|
29
|
+
```Ruby
|
30
|
+
gem 'lita-rimshot'
|
31
|
+
```
|
32
|
+
|
33
|
+
COMMANDS
|
34
|
+
--------
|
35
|
+
* `rimshot` - gives you an instant rimshot for a joke
|
36
|
+
|
37
|
+
USAGE
|
38
|
+
-----
|
39
|
+
```
|
40
|
+
>> Lita rimshot
|
41
|
+
Here ya go! http://instantrimshot.com/classic/?sound=rimshot
|
42
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# -*- coding: UTF-8 -*_
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require 'rubocop/rake_task'
|
4
|
+
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
6
|
+
|
7
|
+
Rubocop::RakeTask.new(:rubocop) do |t|
|
8
|
+
t.patterns =
|
9
|
+
%w( Rakefile Gemfile lita-rimshot.gemspec lib/**/*.rb spec/**/*_spec.rb )
|
10
|
+
t.fail_on_error = true
|
11
|
+
end
|
12
|
+
|
13
|
+
task default: [:rubocop, :spec]
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
require 'lita'
|
3
|
+
|
4
|
+
module Lita
|
5
|
+
module Handlers
|
6
|
+
# InstantRimshot handler for Lita
|
7
|
+
# This really does nothing useful...
|
8
|
+
#
|
9
|
+
class Rimshot < Handler
|
10
|
+
URL ||= 'http://instantrimshot.com/classic/?sound=rimshot'
|
11
|
+
|
12
|
+
route(
|
13
|
+
/^rimshot$/,
|
14
|
+
:rimshot,
|
15
|
+
command: true,
|
16
|
+
help: { 'rimshot' => 'Get an instant rimshot!' }
|
17
|
+
)
|
18
|
+
|
19
|
+
def rimshot(response)
|
20
|
+
response.reply("Here ya go! #{URL}")
|
21
|
+
end
|
22
|
+
|
23
|
+
Lita.register_handler(Rimshot)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/lita-rimshot.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
# The MIT License (MIT)
|
3
|
+
|
4
|
+
# Copyright (c) 2014 Tim Heckman
|
5
|
+
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
|
24
|
+
require 'lita'
|
25
|
+
require 'lita/handlers/rimshot'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
require 'English'
|
3
|
+
|
4
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
5
|
+
|
6
|
+
require 'lita-rimshot/version'
|
7
|
+
|
8
|
+
Gem::Specification.new do |g|
|
9
|
+
g.name = 'lita-rimshot'
|
10
|
+
g.version = LitaRimshot::VERSION
|
11
|
+
g.date = Time.now.strftime('%Y-%m-%d')
|
12
|
+
g.description = 'Lita plugin for generating a rimshot'
|
13
|
+
g.summary = 'Lita + InstantRimshot'
|
14
|
+
g.authors = ['Tim Heckman']
|
15
|
+
g.email = 'tim@timheckman.net'
|
16
|
+
g.homepage = 'https://github.com/theckman/lita-rimshot'
|
17
|
+
g.license = 'MIT'
|
18
|
+
g.required_ruby_version = '>= 2.0.0'
|
19
|
+
g.metadata = { 'lita_plugin_type' => 'handler' }
|
20
|
+
|
21
|
+
g.test_files = %x(git ls-files spec/*).split
|
22
|
+
g.files = %x(git ls-files).split
|
23
|
+
|
24
|
+
g.add_development_dependency 'bundler', '~> 1.5.3'
|
25
|
+
g.add_development_dependency 'rake', '~> 10.2.2'
|
26
|
+
g.add_development_dependency 'rubocop', '~> 0.19.1'
|
27
|
+
g.add_development_dependency 'rspec', '>= 3.0.0.beta2'
|
28
|
+
g.add_development_dependency 'fuubar', '~> 1.3.2'
|
29
|
+
g.add_development_dependency 'coveralls', '~> 0.7.0'
|
30
|
+
g.add_development_dependency 'simplecov', '~> 0.8.2'
|
31
|
+
|
32
|
+
g.add_runtime_dependency 'lita', '>= 3.0.0'
|
33
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Lita::Handlers::Rimshot, lita_handler: true do
|
5
|
+
it { routes_command('rimshot').to(:rimshot) }
|
6
|
+
|
7
|
+
describe '::URL' do
|
8
|
+
subject { Lita::Handlers::Rimshot::URL }
|
9
|
+
|
10
|
+
it { should be_an_instance_of String }
|
11
|
+
|
12
|
+
it { should eql 'http://instantrimshot.com/classic/?sound=rimshot' }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '.rimshot' do
|
16
|
+
context 'when given more than one arg' do
|
17
|
+
it 'should raise ArgumentError' do
|
18
|
+
expect do
|
19
|
+
subject.rimshot(nil, nil)
|
20
|
+
end.to raise_error ArgumentError
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'when given less than one arg' do
|
25
|
+
it 'should raise ArgumentError' do
|
26
|
+
expect do
|
27
|
+
subject.rimshot
|
28
|
+
end.to raise_error ArgumentError
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context 'when given a response object' do
|
33
|
+
it 'should return an instant rimshot!' do
|
34
|
+
send_command('rimshot')
|
35
|
+
expect(replies.last)
|
36
|
+
.to eql 'Here ya go! http://instantrimshot.com/classic/?sound=' \
|
37
|
+
'rimshot'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lita-rimshot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tim Heckman
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.5.3
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.5.3
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 10.2.2
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 10.2.2
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.19.1
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.19.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.0.0.beta2
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 3.0.0.beta2
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: fuubar
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.3.2
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.3.2
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: coveralls
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.7.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.7.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.8.2
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.8.2
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: lita
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 3.0.0
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 3.0.0
|
125
|
+
description: Lita plugin for generating a rimshot
|
126
|
+
email: tim@timheckman.net
|
127
|
+
executables: []
|
128
|
+
extensions: []
|
129
|
+
extra_rdoc_files: []
|
130
|
+
files:
|
131
|
+
- ".gitignore"
|
132
|
+
- ".rspec"
|
133
|
+
- ".rubocop.yml"
|
134
|
+
- ".travis.yml"
|
135
|
+
- Gemfile
|
136
|
+
- LICENSE
|
137
|
+
- README.md
|
138
|
+
- Rakefile
|
139
|
+
- lib/lita-rimshot.rb
|
140
|
+
- lib/lita-rimshot/version.rb
|
141
|
+
- lib/lita/handlers/rimshot.rb
|
142
|
+
- lita-rimshot.gemspec
|
143
|
+
- spec/spec_helper.rb
|
144
|
+
- spec/unit/lita-rimshot/version_spec.rb
|
145
|
+
- spec/unit/lita/handlers/rimshot_spec.rb
|
146
|
+
homepage: https://github.com/theckman/lita-rimshot
|
147
|
+
licenses:
|
148
|
+
- MIT
|
149
|
+
metadata:
|
150
|
+
lita_plugin_type: handler
|
151
|
+
post_install_message:
|
152
|
+
rdoc_options: []
|
153
|
+
require_paths:
|
154
|
+
- lib
|
155
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 2.0.0
|
160
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
|
+
requirements:
|
162
|
+
- - ">="
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
165
|
+
requirements: []
|
166
|
+
rubyforge_project:
|
167
|
+
rubygems_version: 2.2.2
|
168
|
+
signing_key:
|
169
|
+
specification_version: 4
|
170
|
+
summary: Lita + InstantRimshot
|
171
|
+
test_files:
|
172
|
+
- spec/spec_helper.rb
|
173
|
+
- spec/unit/lita-rimshot/version_spec.rb
|
174
|
+
- spec/unit/lita/handlers/rimshot_spec.rb
|