twitter_ebooks 3.0.5 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ebooks +1 -1
- data/lib/twitter_ebooks/bot.rb +3 -4
- data/lib/twitter_ebooks/version.rb +1 -1
- data/spec/bot_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a1690e476b3e3374a0a63bd9bf90aa0736cbfe2
|
4
|
+
data.tar.gz: ca5b19da54cdaef4ca5c263c6c360fdb7fc3829f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 064618e7118a6a1c7e010d8b267c71fa4748f6a1b1ddcae84c6dd3c9ea93588074784fa75ab9b5e9424c2525f36cc32cfd31997bd6122f1438e52d9ffc849afc
|
7
|
+
data.tar.gz: cb38f8d6ee1ecaa00dd482ff6aa6117c8cb0ca4571b354542a0147e1f289668bd692b06827ff99f156395f3810cb41f87d7eb6fc6b53acc096aa894abdd6ef42
|
data/bin/ebooks
CHANGED
data/lib/twitter_ebooks/bot.rb
CHANGED
@@ -29,7 +29,7 @@ module Ebooks
|
|
29
29
|
usertweets = @tweets.select { |t| t.user.screen_name.downcase == username.downcase }
|
30
30
|
|
31
31
|
if usertweets.length > 2
|
32
|
-
if (usertweets[-1].created_at - usertweets[-3].created_at) <
|
32
|
+
if (usertweets[-1].created_at - usertweets[-3].created_at) < 10
|
33
33
|
return true
|
34
34
|
end
|
35
35
|
end
|
@@ -84,8 +84,7 @@ module Ebooks
|
|
84
84
|
# Process mentions to figure out who to reply to
|
85
85
|
# i.e. not self and nobody who has seen too many secondary mentions
|
86
86
|
reply_mentions = @mentions.reject do |m|
|
87
|
-
username
|
88
|
-
username == @bot.username || !@bot.conversation(ev).can_include?(username)
|
87
|
+
m.downcase == @bot.username.downcase || !@bot.conversation(ev).can_include?(m)
|
89
88
|
end
|
90
89
|
@reply_mentions = ([ev.user.screen_name] + reply_mentions).uniq
|
91
90
|
|
@@ -383,8 +382,8 @@ module Ebooks
|
|
383
382
|
return false
|
384
383
|
end
|
385
384
|
|
386
|
-
log "Replying to @#{ev.user.screen_name} with: #{meta.reply_prefix + text}"
|
387
385
|
text = meta.reply_prefix + text unless text.match /@#{Regexp.escape ev.user.screen_name}/i
|
386
|
+
log "Replying to @#{ev.user.screen_name} with: #{text}"
|
388
387
|
tweet = twitter.update(text, opts.merge(in_reply_to_status_id: ev.id))
|
389
388
|
conversation(tweet).add(tweet)
|
390
389
|
tweet
|
data/spec/bot_spec.rb
CHANGED
@@ -83,7 +83,7 @@ end
|
|
83
83
|
|
84
84
|
describe Ebooks::Bot do
|
85
85
|
include Ebooks::Test
|
86
|
-
let(:bot) { TestBot.new('
|
86
|
+
let(:bot) { TestBot.new('Test_Ebooks') }
|
87
87
|
|
88
88
|
before { Timecop.freeze }
|
89
89
|
after { Timecop.return }
|
@@ -158,11 +158,11 @@ describe Ebooks::Bot do
|
|
158
158
|
bot.receive_event(mock_tweet("spammer", "@test_ebooks @m1sp 7"))
|
159
159
|
expect_tweet(bot, "@spammer @m1sp echo: 7")
|
160
160
|
|
161
|
-
Timecop.travel(Time.now +
|
161
|
+
Timecop.travel(Time.now + 2)
|
162
162
|
bot.receive_event(mock_tweet("spammer", "@test_ebooks @m1sp 8"))
|
163
163
|
expect_tweet(bot, "@spammer @m1sp echo: 8")
|
164
164
|
|
165
|
-
Timecop.travel(Time.now +
|
165
|
+
Timecop.travel(Time.now + 2)
|
166
166
|
bot.receive_event(mock_tweet("spammer", "@test_ebooks @m1sp 9"))
|
167
167
|
expect(bot.twitter).to_not have_received(:update)
|
168
168
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter_ebooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaiden Mispy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|