Ruby mogilefs-client dev/users discussion/patches/bugs/help/...
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: mogilefs-client-public@bogomips.org
Cc: Eric Wong <e@80x24.org>
Subject: [PATCH 3/3] fix indentation warnings with ruby trunk
Date: Tue, 19 Jun 2018 03:57:15 +0000	[thread overview]
Message-ID: <20180619035715.13614-4-e@80x24.org> (raw)
In-Reply-To: <20180619035715.13614-1-e@80x24.org>

Ruby trunk started warning about more mismatched indentations
starting around r62836.
---
 lib/mogilefs/backend.rb     |  4 ++--
 lib/mogilefs/copy_stream.rb |  6 +++---
 lib/mogilefs/http_file.rb   | 22 +++++++++++-----------
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/lib/mogilefs/backend.rb b/lib/mogilefs/backend.rb
index 7f91508..6d5fe17 100644
--- a/lib/mogilefs/backend.rb
+++ b/lib/mogilefs/backend.rb
@@ -335,8 +335,8 @@ def clear_cache(types = %w(all))
       end
     end
     nil
-    ensure
-      sockets.each { |io| io.close }
+  ensure
+    sockets.each { |io| io.close }
   end
 
   # Returns a socket connected to a MogileFS tracker.
diff --git a/lib/mogilefs/copy_stream.rb b/lib/mogilefs/copy_stream.rb
index f50bf08..202b2e3 100644
--- a/lib/mogilefs/copy_stream.rb
+++ b/lib/mogilefs/copy_stream.rb
@@ -23,8 +23,8 @@ def self.copy_stream(src, dst)
     end
     dst_io.flush if dst_io.respond_to?(:flush)
     written
-    ensure
-      src_io.close if src.respond_to?(:to_str)
-      dst_io.close if dst.respond_to?(:to_str)
+  ensure
+    src_io.close if src.respond_to?(:to_str)
+    dst_io.close if dst.respond_to?(:to_str)
   end
 end
diff --git a/lib/mogilefs/http_file.rb b/lib/mogilefs/http_file.rb
index a58801a..aa0bcf2 100644
--- a/lib/mogilefs/http_file.rb
+++ b/lib/mogilefs/http_file.rb
@@ -83,11 +83,11 @@ def put_streaming_io(sock, uri) # unlikely to be used
 
   def rewind_or_raise!(uri, err)
     @active.rewind if @active
-    rescue => e
-      msg = "#{uri} failed with #{err.message} (#{err.class}) and " \
-            "retrying is impossible as rewind on " \
-            "#{@active.inspect} failed with: #{e.message} (#{e.class})"
-      raise NonRetryableError, msg, e.backtrace
+  rescue => e
+    msg = "#{uri} failed with #{err.message} (#{err.class}) and " \
+          "retrying is impossible as rewind on " \
+          "#{@active.inspect} failed with: #{e.message} (#{e.class})"
+    raise NonRetryableError, msg, e.backtrace
   end
 
   ##
@@ -127,12 +127,12 @@ def upload(devid, uri) # :nodoc:
 
     read_response(sock) # raises on errors
     file_size
-    rescue SystemCallError, RetryableError => err
-      rewind_or_raise!(uri, err)
-      raise
-    ensure
-      file.close if file && @big_io != file
-      sock.close if sock
+  rescue SystemCallError, RetryableError => err
+    rewind_or_raise!(uri, err)
+    raise
+  ensure
+    file.close if file && @big_io != file
+    sock.close if sock
   end
 
   def nhp_put(devid, uri)
-- 
EW


      parent reply	other threads:[~2018-06-19  3:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19  3:57 [PATCH 0/3] various updates Eric Wong
2018-06-19  3:57 ` [PATCH 1/3] mog: add updateclass command Eric Wong
2018-06-19  3:57 ` [PATCH 2/3] socket/pure_ruby: favor String#clear if available Eric Wong
2018-06-19  3:57 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/mogilefs-client/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180619035715.13614-4-e@80x24.org \
    --to=e@80x24.org \
    --cc=mogilefs-client-public@bogomips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/mogilefs-client.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).