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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 510ee11046c9b80edfa2737fc303af23616c3352
4
- data.tar.gz: 6017d07ab4330374214c4ed75a31a48009aba97d
3
+ metadata.gz: 4ec18fe7ed61d1d26702e8f06b5e01e58f050a45
4
+ data.tar.gz: 0fba2f618421ada345a414476d4184f4fbcd4582
5
5
  SHA512:
6
- metadata.gz: 9df789d85d5fc419f01066aa3d35c53a7d9064c8edbd94d499ed2ae6d66b0821768993ec565015c85dcc72f0b32861557a441a5e7026a128d184b7aa8c133428
7
- data.tar.gz: 40287f12b8ca8a96c9f52dfdbbc670747673654c820a57b2388b6a000d7ea9b1a588944e75f3d5bdfadec7ec0eeffa4e66338e87739e5d858860da9634b300a0
6
+ metadata.gz: 7ec41ac4fc9b296231514a8ef66336da95a7f92266f3e4d2e8b4b0e4da824fa1ee9cae1b50f031936d865a01822408e24e96afb26cd6b2b985f083172920bd2b
7
+ data.tar.gz: d2bcc7d8f87a259a6377d13d567f328676adb536b7ca6401eb40abba45b35292fe1f964b466df178250bb3bb49ec3ab11394697d442f83c8f75251e208e04ba0
@@ -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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-reddim"
3
- spec.version = "0.0.1"
3
+ spec.version = "0.0.2"
4
4
  spec.authors = ["Joel Cogen"]
5
5
  spec.email = ["joel@redilio.us"]
6
6
  spec.description = %q{A Lita handler for Reddit images}
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-reddim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Cogen