atig 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/Rakefile +3 -3
- data/atig.gemspec +4 -5
- data/docs/changelog.rst +25 -0
- data/docs/conf.py +3 -3
- data/docs/index.rst +3 -3
- data/docs/options.rst +0 -4
- data/docs/quickstart.rst +1 -1
- data/lib/atig.rb +0 -2
- data/lib/atig/agent/following.rb +3 -3
- data/lib/atig/bitly.rb +0 -1
- data/lib/atig/channel/timeline.rb +1 -1
- data/lib/atig/db/sql.rb +0 -1
- data/lib/atig/db/statuses.rb +0 -1
- data/lib/atig/ifilter/expand_url.rb +0 -1
- data/lib/atig/monkey.rb +0 -1
- data/lib/atig/oauth.rb +0 -1
- data/lib/atig/ofilter/short_url.rb +0 -4
- data/lib/atig/search.rb +0 -1
- data/lib/atig/stream.rb +0 -1
- data/lib/atig/version.rb +1 -1
- data/requirements.txt +5 -0
- data/spec/ofilter/short_url_spec.rb +0 -36
- data/spec/spec_helper.rb +1 -6
- metadata +8 -33
- data/lib/atig/unu.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5849d378b18e123fd9dcf8bf9a1ee96e6401434
|
4
|
+
data.tar.gz: f0e7fc07a38030e1beb7b2fb9fd2633fb289db1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8418c16aa59ad77355d7ccb591d1ef21cfe0c3963c0626c3f9e1ecdefdebaf76db89286e62e1528a5f07242f2f76aa06cf172b166ee3d2e08439c56623770af
|
7
|
+
data.tar.gz: c50550489c0888bb2bba2facf47ee41b6524a44b2f7c85c0d3661dcaacc2ae93f5542d2e0c2431d84721bc6881f7cf97795184f05743f18bc0a9c9a0be6bf025
|
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
# -*- mode:ruby -*-
|
2
|
-
require 'rubygems'
|
3
2
|
require 'rake'
|
4
3
|
require 'rake/clean'
|
5
4
|
require 'rspec/core/rake_task'
|
@@ -10,7 +9,8 @@ CLEAN.include(
|
|
10
9
|
)
|
11
10
|
|
12
11
|
CLOBBER.include(
|
13
|
-
"pkg"
|
12
|
+
"pkg",
|
13
|
+
"coverage"
|
14
14
|
)
|
15
15
|
|
16
16
|
RSpec::Core::RakeTask.new do |t|
|
@@ -20,7 +20,7 @@ end
|
|
20
20
|
desc "building document with sphinx"
|
21
21
|
task :docs do
|
22
22
|
build_dir = "docs/_build"
|
23
|
-
`sphinx-build -b html -d #{build_dir}/doctrees -D latex_paper_size=a4 docs #{build_dir}/html`
|
23
|
+
`LC_CTYPE=C sphinx-build -b html -d #{build_dir}/doctrees -D latex_paper_size=a4 docs #{build_dir}/html`
|
24
24
|
end
|
25
25
|
|
26
26
|
task :default => [:spec, :clean]
|
data/atig.gemspec
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
require File.expand_path('../lib/atig/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["SHIBATA Hiroshi"]
|
6
|
-
gem.email = ["shibata.hiroshi@gmail.com"]
|
5
|
+
gem.authors = ["MIZUNO Hiroki", "SHIBATA Hiroshi", ]
|
6
|
+
gem.email = ["mzp@ocaml.jp", "shibata.hiroshi@gmail.com"]
|
7
7
|
gem.description = %q{Atig.rb is Twitter Irc Gateway.}
|
8
8
|
gem.summary = %q{Atig.rb is forked from cho45's tig.rb. We improve some features of tig.rb.}
|
9
9
|
gem.homepage = "https://github.com/mzp/atig"
|
@@ -15,13 +15,12 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Atig::VERSION
|
17
17
|
|
18
|
+
gem.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
|
19
|
+
|
18
20
|
gem.add_dependency 'sqlite3', ['>= 1.3.2']
|
19
21
|
gem.add_dependency 'net-irc', ['>= 0']
|
20
22
|
gem.add_dependency 'oauth', ['>= 0']
|
21
23
|
|
22
|
-
gem.add_dependency 'rake', ['>= 0'] unless defined? Rake
|
23
|
-
gem.add_dependency 'json', ['>= 0'] unless defined? JSON
|
24
|
-
|
25
24
|
gem.add_development_dependency 'bundler'
|
26
25
|
gem.add_development_dependency 'rspec'
|
27
26
|
gem.add_development_dependency 'coveralls'
|
data/docs/changelog.rst
CHANGED
@@ -1,6 +1,31 @@
|
|
1
1
|
更新履歴
|
2
2
|
==============
|
3
3
|
|
4
|
+
v0.4.4(2013-12-29)
|
5
|
+
------------------------------
|
6
|
+
http://github.com/mzp/atig/tree/v0.4.4
|
7
|
+
|
8
|
+
機能変更
|
9
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
10
|
+
- サポート対象を Ruby 1.9.3 以降にしました
|
11
|
+
- follower 取得時の1回の取得数を100件に拡張しました
|
12
|
+
|
13
|
+
v0.4.3(2013-10-18)
|
14
|
+
------------------------------
|
15
|
+
http://github.com/mzp/atig/tree/v0.4.3
|
16
|
+
|
17
|
+
不具合修正
|
18
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
19
|
+
- 短縮 URL の展開が動かない問題を修正しました
|
20
|
+
|
21
|
+
v0.4.2(2013-10-13)
|
22
|
+
------------------------------
|
23
|
+
http://github.com/mzp/atig/tree/v0.4.2
|
24
|
+
|
25
|
+
機能変更
|
26
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
27
|
+
- タイムラインの取得間隔を 1 分にしました
|
28
|
+
|
4
29
|
v0.4.1(2013-08-02)
|
5
30
|
------------------------------
|
6
31
|
http://github.com/mzp/atig/tree/v0.4.1
|
data/docs/conf.py
CHANGED
@@ -38,16 +38,16 @@ master_doc = 'index'
|
|
38
38
|
|
39
39
|
# General information about the project.
|
40
40
|
project = u'atig.rb'
|
41
|
-
copyright = u'2010, mzp'
|
41
|
+
copyright = u'2010-2013, mzp'
|
42
42
|
|
43
43
|
# The version info for the project you're documenting, acts as replacement for
|
44
44
|
# |version| and |release|, also used in various other places throughout the
|
45
45
|
# built documents.
|
46
46
|
#
|
47
47
|
# The short X.Y version.
|
48
|
-
version = '0.
|
48
|
+
version = '0.4'
|
49
49
|
# The full version, including alpha/beta/rc tags.
|
50
|
-
release = '0.3
|
50
|
+
release = '0.4.3'
|
51
51
|
|
52
52
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
53
53
|
# for a list of supported languages.
|
data/docs/index.rst
CHANGED
@@ -15,11 +15,11 @@ atig.rbはTwitterとIRCを結ぶゲートウェイです。
|
|
15
15
|
ダウンロード
|
16
16
|
------------------------------
|
17
17
|
|
18
|
-
- 安定板: `atigrb-0.3.
|
18
|
+
- 安定板: `atigrb-0.4.3.tgz`_. ( `過去のバージョン`_ )
|
19
19
|
- 開発版: `Github Repository`_.
|
20
20
|
|
21
|
-
.. _atigrb-0.3.
|
22
|
-
.. _過去のバージョン: http://github.com/mzp/atig/
|
21
|
+
.. _atigrb-0.4.3.tgz: http://github.com/mzp/atig/tarball/v0.4.3
|
22
|
+
.. _過去のバージョン: http://github.com/mzp/atig/tags
|
23
23
|
.. _GitHub Repository: http://github.com/mzp/atig
|
24
24
|
|
25
25
|
特徴
|
data/docs/options.rst
CHANGED
@@ -63,10 +63,6 @@ bitlify=\ ``username``:\ ``api_key``:\ ``size``
|
|
63
63
|
``size``\ 字以上のURLを http://bit.ly のAPIによって短縮します。
|
64
64
|
APIを利用して短縮すると、ユーザページに短縮したURLが記録されたりします。
|
65
65
|
詳しくは、 http://bit.ly のSign up for bit.lyを読んでください。
|
66
|
-
unuify
|
67
|
-
|len| 字以上のURLを http://u.nu によって短縮します。
|
68
|
-
unuify= \ ``size``
|
69
|
-
``size`` 字以上のURLを http://u.nu によって短縮します。
|
70
66
|
|
71
67
|
.. |len| replace:: 20
|
72
68
|
|
data/docs/quickstart.rst
CHANGED
data/lib/atig.rb
CHANGED
data/lib/atig/agent/following.rb
CHANGED
@@ -22,15 +22,15 @@ module Atig
|
|
22
22
|
|
23
23
|
def update(api)
|
24
24
|
if @db.followings.empty?
|
25
|
-
friends = api.page("friends/list", :users, {:user_id => @db.me.id})
|
25
|
+
friends = api.page("friends/list", :users, {:user_id => @db.me.id, :count => 100})
|
26
26
|
else
|
27
27
|
@db.me = api.post("account/update_profile")
|
28
28
|
return if @db.me.friends_count == @db.followings.size
|
29
|
-
friends = api.page("friends/list", :users, {:user_id => @db.me.id})
|
29
|
+
friends = api.page("friends/list", :users, {:user_id => @db.me.id, :count => 100})
|
30
30
|
end
|
31
31
|
|
32
32
|
if @opts.only
|
33
|
-
followers = api.page("friends/ids", :ids, {:user_id => @db.me.id})
|
33
|
+
followers = api.page("friends/ids", :ids, {:user_id => @db.me.id, :count => 2500})
|
34
34
|
friends.each do|friend|
|
35
35
|
friend[:only] = !followers.include?(friend.id)
|
36
36
|
end
|
data/lib/atig/bitly.rb
CHANGED
@@ -32,7 +32,7 @@ module Atig
|
|
32
32
|
messages[0, 3].each do |m|
|
33
33
|
@channel.notify " \002#{m[/.+/]}\017"
|
34
34
|
end
|
35
|
-
@channel.notify(" ... and more. check it: http://mzp.github.
|
35
|
+
@channel.notify(" ... and more. check it: http://mzp.github.io/atig/") if messages.size > 3
|
36
36
|
end
|
37
37
|
sleep (3*60*60)
|
38
38
|
end if UpdateChecker.git_repos?
|
data/lib/atig/db/sql.rb
CHANGED
data/lib/atig/db/statuses.rb
CHANGED
data/lib/atig/monkey.rb
CHANGED
data/lib/atig/oauth.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# -*- mode:ruby; coding:utf-8 -*-
|
2
2
|
|
3
|
-
require 'atig/unu'
|
4
3
|
require 'atig/bitly'
|
5
4
|
|
6
5
|
module Atig
|
@@ -28,9 +27,6 @@ module Atig
|
|
28
27
|
when @opts.bitlify
|
29
28
|
@len = (@opts.bitlify.to_s || MIN_LEN).to_i
|
30
29
|
Bitly.no_login @log
|
31
|
-
when @opts.unuify
|
32
|
-
@len = (@opts.unuify.to_s || MIN_LEN).to_i
|
33
|
-
Unu.new @log
|
34
30
|
else
|
35
31
|
return mesg
|
36
32
|
end
|
data/lib/atig/search.rb
CHANGED
data/lib/atig/stream.rb
CHANGED
data/lib/atig/version.rb
CHANGED
data/requirements.txt
ADDED
@@ -76,42 +76,6 @@ describe Atig::OFilter::ShortUrl,"when login bitly with size" do
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
-
describe Atig::OFilter::ShortUrl,"when unu bitly" do
|
80
|
-
before do
|
81
|
-
logger = double('Logger')
|
82
|
-
unu = double("Unu")
|
83
|
-
unu.stub(:shorten).and_return{|s|
|
84
|
-
"[#{s}]"
|
85
|
-
}
|
86
|
-
Atig::Unu.should_receive(:new).with(logger).and_return(unu)
|
87
|
-
@ofilter = Atig::OFilter::ShortUrl.new(OpenStruct.new(:log=>logger, :opts=>OpenStruct.new('unuify'=>true)))
|
88
|
-
end
|
89
|
-
|
90
|
-
it "should shorten url by unu" do
|
91
|
-
@ofilter.call({:status => "this is http://example.com/a http://example.com/b"}).should == {
|
92
|
-
:status => "this is [http://example.com/a] [http://example.com/b]"
|
93
|
-
}
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
describe Atig::OFilter::ShortUrl,"when no-login unu with size" do
|
98
|
-
before do
|
99
|
-
logger = double('Logger')
|
100
|
-
unu = double("Unu")
|
101
|
-
unu.stub(:shorten).and_return{|s|
|
102
|
-
"[#{s}]"
|
103
|
-
}
|
104
|
-
Atig::Unu.should_receive(:new).with(logger).and_return(unu)
|
105
|
-
@ofilter = Atig::OFilter::ShortUrl.new(OpenStruct.new(:log=>logger, :opts=>OpenStruct.new('unuify'=>13)))
|
106
|
-
end
|
107
|
-
|
108
|
-
it "should only shorten large url" do
|
109
|
-
@ofilter.call({:status => "this is http://example.com/a http://a.com"}).should == {
|
110
|
-
:status => "this is [http://example.com/a] http://a.com"
|
111
|
-
}
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
79
|
describe Atig::OFilter::ShortUrl,"when nop" do
|
116
80
|
before do
|
117
81
|
logger = double('Logger')
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- MIZUNO Hiroki
|
7
8
|
- SHIBATA Hiroshi
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-
|
12
|
+
date: 2013-12-29 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: sqlite3
|
@@ -52,34 +53,6 @@ dependencies:
|
|
52
53
|
- - ">="
|
53
54
|
- !ruby/object:Gem::Version
|
54
55
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: json
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
56
|
- !ruby/object:Gem::Dependency
|
84
57
|
name: bundler
|
85
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,6 +97,7 @@ dependencies:
|
|
124
97
|
version: '0'
|
125
98
|
description: Atig.rb is Twitter Irc Gateway.
|
126
99
|
email:
|
100
|
+
- mzp@ocaml.jp
|
127
101
|
- shibata.hiroshi@gmail.com
|
128
102
|
executables:
|
129
103
|
- atig
|
@@ -250,12 +224,12 @@ files:
|
|
250
224
|
- lib/atig/stream.rb
|
251
225
|
- lib/atig/twitter.rb
|
252
226
|
- lib/atig/twitter_struct.rb
|
253
|
-
- lib/atig/unu.rb
|
254
227
|
- lib/atig/update_checker.rb
|
255
228
|
- lib/atig/url_escape.rb
|
256
229
|
- lib/atig/util.rb
|
257
230
|
- lib/atig/version.rb
|
258
231
|
- lib/memory_profiler.rb
|
232
|
+
- requirements.txt
|
259
233
|
- spec/command/autofix_spec.rb
|
260
234
|
- spec/command/destroy_spec.rb
|
261
235
|
- spec/command/dm_spec.rb
|
@@ -310,7 +284,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
310
284
|
requirements:
|
311
285
|
- - ">="
|
312
286
|
- !ruby/object:Gem::Version
|
313
|
-
version:
|
287
|
+
version: 1.9.3
|
314
288
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
315
289
|
requirements:
|
316
290
|
- - ">="
|
@@ -318,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
318
292
|
version: '0'
|
319
293
|
requirements: []
|
320
294
|
rubyforge_project:
|
321
|
-
rubygems_version: 2.
|
295
|
+
rubygems_version: 2.2.0
|
322
296
|
signing_key:
|
323
297
|
specification_version: 4
|
324
298
|
summary: Atig.rb is forked from cho45's tig.rb. We improve some features of tig.rb.
|
@@ -366,3 +340,4 @@ test_files:
|
|
366
340
|
- spec/sized_hash_spec.rb
|
367
341
|
- spec/spec_helper.rb
|
368
342
|
- spec/update_checker_spec.rb
|
343
|
+
has_rdoc:
|
data/lib/atig/unu.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# -*- mode:ruby; coding:utf-8 -*-
|
2
|
-
module Atig
|
3
|
-
class Unu
|
4
|
-
def initialize(logger)
|
5
|
-
@log = logger
|
6
|
-
@http = Atig::Http.new logger
|
7
|
-
end
|
8
|
-
|
9
|
-
def shorten(url)
|
10
|
-
unu_url = "http://u.nu/"
|
11
|
-
unu = URI("#{unu_url}unu-api-simple")
|
12
|
-
url = URI.rstrip url
|
13
|
-
unu.query = { :url => url }.to_query_str
|
14
|
-
res = @http.http(unu, 5, 5).request(@http.req(:get, unu)).body
|
15
|
-
|
16
|
-
if res[0, 12] == unu_url
|
17
|
-
res
|
18
|
-
else
|
19
|
-
@log.error res
|
20
|
-
url
|
21
|
-
end
|
22
|
-
rescue Errno::ETIMEDOUT, JSON::ParserError, IOError, Timeout::Error, Errno::ECONNRESET => e
|
23
|
-
@log.error e
|
24
|
-
url
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|