tw 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -8,3 +8,4 @@ gem 'userstream'
8
8
  gem 'json'
9
9
  gem 'rainbow'
10
10
  gem 'args_parser'
11
+ gem 'parallel'
data/Gemfile.lock CHANGED
@@ -11,6 +11,7 @@ GEM
11
11
  hoe (3.1.0)
12
12
  rake (~> 0.8)
13
13
  json (1.7.4)
14
+ json (1.7.4-java)
14
15
  multi_json (1.3.6)
15
16
  multipart-post (1.1.5)
16
17
  newgem (1.5.3)
@@ -20,6 +21,7 @@ GEM
20
21
  rubigen (>= 1.5.3)
21
22
  syntax (>= 1.0.0)
22
23
  oauth (0.4.7)
24
+ parallel (0.5.18)
23
25
  rainbow (1.1.4)
24
26
  rake (0.9.2.2)
25
27
  rubigen (1.5.8)
@@ -44,6 +46,7 @@ DEPENDENCIES
44
46
  json
45
47
  newgem
46
48
  oauth
49
+ parallel
47
50
  rainbow
48
51
  twitter
49
52
  userstream
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.2.3 2012-10-06
2
+
3
+ * parallel request twitter API
4
+
1
5
  === 0.2.2 2012-10-06
2
6
 
3
7
  * unescape HTML
data/Rakefile CHANGED
@@ -18,7 +18,8 @@ $hoe = Hoe.spec 'tw' do
18
18
  ['twitter', '>= 4.0.0', '< 5.0.0'],
19
19
  ['userstream', '>= 1.2.0', '< 1.3.0'],
20
20
  ['args_parser', '>= 0.1.0'],
21
- ['rainbow', '>= 1.1.4', '< 2.0.0']]
21
+ ['rainbow', '>= 1.1.4', '< 2.0.0'],
22
+ ['parallel', '>= 0.5.18', '< 1.0.0']]
22
23
 
23
24
  end
24
25
 
data/lib/tw.rb CHANGED
@@ -10,6 +10,7 @@ require 'time'
10
10
  require 'cgi'
11
11
  require 'args_parser'
12
12
  require 'rainbow'
13
+ require 'parallel'
13
14
  require 'tw/conf'
14
15
  require 'tw/client/auth'
15
16
  require 'tw/client/request'
@@ -17,9 +18,8 @@ require 'tw/client/stream'
17
18
  require 'tw/client/error'
18
19
 
19
20
  module Tw
20
- VERSION = '0.2.2'
21
+ VERSION = '0.2.3'
21
22
  class Conf
22
23
  REQUIRE_VERSION = '0.1.0'
23
24
  end
24
25
  end
25
-
data/lib/tw/app/cmds.rb CHANGED
@@ -82,14 +82,13 @@ module Tw::App
82
82
 
83
83
  cmd :stream do |v|
84
84
  stream = Tw::Client::Stream.new @parser.has_param?(:user) ? @parser[:user] : nil
85
+ puts "-- waiting stream.."
85
86
  loop do
86
- puts "-- waiting stream.."
87
87
  begin
88
88
  stream.user_stream do |s|
89
89
  Render.display s
90
90
  end
91
91
  rescue Timeout::Error, SocketError => e
92
- STDERR.puts '-- stream closed'
93
92
  sleep 5
94
93
  next
95
94
  rescue => e
@@ -107,14 +106,13 @@ module Tw::App
107
106
  else
108
107
  track_words = v.split(/\s*,\s*/)
109
108
  stream = Tw::Client::Stream.new @parser.has_param?(:user) ? @parser[:user] : nil
109
+ puts "-- waiting stream.. track \"#{track_words.join(',')}\""
110
110
  loop do
111
- puts "-- waiting stream.. track \"#{track_words.join(',')}\""
112
111
  begin
113
112
  stream.filter track_words do |s|
114
113
  Render.display s
115
114
  end
116
115
  rescue Timeout::Error, SocketError => e
117
- STDERR.puts '-- stream closed'
118
116
  sleep 5
119
117
  next
120
118
  rescue => e
data/lib/tw/app/main.rb CHANGED
@@ -97,7 +97,7 @@ module Tw::App
97
97
  if @parser.argv.size < 1
98
98
  Render.display client.mentions
99
99
  elsif all_requests?(@parser.argv)
100
- Render.display @parser.argv.map{|arg|
100
+ Render.display Parallel.map(@parser.argv, :in_threads => @parser.argv.size){|arg|
101
101
  if user = username?(arg)
102
102
  res = client.user_timeline user
103
103
  elsif (user, list =listname?(arg)) != false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -115,6 +115,28 @@ dependencies:
115
115
  - - <
116
116
  - !ruby/object:Gem::Version
117
117
  version: 2.0.0
118
+ - !ruby/object:Gem::Dependency
119
+ name: parallel
120
+ requirement: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: 0.5.18
126
+ - - <
127
+ - !ruby/object:Gem::Version
128
+ version: 1.0.0
129
+ type: :runtime
130
+ prerelease: false
131
+ version_requirements: !ruby/object:Gem::Requirement
132
+ none: false
133
+ requirements:
134
+ - - ! '>='
135
+ - !ruby/object:Gem::Version
136
+ version: 0.5.18
137
+ - - <
138
+ - !ruby/object:Gem::Version
139
+ version: 1.0.0
118
140
  - !ruby/object:Gem::Dependency
119
141
  name: rdoc
120
142
  requirement: !ruby/object:Gem::Requirement
@@ -214,7 +236,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
214
236
  version: '0'
215
237
  segments:
216
238
  - 0
217
- hash: -2296586545685509471
239
+ hash: 3251140734153845908
218
240
  required_rubygems_version: !ruby/object:Gem::Requirement
219
241
  none: false
220
242
  requirements: