lita-snack 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3fbaf1f3e3c135cad322d11a0e1dea1eb5ddc4b6
4
+ data.tar.gz: f5a111b1fc8a8e3bc6c04cf3f4e2fb00dcf93bb0
5
+ SHA512:
6
+ metadata.gz: 502d06a04cb3209b3751bae2407959b8d221b49f594a7472eaf330e104bf64ee854fcf739909136ffd4897e1cd6baecc60b65925fb734c865fb1406d6c9ea457
7
+ data.tar.gz: 3cc5a106183aabb2f2b5dbed5ca4bb0eda2d9306a531c57110c6f633b510b13b243ff660780b70ec6915f8e97e162759885e1616edcc5a3926fca0aade9549bc
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .idea
4
+ .bundle
5
+ .config
6
+ .yardoc
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) [2015] [Kyle Hasenkamp]
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,33 @@
1
+ # lita-snack
2
+
3
+ Give your Lita bot a snack. This plugin was inspired by botsnack, from hubot-scripts.
4
+ https://github.com/github/hubot-scripts/blob/master/src/scripts/botsnack.coffee
5
+
6
+ ## Installation
7
+
8
+ Add lita-snack to your Lita instance's Gemfile:
9
+
10
+ ``` ruby
11
+ gem "lita-snack"
12
+ ```
13
+
14
+ ## Configuration
15
+
16
+ No configuration needed
17
+
18
+ ## Usage
19
+
20
+ ```
21
+ You: @lita have a snack
22
+ Lita: 'Thank you very much!'
23
+ ```
24
+
25
+ There are five different responses that Lita will randomly respond with.
26
+
27
+ Responses:
28
+ * 'Om nom nom!'
29
+ * 'That is very nice of you!'
30
+ * 'Oh thanks! Have a cookie yourself!'
31
+ * 'Thank you very much!'
32
+ * 'Thanks for the treat!
33
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/lib/lita-snack.rb ADDED
@@ -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/snack"
8
+
9
+ Lita::Handlers::Snack.template_root File.expand_path(
10
+ File.join("..", "..", "templates"),
11
+ __FILE__
12
+ )
@@ -0,0 +1,21 @@
1
+ module Lita
2
+ module Handlers
3
+ class Snack < Handler
4
+ route(/^(have a snack)/, :snack, command: true, help: {
5
+ 'snack' => 'Give Lita a snack!' })
6
+
7
+ SNACKS = [
8
+ 'Om nom nom!',
9
+ 'That is very nice of you!',
10
+ 'Oh thanks! Have a cookie yourself!',
11
+ 'Thank you very much!',
12
+ 'Thanks for the treat!'
13
+ ]
14
+
15
+ def snack(response)
16
+ response.reply SNACKS.sample
17
+ end
18
+ end
19
+ Lita.register_handler(Snack)
20
+ end
21
+ end
@@ -0,0 +1,23 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "lita-snack"
3
+ spec.version = "0.1.0"
4
+ spec.authors = ["Kyle Hasenkamp"]
5
+ spec.description = "Give your Lita bot a snack"
6
+ spec.summary = "Give your Lita bot a snack"
7
+ spec.homepage = "https://github.com/kylehasenkamp/lita-snack"
8
+ spec.license = "MIT"
9
+ spec.metadata = { "lita_plugin_type" => "handler" }
10
+
11
+ spec.files = `git ls-files`.split($/)
12
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
13
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
14
+ spec.require_paths = ["lib"]
15
+
16
+ spec.add_runtime_dependency "lita", ">= 4.3"
17
+
18
+ spec.add_development_dependency "bundler", "~> 1.3"
19
+ spec.add_development_dependency "pry-byebug"
20
+ spec.add_development_dependency "rake"
21
+ spec.add_development_dependency "rack-test"
22
+ spec.add_development_dependency "rspec", ">= 3.0.0"
23
+ end
data/locales/en.yml ADDED
@@ -0,0 +1,4 @@
1
+ en:
2
+ lita:
3
+ handlers:
4
+ snack:
@@ -0,0 +1,4 @@
1
+ require "spec_helper"
2
+
3
+ describe Lita::Handlers::Snack, lita_handler: true do
4
+ end
@@ -0,0 +1,6 @@
1
+ require "lita-snack"
2
+ require "lita/rspec"
3
+
4
+ # A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
5
+ # was generated with Lita 4, the compatibility mode should be left disabled.
6
+ Lita.version_3_compatibility_mode = false
File without changes
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lita-snack
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Kyle Hasenkamp
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-21 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.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '4.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry-byebug
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
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: rack-test
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: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 3.0.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 3.0.0
97
+ description: Give your Lita bot a snack
98
+ email:
99
+ executables: []
100
+ extensions: []
101
+ extra_rdoc_files: []
102
+ files:
103
+ - ".gitignore"
104
+ - Gemfile
105
+ - LICENSE
106
+ - README.md
107
+ - Rakefile
108
+ - lib/lita-snack.rb
109
+ - lib/lita/handlers/snack.rb
110
+ - lita-snack.gemspec
111
+ - locales/en.yml
112
+ - spec/lita/handlers/snack_spec.rb
113
+ - spec/spec_helper.rb
114
+ - templates/.gitkeep
115
+ homepage: https://github.com/kylehasenkamp/lita-snack
116
+ licenses:
117
+ - MIT
118
+ metadata:
119
+ lita_plugin_type: handler
120
+ post_install_message:
121
+ rdoc_options: []
122
+ require_paths:
123
+ - lib
124
+ required_ruby_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ required_rubygems_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ requirements: []
135
+ rubyforge_project:
136
+ rubygems_version: 2.4.4
137
+ signing_key:
138
+ specification_version: 4
139
+ summary: Give your Lita bot a snack
140
+ test_files:
141
+ - spec/lita/handlers/snack_spec.rb
142
+ - spec/spec_helper.rb
143
+ has_rdoc: