mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Silence some trivial warnings: shadowed local vars, indentation mismatches
This commit is contained in:
parent
6d390671f6
commit
9a650a6547
10 changed files with 213 additions and 218 deletions
|
@ -20,7 +20,7 @@ module AbstractController
|
|||
end
|
||||
|
||||
def clear_template_caches!
|
||||
@found_layouts.clear if @found_layouts
|
||||
@found_layouts.clear if defined? @found_layouts
|
||||
super
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module AbstractController
|
||||
class HashKey
|
||||
@hash_keys = Hash.new {|h,k| h[k] = Hash.new {|h,k| h[k] = {} } }
|
||||
@hash_keys = Hash.new {|h,k| h[k] = Hash.new {|sh,sk| sh[sk] = {} } }
|
||||
|
||||
def self.get(klass, formats, locale)
|
||||
@hash_keys[klass][formats][locale] ||= new(klass, formats, locale)
|
||||
|
|
|
@ -85,7 +85,7 @@ module ActionController
|
|||
end
|
||||
|
||||
class ActionEndpoint
|
||||
@@endpoints = Hash.new {|h,k| h[k] = Hash.new {|h,k| h[k] = {} } }
|
||||
@@endpoints = Hash.new {|h,k| h[k] = Hash.new {|sh,sk| sh[sk] = {} } }
|
||||
|
||||
def self.for(controller, action, stack)
|
||||
@@endpoints[controller][action][stack] ||= begin
|
||||
|
|
|
@ -169,7 +169,6 @@ module ActionController #:nodoc:
|
|||
flash[:notice] = message
|
||||
end
|
||||
|
||||
|
||||
protected
|
||||
def process_action(method_name)
|
||||
@_flash = nil
|
||||
|
|
|
@ -104,7 +104,7 @@ module Mime
|
|||
|
||||
SET << Mime.const_get(symbol.to_s.upcase)
|
||||
|
||||
([string] + mime_type_synonyms).each { |string| LOOKUP[string] = SET.last } unless skip_lookup
|
||||
([string] + mime_type_synonyms).each { |str| LOOKUP[str] = SET.last } unless skip_lookup
|
||||
([symbol.to_s] + extension_synonyms).each { |ext| EXTENSION_LOOKUP[ext] = SET.last }
|
||||
end
|
||||
|
||||
|
|
|
@ -108,13 +108,9 @@ module ActionView
|
|||
query << '{' << ext.map {|e| e && ".#{e}" }.join(',') << '}'
|
||||
end
|
||||
|
||||
Dir[query].map do |path|
|
||||
next if File.directory?(path)
|
||||
source = File.read(path)
|
||||
identifier = Pathname.new(path).expand_path.to_s
|
||||
|
||||
Template.new(source, identifier, *path_to_details(path))
|
||||
end.compact
|
||||
Dir[query].reject { |p| File.directory?(p) }.map do |p|
|
||||
Template.new(File.read(p), File.expand_path(p), *path_to_details(p))
|
||||
end
|
||||
end
|
||||
|
||||
# # TODO: fix me
|
||||
|
|
|
@ -467,8 +467,8 @@ module ActiveSupport
|
|||
# method that took into consideration the per_key conditions. This
|
||||
# is a speed improvement for ActionPack.
|
||||
#
|
||||
def set_callback(name, *filters, &block)
|
||||
__update_callbacks(name, filters, block) do |chain, type, filters, options|
|
||||
def set_callback(name, *filter_list, &block)
|
||||
__update_callbacks(name, filter_list, block) do |chain, type, filters, options|
|
||||
filters.map! do |filter|
|
||||
chain.delete_if {|c| c.matches?(type, filter) }
|
||||
Callback.new(chain, filter, type, options.dup, self)
|
||||
|
@ -480,8 +480,8 @@ module ActiveSupport
|
|||
|
||||
# Skip a previously defined callback for a given type.
|
||||
#
|
||||
def skip_callback(name, *filters, &block)
|
||||
__update_callbacks(name, filters, block) do |chain, type, filters, options|
|
||||
def skip_callback(name, *filter_list, &block)
|
||||
__update_callbacks(name, filter_list, block) do |chain, type, filters, options|
|
||||
chain = send("_#{name}_callbacks=", chain.clone(self))
|
||||
|
||||
filters.each do |filter|
|
||||
|
|
Loading…
Reference in a new issue