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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 216097fd35b255ddec313b23165d2567ca7531c3
4
- data.tar.gz: 2b54bf321d33cb4b9a72f86049283f1ac8eb4bc8
3
+ metadata.gz: 8a1690e476b3e3374a0a63bd9bf90aa0736cbfe2
4
+ data.tar.gz: ca5b19da54cdaef4ca5c263c6c360fdb7fc3829f
5
5
  SHA512:
6
- metadata.gz: 7fe62a7fa1c3ac656b8cd9f241a585cf0f12cbb8c3bd426cb2f0b41d62fc84e88ac0fed2a265280784ad79658b9afcfda5967fcfad2f3bbdd1ad02618a361453
7
- data.tar.gz: 59dc22b0ba45436013e64a0047253eeeaf743e79a2a1f80fccd1533dc480a2365f94dd667962257b559802cd49c083ec1e84ad786da7c828a6808f7f0793ea05
6
+ metadata.gz: 064618e7118a6a1c7e010d8b267c71fa4748f6a1b1ddcae84c6dd3c9ea93588074784fa75ab9b5e9424c2525f36cc32cfd31997bd6122f1438e52d9ffc849afc
7
+ data.tar.gz: cb38f8d6ee1ecaa00dd482ff6aa6117c8cb0ca4571b354542a0147e1f289668bd692b06827ff99f156395f3810cb41f87d7eb6fc6b53acc096aa894abdd6ef42
data/bin/ebooks CHANGED
@@ -264,7 +264,7 @@ STR
264
264
  puts e.backtrace.map { |s| "\t"+s }.join("\n")
265
265
  end
266
266
  bot.log "Sleeping before reconnect"
267
- sleep 5
267
+ sleep 60
268
268
  end
269
269
  end
270
270
  end
@@ -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) < 30
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 = m.downcase
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
@@ -1,3 +1,3 @@
1
1
  module Ebooks
2
- VERSION = "3.0.5"
2
+ VERSION = "3.0.6"
3
3
  end
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('test_ebooks') }
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 + 10)
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 + 10)
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.5
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-12 00:00:00.000000000 Z
11
+ date: 2014-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec