[Groonga-commit] ranguba/chupa-text at 762cd1f [master] Indent

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Jan 3 14:08:28 JST 2014


Kouhei Sutou	2014-01-03 14:08:28 +0900 (Fri, 03 Jan 2014)

  New Revision: 762cd1fde6d9ba64f8335eb72309b95994f8d75c
  https://github.com/ranguba/chupa-text/commit/762cd1fde6d9ba64f8335eb72309b95994f8d75c

  Message:
    Indent

  Modified files:
    lib/chupa-text/decomposers/gzip.rb
    lib/chupa-text/decomposers/tar.rb

  Modified: lib/chupa-text/decomposers/gzip.rb (+24 -24)
===================================================================
--- lib/chupa-text/decomposers/gzip.rb    2014-01-03 14:07:55 +0900 (eb9ba49)
+++ lib/chupa-text/decomposers/gzip.rb    2014-01-03 14:08:28 +0900 (cfd4090)
@@ -21,33 +21,33 @@ require "chupa-text"
 
 module ChupaText
   module Decomposers
-  class Gzip < Decomposer
-    registry.register(self)
+    class Gzip < Decomposer
+      registry.register(self)
 
-    TARGET_EXTENSIONS = ["gz", "tgz"]
-    TARGET_CONTENT_TYPES = [
-      "application/gzip",
-      "application/x-gzip",
-      "application/x-gtar-compressed",
-    ]
-    def target?(data)
-      TARGET_EXTENSIONS.include?(data.extension) or
-        TARGET_CONTENT_TYPES.include?(data.content_type)
-    end
+      TARGET_EXTENSIONS = ["gz", "tgz"]
+      TARGET_CONTENT_TYPES = [
+        "application/gzip",
+        "application/x-gzip",
+        "application/x-gtar-compressed",
+      ]
+      def target?(data)
+        TARGET_EXTENSIONS.include?(data.extension) or
+          TARGET_CONTENT_TYPES.include?(data.content_type)
+      end
 
-    def decompose(data)
-      reader = Zlib::GzipReader.new(StringIO.new(data.body))
-      extracted = Data.new
-      case data.extension
-      when "gz"
-        extracted.path = data.path.to_s.gsub(/\.gz\z/i, "")
-      when "tgz"
-        extracted.path = data.path.to_s.gsub(/\.tgz\z/i, ".tar")
+      def decompose(data)
+        reader = Zlib::GzipReader.new(StringIO.new(data.body))
+        extracted = Data.new
+        case data.extension
+        when "gz"
+          extracted.path = data.path.to_s.gsub(/\.gz\z/i, "")
+        when "tgz"
+          extracted.path = data.path.to_s.gsub(/\.tgz\z/i, ".tar")
+        end
+        extracted.body   = reader.read
+        extracted.source = data
+        yield(extracted)
       end
-      extracted.body   = reader.read
-      extracted.source = data
-      yield(extracted)
     end
   end
-  end
 end

  Modified: lib/chupa-text/decomposers/tar.rb (+16 -16)
===================================================================
--- lib/chupa-text/decomposers/tar.rb    2014-01-03 14:07:55 +0900 (f0c3e6b)
+++ lib/chupa-text/decomposers/tar.rb    2014-01-03 14:08:28 +0900 (0da23d3)
@@ -21,26 +21,26 @@ require "chupa-text"
 
 module ChupaText
   module Decomposers
-  class Tar < Decomposer
-    registry.register(self)
+    class Tar < Decomposer
+      registry.register(self)
 
-    def target?(data)
-      data.extension == "tar" or
-        data.content_type == "application/x-tar"
-    end
+      def target?(data)
+        data.extension == "tar" or
+          data.content_type == "application/x-tar"
+      end
 
-    def decompose(data)
-      Gem::Package::TarReader.new(StringIO.new(data.body)) do |reader|
-        reader.each do |entry|
-          next unless entry.file?
-          extracted = Data.new
-          extracted.path   = entry.full_name
-          extracted.body   = entry.read
-          extracted.source = data
-          yield(extracted)
+      def decompose(data)
+        Gem::Package::TarReader.new(StringIO.new(data.body)) do |reader|
+          reader.each do |entry|
+            next unless entry.file?
+            extracted = Data.new
+            extracted.path   = entry.full_name
+            extracted.body   = entry.read
+            extracted.source = data
+            yield(extracted)
+          end
         end
       end
     end
   end
-  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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