1
0
Fork 0
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:
Jeremy Kemper 2009-12-28 16:28:26 -08:00
parent 6d390671f6
commit 9a650a6547
10 changed files with 213 additions and 218 deletions

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -169,7 +169,6 @@ module ActionController #:nodoc:
flash[:notice] = message
end
protected
def process_action(method_name)
@_flash = nil

View file

@ -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

View file

@ -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

View file

@ -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|