lita-snoo 0.1.1 → 0.1.2
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/lib/lita/handlers/snoo.rb +3 -1
- data/lita-snoo.gemspec +1 -1
- data/spec/lita/handlers/snoo_spec.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e7d02daf4210faa0f77cca69b8d429b3996b634
|
4
|
+
data.tar.gz: 6a8d27eb7b704efa68ef751aafc55269af63a01a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25aba2f0c8ebdbd7e039bb3df0ad08a0927f6884417f52029158d6cb0496775c4ff97eb7ed960054890743215ff43c4839379d7aee7815ed5317c77d3cd756a3
|
7
|
+
data.tar.gz: 622a0afa5c45adc2627b0603f2c36ce89d3659c3671a0d7287a4da9f8e2d9b27739452c2b202593a13a2a378af9473db86711b8205f4557bfbeb3c9d2325757c
|
data/.gitignore
CHANGED
data/lib/lita/handlers/snoo.rb
CHANGED
@@ -14,7 +14,9 @@ module Lita
|
|
14
14
|
|
15
15
|
def ambient_url(response)
|
16
16
|
url = response.matches.first.first.split("#").first
|
17
|
-
|
17
|
+
hostname = URI.parse(url).hostname
|
18
|
+
return if hostname.nil?
|
19
|
+
if config.domains.any? { |d| hostname.include? d }
|
18
20
|
post = api_search("url:'#{url}'")
|
19
21
|
if response.message.command?
|
20
22
|
response.reply post ? post : "No reddit posts found for #{url}"
|
data/lita-snoo.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-snoo"
|
3
|
-
spec.version = "0.1.
|
3
|
+
spec.version = "0.1.2"
|
4
4
|
spec.authors = ["Tristan Chong"]
|
5
5
|
spec.email = ["ong@tristaneuan.ch"]
|
6
6
|
spec.description = "A Lita handler for reddit that can detect imgur (or custom) URLs and find their original posts"
|
@@ -59,6 +59,10 @@ describe Lita::Handlers::Snoo, lita_handler: true do
|
|
59
59
|
expect(replies.first).not_to match(/&/)
|
60
60
|
end
|
61
61
|
|
62
|
+
it "does not raise an error for a false positive URL" do
|
63
|
+
expect { send_command "translate(zh-cn:en) 您好" }.not_to raise_error
|
64
|
+
end
|
65
|
+
|
62
66
|
end
|
63
67
|
|
64
68
|
describe "#url" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-snoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tristan Chong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
version: '0'
|
166
166
|
requirements: []
|
167
167
|
rubyforge_project:
|
168
|
-
rubygems_version: 2.
|
168
|
+
rubygems_version: 2.4.5
|
169
169
|
signing_key:
|
170
170
|
specification_version: 4
|
171
171
|
summary: A Lita handler for reddit that can detect imgur (or custom) URLs and find
|