From dddf48207b0dcac1d3d0d67916f9821243ab3f8c Mon Sep 17 00:00:00 2001 From: namusyaka Date: Tue, 20 Sep 2016 14:44:16 +0900 Subject: [PATCH] fix a little bit whitespace --- lib/sinatra/base.rb | 8 ++++---- lib/sinatra/show_exceptions.rb | 4 ++-- sinatra-contrib/lib/sinatra/config_file.rb | 2 +- sinatra-contrib/lib/sinatra/content_for.rb | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index e7f7ebd6..2fc5dbab 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -705,7 +705,7 @@ module Sinatra render :less, template, options, locals end - def stylus(template, options={}, locals={}) + def stylus(template, options = {}, locals = {}) options.merge! :layout => false, :default_content_type => :css render :styl, template, options, locals end @@ -1081,7 +1081,7 @@ module Sinatra # Creates a Hash with indifferent access. def indifferent_hash - Hash.new {|hash,key| hash[key.to_s] if Symbol === key } + Hash.new { |hash, key| hash[key.to_s] if Symbol === key } end # Run the block with 'throw :halt' support and apply result to the response. @@ -1909,9 +1909,9 @@ module Sinatra # top-level. Subclassing Sinatra::Base is highly recommended for # modular applications. class Application < Base - set :logging, Proc.new { ! test? } + set :logging, Proc.new { !test? } set :method_override, true - set :run, Proc.new { ! test? } + set :run, Proc.new { !test? } set :session_secret, Proc.new { super() unless development? } set :app_file, nil diff --git a/lib/sinatra/show_exceptions.rb b/lib/sinatra/show_exceptions.rb index ab26997e..c0ed224f 100644 --- a/lib/sinatra/show_exceptions.rb +++ b/lib/sinatra/show_exceptions.rb @@ -15,7 +15,7 @@ module Sinatra def @@eats_errors.puts(*) end def initialize(app) - @app = app + @app = app end def call(env) @@ -51,7 +51,7 @@ module Sinatra def prefers_plain_text?(env) !(Request.new(env).preferred_type("text/plain","text/html") == "text/html") && - [/curl/].index{|item| item =~ env["HTTP_USER_AGENT"]} + [/curl/].index { |item| item =~ env["HTTP_USER_AGENT"] } end def frame_class(frame) diff --git a/sinatra-contrib/lib/sinatra/config_file.rb b/sinatra-contrib/lib/sinatra/config_file.rb index 0ad8e88c..0bddd6fc 100644 --- a/sinatra-contrib/lib/sinatra/config_file.rb +++ b/sinatra-contrib/lib/sinatra/config_file.rb @@ -161,7 +161,7 @@ module Sinatra end if hash.respond_to? :to_hash - indifferent_hash = Hash.new {|hash,key| hash[key.to_s] if Symbol === key } + indifferent_hash = Hash.new { |hash, key| hash[key.to_s] if Symbol === key } indifferent_hash.merge hash.to_hash else hash diff --git a/sinatra-contrib/lib/sinatra/content_for.rb b/sinatra-contrib/lib/sinatra/content_for.rb index 0d444d15..c61d8191 100644 --- a/sinatra-contrib/lib/sinatra/content_for.rb +++ b/sinatra-contrib/lib/sinatra/content_for.rb @@ -179,7 +179,7 @@ module Sinatra private def content_blocks - @content_blocks ||= Hash.new {|h,k| h[k] = [] } + @content_blocks ||= Hash.new { |h, k| h[k] = [] } end end