[Groonga-commit] ranguba/chupa-text at e7ba80f [master] zip: reduce scope

Back to archive index
Kouhei Sutou null+****@clear*****
Fri Mar 1 19:05:49 JST 2019


Kouhei Sutou	2019-03-01 19:05:49 +0900 (Fri, 01 Mar 2019)

  Revision: e7ba80fa9e89acf25bb23f4e76a76bcdc4b23a8c
  https://github.com/ranguba/chupa-text/commit/e7ba80fa9e89acf25bb23f4e76a76bcdc4b23a8c

  Message:
    zip: reduce scope

  Modified files:
    lib/chupa-text/decomposers/zip.rb

  Modified: lib/chupa-text/decomposers/zip.rb (+9 -9)
===================================================================
--- lib/chupa-text/decomposers/zip.rb    2019-03-01 19:05:04 +0900 (1bad88f)
+++ lib/chupa-text/decomposers/zip.rb    2019-03-01 19:05:49 +0900 (f9b432e)
@@ -69,18 +69,18 @@ module ChupaText
 
       private
       def open_zip(data)
-        begin
-          data.open do |input|
+        data.open do |input|
+          begin
             Archive::Zip.open(input) do |zip|
               yield(zip)
             end
-          end
-        rescue Archive::Zip::Error => zip_error
-          error do
-            message = "#{log_tag} Failed to process zip: "
-            message << "#{zip_error.class}: #{zip_error.message}\n"
-            message << zip_error.backtrace.join("\n")
-            message
+          rescue Archive::Zip::Error => zip_error
+            error do
+              message = "#{log_tag} Failed to process zip: "
+              message << "#{zip_error.class}: #{zip_error.message}\n"
+              message << zip_error.backtrace.join("\n")
+              message
+            end
           end
         end
       end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190301/d4a9c5ce/attachment-0001.html>


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