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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/twuckoo/feeders/one_line_from_file.rb +3 -0
- data/lib/twuckoo/feeders/wikipedia_tfa.rb +5 -1
- data/lib/twuckoo/runner.rb +5 -5
- data/lib/twuckoo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9d17d13bcc1d563dbb8ed299480e041e2a7017f
|
4
|
+
data.tar.gz: 6aaedbb770723e6b2ba23e568ea39570290e0ddd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17f9da97d02e04660a0f6007ce5ec8db929539bf36b11dcb87a30b9af4c29b3000194fddf705ab26a261b22a59206e2e58d3b8f603ab84ec87635b8d36dc366a
|
7
|
+
data.tar.gz: 74d5f13de867664ad5694e3ed7c431a0ad699c79214a806f3b6e15bb681502cdd352df851c13309877ec18e587735af5afdee46a1f8d3e0c690bcd2079443667
|
data/Gemfile.lock
CHANGED
@@ -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
|
data/lib/twuckoo/runner.rb
CHANGED
@@ -35,19 +35,19 @@ class Twuckoo::Runner
|
|
35
35
|
|
36
36
|
attr_accessor :tweets_sent
|
37
37
|
|
38
|
-
def initialize(feeder_class, tweeter_module=
|
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
|
data/lib/twuckoo/version.rb
CHANGED