lita-bingo 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b15a8b51719b8ed471289ae43e0ecba0f5363e20
4
+ data.tar.gz: cef24224f5c78243d3608094cf491acc03f22f4a
5
+ SHA512:
6
+ metadata.gz: f3bd52afed997904693bcf669eb8f1e3d4b61daa8d6cde920b71fce0e4f430b2a19d1abf16ded086d578b5c297a7da94410c01e21e2f53261feeebc33aba71b3
7
+ data.tar.gz: bcfa11adbdc4b60a3a4c510c557bcfbf53e977973c7f6f73f2e7625d7da18688944df1b302775f07c8c2792d90caa94051cf7a247987f97062abf402fbff96f3
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --profile
@@ -0,0 +1,9 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.1.2
5
+ script: bundle exec rake
6
+ before_install:
7
+ - gem update --system
8
+ services:
9
+ - redis-server
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
@@ -0,0 +1,20 @@
1
+ # lita-bingo
2
+
3
+ [![Coverage Status](https://img.shields.io/coveralls/SammyLin/lita-bingo.svg)](https://coveralls.io/r/SammyLin/lita-bingo?branch=master)
4
+ [![Travis CI](https://travis-ci.org/SammyLin/lita-bingo.svg)](https://travis-ci.org/SammyLin/lita-bingo)
5
+
6
+ **lita-bingo** is a handler for [Lita](https://github.com/jimmycuadra/lita)
7
+ that outputs random funny formats text (using the
8
+ [FUN SLOOTS](http://slot.miario.com/))
9
+
10
+ ## Installation
11
+
12
+ Add lita-bingo to your Lita instance's Gemfile:
13
+
14
+ ``` ruby
15
+ gem "lita-bingo"
16
+ ```
17
+
18
+ ## License
19
+
20
+ [MIT](http://opensource.org/licenses/MIT)
@@ -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
@@ -0,0 +1,8 @@
1
+ require "lita"
2
+
3
+ Lita.load_locales Dir[File.expand_path(
4
+ File.join("..", "..", "locales", "*.yml"), __FILE__
5
+ )]
6
+
7
+ require "lita/handlers/bingo/engineer"
8
+ require "lita/handlers/bingo/overtime"
@@ -0,0 +1,36 @@
1
+ module Lita
2
+ module Lita::Handlers::Bingo
3
+ class Engineer < Lita::Handler
4
+
5
+ route(/工程師|engineer|凹/i, :engineer, command: true, help: {
6
+ t("help.engineer_key") => t("help.engineer_value")
7
+ })
8
+
9
+ def engineer(response)
10
+ reply1 = %w(
11
+ 你就當練功
12
+ 你就當學經驗
13
+ 你就當我都不懂
14
+ 你要想未來的分紅
15
+ 你要看長遠一點
16
+ 你就當練技術
17
+ 你就當測試
18
+ ).sample
19
+
20
+ reply2 = %w(
21
+ 幫我修這個Bug吧!
22
+ 幫我做這個案子吧!
23
+ 幫我解這個問題吧!
24
+ 幫我回這個客戶吧!
25
+ 幫我上這個App吧!
26
+ 幫我墊這個小錢吧!
27
+ 幫我加這個欄位吧!
28
+ 幫我偷這些資料吧!
29
+ ).sample
30
+
31
+ response.reply "#{reply1}#{reply2}"
32
+ end
33
+ end
34
+ Lita.register_handler(Engineer)
35
+ end
36
+ end
@@ -0,0 +1,51 @@
1
+ module Lita
2
+ module Lita::Handlers::Bingo
3
+ class Overtime < Lita::Handler
4
+
5
+ route(/加班|overtime/i, :overtime, command: true, help: {
6
+ t("help.overtime_key") => t("help.overtime_value")
7
+ })
8
+
9
+ def overtime(response)
10
+ reply1 = %w(
11
+ 賽車
12
+ 引擎
13
+ 繪圖
14
+ 網路平台
15
+ 航空
16
+ 撞球
17
+ 三國
18
+ ).sample
19
+
20
+ reply2 = %w(
21
+ 功能
22
+ 問題
23
+ 文件
24
+ 系統
25
+ \ bug\
26
+ \ feature\
27
+ \ API\
28
+ 規格
29
+ 子系統
30
+ \ memory\
31
+ 效能
32
+ ).sample
33
+ reply3 = %w(
34
+ 實做
35
+ 設計
36
+ 除錯
37
+ 修正
38
+ 支援
39
+ 協助
40
+ 追蹤
41
+ 了解
42
+ 蒐集
43
+ 測試
44
+ 試用
45
+ ).sample
46
+ response.reply "#{reply1}#{reply2}#{reply3}"
47
+ end
48
+ end
49
+ Lita.register_handler(Overtime)
50
+ end
51
+ end
@@ -0,0 +1,25 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "lita-bingo"
3
+ spec.version = "0.1.0"
4
+ spec.authors = ["Sammy Lin"]
5
+ spec.email = ["sammylintw@gmail.com"]
6
+ spec.description = %q{A Lita handler that random formats text}
7
+ spec.summary = %q{Lita Bindo handler}
8
+ spec.homepage = "https://github.com/SammyLin/lita-bingo"
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.0"
18
+
19
+ spec.add_development_dependency "bundler", "~> 1.3"
20
+ spec.add_development_dependency "rake"
21
+ spec.add_development_dependency "rack-test"
22
+ spec.add_development_dependency "rspec", ">= 3.0.0"
23
+ spec.add_development_dependency "simplecov"
24
+ spec.add_development_dependency "coveralls"
25
+ end
@@ -0,0 +1,12 @@
1
+ en:
2
+ lita:
3
+ handlers:
4
+ bingo:
5
+ engineer:
6
+ help:
7
+ engineer_key: "say engineer"
8
+ engineer_value: "Random Format TEXT using bingo"
9
+ overtime:
10
+ help:
11
+ overtime_key: "say overtime"
12
+ overtime_value: "Random Format TEXT using bingo"
@@ -0,0 +1,8 @@
1
+ require "spec_helper"
2
+
3
+ describe Lita::Handlers::Bingo::Engineer, lita_handler: true do
4
+ it { is_expected.to route_command("工程師").to(:engineer) }
5
+ it { is_expected.to route_command("找工程師").to(:engineer) }
6
+ it { is_expected.to route_command("找engineer").to(:engineer) }
7
+ it { is_expected.to route_command("可以凹他嗎").to(:engineer) }
8
+ end
@@ -0,0 +1,5 @@
1
+ require "spec_helper"
2
+
3
+ describe Lita::Handlers::Bingo::Overtime, lita_handler: true do
4
+ it { is_expected.to route_command("我要加班了").to(:overtime) }
5
+ end
@@ -0,0 +1,15 @@
1
+ require "simplecov"
2
+ require "coveralls"
3
+
4
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
5
+ SimpleCov::Formatter::HTMLFormatter,
6
+ Coveralls::SimpleCov::Formatter
7
+ ]
8
+ SimpleCov.start { add_filter "spec/" }
9
+
10
+ require "lita-bingo"
11
+ require "lita/rspec"
12
+
13
+ # A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
14
+ # # was generated with Lita 4, the compatibility mode should be left disabled.
15
+ Lita.version_3_compatibility_mode = false
metadata ADDED
@@ -0,0 +1,161 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lita-bingo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Sammy Lin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-23 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.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
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: rake
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: rack-test
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: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 3.0.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 3.0.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
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: coveralls
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: A Lita handler that random formats text
112
+ email:
113
+ - sammylintw@gmail.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - ".gitignore"
119
+ - ".rspec"
120
+ - ".travis.yml"
121
+ - Gemfile
122
+ - README.md
123
+ - Rakefile
124
+ - lib/lita-bingo.rb
125
+ - lib/lita/handlers/bingo/engineer.rb
126
+ - lib/lita/handlers/bingo/overtime.rb
127
+ - lita-bingo.gemspec
128
+ - locales/en.yml
129
+ - spec/lita/handlers/bingo/engineer_spec.rb
130
+ - spec/lita/handlers/bingo/overtime_spec.rb
131
+ - spec/spec_helper.rb
132
+ homepage: https://github.com/SammyLin/lita-bingo
133
+ licenses:
134
+ - MIT
135
+ metadata:
136
+ lita_plugin_type: handler
137
+ post_install_message:
138
+ rdoc_options: []
139
+ require_paths:
140
+ - lib
141
+ required_ruby_version: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ required_rubygems_version: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: '0'
151
+ requirements: []
152
+ rubyforge_project:
153
+ rubygems_version: 2.2.2
154
+ signing_key:
155
+ specification_version: 4
156
+ summary: Lita Bindo handler
157
+ test_files:
158
+ - spec/lita/handlers/bingo/engineer_spec.rb
159
+ - spec/lita/handlers/bingo/overtime_spec.rb
160
+ - spec/spec_helper.rb
161
+ has_rdoc: