rabbiter 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +4 -3
- data/lib/rabbiter.rb +18 -22
- data/lib/rabbiter/version.rb +2 -2
- data/rabbiter.gemspec +3 -2
- metadata +42 -42
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b55054e7599c085620193a0a2b716c80064c7cdb
|
4
|
+
data.tar.gz: 7ca5f75407ad9efd99ac2e0742490111c89ba343
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a04250f06e63f0b36d0c17904c73e0e1ba38956111f9003d3dac96c3fa6685e47c566ae75f42e4975fadca59dd6de7e175c537da2c65b31189466c284f070274
|
7
|
+
data.tar.gz: c94b77c06b2f2072f1584424247970df4d9ff1735ee9f67de0395bd35920c6687d4addc7ee554064110e593464685487cbc27c8c343c92f078de8031f6b35f20
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
#
|
3
|
-
# Copyright (C) 2012 Kouhei Sutou <kou@cozmixng.org>
|
3
|
+
# Copyright (C) 2012-2014 Kouhei Sutou <kou@cozmixng.org>
|
4
4
|
#
|
5
5
|
# This program is free software; you can redistribute it and/or modify
|
6
6
|
# it under the terms of the GNU General Public License as published by
|
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
require "rubygems"
|
20
20
|
require "bundler/gem_helper"
|
21
|
-
require "gettext/task"
|
21
|
+
require "gettext/tools/task"
|
22
22
|
|
23
23
|
base_dir = File.expand_path(File.dirname(__FILE__))
|
24
24
|
|
@@ -30,7 +30,8 @@ end
|
|
30
30
|
helper.install
|
31
31
|
spec = helper.gemspec
|
32
32
|
|
33
|
-
GetText::Task.
|
33
|
+
GetText::Tools::Task.define do |task|
|
34
|
+
task.spec = spec
|
34
35
|
end
|
35
36
|
|
36
37
|
task :build => "gettext"
|
data/lib/rabbiter.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2010-
|
1
|
+
# Copyright (C) 2010-2014 Kouhei Sutou <kou@cozmixng.org>
|
2
2
|
#
|
3
3
|
# This program is free software; you can redistribute it and/or modify
|
4
4
|
# it under the terms of the GNU General Public License as published by
|
@@ -162,32 +162,30 @@ module Rabbiter
|
|
162
162
|
@client.tls_validation_flags -= :unknown_ca
|
163
163
|
end
|
164
164
|
@connection = @client.connect_to_host(@options[:host], @options[:port])
|
165
|
-
@socket = @connection.socket
|
166
|
-
@socket.blocking = false
|
167
165
|
@input = @connection.input_stream
|
168
166
|
@output = @connection.output_stream
|
169
167
|
|
170
|
-
reader_source = @
|
168
|
+
reader_source = @input.create_source do |stream|
|
171
169
|
@logger.debug("[twitter][read][start]")
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
170
|
+
begin
|
171
|
+
data = @input.read_nonblocking(8192)
|
172
|
+
rescue Gio::IOError::WouldBlock
|
173
|
+
data = ""
|
174
|
+
rescue => error
|
175
|
+
@logger.debug("[twitter][read][error] #{error}")
|
176
|
+
@handler.send(:receive_error, "#{error.class}: #{error}")
|
177
|
+
data = nil
|
178
|
+
end
|
179
|
+
if data
|
180
|
+
@logger.debug("[twitter][read][done] #{data.bytesize}")
|
181
|
+
@handler.receive_data(data) unless data.empty?
|
180
182
|
true
|
183
|
+
else
|
184
|
+
false
|
181
185
|
end
|
182
186
|
end
|
183
187
|
@source_ids << reader_source.attach
|
184
188
|
|
185
|
-
error_source = @socket.create_source(:err) do |socket, condition|
|
186
|
-
@handler.send(:receive_error, condition)
|
187
|
-
true
|
188
|
-
end
|
189
|
-
@source_ids << error_source.attach
|
190
|
-
|
191
189
|
@handler.extend(GLibAdapter)
|
192
190
|
@handler.connection = self
|
193
191
|
@handler.connection_completed
|
@@ -195,7 +193,7 @@ module Rabbiter
|
|
195
193
|
|
196
194
|
def send_data(data)
|
197
195
|
rest = data.bytesize
|
198
|
-
writer_source = @
|
196
|
+
writer_source = @output.create_source do |stream|
|
199
197
|
if rest.zero?
|
200
198
|
@logger.debug("[twitter][flush][start]")
|
201
199
|
@output.flush
|
@@ -204,7 +202,7 @@ module Rabbiter
|
|
204
202
|
false
|
205
203
|
else
|
206
204
|
@logger.debug("[twitter][write][start]")
|
207
|
-
written_size = @output.
|
205
|
+
written_size = @output.write_nonblocking(data)
|
208
206
|
@logger.debug("[twitter][write][done] #{written_size}")
|
209
207
|
rest -= written_size
|
210
208
|
data[0, written_size] = ""
|
@@ -220,8 +218,6 @@ module Rabbiter
|
|
220
218
|
GLib::Source.remove(id)
|
221
219
|
true
|
222
220
|
end
|
223
|
-
@socket.close
|
224
|
-
@socket = nil
|
225
221
|
@input = nil
|
226
222
|
@output = nil
|
227
223
|
@connection = nil
|
data/lib/rabbiter/version.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012 Kouhei Sutou <kou@cozmixng.org>
|
1
|
+
# Copyright (C) 2012-2013 Kouhei Sutou <kou@cozmixng.org>
|
2
2
|
#
|
3
3
|
# This program is free software; you can redistribute it and/or modify
|
4
4
|
# it under the terms of the GNU General Public License as published by
|
@@ -15,5 +15,5 @@
|
|
15
15
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
16
16
|
|
17
17
|
module Rabbiter
|
18
|
-
VERSION = "2.0.
|
18
|
+
VERSION = "2.0.2"
|
19
19
|
end
|
data/rabbiter.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
#
|
3
|
-
# Copyright (C) 2012 Kouhei Sutou <kou@cozmixng.org>
|
3
|
+
# Copyright (C) 2012-2014 Kouhei Sutou <kou@cozmixng.org>
|
4
4
|
#
|
5
5
|
# This program is free software; you can redistribute it and/or modify
|
6
6
|
# it under the terms of the GNU General Public License as published by
|
@@ -45,10 +45,11 @@ Gem::Specification.new do |spec|
|
|
45
45
|
end
|
46
46
|
|
47
47
|
spec.add_runtime_dependency("rabbit", ">= 2.0.0")
|
48
|
-
spec.add_runtime_dependency("gio2", ">= 1.1
|
48
|
+
spec.add_runtime_dependency("gio2", ">= 2.1.1")
|
49
49
|
spec.add_runtime_dependency("twitter_oauth")
|
50
50
|
spec.add_runtime_dependency("twitter-stream", ">= 0.1.16")
|
51
51
|
|
52
52
|
spec.add_development_dependency("rake")
|
53
53
|
spec.add_development_dependency("bundler")
|
54
|
+
spec.add_development_dependency("gettext")
|
54
55
|
end
|
metadata
CHANGED
@@ -1,110 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbiter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kouhei Sutou
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-06-04 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rabbit
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 2.0.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 2.0.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: gio2
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.1
|
33
|
+
version: 2.1.1
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.1
|
40
|
+
version: 2.1.1
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: twitter_oauth
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: twitter-stream
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: 0.1.16
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: 0.1.16
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: rake
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: bundler
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - ">="
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: gettext
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
108
109
|
- !ruby/object:Gem::Version
|
109
110
|
version: '0'
|
110
111
|
description: Rabbiter receives comments from twitter and sends them to Rabbit. Rabbit
|
@@ -116,42 +117,41 @@ executables:
|
|
116
117
|
extensions: []
|
117
118
|
extra_rdoc_files: []
|
118
119
|
files:
|
119
|
-
- Rakefile
|
120
120
|
- COPYING
|
121
121
|
- GPL
|
122
|
-
- README
|
123
122
|
- Gemfile
|
124
|
-
-
|
125
|
-
-
|
126
|
-
-
|
123
|
+
- README
|
124
|
+
- Rakefile
|
125
|
+
- bin/rabbiter
|
127
126
|
- lib/rabbiter.rb
|
128
|
-
-
|
127
|
+
- lib/rabbiter/gettext.rb
|
128
|
+
- lib/rabbiter/version.rb
|
129
129
|
- locale/ja/LC_MESSAGES/rabbiter.mo
|
130
|
-
-
|
130
|
+
- po/ja/rabbiter.po
|
131
|
+
- rabbiter.gemspec
|
131
132
|
homepage: http://rabbit-shocker.org/en/rabbiter/
|
132
133
|
licenses:
|
133
134
|
- GPLv2+
|
135
|
+
metadata: {}
|
134
136
|
post_install_message:
|
135
137
|
rdoc_options: []
|
136
138
|
require_paths:
|
137
139
|
- lib
|
138
140
|
required_ruby_version: !ruby/object:Gem::Requirement
|
139
|
-
none: false
|
140
141
|
requirements:
|
141
|
-
- -
|
142
|
+
- - ">="
|
142
143
|
- !ruby/object:Gem::Version
|
143
144
|
version: '0'
|
144
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
146
|
requirements:
|
147
|
-
- -
|
147
|
+
- - ">="
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project: rabbit
|
152
|
-
rubygems_version:
|
152
|
+
rubygems_version: 2.2.2
|
153
153
|
signing_key:
|
154
|
-
specification_version:
|
154
|
+
specification_version: 4
|
155
155
|
summary: Rabbiter is a twitter client for Rabbit
|
156
156
|
test_files: []
|
157
157
|
has_rdoc:
|