aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/vendor/i18n-0.0.1
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-08-23 16:03:00 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-08-23 16:03:00 -0700
commit92a7239a3dd1de672730f7b0bcf5f5d2cb0f877f (patch)
tree2843c05fec065e01bd69ba37a957205f29ee0ea8 /activesupport/lib/active_support/vendor/i18n-0.0.1
parente7127be365a0a507c8538313b52ba62f476c2076 (diff)
downloadrails-92a7239a3dd1de672730f7b0bcf5f5d2cb0f877f.tar.gz
rails-92a7239a3dd1de672730f7b0bcf5f5d2cb0f877f.tar.bz2
rails-92a7239a3dd1de672730f7b0bcf5f5d2cb0f877f.zip
Ruby 1.9: silence some warnings for block args shadowing local vars
Diffstat (limited to 'activesupport/lib/active_support/vendor/i18n-0.0.1')
-rwxr-xr-xactivesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb4
-rw-r--r--activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb10
2 files changed, 7 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb b/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb
index 0e2a2d7051..9e347d94e9 100755
--- a/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb
+++ b/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb
@@ -183,8 +183,8 @@ module I18n
# keys are Symbols.
def normalize_translation_keys(locale, key, scope)
keys = [locale] + Array(scope) + [key]
- keys = keys.map{|key| key.to_s.split(/\./) }
- keys.flatten.map{|key| key.to_sym}
+ keys = keys.map{|k| k.to_s.split(/\./) }
+ keys.flatten.map{|k| k.to_sym}
end
end
end
diff --git a/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb b/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb
index 6c7c54777c..43ff686514 100644
--- a/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb
+++ b/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb
@@ -27,7 +27,7 @@ module I18n
def translate(locale, key, options = {})
raise InvalidLocale.new(locale) if locale.nil?
- return key.map{|key| translate locale, key, options } if key.is_a? Array
+ return key.map{|k| translate locale, k, options } if key.is_a? Array
reserved = :scope, :default
count, scope, default = options.values_at(:count, *reserved)
@@ -74,7 +74,7 @@ module I18n
def lookup(locale, key, scope = [])
return unless key
keys = I18n.send :normalize_translation_keys, locale, key, scope
- keys.inject(translations){|result, key| result[key.to_sym] or return nil }
+ keys.inject(translations){|result, k| result[k.to_sym] or return nil }
end
# Evaluates a default translation.
@@ -147,9 +147,9 @@ module I18n
type = File.extname(filename).tr('.', '').downcase
raise UnknownFileType.new(type, filename) unless respond_to? :"load_#{type}"
data = send :"load_#{type}", filename # TODO raise a meaningful exception if this does not yield a Hash
- data.each do |locale, data|
- merge_translations locale, data
- end
+ data.each do |locale, d|
+ merge_translations locale, d
+ end
end
# Loads a plain Ruby translations file. eval'ing the file must yield