[Groonga-commit] ranguba/chupa-text at 8a2aa76 [master] Add chupa-text command

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Dec 31 23:11:28 JST 2013


Kouhei Sutou	2013-12-31 23:11:28 +0900 (Tue, 31 Dec 2013)

  New Revision: 8a2aa76e1dea9404a63acba47fbc69b353511b39
  https://github.com/ranguba/chupa-text/commit/8a2aa76e1dea9404a63acba47fbc69b353511b39

  Message:
    Add chupa-text command

  Added files:
    bin/chupa-text
    lib/chupa-text/command.rb
    lib/chupa-text/command/chupa-text.rb

  Added: bin/chupa-text (+21 -0) 100755
===================================================================
--- /dev/null
+++ bin/chupa-text    2013-12-31 23:11:28 +0900 (085ad1e)
@@ -0,0 +1,21 @@
+#!/usr/bin/env ruby
+#
+# Copyright (C) 2013  Kouhei Sutou <kou �� clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+require "chupa-text"
+
+exit(ChupaText::Command::ChupaText.run(*ARGV))

  Added: lib/chupa-text/command.rb (+17 -0) 100644
===================================================================
--- /dev/null
+++ lib/chupa-text/command.rb    2013-12-31 23:11:28 +0900 (332f93d)
@@ -0,0 +1,17 @@
+# Copyright (C) 2013  Kouhei Sutou <kou �� clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+require "chupa-text/command/chupa-text"

  Added: lib/chupa-text/command/chupa-text.rb (+44 -0) 100644
===================================================================
--- /dev/null
+++ lib/chupa-text/command/chupa-text.rb    2013-12-31 23:11:28 +0900 (8dc5caf)
@@ -0,0 +1,44 @@
+# Copyright (C) 2013  Kouhei Sutou <kou �� clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+module ChupaText
+  module Command
+    class ChupaText
+      class << self
+        def run(*arguments)
+          chupa_text = new
+          chupa_text.run(*arguments)
+        end
+      end
+
+      def initialize
+        @feeder = Feeder.new
+      end
+
+      def run(*arguments)
+        paths = arguments
+        paths.each do |path|
+          data = Data.new
+          data.path = path
+          @feeder.feed(data) do |extracted|
+            puts(extracted.body)
+          end
+        end
+        true
+      end
+    end
+  end
+end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index