replace if ! with unless

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
Neeraj Singh
2010-10-16 23:12:19 -04:00
committed by Santiago Pastorino
parent b44e2abd9f
commit ea14396c45
7 changed files with 7 additions and 7 deletions

View File

@@ -212,7 +212,7 @@ module ActionMailer
# If this is a multipart e-mail add the mime_version if it is not
# already set.
@mime_version ||= "1.0" if !@parts.empty?
@mime_version ||= "1.0" unless @parts.empty?
end
end

View File

@@ -407,7 +407,7 @@ module ActionController
# Returns nil if no token is found.
def authenticate(controller, &login_procedure)
token, options = token_and_options(controller.request)
if !token.blank?
unless token.blank?
login_procedure.call(token, options)
end
end

View File

@@ -72,7 +72,7 @@ module ActiveRecord
end
adapter_method = "#{spec[:adapter]}_connection"
if !respond_to?(adapter_method)
unless respond_to?(adapter_method)
raise AdapterNotFound, "database configuration specifies nonexistent #{spec[:adapter]} adapter"
end

View File

@@ -166,7 +166,7 @@ module ActiveSupport #:nodoc:
def const_missing(const_name, nesting = nil)
klass_name = name.presence || "Object"
if !nesting
unless nesting
# We'll assume that the nesting of Foo::Bar is ["Foo::Bar", "Foo"]
# even though it might not be, such as in the case of
# class Foo::Bar; Baz; end

View File

@@ -95,7 +95,7 @@ module ActiveSupport
end
end
if !defined?(@has_win32)
unless defined?(@has_win32)
begin
require 'Win32API'

View File

@@ -147,7 +147,7 @@ module Rails
middleware.use ::Rack::Cache, rack_cache if rack_cache
middleware.use ::ActionDispatch::Static, config.static_asset_paths if config.serve_static_assets
middleware.use ::Rack::Lock if !config.allow_concurrency
middleware.use ::Rack::Lock unless config.allow_concurrency
middleware.use ::Rack::Runtime
middleware.use ::Rails::Rack::Logger
middleware.use ::ActionDispatch::ShowExceptions, config.consider_all_requests_local if config.action_dispatch.show_exceptions

View File

@@ -19,7 +19,7 @@ module Rails
def tail!
@file.seek @cursor
if !@file.eof?
unless @file.eof?
contents = @file.read
@cursor = @file.tell
$stdout.print contents