lita-reddim 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/reddim.rb +2 -2
- data/lita-reddim.gemspec +1 -1
- data/spec/lita/handlers/reddim_spec.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ec18fe7ed61d1d26702e8f06b5e01e58f050a45
|
4
|
+
data.tar.gz: 0fba2f618421ada345a414476d4184f4fbcd4582
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ec41ac4fc9b296231514a8ef66336da95a7f92266f3e4d2e8b4b0e4da824fa1ee9cae1b50f031936d865a01822408e24e96afb26cd6b2b985f083172920bd2b
|
7
|
+
data.tar.gz: d2bcc7d8f87a259a6377d13d567f328676adb536b7ca6401eb40abba45b35292fe1f964b466df178250bb3bb49ec3ab11394697d442f83c8f75251e208e04ba0
|
data/lib/lita/handlers/reddim.rb
CHANGED
@@ -10,7 +10,7 @@ module Lita
|
|
10
10
|
def reddim(response)
|
11
11
|
subr = response.matches[0][0]
|
12
12
|
response.reply(get_listing_from_sub(subr).sample)
|
13
|
-
rescue NoMethodError
|
13
|
+
rescue NoMethodError, JSON::ParserError
|
14
14
|
response.reply("/r/#{subr} is not a subreddit")
|
15
15
|
rescue => e
|
16
16
|
response.reply("Error: #{e}")
|
@@ -22,7 +22,7 @@ module Lita
|
|
22
22
|
@@cache[subr] ||= RedditListings
|
23
23
|
.get(subr, sort_by: "hot", total: "100")
|
24
24
|
.map { |post| post[:url] }
|
25
|
-
.select { |url| url.match(/(jpg|jpeg|png|gif)\z/) }
|
25
|
+
.select { |url| url.match(/(jpg|jpeg|png|gif|gifv|webm)\z/) }
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
data/lita-reddim.gemspec
CHANGED
@@ -24,6 +24,8 @@ describe Lita::Handlers::Reddim, lita_handler: true do
|
|
24
24
|
it "gives the error if bad sub" do
|
25
25
|
send_command("reddim sdjflkjazazeoifsdkjfbdv")
|
26
26
|
expect(replies.last).to eq("/r/sdjflkjazazeoifsdkjfbdv is not a subreddit")
|
27
|
+
send_command("reddim chiennasse") # thanks ave
|
28
|
+
expect(replies.last).to eq("/r/chiennasse is not a subreddit")
|
27
29
|
end
|
28
30
|
|
29
31
|
it "gives the error if unknown error" do
|