[DRE-commits] [rabbiter] 02/05: Drop patch

Youhei SASAKI uwabami-guest at moszumanska.debian.org
Sun Aug 21 08:20:35 UTC 2016


This is an automated email from the git hooks/post-receive script.

uwabami-guest pushed a commit to branch master
in repository rabbiter.

commit c7477656f90300505187d2efe8d3a01cf9a327ce
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date:   Sun Aug 21 16:58:00 2016 +0900

    Drop patch
    
    Signed-off-by: Youhei SASAKI <uwabami at gfd-dennou.org>
---
 .../patches/0001-Import-upstream-Git-d5d638a.patch | 152 ---------------------
 debian/patches/series                              |   1 -
 2 files changed, 153 deletions(-)

diff --git a/debian/patches/0001-Import-upstream-Git-d5d638a.patch b/debian/patches/0001-Import-upstream-Git-d5d638a.patch
deleted file mode 100644
index 9103ef2..0000000
--- a/debian/patches/0001-Import-upstream-Git-d5d638a.patch
+++ /dev/null
@@ -1,152 +0,0 @@
-From: Youhei SASAKI <uwabami at gfd-dennou.org>
-Date: Fri, 17 Jun 2016 18:44:31 +0900
-Subject: Import upstream Git d5d638a
-
----
- bin/rabbiter            | 52 ++++++++++++++++++++++++++++++++++++++++++++++---
- lib/rabbiter.rb         |  1 -
- lib/rabbiter/version.rb |  4 ++--
- rabbiter.gemspec        |  3 ++-
- 4 files changed, 53 insertions(+), 7 deletions(-)
-
-diff --git a/bin/rabbiter b/bin/rabbiter
-index 0960c70..91a2065 100755
---- a/bin/rabbiter
-+++ b/bin/rabbiter
-@@ -19,6 +19,7 @@
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- 
- require "drb/drb"
-+require "uri"
- 
- require "rabbit/console"
- require "rabbiter"
-@@ -31,6 +32,7 @@ def parse(args=ARGV, logger=nil)
-     options.rabbit_uri = options.druby_uri
-     options.filters = []
-     options.user_languages = []
-+    options.resolve_shorten_url = true
-     options.log_status = false
- 
-     parser.separator ""
-@@ -54,6 +56,12 @@ def parse(args=ARGV, logger=nil)
-       options.user_languages << language
-     end
- 
-+    parser.on("--[no-]resolve-shorten-url",
-+              _("Resolve shorten URL such as http://t.co/XXX."),
-+              "(#{options.resolve_shorten_url})") do |boolean|
-+      options.resolve_shorten_url = boolean
-+    end
-+
-     parser.category(_("Debug"))
- 
-     parser.on("--[no-]log-status",
-@@ -72,8 +80,16 @@ def target?(status, options)
-   options.user_languages.include?(user_lang)
- end
- 
--def clean_text(text, filters)
--  remove_ustream_link(remove_hash_tag(text, filters))
-+def clean_text(status, options)
-+  raw_text = status["text"]
-+  if options.resolve_shorten_url
-+    target_text = resolve_shorten_urls(raw_text, status, options)
-+  else
-+    target_text = raw_text
-+  end
-+  cleaned_text = remove_hash_tag(target_text, options.filters)
-+  cleaned_text = remove_ustream_link(cleaned_text)
-+  cleaned_text
- end
- 
- def remove_hash_tag(text, filters)
-@@ -87,6 +103,36 @@ def remove_hash_tag(text, filters)
-   text.gsub(Regexp.union(*hash_tag_regexps), "")
- end
- 
-+def resolve_t_co(url_text)
-+  uri = URI(url_text)
-+  Net::HTTP.start(uri.host, uri.port) do |http|
-+    response = http.head(uri.path)
-+    response["location"] || url_text
-+  end
-+end
-+
-+def resolve_shorten_url(url_text)
-+  if url_text.start_with?("http://t.co/")
-+    resolve_t_co(url_text)
-+  else
-+    url_text
-+  end
-+end
-+
-+def resolve_shorten_urls(raw_text, status, options)
-+  resolved_text = raw_text.dup
-+  reversed_urls = status["entities"]["urls"].sort_by do |url|
-+    start_position, _ = url["indices"]
-+    -start_position
-+  end
-+  reversed_urls.each do |url|
-+    start_position, end_position = url["indices"]
-+    resolved_url_text = resolve_shorten_url(url["expanded_url"])
-+    resolved_text[start_position...end_position] = resolved_url_text
-+  end
-+  resolved_text
-+end
-+
- def remove_ustream_link(text)
-   text.gsub(/\(.* live at http:\/\/ustre\.am\/.*\)/, "")
- end
-@@ -104,7 +150,7 @@ def main
-     text = status["text"]
-     next if text.nil?
-     next unless target?(status, options)
--    text = clean_text(status['text'], options.filters)
-+    text = clean_text(status, options)
-     comment = "@#{status['user']['screen_name']}: #{text}"
-     logger.info(comment)
-     begin
-diff --git a/lib/rabbiter.rb b/lib/rabbiter.rb
-index e75e9e1..7ab459a 100644
---- a/lib/rabbiter.rb
-+++ b/lib/rabbiter.rb
-@@ -149,7 +149,6 @@ module Rabbiter
-         @options = @handler.instance_variable_get("@options")
-         @client = nil
-         @connection = nil
--        @socket = nil
-         @source_ids = []
-       end
- 
-diff --git a/lib/rabbiter/version.rb b/lib/rabbiter/version.rb
-index 7541e87..f7f6186 100644
---- a/lib/rabbiter/version.rb
-+++ b/lib/rabbiter/version.rb
-@@ -1,4 +1,4 @@
--# Copyright (C) 2012-2013  Kouhei Sutou <kou at cozmixng.org>
-+# Copyright (C) 2012-2014  Kouhei Sutou <kou at cozmixng.org>
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
-@@ -15,5 +15,5 @@
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- 
- module Rabbiter
--  VERSION = "2.0.2"
-+  VERSION = "2.0.3"
- end
-diff --git a/rabbiter.gemspec b/rabbiter.gemspec
-index 15f4317..3142fc6 100644
---- a/rabbiter.gemspec
-+++ b/rabbiter.gemspec
-@@ -38,7 +38,8 @@ Gem::Specification.new do |spec|
-   spec.files = ["Rakefile", "COPYING", "GPL", "README"]
-   spec.files += ["Gemfile", "#{spec.name}.gemspec"]
-   spec.files += Dir.glob("lib/**/*.rb")
--  spec.files += Dir.glob("po/**/*.po")
-+  spec.files += Dir.glob("doc/**/*.*")
-+  spec.files += Dir.glob("po/*/#{spec.name}.po")
-   spec.files += Dir.glob("locale/**/*.mo")
-   Dir.chdir("bin") do
-     spec.executables = Dir.glob("*")
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index 9038cbd..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1 +0,0 @@
-0001-Import-upstream-Git-d5d638a.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/rabbiter.git



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