tweetlr 0.1.33 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1aa8a0d2e3bb12715a214d46d3deac6b98b86a11
4
- data.tar.gz: 396f8e7680f63b65fda9774b6a8cea375f00c703
3
+ metadata.gz: 0c9dad0a0520b23a7bad8320b9201b8532565840
4
+ data.tar.gz: c978579a001652cc5f2c6b7647936341c908326d
5
5
  SHA512:
6
- metadata.gz: af23c25ed42011c91a0d406ba90fb0062795755d6eefa5aff3fb3b040a6b84cf8bf47aa97f7268b14ee7fa10182ae6003b7db8a907ee1728006c2ca286be5680
7
- data.tar.gz: 207becfa278d0b07214b9bca848d7df0222ee91a576d5f18f9ffc387ee3a9d014bedcf5b84076e6f47c9e2cad71d293ea24db4dc41d38d039df217a91924b273
6
+ metadata.gz: 1ea2c9e42f4902069eefed131f2a358912b8594588d532e01cd9d387ed1fedf8502fd579a8af43edfabf9ac4e045b2db6e5c0a594c9bcc01ed15393bc5d4b2b5
7
+ data.tar.gz: ec2d6c170670baf3439de8c87ddea5d6553dfd7be8fa1cbcfdd9c9fd4bb70ec0a0b0eab3eaf67f046103f0f72ff7f184a9189df64376cf1e702af6feaf297340
@@ -73,10 +73,15 @@ private
73
73
  end
74
74
  end
75
75
  def self.call_twitter_with(search_call, config, lazy)
76
- if lazy
77
- response = ::Twitter.search(search_call, :since_id => config['since_id'] || config[:since_id], :count => config[:results_per_page], :result_type => config[:result_type])
78
- else
79
- response = ::Twitter.search(search_call, :count => config[:results_per_page], :result_type => config[:result_type])
76
+ begin
77
+ if lazy
78
+ response = ::Twitter.search(search_call, :since_id => config['since_id'] || config[:since_id], :count => config[:results_per_page], :result_type => config[:result_type])
79
+ else
80
+ response = ::Twitter.search(search_call, :count => config[:results_per_page], :result_type => config[:result_type])
81
+ end
82
+ rescue ::Twitter::Error::Client => error
83
+ log.error "Twitter client error: (#{error})"
84
+ response
80
85
  end
81
86
  response
82
87
  end
data/lib/tweetlr.rb CHANGED
@@ -2,7 +2,7 @@ require 'tweetlr/log_aware'
2
2
  require 'tweetlr/core'
3
3
 
4
4
  module Tweetlr
5
- VERSION = '0.1.33'
5
+ VERSION = '0.1.34'
6
6
 
7
7
  API_ENDPOINT_TWITTER = 'http://search.twitter.com/search.json'
8
8
  API_ENDPOINT_TUMBLR = 'http://www.tumblr.com'
@@ -19,11 +19,14 @@ describe Tweetlr::Processors::Twitter do
19
19
  tweets.should_not be_empty
20
20
  end
21
21
  it "copes with errors by retrying, not raising" do
22
- ::Twitter.stub(:search).and_raise(::Twitter::Error::TooManyRequests)
23
- Tweetlr::Processors::Twitter.stub!(:sleep) #releasing the sleep handbrake...
24
- Tweetlr::Processors::Twitter.should_receive(:sleep) #called in rescue block
25
- expect { Tweetlr::Processors::Twitter.call_twitter_api('mocky wocky',{})}.to_not raise_error(::Twitter::Error::TooManyRequests)
26
- end
22
+ ::Twitter.stub(:search).and_raise(::Twitter::Error::TooManyRequests)
23
+ Tweetlr::Processors::Twitter.stub!(:sleep) #releasing the sleep handbrake...
24
+ expect { Tweetlr::Processors::Twitter.call_twitter_api('mocky wocky',{})}.to_not raise_error(::Twitter::Error::TooManyRequests)
25
+ end
26
+ it "copes with client errors" do
27
+ ::Twitter.stub(:search).and_raise(::Twitter::Error::ClientError)
28
+ expect { Tweetlr::Processors::Twitter.call_twitter_api('mocky wocky',{})}.to_not raise_error(::Twitter::Error::TooManyRequests)
29
+ end
27
30
  end
28
31
  describe "#lazy_search(config)" do
29
32
  it "searches twitter for a given term" do
data/tweetlr.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "tweetlr"
3
- s.version = "0.1.33"
3
+ s.version = "0.1.34"
4
4
  s.author = "Sven Kraeuter"
5
5
  s.email = "sven.kraeuter@gmail.com"
6
6
  s.homepage = "http://tweetlr.5v3n.com"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tweetlr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.33
4
+ version: 0.1.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Kraeuter