[DRE-commits] [SCM] atig.git branch, master, updated. upstream/0.3.6-15-g76fd335

Youhei SASAKI uwabami at gfd-dennou.org
Sat Feb 9 08:04:48 UTC 2013


The following commit has been merged in the master branch:
commit a72ca3123bdc019144d2d726008798c9160b4f15
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date:   Sun Jan 27 23:11:09 2013 +0900

    Import new upstream: 0.3.7
    
    Signed-off-by: Youhei SASAKI <uwabami at gfd-dennou.org>

diff --git a/debian/changelog b/debian/changelog
index d7997da..4b6f4cc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-atig (0.3.6-1) unstable; urgency=low
+atig (0.3.7-1) UNRELEASED; urgency=low
 
   * Initial release (Closes: #670130)
 
diff --git a/debian/patches/0001-Remove-Bundler-and-Rubygems-Dependencies.patch b/debian/patches/0001-Remove-Bundler-and-Rubygems-Dependencies.patch
index d889c53..06a1282 100644
--- a/debian/patches/0001-Remove-Bundler-and-Rubygems-Dependencies.patch
+++ b/debian/patches/0001-Remove-Bundler-and-Rubygems-Dependencies.patch
@@ -57,7 +57,7 @@ index ec5a652..c7cdfab 100644
  
  # monkey hack
 diff --git a/lib/atig/oauth.rb b/lib/atig/oauth.rb
-index cd7c2d0..58b7cd0 100644
+index f23f136..40d4bbd 100644
 --- a/lib/atig/oauth.rb
 +++ b/lib/atig/oauth.rb
 @@ -1,5 +1,4 @@
@@ -76,7 +76,7 @@ index 26ccdba..6947e50 100644
  require 'atig/http'
  require 'atig/url_escape'
 diff --git a/lib/atig/stream.rb b/lib/atig/stream.rb
-index 5f1360d..a30e090 100644
+index ff846bf..069c0df 100644
 --- a/lib/atig/stream.rb
 +++ b/lib/atig/stream.rb
 @@ -1,6 +1,5 @@
diff --git a/debian/patches/0007-Disabled_Update_Checker.patch b/debian/patches/0002-Disabled_Update_Checker.patch
similarity index 100%
rename from debian/patches/0007-Disabled_Update_Checker.patch
rename to debian/patches/0002-Disabled_Update_Checker.patch
diff --git a/debian/patches/0002-Update-and-Fix-README.mkdn.patch b/debian/patches/0002-Update-and-Fix-README.mkdn.patch
deleted file mode 100644
index b2fe0f9..0000000
--- a/debian/patches/0002-Update-and-Fix-README.mkdn.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: Yamagishi Kazutoshi <ykzts at desire.sh>
-Date: Sun, 27 May 2012 10:36:35 +0000
-Subject: Update and Fix README.mkdn
-
-Signed-off-by: Youhei SASAKI <uwabami at gfd-dennou.org>
----
- README.mkdn |    6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/README.mkdn b/README.mkdn
-index 443542e..cc4234f 100644
---- a/README.mkdn
-+++ b/README.mkdn
-@@ -21,9 +21,9 @@ HOW TO USE
- 
- You type:
- 
-- $ cd atig
-- $ ruby atig.rb -d
-- I, [2010-04-05T07:22:07.861527 #62002]  INFO -- : Host: localhost Port:16668
-+    $ cd atig
-+    $ bin/atig -d
-+    I, [2010-04-05T07:22:07.861527 #62002]  INFO -- : Host: localhost Port:16668
- 
- and access localhost:16668 by Irc client.
- 
diff --git a/debian/patches/0008-Fix-char-count.patch b/debian/patches/0003-Fix-char-count.patch
similarity index 100%
rename from debian/patches/0008-Fix-char-count.patch
rename to debian/patches/0003-Fix-char-count.patch
diff --git a/debian/patches/0003-Userstream-should-work.patch b/debian/patches/0003-Userstream-should-work.patch
deleted file mode 100644
index 0116730..0000000
--- a/debian/patches/0003-Userstream-should-work.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-From: Tomonori Tamagawa <xtuaok at gmail.com>
-Date: Mon, 28 May 2012 13:52:49 +0900
-Subject: Userstream should work
-
- - update Userstream API endpoint
- - disable DM,Mention and Timeline agent when opts.stream is true
- - use OAuth and HTTPS::Get for userstream session.
----
- lib/atig/agent/dm.rb        |    1 +
- lib/atig/agent/mention.rb   |    5 ++++-
- lib/atig/agent/timeline.rb  |    5 ++++-
- lib/atig/gateway/session.rb |    2 +-
- lib/atig/oauth.rb           |    1 +
- lib/atig/option.rb          |    2 +-
- lib/atig/stream.rb          |   47 +++++++++++++++++++++----------------------
- 7 files changed, 35 insertions(+), 28 deletions(-)
-
-diff --git a/lib/atig/agent/dm.rb b/lib/atig/agent/dm.rb
-index 16e6442..8dbb21b 100644
---- a/lib/atig/agent/dm.rb
-+++ b/lib/atig/agent/dm.rb
-@@ -7,6 +7,7 @@ module Atig
-       include Util
- 
-       def initialize(context, api, db)
-+        return if context.opts.stream
-         @log = context.log
-         @api = api
-         @prev = nil
-diff --git a/lib/atig/agent/mention.rb b/lib/atig/agent/mention.rb
-index 84b0edf..391b3d3 100644
---- a/lib/atig/agent/mention.rb
-+++ b/lib/atig/agent/mention.rb
-@@ -4,7 +4,10 @@ require 'atig/agent/agent'
- module Atig
-   module Agent
-     class Mention < Atig::Agent::Agent
--      def initialize(context, api, db); super end
-+      def initialize(context, api, db)
-+        return if context.opts.stream
-+        super
-+      end
-       def interval; 180 end
-       def path; '/statuses/mentions' end
-       def source; :mention end
-diff --git a/lib/atig/agent/timeline.rb b/lib/atig/agent/timeline.rb
-index a928f07..4f4ce88 100644
---- a/lib/atig/agent/timeline.rb
-+++ b/lib/atig/agent/timeline.rb
-@@ -4,7 +4,10 @@ require 'atig/agent/agent'
- module Atig
-   module Agent
-     class Timeline < Atig::Agent::Agent
--      def initialize(context, api, db); super end
-+      def initialize(context, api, db)
-+        return if context.opts.stream
-+        super
-+      end
-       def interval; 30 end
-       def path; '/statuses/home_timeline' end
-       def source; :timeline end
-diff --git a/lib/atig/gateway/session.rb b/lib/atig/gateway/session.rb
-index 9dc5bec..2438922 100644
---- a/lib/atig/gateway/session.rb
-+++ b/lib/atig/gateway/session.rb
-@@ -138,7 +138,7 @@ END
-         log :debug, "initialize Twitter"
-         twitter = Twitter.new   context, oauth.access
-         search  = SearchTwitter.new context
--        stream  = Stream.new context, @nick, at pass if @opts.stream
-+        stream  = Stream.new context, oauth.oauth, oauth.access if @opts.stream
-         @api    = Scheduler.new context, twitter, search, stream
- 
-         log :debug, "initialize filter"
-diff --git a/lib/atig/oauth.rb b/lib/atig/oauth.rb
-index 58b7cd0..40d4bbd 100644
---- a/lib/atig/oauth.rb
-+++ b/lib/atig/oauth.rb
-@@ -19,6 +19,7 @@ module Atig
-     end
- 
-     attr_reader :access
-+    attr_reader :oauth
-     def initialize(context, nick)
-       uri = URI(context.opts.api_base)
-       site = "http://#{uri.host}"
-diff --git a/lib/atig/option.rb b/lib/atig/option.rb
-index 9c9897a..05c5efc 100644
---- a/lib/atig/option.rb
-+++ b/lib/atig/option.rb
-@@ -30,7 +30,7 @@ module Atig
-     end
- 
-     default_value :api_base,        'https://api.twitter.com/1/'
--    default_value :stream_api_base, 'http://chirpstream.twitter.com/2b/'
-+    default_value :stream_api_base, 'https://userstream.twitter.com/2/'
-     default_value :search_api_base, 'http://search.twitter.com/'
- 
-     def initialize(table)
-diff --git a/lib/atig/stream.rb b/lib/atig/stream.rb
-index a30e090..7d927e4 100644
---- a/lib/atig/stream.rb
-+++ b/lib/atig/stream.rb
-@@ -12,11 +12,11 @@ module Atig
-     include Util
- 
-     class APIFailed < StandardError; end
--    def initialize(context, user, password)
-+    def initialize(context, consumer, access)
-       @log      = context.log
-       @opts     = context.opts
--      @user     = user
--      @password = password
-+      @consumer = consumer
-+      @access   = access
-     end
- 
-     def watch(path, query={}, &f)
-@@ -29,32 +29,31 @@ module Atig
- 
-       @log.debug [uri.to_s]
- 
--      Net::HTTP.start(uri.host, uri.port) do |http|
--        request = Net::HTTP::Post.new uri.request_uri
--        request.basic_auth @user, @password
--
--        http.request(request) do |response|
--          unless response.code == '200' then
--            raise APIFailed,"#{response.code} #{response.message}"
--          end
-+      http = Net::HTTP.new(uri.host, uri.port)
-+      http.use_ssl = true
-+      request = Net::HTTP::Get.new(uri.request_uri)
-+      request.oauth!(http, @consumer, @access)
-+      http.request(request) do |response|
-+        unless response.code == '200' then
-+          raise APIFailed,"#{response.code} #{response.message}"
-+        end
- 
--          begin
--            buffer = ''
--            response.read_body do |chunk|
--              next if chunk.chomp.empty?
--              buffer << chunk.to_s
-+        begin
-+          buffer = ''
-+          response.read_body do |chunk|
-+            next if chunk.chomp.empty?
-+            buffer << chunk.to_s
- 
--              if buffer =~ /\A(.*)\n/ then
--                text = $1
--                unless text.strip.empty?
--                  f.call TwitterStruct.make(JSON.parse(text))
--                end
--                buffer = ''
-+            if buffer =~ /\A(.*)\n/ then
-+              text = $1
-+              unless text.strip.empty?
-+                f.call TwitterStruct.make(JSON.parse(text))
-               end
-+              buffer = ''
-             end
--          rescue => e
--            raise APIFailed,e.to_s
-           end
-+        rescue => e
-+          raise APIFailed,e.to_s
-         end
-       end
-     end
diff --git a/debian/patches/0004-Userstream-changes.patch b/debian/patches/0004-Userstream-changes.patch
deleted file mode 100644
index 214b552..0000000
--- a/debian/patches/0004-Userstream-changes.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From: Tomonori Tamagawa <xtuaok at gmail.com>
-Date: Mon, 28 May 2012 18:11:24 +0900
-Subject: Userstream changes.
-
-  - Stream : add reference to channel object to notify stream events.
-  - Stream : remove consumer from initialize arguments, it can be referenced as @access.consumer
-  - Gateway::Session : JOIN '#<nickname>' for stream events
-  - Agent::UserStream : handle stream events
----
- lib/atig/agent/user_stream.rb |   14 ++++++++++++++
- lib/atig/gateway/session.rb   |    8 +++++++-
- lib/atig/stream.rb            |    8 +++++---
- 3 files changed, 26 insertions(+), 4 deletions(-)
-
-diff --git a/lib/atig/agent/user_stream.rb b/lib/atig/agent/user_stream.rb
-index f96fb4a..dc6315d 100644
---- a/lib/atig/agent/user_stream.rb
-+++ b/lib/atig/agent/user_stream.rb
-@@ -23,6 +23,20 @@ module Atig
-                 d.add :status => status, :user => status.user, :source => :user_stream
-               end
-             end
-+            if status and status.event
-+              case status.event
-+              when 'list_member_added'
-+                t.channel.notify "list member \00311added\017 : @#{status.target.screen_name} into #{status.target_object.full_name} [ http://twitter.com#{status.target_object.uri} ]"
-+              when 'list_member_removed'
-+                t.channel.notify "list member \00305removed\017 : @#{status.target.screen_name} from #{status.target_object.full_name} [ http://twitter.com#{status.target_object.uri} ]"
-+              when 'follow'
-+                t.channel.notify "#{status.source.screen_name} \00311follows\017 @#{status.target.screen_name}"
-+              when 'favorite'
-+                t.channel.notify "#{status.source.screen_name} \00311favorites\017 => @#{status.target_object.user.screen_name} : #{status.target_object.text}"
-+               when 'unfavorite'
-+                t.channel.notify "#{status.source.screen_name} \00305unfavorites\017 => @#{status.target_object.user.screen_name} : #{status.target_object.text}"
-+              end
-+            end
-           end
-         end
-       end
-diff --git a/lib/atig/gateway/session.rb b/lib/atig/gateway/session.rb
-index 2438922..f5edadf 100644
---- a/lib/atig/gateway/session.rb
-+++ b/lib/atig/gateway/session.rb
-@@ -138,7 +138,13 @@ END
-         log :debug, "initialize Twitter"
-         twitter = Twitter.new   context, oauth.access
-         search  = SearchTwitter.new context
--        stream  = Stream.new context, oauth.oauth, oauth.access if @opts.stream
-+        if @opts.stream
-+          unless @channels.key?("##{@nick}")
-+            ch = channel("##{@nick}")
-+            ch.join_me
-+          end
-+        end
-+        stream  = Stream.new context, @channels["##{@nick}"], oauth.access if @opts.stream
-         @api    = Scheduler.new context, twitter, search, stream
- 
-         log :debug, "initialize filter"
-diff --git a/lib/atig/stream.rb b/lib/atig/stream.rb
-index 7d927e4..069c0df 100644
---- a/lib/atig/stream.rb
-+++ b/lib/atig/stream.rb
-@@ -11,11 +11,13 @@ module Atig
-   class Stream
-     include Util
- 
-+    attr_reader :channel
-+
-     class APIFailed < StandardError; end
--    def initialize(context, consumer, access)
-+    def initialize(context, channel, access)
-       @log      = context.log
-       @opts     = context.opts
--      @consumer = consumer
-+      @channel  = channel
-       @access   = access
-     end
- 
-@@ -32,7 +34,7 @@ module Atig
-       http = Net::HTTP.new(uri.host, uri.port)
-       http.use_ssl = true
-       request = Net::HTTP::Get.new(uri.request_uri)
--      request.oauth!(http, @consumer, @access)
-+      request.oauth!(http, @access.consumer, @access)
-       http.request(request) do |response|
-         unless response.code == '200' then
-           raise APIFailed,"#{response.code} #{response.message}"
diff --git a/debian/patches/0005-don-t-process-retweet-status-by-no_retweet_ids.patch b/debian/patches/0005-don-t-process-retweet-status-by-no_retweet_ids.patch
deleted file mode 100644
index 287310b..0000000
--- a/debian/patches/0005-don-t-process-retweet-status-by-no_retweet_ids.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From: Tomonori Tamagawa <xtuaok at gmail.com>
-Date: Mon, 28 May 2012 19:02:04 +0900
-Subject: don't process retweet status by no_retweet_ids
-
----
- lib/atig/agent.rb             |    1 +
- lib/atig/agent/noretweets.rb  |   24 ++++++++++++++++++++++++
- lib/atig/agent/user_stream.rb |    1 +
- lib/atig/db/db.rb             |    3 ++-
- lib/atig/gateway.rb           |    1 +
- 5 files changed, 29 insertions(+), 1 deletion(-)
- create mode 100644 lib/atig/agent/noretweets.rb
-
-diff --git a/lib/atig/agent.rb b/lib/atig/agent.rb
-index 24c89aa..8ee9dc8 100644
---- a/lib/atig/agent.rb
-+++ b/lib/atig/agent.rb
-@@ -7,3 +7,4 @@ require 'atig/agent/dm'
- require 'atig/agent/timeline'
- require 'atig/agent/clenup'
- require 'atig/agent/user_stream'
-+require 'atig/agent/noretweets'
-diff --git a/lib/atig/agent/noretweets.rb b/lib/atig/agent/noretweets.rb
-new file mode 100644
-index 0000000..ea50135
---- /dev/null
-+++ b/lib/atig/agent/noretweets.rb
-@@ -0,0 +1,24 @@
-+# -*- mode:ruby; coding:utf-8 -*-
-+
-+require 'atig/util'
-+
-+module Atig
-+  module Agent
-+    class Noretweets
-+      include Util
-+
-+      def initialize(context, api, db)
-+        @opts = context.opts
-+        @log  = context.log
-+        @db   = db
-+        log :info, "initialize"
-+
-+        api.repeat(3600){|t| update t }
-+      end
-+
-+      def update(api)
-+        @db.noretweets.clear.concat( api.get("friendships/no_retweet_ids") )
-+      end
-+    end
-+  end
-+end
-diff --git a/lib/atig/agent/user_stream.rb b/lib/atig/agent/user_stream.rb
-index dc6315d..a7cf345 100644
---- a/lib/atig/agent/user_stream.rb
-+++ b/lib/atig/agent/user_stream.rb
-@@ -18,6 +18,7 @@ module Atig
-         @api.stream do|t|
-           t.watch('user') do |status|
- #            @log.debug status.inspect
-+            next if status.retweeted_status and db.noretweets.include?(status.user.id)
-             if status and status.user
-               db.statuses.transaction do|d|
-                 d.add :status => status, :user => status.user, :source => :user_stream
-diff --git a/lib/atig/db/db.rb b/lib/atig/db/db.rb
-index 74c31f9..d035292 100644
---- a/lib/atig/db/db.rb
-+++ b/lib/atig/db/db.rb
-@@ -13,7 +13,7 @@ module Atig
-   module Db
-     class Db
-       include Util
--      attr_reader :followings, :statuses, :dms, :lists
-+      attr_reader :followings, :statuses, :dms, :lists, :noretweets
-       attr_accessor :me
-       Path = ::Dir.tmpdir
-       VERSION = 4
-@@ -26,6 +26,7 @@ module Atig
-         @statuses   = Statuses.new   dir('status')
-         @dms        = Statuses.new   dir('dm')
-         @lists      = Lists.new      dir('lists.%s')
-+        @noretweets = Array.new
- 
-         log :info, "initialize"
-       end
-diff --git a/lib/atig/gateway.rb b/lib/atig/gateway.rb
-index 8a12381..61e4221 100644
---- a/lib/atig/gateway.rb
-+++ b/lib/atig/gateway.rb
-@@ -9,6 +9,7 @@ Atig::Gateway::Session.agents   = [
-                                    Atig::Agent::Timeline,
-                                    Atig::Agent::Cleanup,
-                                    Atig::Agent::UserStream,
-+                                   Atig::Agent::Noretweets,
-                                   ]
- 
- Atig::Gateway::Session.ifilters = [
diff --git a/debian/patches/0006-handle-direct-message-in-userstream.patch b/debian/patches/0006-handle-direct-message-in-userstream.patch
deleted file mode 100644
index a74678a..0000000
--- a/debian/patches/0006-handle-direct-message-in-userstream.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Tomonori Tamagawa <xtuaok at gmail.com>
-Date: Fri, 1 Jun 2012 15:09:20 +0900
-Subject: handle direct message in userstream.
-
----
- lib/atig/agent/user_stream.rb |   10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
-
-diff --git a/lib/atig/agent/user_stream.rb b/lib/atig/agent/user_stream.rb
-index a7cf345..e2b4866 100644
---- a/lib/atig/agent/user_stream.rb
-+++ b/lib/atig/agent/user_stream.rb
-@@ -19,12 +19,16 @@ module Atig
-           t.watch('user') do |status|
- #            @log.debug status.inspect
-             next if status.retweeted_status and db.noretweets.include?(status.user.id)
--            if status and status.user
-+            if status.direct_message
-+              dm = status.direct_message
-+              db.dms.transaction do|d|
-+                d.add :status => dm, :user => dm.sender
-+              end
-+            elsif status and status.user
-               db.statuses.transaction do|d|
-                 d.add :status => status, :user => status.user, :source => :user_stream
-               end
--            end
--            if status and status.event
-+            elsif status and status.event
-               case status.event
-               when 'list_member_added'
-                 t.channel.notify "list member \00311added\017 : @#{status.target.screen_name} into #{status.target_object.full_name} [ http://twitter.com#{status.target_object.uri} ]"
diff --git a/debian/patches/series b/debian/patches/series
index 1afc243..0adfb63 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,8 +1,3 @@
 0001-Remove-Bundler-and-Rubygems-Dependencies.patch
-0002-Update-and-Fix-README.mkdn.patch
-0003-Userstream-should-work.patch
-0004-Userstream-changes.patch
-0005-don-t-process-retweet-status-by-no_retweet_ids.patch
-0006-handle-direct-message-in-userstream.patch
-0007-Disabled_Update_Checker.patch
-0008-Fix-char-count.patch
+0002-Disabled_Update_Checker.patch
+0003-Fix-char-count.patch

-- 
atig.git



More information about the Pkg-ruby-extras-commits mailing list