activesupport 2.3.8 → 2.3.9.pre
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activesupport might be problematic. Click here for more details.
- data/CHANGELOG +11 -0
- data/lib/active_support/core_ext/array/grouping.rb +1 -1
- data/lib/active_support/core_ext/array/random_access.rb +24 -4
- data/lib/active_support/core_ext/class.rb +1 -0
- data/lib/active_support/core_ext/class/attribute.rb +67 -0
- data/lib/active_support/core_ext/enumerable.rb +1 -1
- data/lib/active_support/core_ext/kernel/singleton_class.rb +13 -0
- data/lib/active_support/core_ext/module/remove_method.rb +6 -0
- data/lib/active_support/core_ext/object/misc.rb +3 -0
- data/lib/active_support/core_ext/range/blockless_step.rb +1 -1
- data/lib/active_support/core_ext/string/output_safety.rb +0 -11
- data/lib/active_support/dependencies.rb +36 -12
- data/lib/active_support/deprecation.rb +7 -0
- data/lib/active_support/json/backends/yajl.rb +1 -1
- data/lib/active_support/ordered_hash.rb +6 -0
- data/lib/active_support/testing/performance.rb +1 -1
- data/lib/active_support/values/time_zone.rb +5 -1
- data/lib/active_support/vendor.rb +2 -2
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n.rb +92 -105
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend.rb +5 -4
- data/lib/active_support/vendor/i18n-0.4.1/i18n/backend/active_record.rb +61 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/active_record/missing.rb +4 -6
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/active_record/store_procs.rb +0 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/active_record/translation.rb +8 -3
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/base.rb +55 -84
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/cache.rb +1 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/cascade.rb +0 -1
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/chain.rb +3 -1
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/cldr.rb +0 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/fallbacks.rb +0 -0
- data/lib/active_support/vendor/i18n-0.4.1/i18n/backend/flatten.rb +113 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/gettext.rb +0 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/interpolation_compiler.rb +8 -4
- data/lib/active_support/vendor/i18n-0.4.1/i18n/backend/key_value.rb +102 -0
- data/lib/active_support/vendor/i18n-0.4.1/i18n/backend/memoize.rb +48 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/metadata.rb +5 -13
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/backend/pluralization.rb +0 -0
- data/lib/active_support/vendor/i18n-0.4.1/i18n/backend/simple.rb +87 -0
- data/lib/active_support/vendor/i18n-0.4.1/i18n/backend/transliterator.rb +98 -0
- data/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb +84 -0
- data/lib/active_support/vendor/i18n-0.4.1/i18n/core_ext/hash.rb +29 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/core_ext/string/interpolate.rb +3 -4
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/exceptions.rb +0 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/gettext.rb +2 -0
- data/lib/active_support/vendor/{i18n-0.3.7/i18n/helpers/gettext.rb → i18n-0.4.1/i18n/gettext/helpers.rb} +2 -2
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/gettext/po_parser.rb +0 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/locale.rb +0 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/locale/fallbacks.rb +0 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/locale/tag.rb +0 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/locale/tag/parents.rb +0 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/locale/tag/rfc4646.rb +0 -0
- data/lib/active_support/vendor/{i18n-0.3.7 → i18n-0.4.1}/i18n/locale/tag/simple.rb +0 -0
- data/lib/active_support/vendor/i18n-0.4.1/i18n/version.rb +3 -0
- data/lib/active_support/version.rb +1 -1
- data/lib/active_support/whiny_nil.rb +1 -1
- metadata +48 -43
- data/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record.rb +0 -66
- data/lib/active_support/vendor/i18n-0.3.7/i18n/backend/fast.rb +0 -69
- data/lib/active_support/vendor/i18n-0.3.7/i18n/backend/helpers.rb +0 -68
- data/lib/active_support/vendor/i18n-0.3.7/i18n/backend/links.rb +0 -34
- data/lib/active_support/vendor/i18n-0.3.7/i18n/backend/simple.rb +0 -22
- data/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/hash/except.rb +0 -8
- data/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/hash/slice.rb +0 -8
- data/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/object/meta_class.rb +0 -5
- data/lib/active_support/vendor/i18n-0.3.7/i18n/helpers.rb +0 -5
- data/lib/active_support/vendor/i18n-0.3.7/i18n/version.rb +0 -3
@@ -1,34 +0,0 @@
|
|
1
|
-
module I18n
|
2
|
-
module Backend
|
3
|
-
module Links
|
4
|
-
protected
|
5
|
-
def links(locale)
|
6
|
-
@links ||= {}
|
7
|
-
@links[locale.to_sym] ||= {}
|
8
|
-
end
|
9
|
-
|
10
|
-
def store_link(locale, key, link)
|
11
|
-
links(locale)[key.to_s] = link.to_s
|
12
|
-
end
|
13
|
-
|
14
|
-
def resolve_link(locale, key)
|
15
|
-
key = key.to_s
|
16
|
-
links = self.links(locale)
|
17
|
-
|
18
|
-
if links.key?(key)
|
19
|
-
links[key]
|
20
|
-
elsif link = find_link(locale, key)
|
21
|
-
store_link(locale, key, key.gsub(*link))
|
22
|
-
else
|
23
|
-
key
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def find_link(locale, key)
|
28
|
-
links(locale).each do |from, to|
|
29
|
-
return [from, to] if key[0, from.length] == from
|
30
|
-
end && nil
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# Stub class for the Simple backend. The actual implementation is provided by
|
4
|
-
# the backend Base class. This makes it easier to extend the Simple backend's
|
5
|
-
# behaviour by including modules. E.g.:
|
6
|
-
#
|
7
|
-
# module I18n::Backend::Pluralization
|
8
|
-
# def pluralize(*args)
|
9
|
-
# # extended pluralization logic
|
10
|
-
# super
|
11
|
-
# end
|
12
|
-
# end
|
13
|
-
#
|
14
|
-
# I18n::Backend::Simple.send(:include, I18n::Backend::Pluralization)
|
15
|
-
|
16
|
-
module I18n
|
17
|
-
module Backend
|
18
|
-
class Simple
|
19
|
-
include Base
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|