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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d191cf075eb289d5575d0bc615e89b521efc9a2
4
- data.tar.gz: ebb0374e6f9a9fb7474bb18d9f1f6c52702f138d
3
+ metadata.gz: 4e7d02daf4210faa0f77cca69b8d429b3996b634
4
+ data.tar.gz: 6a8d27eb7b704efa68ef751aafc55269af63a01a
5
5
  SHA512:
6
- metadata.gz: 8eda2214e8ab83692691959511308c2b6a112588c99cf47a8cd4d194b157ac63e60b0c98fcb22ddecf6e365ec8b0630fc0479808881e1a22753399d36dca2d34
7
- data.tar.gz: 41a064110f2fbe60fa68265ac64b6450a802da019fc9f3bceccedd56493db10d29f7b6aea9ac6d692e440e5bfd1dc0da1e85a43872d977fbdf6a62bf785f547c
6
+ metadata.gz: 25aba2f0c8ebdbd7e039bb3df0ad08a0927f6884417f52029158d6cb0496775c4ff97eb7ed960054890743215ff43c4839379d7aee7815ed5317c77d3cd756a3
7
+ data.tar.gz: 622a0afa5c45adc2627b0603f2c36ce89d3659c3671a0d7287a4da9f8e2d9b27739452c2b202593a13a2a378af9473db86711b8205f4557bfbeb3c9d2325757c
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ *.swp
@@ -14,7 +14,9 @@ module Lita
14
14
 
15
15
  def ambient_url(response)
16
16
  url = response.matches.first.first.split("#").first
17
- if config.domains.any? { |d| URI.parse(url).hostname.include? d }
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.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.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-02 00:00:00.000000000 Z
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.2.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