twuckoo 0.5.3 → 0.5.4

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: 9e0da30af484014f0edecddc44459957334539d7
4
- data.tar.gz: 6700134df35fdd23e627d27bae164caa36108345
3
+ metadata.gz: f9d17d13bcc1d563dbb8ed299480e041e2a7017f
4
+ data.tar.gz: 6aaedbb770723e6b2ba23e568ea39570290e0ddd
5
5
  SHA512:
6
- metadata.gz: 51cf21583a157e6367e024645bf40595c00a927ab6d4c9c6cc623bbdc3337e4b6421076ec821edf09eca1d64c8c90c6c058aa9a0129c780370c9d99fe103205c
7
- data.tar.gz: df7e5f1efb9263be222580ac7234b7c3dc54aef584de052071b562af78f907c9357007a31f27fa6a662d99d000d45ba400bfcff3015c9b010d2c6857ac13d5cd
6
+ metadata.gz: 17f9da97d02e04660a0f6007ce5ec8db929539bf36b11dcb87a30b9af4c29b3000194fddf705ab26a261b22a59206e2e58d3b8f603ab84ec87635b8d36dc366a
7
+ data.tar.gz: 74d5f13de867664ad5694e3ed7c431a0ad699c79214a806f3b6e15bb681502cdd352df851c13309877ec18e587735af5afdee46a1f8d3e0c690bcd2079443667
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- twuckoo (0.5.3)
4
+ twuckoo (0.5.4)
5
5
  hpricot (>= 0.6.164)
6
6
  mail (>= 1.6.0)
7
7
  tlsmail (>= 0.0.1)
@@ -10,6 +10,9 @@ module Twuckoo
10
10
  LINES_FILE = 'lines.txt'
11
11
  USED_LINES_FILE = 'used_lines.txt'
12
12
 
13
+ def initialize(tweeter_module)
14
+ end
15
+
13
16
  def setup
14
17
  @lines = []
15
18
  end
@@ -7,6 +7,10 @@ module Twuckoo
7
7
 
8
8
  WIKIPEDIA_HOST = "http://en.wikipedia.org"
9
9
 
10
+ def initialize(tweeter_module)
11
+ @tweeter_module = tweeter_module
12
+ end
13
+
10
14
  def setup
11
15
  end
12
16
 
@@ -26,7 +30,7 @@ module Twuckoo
26
30
  end
27
31
 
28
32
  def next
29
- prev_tweet = twitter_module.latest_tweet(config)
33
+ prev_tweet = @twitter_module.latest_tweet(config)
30
34
  next_tweet = fetch_tfa
31
35
  prev_tweet == next_tweet ? '' : next_tweet
32
36
  end
@@ -35,19 +35,19 @@ class Twuckoo::Runner
35
35
 
36
36
  attr_accessor :tweets_sent
37
37
 
38
- def initialize(feeder_class, tweeter_module=nil, args=[])
38
+ def initialize(feeder_class, tweeter_module=Twuckoo::TwitterOauth, args=[])
39
+ # tweeter_module should be a class instance instead. Then everything falls into place
40
+ @tweeter_module = tweeter_module
41
+
39
42
  #TODO: Fail if feeder_class is nil or better: parse options first
40
43
  unless feeder_class.nil?
41
44
  feeder_class = self.class.get_feeder_class(feeder_class)
42
- @feeder = feeder_class.new
45
+ @feeder = feeder_class.new(@tweeter_module)
43
46
  end
44
47
 
45
48
  #TODO: This should be stored in the tweeter, not the runner
46
49
  @tweets_sent = 0
47
50
 
48
- # tweeter_module should be a class instance instead. Then everything falls into place
49
- @tweeter_module = tweeter_module.nil? ? Twuckoo::TwitterOauth : tweeter_module
50
-
51
51
  @options = OpenStruct.new
52
52
  parse_options!(args)
53
53
  @feeder.setup
@@ -1,3 +1,3 @@
1
1
  module Twuckoo
2
- VERSION = '0.5.3'
2
+ VERSION = '0.5.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twuckoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Balint Erdi