tweetdump 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bin/tweetdump +4 -3
  3. data/lib/tweetdump.rb +2 -2
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -20,7 +20,8 @@ module TweetDumpOptions extend OptiFlagSet
20
20
  alternate_forms "k"
21
21
  description "Your search query"
22
22
  end
23
- optional_flag "log" do
23
+ optional_flag "logfile" do
24
+ alternate_forms "log"
24
25
  description "A file to log output to, defaults to /dev/null"
25
26
  end
26
27
  optional_flag "limit" do
@@ -34,7 +35,7 @@ t = TweetDump.new
34
35
  t.screen_name = ARGV.flags.screen_name
35
36
  t.password = ARGV.flags.password
36
37
  t.keyword = ARGV.flags.keyword
37
- t.logfile = ARGV.flags.log || '/dev/null'
38
38
  t.api = ARGV.flags.api
39
- t.limit = ARGV.flags.limit || 1
39
+ t.logfile = ARGV.flags.logfile if ARGV.flags.logfile?
40
+ t.limit = ARGV.flags.limit.to_i if ARGV.flags.limit?
40
41
  t.run!
@@ -48,7 +48,7 @@ private
48
48
  tweet = Hashie::Mash.new(JSON.parse(status))
49
49
  logger.info "Fetched tweet ##{tweet.id} via Streaming API"
50
50
  logger.info "Job Status: #{@count}/#{@limit}"
51
- if @count >= @limit
51
+ if @limit and @count >= @limit
52
52
  logger.info "Limit reached (#{@count} out of #{@limit})"
53
53
  logger.info "Disconnecting from Twitter"
54
54
  return
@@ -87,7 +87,7 @@ private
87
87
  puts JSON.dump(tweet)
88
88
  logger.info "Fetched tweet ##{tweet.id} via Search API"
89
89
  logger.info "Job Status: #{@count}/#{@limit}"
90
- if @count >= @limit
90
+ if @limit and @count >= @limit
91
91
  logger.info "Limit reached (#{@count} out of #{@limit})"
92
92
  return
93
93
  else
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Logan Koester