lita-wtf 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/.rubocop.yml +3 -0
- data/README.md +21 -3
- data/lib/lita-wtf.rb +2 -0
- data/lib/lita/handlers/wtf.rb +64 -2
- data/lita-wtf.gemspec +6 -4
- data/locales/en.yml +2 -1
- data/spec/files/merriam +8 -0
- data/spec/files/urban +1 -0
- data/spec/lita/handlers/wtf_spec.rb +75 -13
- data/spec/spec_helper.rb +28 -1
- metadata +38 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cc760cdfe9231a5686e102f208d7f5271ce3ded
|
4
|
+
data.tar.gz: dea01bd0bd5b39e2ccd74dc255fa8e6f89f59360
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd61ba1a8eea0bcd4b4ececeab3aefe8836f03ad9358f9dee2fa21fd2be724d81521c1c2a0178b3de56ef9505661bb8443d5a9b584c063f5a28a55e3e3b048b2
|
7
|
+
data.tar.gz: 7a3aeb2d1cd7f6619e537dfda411c0a52f393ad461e25ad43d822e07c7bbda4aeb2e9b399e891f1bf17e9e285b4ceb5f38bdd7271cde2ba3889aa9dd562a83ce
|
data/.gitignore
CHANGED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color --profile 5
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -19,7 +19,14 @@ gem "lita-wtf"
|
|
19
19
|
|
20
20
|
## Configuration
|
21
21
|
|
22
|
-
|
22
|
+
Optionally, you can add 'See Also' handlers
|
23
|
+
|
24
|
+
```
|
25
|
+
lita.config.wtf.see_also = ['merriam', 'urbandictionary']
|
26
|
+
lita.config.wtf.api_keys = {
|
27
|
+
'merriam': 'abc123'
|
28
|
+
}
|
29
|
+
```
|
23
30
|
|
24
31
|
## Usage
|
25
32
|
|
@@ -37,6 +44,17 @@ lita wtf is foo
|
|
37
44
|
> foo is something that you want to have defined
|
38
45
|
```
|
39
46
|
|
40
|
-
|
47
|
+
Optionally, get 'See Also' recommendations:
|
48
|
+
|
49
|
+
```
|
50
|
+
lita wtf is foo
|
51
|
+
> According to Merriam-Webster Collegiate Dictionary,
|
52
|
+
> foo is a mythical lion-dog used as a decorative motif
|
53
|
+
> in Far Eastern art
|
54
|
+
> To replace this with our own definition, type: define foo is <description>.
|
55
|
+
```
|
56
|
+
|
57
|
+
## Development
|
41
58
|
|
42
|
-
|
59
|
+
This project uses dotenv to load sensitive variables for development. Create
|
60
|
+
a .env file in your local copy with "MERRIAM_KEY=<whatever key you use>"
|
data/lib/lita-wtf.rb
CHANGED
data/lib/lita/handlers/wtf.rb
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
module Lita
|
2
2
|
module Handlers
|
3
3
|
class Wtf < Handler
|
4
|
+
config :see_also, required: false, type: Array, default: []
|
5
|
+
config :api_keys, required: false, type: Hash, default: {}
|
6
|
+
|
7
|
+
SOURCE_NAMES = {
|
8
|
+
'merriam' => 'Merriam-Webster Collegiate Dictionary',
|
9
|
+
'urbandictionary' => 'UrbanDictionary'
|
10
|
+
}.freeze
|
11
|
+
|
4
12
|
route(
|
5
13
|
/^wtf(?:\s+is)?\s(?<term>[^\s@#]+)(?:\?)?/,
|
6
14
|
:lookup,
|
@@ -21,8 +29,15 @@ module Lita
|
|
21
29
|
|
22
30
|
def lookup(response)
|
23
31
|
term = response.match_data['term']
|
24
|
-
return response.reply(
|
25
|
-
|
32
|
+
return response.reply(format_definition(term, definition(term))) if known?(term)
|
33
|
+
|
34
|
+
definition, source_name = alternate_definition(term)
|
35
|
+
return response.reply(t('wtf.seealso',
|
36
|
+
term: term,
|
37
|
+
definition: definition,
|
38
|
+
source: SOURCE_NAMES[source_name])) if definition
|
39
|
+
|
40
|
+
response.reply(t('wtf.unknown', term: term))
|
26
41
|
end
|
27
42
|
|
28
43
|
def define(response)
|
@@ -50,6 +65,53 @@ module Lita
|
|
50
65
|
redis.hset(term.downcase, 'definition', definition)
|
51
66
|
redis.hset(term.downcase, 'owner', owner)
|
52
67
|
end
|
68
|
+
|
69
|
+
def alternate_definition(term)
|
70
|
+
config.see_also.each do |source_name|
|
71
|
+
definition = send("lookup_#{source_name}", term)
|
72
|
+
return definition, source_name if definition
|
73
|
+
end
|
74
|
+
|
75
|
+
nil
|
76
|
+
end
|
77
|
+
|
78
|
+
def lookup_merriam(term)
|
79
|
+
api_key = config.api_keys['merriam']
|
80
|
+
# FIXME: Add timeouts.
|
81
|
+
response = http.get('http://www.dictionaryapi.com/api/v1/'\
|
82
|
+
"references/collegiate/xml/#{term}",
|
83
|
+
key: api_key)
|
84
|
+
|
85
|
+
raise unless response.status == 200
|
86
|
+
|
87
|
+
format_merriam_entries(response.body)
|
88
|
+
rescue StandardError
|
89
|
+
nil
|
90
|
+
end
|
91
|
+
|
92
|
+
def format_merriam_entries(content)
|
93
|
+
nokogiri_dom = Nokogiri::XML(content) do |config|
|
94
|
+
config.options = Nokogiri::XML::ParseOptions::STRICT |
|
95
|
+
Nokogiri::XML::ParseOptions::NONET
|
96
|
+
end
|
97
|
+
|
98
|
+
nokogiri_dom.css('//entry[1]/def/dt/text()').to_s[1..-1]
|
99
|
+
rescue StandardError
|
100
|
+
nil
|
101
|
+
end
|
102
|
+
|
103
|
+
def lookup_urbandictionary(term)
|
104
|
+
# FIXME: Add timeouts.
|
105
|
+
response = http.get('http://api.urbandictionary.com/v0/define',
|
106
|
+
term: term)
|
107
|
+
|
108
|
+
def_list = JSON.parse(response.body)['list']
|
109
|
+
def_text = def_list[0]['definition'].strip
|
110
|
+
def_text[0] = def_text[0].chr.downcase
|
111
|
+
def_text
|
112
|
+
rescue StandardError
|
113
|
+
nil
|
114
|
+
end
|
53
115
|
end
|
54
116
|
|
55
117
|
Lita.register_handler(Wtf)
|
data/lita-wtf.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-wtf'
|
3
|
-
spec.version = '1.0
|
4
|
-
spec.authors = ['Eric Sigler', 'Rob Ottaway']
|
5
|
-
spec.email = ['me@esigler.com', 'rottaway@pagerduty.com']
|
3
|
+
spec.version = '1.1.0'
|
4
|
+
spec.authors = ['Eric Sigler', 'Rob Ottaway', 'Max T']
|
5
|
+
spec.email = ['me@esigler.com', 'rottaway@pagerduty.com', 'github@maxvt.com']
|
6
6
|
spec.description = 'A user-controlled dictionary plugin for Lita'
|
7
|
-
spec.summary =
|
7
|
+
spec.summary = spec.description
|
8
8
|
spec.homepage = 'http://github.com/esigler/lita-wtf'
|
9
9
|
spec.license = 'MIT'
|
10
10
|
spec.metadata = { 'lita_plugin_type' => 'handler' }
|
@@ -15,9 +15,11 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.require_paths = ['lib']
|
16
16
|
|
17
17
|
spec.add_runtime_dependency 'lita', '>= 4.0'
|
18
|
+
spec.add_runtime_dependency 'nokogiri'
|
18
19
|
|
19
20
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
20
21
|
spec.add_development_dependency 'coveralls'
|
22
|
+
spec.add_development_dependency 'dotenv'
|
21
23
|
spec.add_development_dependency 'rake'
|
22
24
|
spec.add_development_dependency 'rspec', '>= 3.0'
|
23
25
|
spec.add_development_dependency 'rubocop'
|
data/locales/en.yml
CHANGED
@@ -4,11 +4,12 @@ en:
|
|
4
4
|
wtf:
|
5
5
|
help:
|
6
6
|
wtf:
|
7
|
-
syntax: wtf is <term
|
7
|
+
syntax: wtf is <term>
|
8
8
|
desc: Get the description of <term>
|
9
9
|
define:
|
10
10
|
syntax: define <term> is <defintion>
|
11
11
|
desc: Set the description of <term> to <definition>
|
12
12
|
wtf:
|
13
13
|
is: "%{term} is %{definition}"
|
14
|
+
seealso: "According to %{source}, %{term} is %{definition}\nTo replace this with our own definition, type: define %{term} is <description>."
|
14
15
|
unknown: "I don't know what %{term} is, type: define %{term} is <description> to set it."
|
data/spec/files/merriam
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
2
|
+
<entry_list version="1.0">
|
3
|
+
<entry id="foo dog"><ew>foo dog</ew><subj>MY</subj><hw>foo dog</hw><sound><wav>foo_do01.wav</wav><wpr>!fU-!dog</wpr></sound><vr><vl>or</vl> <va>fu dog</va> <pr>ˈfü-</pr></vr><fl>noun</fl><lb>often capitalized F</lb><et>Chinese (Beijing) <it>fó</it> Buddha; from the use of such figures in ceramic or stone as guardians of Buddhist temples</et><def><date>1953</date><dt>:a mythical lion-dog used as a decorative motif in Far Eastern art</dt></def></entry>
|
4
|
+
<entry id="foo-foo[1]"><hw>foo-foo[1]</hw><fl>teaser entry</fl></entry>
|
5
|
+
<entry id="foo-foo[2]"><hw>foo-foo[2]</hw><fl>teaser entry</fl></entry>
|
6
|
+
<entry id="egg foo yong"><ew>egg foo yong</ew><grp>egg foo</grp><grp>egg yong</grp><grp>foo yong</grp><subj>FD</subj><hw>egg foo yong</hw><sound><wav>eggfo01v.wav</wav><wpr>!eg-!fU-!yuN</wpr></sound><vr><vl>or</vl> <va>egg foo young</va> <vl>or</vl> <va>egg foo yung</va> <pr>-ˈfü-ˈyəŋ</pr></vr><fl>noun</fl><et>Chinese (Guangdong) <it>fuùh yuùhng</it> egg white, egg-coated ingredients, literally, a kind of hibiscus</et><def><date>1917</date><dt>:a fried egg patty containing vegetables (as bean sprouts) and sometimes meat</dt></def></entry>
|
7
|
+
<entry id="fu dog"><ew>fu dog</ew><subj>MY#FA</subj><hw>fu dog</hw><lb>often capitalized F</lb><cx><cl>variant of</cl> <ct>foo dog</ct></cx></entry>
|
8
|
+
</entry_list>
|
data/spec/files/urban
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"tags":["fool","foos","bar","dumbass","bitch","dude","foo fighters","fu","homie","foosball"],"result_type":"exact","list":[{"definition":"An term used for unimportant variables in programming when the programmer is too lazy to think of an actual name. The origin of such word is described in detail in [RFC] 3092.","permalink":"http://foo.urbanup.com/765064","thumbs_up":1384,"author":"Dahhak","word":"foo","defid":765064,"current_vote":"","example":"int foo;\r\nfoo = 2 + 2;\r\ncout << foo;","thumbs_down":470},{"definition":"A contracted version of the word 'fool'.\r\n\r\nThe word origionated with Mr.T. Due to the extended contact with cheap substitute gold, he can no longer tell the difference between anybody he meets. In order to save himself the humiliation of asking who he's talking to, he simply refers to anyone and every one as 'foo' or 'sucka'. ","permalink":"http://foo.urbanup.com/78594","thumbs_up":1303,"author":"CubanB","word":"Foo","defid":78594,"current_vote":"","example":"\"You crazy foo!\"\r\n\"Dial 1-800-COLLECT, foo!\"","thumbs_down":688},{"definition":"One of the default variables in programmer's slang. See [bar].","permalink":"http://foo.urbanup.com/6579","thumbs_up":434,"author":"Anonymous","word":"foo","defid":6579,"current_vote":"","example":"And I incremented foo, but then forgot to check the array boundary and all hell broke loose","thumbs_down":237},{"definition":"foo A sample name for absolutely anything,\r\nespecially programs and files (especially scratch files).\r\nFirst on the standard list of metasyntactic variables used\r\nin syntax examples.","permalink":"http://foo.urbanup.com/5357921","thumbs_up":288,"author":"fooman99","word":"foo","defid":5357921,"current_vote":"","example":"The terms foobar, foo, bar, and baz are sometimes used as placeholder names (also referred to as metasyntactic variables) in computer programming or computer-related documentation. They have been used to name entities such as variables, functions, and commands whose purpose is unimportant and serve only to demonstrate a concept. The words themselves have no meaning in this usage. Foobar is sometimes used alone; foo, bar, and baz are sometimes used in that order, when multiple entities are needed.","thumbs_down":119},{"definition":"1. A word meaning \"fool\", in the case of Mr. T\r\n\r\n2. A commonly used programming variable, used when someone doesn't want to spend the time thinking up a real name for it.\r\n\r\n3. A [metasyntactic variable] commonly used by coders.\r\n\r\nFoo is often used in conjunction with the words [bar] [baz] and [qux]","permalink":"http://foo.urbanup.com/1073697","thumbs_up":464,"author":"\"Niffshack\"","word":"foo","defid":1073697,"current_vote":"","example":"1. \"I pity the foo!\"\r\n\r\n2. foo = 3;\r\n\r\n3. \"Damn! Dont we have any good food? All thats left is this foo!\"\r\n\"The code is full of foo\"","thumbs_down":357},{"definition":"Kung fu means skill from effort.\r\nKung foo means skill from bad-ass programming powers.\r\n\r\n$foo is used extensivly in php as a generic variable.","permalink":"http://foo.urbanup.com/1136221","thumbs_up":268,"author":"Skara","word":"foo","defid":1136221,"current_vote":"","example":"\"This is my kung foo, and it is strong.\"\r\n\r\n$foo += 10;","thumbs_down":177},{"definition":"like [foo] except with proper use of the apostrophe for the omission of the letter l. A contraction of the word fool","permalink":"http://foo.urbanup.com/960374","thumbs_up":105,"author":"Aaron","word":"foo'","defid":960374,"current_vote":"","example":"Fast food will make you fat foo'!","thumbs_down":26},{"definition":"Foo was a nonsense word used by cartoonist Bill Holman in the comic strip \"Smokey Stover\" from the 30's into the 50's. He was reported to have discovered the word in a Chinese fortune cookie and the word appeared in almost every panel in the strip. It predates most of definitions that I have seen so far. The strip appeared in the SF Chronicle or the SF Examiner.","permalink":"http://foo.urbanup.com/5945353","thumbs_up":69,"author":"Pete71","word":"FOO","defid":5945353,"current_vote":"","example":"Foo was on signs along the road, on license plates or anywhere else one could imagine","thumbs_down":29},{"definition":"verb- to put ones finger in anothers ear and quickly wiggle it around.\n\nsubdefinitions:\n\nwet-foos- licking ones fingee before Foosing another person\n\nDouble-Foos: Using two fingers to Foos other(s) it can either be both ears of one person or one ear of two different people\n\nMiddlefinger-Foos: to Foos another using ones middle finger (considered much more disgraceful than a sandard Foos)","permalink":"http://foos.urbanup.com/4237735","thumbs_up":41,"author":"the foos master","word":"Foos","defid":4237735,"current_vote":"","example":"Tony jumped when he was unexpectedly Foosed from behind.\n\nHe felt disgraced after being middlefinger-foosed.","thumbs_down":21},{"definition":"An english student teacher, whos coolness overwhelms all.","permalink":"http://foos.urbanup.com/1192169","thumbs_up":82,"author":"Vorbis Yuckabitobis","word":"foos","defid":1192169,"current_vote":"","example":"What the foos?\r\nGo ask foos.\r\nIts Foos!\r\nSo you know that foos...","thumbs_down":64}],"sounds":["http://media.urbandictionary.com/sound/foo-2487.mp3","http://media.urbandictionary.com/sound/foo-16117.mp3"]}
|
@@ -1,35 +1,97 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Lita::Handlers::Wtf, lita_handler: true do
|
4
|
-
it
|
5
|
-
|
6
|
-
|
7
|
-
is_expected.to route_command('define foo is bar').to(:define)
|
8
|
-
end
|
4
|
+
it { is_expected.to route_command('wtf is foo').to(:lookup) }
|
5
|
+
it { is_expected.to route_command('wtf foo').to(:lookup) }
|
6
|
+
it { is_expected.to route_command('define foo is bar').to(:define) }
|
9
7
|
|
10
8
|
describe '#lookup' do
|
11
|
-
|
9
|
+
before do
|
10
|
+
robot.config.handlers.wtf.see_also = []
|
12
11
|
send_command('define web is Rails. Rails. Rails.')
|
13
|
-
send_command('
|
14
|
-
expect(replies.last).to eq('web is Rails. Rails. Rails.')
|
12
|
+
send_command('define &&--88^%!$*() is garbage text')
|
15
13
|
end
|
16
14
|
|
17
|
-
it '
|
18
|
-
send_command('
|
19
|
-
|
20
|
-
expect(replies.last).to eq('&&--88^%!$*() is garbage text')
|
15
|
+
it 'responds with the definition of the service' do
|
16
|
+
send_command('wtf is web')
|
17
|
+
expect(replies.last).to eq('web is Rails. Rails. Rails.')
|
21
18
|
end
|
22
19
|
|
23
20
|
it 'responds with the definition of a capitalized service' do
|
24
|
-
send_command('define web is Rails. Rails. Rails.')
|
25
21
|
send_command('wtf is WEB')
|
26
22
|
expect(replies.last).to eq('WEB is Rails. Rails. Rails.')
|
27
23
|
end
|
28
24
|
|
25
|
+
it 'allows definitions with lots of weird characters' do
|
26
|
+
send_command('wtf is &&--88^%!$*()')
|
27
|
+
expect(replies.last).to eq('&&--88^%!$*() is garbage text')
|
28
|
+
end
|
29
|
+
|
29
30
|
it 'responds with an error if there is no such service' do
|
30
31
|
send_command('wtf is foo')
|
31
32
|
expect(replies.last).to eq('I don\'t know what foo is, ' \
|
32
33
|
'type: define foo is <description> to set it.')
|
33
34
|
end
|
34
35
|
end
|
36
|
+
|
37
|
+
describe 'with urbandictionary enabled' do
|
38
|
+
before do
|
39
|
+
robot.config.handlers.wtf.see_also = ['urbandictionary']
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'responds with see also text' do
|
43
|
+
grab_request('get', 200, File.read('spec/files/urban'))
|
44
|
+
send_command('wtf is foo')
|
45
|
+
expect(replies).to include('According to UrbanDictionary, foo is an term used ' \
|
46
|
+
'for unimportant variables in programming when the ' \
|
47
|
+
'programmer is too lazy to think of an actual name. ' \
|
48
|
+
'The origin of such word is described in detail in ' \
|
49
|
+
"[RFC] 3092.\nTo replace this with our own " \
|
50
|
+
'definition, type: define foo is <description>.')
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'responds with just the define statement if there is nothing to look up' do
|
54
|
+
grab_request('get', 200, '') # Yes, the API returns a 200 on not found. Sigh.
|
55
|
+
send_command('wtf is asdkjfal')
|
56
|
+
expect(replies.last).to eq('I don\'t know what asdkjfal is, ' \
|
57
|
+
'type: define asdkjfal is <description> to set it.')
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe 'with merriam enabled' do
|
62
|
+
before do
|
63
|
+
robot.config.handlers.wtf.see_also = ['merriam']
|
64
|
+
robot.config.handlers.wtf.api_keys['merriam'] = ENV['MERRIAM_KEY']
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'responds with see also text' do
|
68
|
+
grab_request('get', 200, File.read('spec/files/merriam'))
|
69
|
+
send_command('wtf is foo')
|
70
|
+
expect(replies).to include('According to Merriam-Webster Collegiate Dictionary, ' \
|
71
|
+
'foo is a mythical lion-dog used as a decorative ' \
|
72
|
+
"motif in Far Eastern art\nTo replace this with our " \
|
73
|
+
'own definition, type: define foo is <description>.')
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'responds with just the define statement if there is nothing to look up' do
|
77
|
+
grab_request('get', 200, '') # Yes, the API returns a 200 on not found. Sigh.
|
78
|
+
send_command('wtf is asdkjfal')
|
79
|
+
expect(replies.last).to eq('I don\'t know what asdkjfal is, ' \
|
80
|
+
'type: define asdkjfal is <description> to set it.')
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'responds with just the define statement if there is a fetch error' do
|
84
|
+
grab_request('get', 500, nil)
|
85
|
+
send_command('wtf is asdkjfal')
|
86
|
+
expect(replies.last).to eq('I don\'t know what asdkjfal is, ' \
|
87
|
+
'type: define asdkjfal is <description> to set it.')
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'responds with just the define statement if there is a parse error' do
|
91
|
+
grab_request('get', 200, 'wha?')
|
92
|
+
send_command('wtf is asdkjfal')
|
93
|
+
expect(replies.last).to eq('I don\'t know what asdkjfal is, ' \
|
94
|
+
'type: define asdkjfal is <description> to set it.')
|
95
|
+
end
|
96
|
+
end
|
35
97
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,39 @@
|
|
1
1
|
require 'simplecov'
|
2
2
|
require 'coveralls'
|
3
|
-
SimpleCov.
|
3
|
+
SimpleCov.formatters = [
|
4
4
|
SimpleCov::Formatter::HTMLFormatter,
|
5
5
|
Coveralls::SimpleCov::Formatter
|
6
6
|
]
|
7
7
|
SimpleCov.start { add_filter '/spec/' }
|
8
8
|
|
9
|
+
require 'dotenv'
|
10
|
+
Dotenv.load
|
11
|
+
|
9
12
|
require 'lita-wtf'
|
13
|
+
|
10
14
|
require 'lita/rspec'
|
11
15
|
|
12
16
|
Lita.version_3_compatibility_mode = false
|
17
|
+
|
18
|
+
RSpec.configure do |config|
|
19
|
+
config.expect_with :rspec do |expectations|
|
20
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
21
|
+
end
|
22
|
+
|
23
|
+
config.mock_with :rspec do |mocks|
|
24
|
+
mocks.verify_partial_doubles = true
|
25
|
+
end
|
26
|
+
|
27
|
+
config.filter_run :focus
|
28
|
+
config.run_all_when_everything_filtered = true
|
29
|
+
config.default_formatter = 'doc' if config.files_to_run.one?
|
30
|
+
config.order = :random
|
31
|
+
|
32
|
+
Kernel.srand config.seed
|
33
|
+
end
|
34
|
+
|
35
|
+
def grab_request(method, status, body)
|
36
|
+
response = double('Faraday::Response', status: status, body: body)
|
37
|
+
allow_any_instance_of(Faraday::Connection).to receive(method.to_sym)
|
38
|
+
.and_return(response)
|
39
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-wtf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Sigler
|
8
8
|
- Rob Ottaway
|
9
|
+
- Max T
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2016-03-28 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: lita
|
@@ -25,6 +26,20 @@ dependencies:
|
|
25
26
|
- - ">="
|
26
27
|
- !ruby/object:Gem::Version
|
27
28
|
version: '4.0'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: nokogiri
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
28
43
|
- !ruby/object:Gem::Dependency
|
29
44
|
name: bundler
|
30
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,6 +68,20 @@ dependencies:
|
|
53
68
|
- - ">="
|
54
69
|
- !ruby/object:Gem::Version
|
55
70
|
version: '0'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: dotenv
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
56
85
|
- !ruby/object:Gem::Dependency
|
57
86
|
name: rake
|
58
87
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,11 +142,13 @@ description: A user-controlled dictionary plugin for Lita
|
|
113
142
|
email:
|
114
143
|
- me@esigler.com
|
115
144
|
- rottaway@pagerduty.com
|
145
|
+
- github@maxvt.com
|
116
146
|
executables: []
|
117
147
|
extensions: []
|
118
148
|
extra_rdoc_files: []
|
119
149
|
files:
|
120
150
|
- ".gitignore"
|
151
|
+
- ".rspec"
|
121
152
|
- ".rubocop.yml"
|
122
153
|
- ".travis.yml"
|
123
154
|
- CONTRIBUTING.md
|
@@ -129,6 +160,8 @@ files:
|
|
129
160
|
- lib/lita/handlers/wtf.rb
|
130
161
|
- lita-wtf.gemspec
|
131
162
|
- locales/en.yml
|
163
|
+
- spec/files/merriam
|
164
|
+
- spec/files/urban
|
132
165
|
- spec/lita/handlers/wtf_spec.rb
|
133
166
|
- spec/spec_helper.rb
|
134
167
|
homepage: http://github.com/esigler/lita-wtf
|
@@ -152,10 +185,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
185
|
version: '0'
|
153
186
|
requirements: []
|
154
187
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.
|
188
|
+
rubygems_version: 2.5.1
|
156
189
|
signing_key:
|
157
190
|
specification_version: 4
|
158
191
|
summary: A user-controlled dictionary plugin for Lita
|
159
192
|
test_files:
|
193
|
+
- spec/files/merriam
|
194
|
+
- spec/files/urban
|
160
195
|
- spec/lita/handlers/wtf_spec.rb
|
161
196
|
- spec/spec_helper.rb
|