abiquo-etk 0.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +87 -0
- data/TODO +6 -0
- data/VERSION +1 -0
- data/abiquo-etk.gemspec +577 -0
- data/abiquo-etk.spec +125 -0
- data/bin/abicli +90 -0
- data/bin/abiquo-check-16-install +129 -0
- data/bin/aetk-setup-rs +36 -0
- data/bin/aetk-setup-server +77 -0
- data/bin/aetk-setup-v2v +33 -0
- data/lib/abicli/commands/remote-services-settings.rb +24 -0
- data/lib/abicli/commands/server-settings.rb +22 -0
- data/lib/abicli/commands/set.rb +133 -0
- data/lib/abicli/commands/smoketest.rb +93 -0
- data/lib/abicli/commands/upload-template.rb +272 -0
- data/lib/abicli/commands/version.rb +5 -0
- data/lib/abiquo-etk.rb +191 -0
- data/lib/checks/01detect_abiquo.rb +4 -0
- data/lib/checks/abiquo_service.rb +34 -0
- data/lib/checks/abiquo_version.rb +24 -0
- data/lib/checks/components_installed.rb +6 -0
- data/lib/checks/firewall.rb +10 -0
- data/lib/checks/hv_passwords.rb +51 -0
- data/lib/checks/install_type.rb +8 -0
- data/lib/checks/java.rb +19 -0
- data/lib/checks/mysql.rb +33 -0
- data/lib/checks/nfs.rb +18 -0
- data/lib/checks/os_version.rb +5 -0
- data/lib/checks/virtualbox.rb +11 -0
- data/scripts/setup_rs +44 -0
- data/scripts/setup_v2v +1 -0
- data/vendor/activesupport-2.3.8/CHANGELOG +1367 -0
- data/vendor/activesupport-2.3.8/README +43 -0
- data/vendor/activesupport-2.3.8/lib/active_support/all.rb +8 -0
- data/vendor/activesupport-2.3.8/lib/active_support/backtrace_cleaner.rb +72 -0
- data/vendor/activesupport-2.3.8/lib/active_support/base64.rb +33 -0
- data/vendor/activesupport-2.3.8/lib/active_support/basic_object.rb +24 -0
- data/vendor/activesupport-2.3.8/lib/active_support/buffered_logger.rb +127 -0
- data/vendor/activesupport-2.3.8/lib/active_support/cache/compressed_mem_cache_store.rb +20 -0
- data/vendor/activesupport-2.3.8/lib/active_support/cache/drb_store.rb +14 -0
- data/vendor/activesupport-2.3.8/lib/active_support/cache/file_store.rb +72 -0
- data/vendor/activesupport-2.3.8/lib/active_support/cache/mem_cache_store.rb +143 -0
- data/vendor/activesupport-2.3.8/lib/active_support/cache/memory_store.rb +58 -0
- data/vendor/activesupport-2.3.8/lib/active_support/cache/strategy/local_cache.rb +104 -0
- data/vendor/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb +47 -0
- data/vendor/activesupport-2.3.8/lib/active_support/cache.rb +248 -0
- data/vendor/activesupport-2.3.8/lib/active_support/callbacks.rb +279 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/array/access.rb +53 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/array/conversions.rb +197 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/array/extract_options.rb +20 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/array/grouping.rb +106 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/array/random_access.rb +22 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/array/wrapper.rb +24 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/array.rb +15 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/base64/encoding.rb +16 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/base64.rb +4 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb +19 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/bigdecimal/conversions.rb +37 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/bigdecimal.rb +6 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/blank.rb +2 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb +23 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/cgi.rb +5 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/class/attribute_accessors.rb +61 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/class/delegating_attributes.rb +47 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/class/inheritable_attributes.rb +140 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/class/removal.rb +50 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/class.rb +4 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/date/behavior.rb +42 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/date/calculations.rb +241 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/date/conversions.rb +107 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/date.rb +10 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/date_time/calculations.rb +126 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/date_time/conversions.rb +107 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/date_time.rb +12 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/duplicable.rb +43 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/enumerable.rb +120 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/exception.rb +45 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/file/atomic.rb +47 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/file.rb +5 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/float/rounding.rb +24 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/float/time.rb +27 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/float.rb +7 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/hash/conversions.rb +247 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/hash/deep_merge.rb +23 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/hash/diff.rb +19 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/hash/except.rb +25 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/hash/indifferent_access.rb +143 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/hash/keys.rb +52 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/hash/reverse_merge.rb +35 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/hash/slice.rb +40 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/hash.rb +14 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/integer/even_odd.rb +29 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/integer/inflections.rb +20 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/integer/time.rb +45 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/integer.rb +9 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/kernel/agnostics.rb +11 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/kernel/daemonizing.rb +7 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/kernel/debugger.rb +16 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/kernel/reporting.rb +59 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/kernel/requires.rb +24 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/kernel.rb +5 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/load_error.rb +38 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/logger.rb +145 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/module/aliasing.rb +74 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/module/attr_accessor_with_default.rb +31 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/module/attr_internal.rb +32 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/module/attribute_accessors.rb +67 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/module/delegation.rb +135 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/module/inclusion.rb +30 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/module/introspection.rb +90 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/module/loading.rb +23 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/module/model_naming.rb +25 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/module/synchronization.rb +39 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/module.rb +23 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/name_error.rb +19 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/numeric/bytes.rb +50 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/numeric/conversions.rb +19 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/numeric/time.rb +81 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/numeric.rb +9 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/object/blank.rb +76 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/object/conversions.rb +15 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/object/extending.rb +80 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/object/instance_variables.rb +74 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/object/metaclass.rb +14 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/object/misc.rb +90 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb +13 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/object.rb +7 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/pathname/clean_within.rb +14 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/pathname.rb +7 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/proc.rb +12 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/process/daemon.rb +25 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/process.rb +1 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/range/blockless_step.rb +32 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/range/conversions.rb +27 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/range/include_range.rb +30 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb +15 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/range.rb +11 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/rexml.rb +41 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/string/access.rb +106 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/string/behavior.rb +13 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/string/bytesize.rb +5 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/string/conversions.rb +28 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/string/filters.rb +26 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/string/inflections.rb +167 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/string/iterators.rb +23 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/string/multibyte.rb +81 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/string/output_safety.rb +112 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/string/starts_ends_with.rb +33 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/string/xchar.rb +11 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/string.rb +24 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/symbol.rb +14 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/time/behavior.rb +13 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/time/calculations.rb +313 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/time/conversions.rb +90 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/time/zones.rb +86 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/time.rb +46 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/try.rb +36 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext/uri.rb +16 -0
- data/vendor/activesupport-2.3.8/lib/active_support/core_ext.rb +8 -0
- data/vendor/activesupport-2.3.8/lib/active_support/dependencies.rb +625 -0
- data/vendor/activesupport-2.3.8/lib/active_support/deprecation.rb +197 -0
- data/vendor/activesupport-2.3.8/lib/active_support/duration.rb +100 -0
- data/vendor/activesupport-2.3.8/lib/active_support/gzip.rb +25 -0
- data/vendor/activesupport-2.3.8/lib/active_support/inflections.rb +56 -0
- data/vendor/activesupport-2.3.8/lib/active_support/inflector.rb +409 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/backends/jsongem.rb +37 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/backends/yajl.rb +40 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/backends/yaml.rb +87 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/decoding.rb +50 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/date.rb +22 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/date_time.rb +22 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/enumerable.rb +17 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/false_class.rb +7 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/hash.rb +56 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/nil_class.rb +7 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/numeric.rb +21 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/object.rb +10 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/regexp.rb +9 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/string.rb +9 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/symbol.rb +5 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/time.rb +22 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoders/true_class.rb +7 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/encoding.rb +111 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json/variable.rb +10 -0
- data/vendor/activesupport-2.3.8/lib/active_support/json.rb +2 -0
- data/vendor/activesupport-2.3.8/lib/active_support/locale/en.yml +33 -0
- data/vendor/activesupport-2.3.8/lib/active_support/memoizable.rb +100 -0
- data/vendor/activesupport-2.3.8/lib/active_support/message_encryptor.rb +70 -0
- data/vendor/activesupport-2.3.8/lib/active_support/message_verifier.rb +79 -0
- data/vendor/activesupport-2.3.8/lib/active_support/multibyte/chars.rb +707 -0
- data/vendor/activesupport-2.3.8/lib/active_support/multibyte/exceptions.rb +8 -0
- data/vendor/activesupport-2.3.8/lib/active_support/multibyte/unicode_database.rb +71 -0
- data/vendor/activesupport-2.3.8/lib/active_support/multibyte/utils.rb +60 -0
- data/vendor/activesupport-2.3.8/lib/active_support/multibyte.rb +57 -0
- data/vendor/activesupport-2.3.8/lib/active_support/option_merger.rb +23 -0
- data/vendor/activesupport-2.3.8/lib/active_support/ordered_hash.rb +158 -0
- data/vendor/activesupport-2.3.8/lib/active_support/ordered_options.rb +19 -0
- data/vendor/activesupport-2.3.8/lib/active_support/rescuable.rb +108 -0
- data/vendor/activesupport-2.3.8/lib/active_support/secure_random.rb +199 -0
- data/vendor/activesupport-2.3.8/lib/active_support/string_inquirer.rb +21 -0
- data/vendor/activesupport-2.3.8/lib/active_support/test_case.rb +40 -0
- data/vendor/activesupport-2.3.8/lib/active_support/testing/assertions.rb +79 -0
- data/vendor/activesupport-2.3.8/lib/active_support/testing/declarative.rb +21 -0
- data/vendor/activesupport-2.3.8/lib/active_support/testing/default.rb +9 -0
- data/vendor/activesupport-2.3.8/lib/active_support/testing/deprecation.rb +57 -0
- data/vendor/activesupport-2.3.8/lib/active_support/testing/performance.rb +452 -0
- data/vendor/activesupport-2.3.8/lib/active_support/testing/setup_and_teardown.rb +91 -0
- data/vendor/activesupport-2.3.8/lib/active_support/time_with_zone.rb +335 -0
- data/vendor/activesupport-2.3.8/lib/active_support/values/time_zone.rb +412 -0
- data/vendor/activesupport-2.3.8/lib/active_support/values/unicode_tables.dat +0 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/builder-2.1.2/blankslate.rb +113 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/builder-2.1.2/builder/blankslate.rb +20 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/builder-2.1.2/builder/css.rb +250 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb +115 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/builder-2.1.2/builder/xmlbase.rb +139 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb +63 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/builder-2.1.2/builder/xmlmarkup.rb +328 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/builder-2.1.2/builder.rb +13 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record/missing.rb +67 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record/store_procs.rb +38 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record/translation.rb +88 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record.rb +66 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/base.rb +266 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/cache.rb +76 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/cascade.rb +58 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/chain.rb +75 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/cldr.rb +100 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/fallbacks.rb +69 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/fast.rb +69 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/gettext.rb +75 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/helpers.rb +68 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/interpolation_compiler.rb +119 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/links.rb +34 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/metadata.rb +73 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/pluralization.rb +57 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/simple.rb +22 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend.rb +19 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/hash/except.rb +8 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/hash/slice.rb +8 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/object/meta_class.rb +5 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/string/interpolate.rb +99 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/exceptions.rb +61 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/gettext/po_parser.rb +329 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/gettext.rb +25 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/helpers/gettext.rb +65 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/helpers.rb +5 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/locale/fallbacks.rb +98 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/parents.rb +24 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/rfc4646.rb +76 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/simple.rb +41 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag.rb +28 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/locale.rb +6 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/version.rb +3 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n.rb +335 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/memcache-client-1.7.4/memcache.rb +1107 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/data_timezone.rb +47 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/data_timezone_info.rb +228 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Algiers.rb +55 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Cairo.rb +219 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Casablanca.rb +40 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Harare.rb +18 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Johannesburg.rb +25 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Monrovia.rb +22 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Nairobi.rb +23 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +166 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Argentina/San_Juan.rb +86 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Bogota.rb +23 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Caracas.rb +23 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Chicago.rb +283 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Chihuahua.rb +136 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Denver.rb +204 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Godthab.rb +161 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Guatemala.rb +27 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Halifax.rb +274 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Indiana/Indianapolis.rb +149 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Juneau.rb +194 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/La_Paz.rb +22 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Lima.rb +35 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Los_Angeles.rb +232 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Mazatlan.rb +139 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Mexico_City.rb +144 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Monterrey.rb +131 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/New_York.rb +282 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Phoenix.rb +30 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Regina.rb +74 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Santiago.rb +205 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Sao_Paulo.rb +171 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/St_Johns.rb +288 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Tijuana.rb +196 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Almaty.rb +67 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Baghdad.rb +73 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Baku.rb +161 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Bangkok.rb +20 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Chongqing.rb +33 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Colombo.rb +30 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Dhaka.rb +27 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Hong_Kong.rb +87 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Irkutsk.rb +165 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Jakarta.rb +30 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Jerusalem.rb +163 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kabul.rb +20 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kamchatka.rb +163 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Karachi.rb +30 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Katmandu.rb +20 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kolkata.rb +25 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Krasnoyarsk.rb +163 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kuala_Lumpur.rb +31 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kuwait.rb +18 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Magadan.rb +163 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Muscat.rb +18 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Novosibirsk.rb +164 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Rangoon.rb +24 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Riyadh.rb +18 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Seoul.rb +34 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Shanghai.rb +35 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Singapore.rb +33 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Taipei.rb +59 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Tashkent.rb +47 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Tbilisi.rb +78 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Tehran.rb +121 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Tokyo.rb +30 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Ulaanbaatar.rb +65 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Urumqi.rb +33 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Vladivostok.rb +164 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Yakutsk.rb +163 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Yekaterinburg.rb +165 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Yerevan.rb +165 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Atlantic/Azores.rb +270 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Atlantic/Cape_Verde.rb +23 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Atlantic/South_Georgia.rb +18 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Adelaide.rb +187 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Brisbane.rb +35 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Darwin.rb +29 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Hobart.rb +193 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Melbourne.rb +185 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Perth.rb +37 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Sydney.rb +185 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Etc/UTC.rb +16 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Amsterdam.rb +228 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Athens.rb +185 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Belgrade.rb +163 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Berlin.rb +188 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Bratislava.rb +13 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Brussels.rb +232 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Bucharest.rb +181 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Budapest.rb +197 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Copenhagen.rb +179 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Dublin.rb +276 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Helsinki.rb +163 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Istanbul.rb +218 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Kiev.rb +168 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Lisbon.rb +268 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Ljubljana.rb +13 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/London.rb +288 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Madrid.rb +211 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Minsk.rb +170 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Moscow.rb +181 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Paris.rb +232 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Prague.rb +187 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Riga.rb +176 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Rome.rb +215 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Sarajevo.rb +13 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Skopje.rb +13 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Sofia.rb +173 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Stockholm.rb +165 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Tallinn.rb +172 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Vienna.rb +183 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Vilnius.rb +170 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Warsaw.rb +212 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Zagreb.rb +13 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Auckland.rb +202 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Fiji.rb +23 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Guam.rb +22 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Honolulu.rb +28 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Majuro.rb +20 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Midway.rb +25 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Noumea.rb +25 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Pago_Pago.rb +26 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Port_Moresby.rb +20 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Tongatapu.rb +27 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/info_timezone.rb +52 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/linked_timezone.rb +51 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/linked_timezone_info.rb +44 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/offset_rationals.rb +98 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/ruby_core_support.rb +56 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/time_or_datetime.rb +292 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone.rb +508 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_definition.rb +56 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_info.rb +40 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_offset_info.rb +94 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_period.rb +198 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_transition_info.rb +129 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor/tzinfo-0.3.12/tzinfo.rb +33 -0
- data/vendor/activesupport-2.3.8/lib/active_support/vendor.rb +36 -0
- data/vendor/activesupport-2.3.8/lib/active_support/version.rb +9 -0
- data/vendor/activesupport-2.3.8/lib/active_support/whiny_nil.rb +64 -0
- data/vendor/activesupport-2.3.8/lib/active_support/xml_mini/jdom.rb +162 -0
- data/vendor/activesupport-2.3.8/lib/active_support/xml_mini/libxml.rb +73 -0
- data/vendor/activesupport-2.3.8/lib/active_support/xml_mini/libxmlsax.rb +74 -0
- data/vendor/activesupport-2.3.8/lib/active_support/xml_mini/nokogiri.rb +72 -0
- data/vendor/activesupport-2.3.8/lib/active_support/xml_mini/nokogirisax.rb +73 -0
- data/vendor/activesupport-2.3.8/lib/active_support/xml_mini/rexml.rb +108 -0
- data/vendor/activesupport-2.3.8/lib/active_support/xml_mini.rb +31 -0
- data/vendor/activesupport-2.3.8/lib/active_support.rb +60 -0
- data/vendor/activesupport-2.3.8/lib/activesupport.rb +2 -0
- data/vendor/addressable-2.2.1/CHANGELOG +95 -0
- data/vendor/addressable-2.2.1/LICENSE +20 -0
- data/vendor/addressable-2.2.1/README +60 -0
- data/vendor/addressable-2.2.1/Rakefile +42 -0
- data/vendor/addressable-2.2.1/lib/addressable/idna.rb +4871 -0
- data/vendor/addressable-2.2.1/lib/addressable/template.rb +1049 -0
- data/vendor/addressable-2.2.1/lib/addressable/uri.rb +2250 -0
- data/vendor/addressable-2.2.1/lib/addressable/version.rb +36 -0
- data/vendor/addressable-2.2.1/spec/addressable/idna_spec.rb +194 -0
- data/vendor/addressable-2.2.1/spec/addressable/template_spec.rb +2152 -0
- data/vendor/addressable-2.2.1/spec/addressable/uri_spec.rb +4203 -0
- data/vendor/addressable-2.2.1/spec/data/rfc3986.txt +3419 -0
- data/vendor/addressable-2.2.1/tasks/clobber.rake +2 -0
- data/vendor/addressable-2.2.1/tasks/gem.rake +84 -0
- data/vendor/addressable-2.2.1/tasks/git.rake +40 -0
- data/vendor/addressable-2.2.1/tasks/metrics.rake +22 -0
- data/vendor/addressable-2.2.1/tasks/rdoc.rake +26 -0
- data/vendor/addressable-2.2.1/tasks/rubyforge.rake +89 -0
- data/vendor/addressable-2.2.1/tasks/spec.rake +47 -0
- data/vendor/addressable-2.2.1/tasks/yard.rake +26 -0
- data/vendor/addressable-2.2.1/website/index.html +110 -0
- data/vendor/api_ruby_client/Gemfile +10 -0
- data/vendor/api_ruby_client/LICENSE +20 -0
- data/vendor/api_ruby_client/README +39 -0
- data/vendor/api_ruby_client/Rakefile +89 -0
- data/vendor/api_ruby_client/abiquo.gemspec +43 -0
- data/vendor/api_ruby_client/examples/create_dc_and_hv.rb +38 -0
- data/vendor/api_ruby_client/examples/hypervisor_resource.rb +16 -0
- data/vendor/api_ruby_client/examples/rack_resource.rb +38 -0
- data/vendor/api_ruby_client/lib/abiquo.rb +201 -0
- data/vendor/api_ruby_client/lib/core_ext.rb +28 -0
- data/vendor/api_ruby_client/lib/to_xml.rb +22 -0
- data/vendor/api_ruby_client/spec/acceptance/create_resource_spec.rb +43 -0
- data/vendor/api_ruby_client/spec/acceptance/delete_resource_spec.rb +27 -0
- data/vendor/api_ruby_client/spec/acceptance/fetch_resource_collections_spec.rb +55 -0
- data/vendor/api_ruby_client/spec/acceptance/fetch_single_resources_spec.rb +47 -0
- data/vendor/api_ruby_client/spec/acceptance/from_xml_spec.rb +15 -0
- data/vendor/api_ruby_client/spec/acceptance/navigate_linked_resources_spec.rb +61 -0
- data/vendor/api_ruby_client/spec/acceptance/update_resource_spec.rb +26 -0
- data/vendor/api_ruby_client/spec/spec_helper.rb +32 -0
- data/vendor/api_ruby_client/spec/unit/to_xml_spec.rb +56 -0
- data/vendor/fattr-2.1.0/README +347 -0
- data/vendor/fattr-2.1.0/README.erb +82 -0
- data/vendor/fattr-2.1.0/Rakefile +242 -0
- data/vendor/fattr-2.1.0/a.rb +42 -0
- data/vendor/fattr-2.1.0/fattr.gemspec +29 -0
- data/vendor/fattr-2.1.0/lib/fattr.rb +193 -0
- data/vendor/fattr-2.1.0/samples/a.rb +21 -0
- data/vendor/fattr-2.1.0/samples/b.rb +22 -0
- data/vendor/fattr-2.1.0/samples/c.rb +12 -0
- data/vendor/fattr-2.1.0/samples/d.rb +34 -0
- data/vendor/fattr-2.1.0/samples/e.rb +17 -0
- data/vendor/fattr-2.1.0/samples/f.rb +21 -0
- data/vendor/fattr-2.1.0/samples/g.rb +15 -0
- data/vendor/fattr-2.1.0/samples/h.rb +29 -0
- data/vendor/fattr-2.1.0/test/fattr.rb +166 -0
- data/vendor/httpauth-0.1/LICENSE +16 -0
- data/vendor/httpauth-0.1/README +39 -0
- data/vendor/httpauth-0.1/Rakefile +76 -0
- data/vendor/httpauth-0.1/examples/client_digest_secure +132 -0
- data/vendor/httpauth-0.1/examples/server_digest_secure +47 -0
- data/vendor/httpauth-0.1/lib/httpauth/basic.rb +114 -0
- data/vendor/httpauth-0.1/lib/httpauth/constants.rb +14 -0
- data/vendor/httpauth-0.1/lib/httpauth/digest.rb +583 -0
- data/vendor/httpauth-0.1/lib/httpauth/exceptions.rb +6 -0
- data/vendor/httpauth-0.1/lib/httpauth.rb +4 -0
- data/vendor/options-2.3.0/README +186 -0
- data/vendor/options-2.3.0/README.erb +35 -0
- data/vendor/options-2.3.0/Rakefile +371 -0
- data/vendor/options-2.3.0/lib/options.rb +220 -0
- data/vendor/options-2.3.0/options.gemspec +26 -0
- data/vendor/options-2.3.0/samples/a.rb +15 -0
- data/vendor/options-2.3.0/samples/b.rb +50 -0
- data/vendor/options-2.3.0/samples/c.rb +20 -0
- data/vendor/options-2.3.0/samples/d.rb +17 -0
- data/vendor/options-2.3.0/spec/options_spec.rb +38 -0
- data/vendor/options-2.3.0/spec/spec_helper.rb +7 -0
- data/vendor/resourceful-1.0.1/History.txt +39 -0
- data/vendor/resourceful-1.0.1/MIT-LICENSE +21 -0
- data/vendor/resourceful-1.0.1/Manifest +43 -0
- data/vendor/resourceful-1.0.1/README.markdown +92 -0
- data/vendor/resourceful-1.0.1/Rakefile +91 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/abstract_form_data.rb +18 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/authentication_manager.rb +108 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/cache_manager.rb +242 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/exceptions.rb +34 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/header.rb +355 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/http_accessor.rb +103 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/memcache_cache_manager.rb +75 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/multipart_form_data.rb +46 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/net_http_adapter.rb +84 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/request.rb +235 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/resource.rb +179 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/response.rb +221 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/simple.rb +36 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/stubbed_resource_proxy.rb +47 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/urlencoded_form_data.rb +17 -0
- data/vendor/resourceful-1.0.1/lib/resourceful/util.rb +6 -0
- data/vendor/resourceful-1.0.1/lib/resourceful.rb +26 -0
- data/vendor/resourceful-1.0.1/resourceful.gemspec +51 -0
- data/vendor/resourceful-1.0.1/spec/acceptance/authorization_spec.rb +16 -0
- data/vendor/resourceful-1.0.1/spec/acceptance/caching_spec.rb +190 -0
- data/vendor/resourceful-1.0.1/spec/acceptance/header_spec.rb +24 -0
- data/vendor/resourceful-1.0.1/spec/acceptance/redirecting_spec.rb +12 -0
- data/vendor/resourceful-1.0.1/spec/acceptance/resource_spec.rb +84 -0
- data/vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb +56 -0
- data/vendor/resourceful-1.0.1/spec/acceptance_shared_specs.rb +44 -0
- data/vendor/resourceful-1.0.1/spec/caching_spec.rb +89 -0
- data/vendor/resourceful-1.0.1/spec/old_acceptance_specs.rb +378 -0
- data/vendor/resourceful-1.0.1/spec/resourceful/header_spec.rb +153 -0
- data/vendor/resourceful-1.0.1/spec/resourceful/http_accessor_spec.rb +56 -0
- data/vendor/resourceful-1.0.1/spec/resourceful/multipart_form_data_spec.rb +77 -0
- data/vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb +20 -0
- data/vendor/resourceful-1.0.1/spec/resourceful/response_spec.rb +51 -0
- data/vendor/resourceful-1.0.1/spec/resourceful/urlencoded_form_data_spec.rb +44 -0
- data/vendor/resourceful-1.0.1/spec/resourceful_spec.rb +79 -0
- data/vendor/resourceful-1.0.1/spec/simple_sinatra_server.rb +74 -0
- data/vendor/resourceful-1.0.1/spec/simple_sinatra_server_spec.rb +98 -0
- data/vendor/resourceful-1.0.1/spec/spec.opts +3 -0
- data/vendor/resourceful-1.0.1/spec/spec_helper.rb +31 -0
- metadata +645 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'yaml'
|
|
4
|
+
require 'i18n/core_ext/hash/except'
|
|
5
|
+
|
|
6
|
+
module I18n
|
|
7
|
+
module Backend
|
|
8
|
+
module Base
|
|
9
|
+
include I18n::Backend::Helpers
|
|
10
|
+
|
|
11
|
+
RESERVED_KEYS = [:scope, :default, :separator, :resolve]
|
|
12
|
+
INTERPOLATION_SYNTAX_PATTERN = /(\\)?\{\{([^\}]+)\}\}/
|
|
13
|
+
|
|
14
|
+
# Accepts a list of paths to translation files. Loads translations from
|
|
15
|
+
# plain Ruby (*.rb) or YAML files (*.yml). See #load_rb and #load_yml
|
|
16
|
+
# for details.
|
|
17
|
+
def load_translations(*filenames)
|
|
18
|
+
filenames.each { |filename| load_file(filename) }
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Stores translations for the given locale in memory.
|
|
22
|
+
# This uses a deep merge for the translations hash, so existing
|
|
23
|
+
# translations will be overwritten by new ones only at the deepest
|
|
24
|
+
# level of the hash.
|
|
25
|
+
def store_translations(locale, data, options = {})
|
|
26
|
+
merge_translations(locale, data, options)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def translate(locale, key, options = {})
|
|
30
|
+
raise InvalidLocale.new(locale) unless locale
|
|
31
|
+
return key.map { |k| translate(locale, k, options) } if key.is_a?(Array)
|
|
32
|
+
|
|
33
|
+
if options.empty?
|
|
34
|
+
entry = resolve(locale, key, lookup(locale, key), options)
|
|
35
|
+
raise(I18n::MissingTranslationData.new(locale, key, options)) if entry.nil?
|
|
36
|
+
else
|
|
37
|
+
count, scope, default = options.values_at(:count, :scope, :default)
|
|
38
|
+
values = options.reject { |name, value| RESERVED_KEYS.include?(name) }
|
|
39
|
+
|
|
40
|
+
entry = lookup(locale, key, scope, options)
|
|
41
|
+
entry = entry.nil? && default ? default(locale, key, default, options) : resolve(locale, key, entry, options)
|
|
42
|
+
raise(I18n::MissingTranslationData.new(locale, key, options)) if entry.nil?
|
|
43
|
+
|
|
44
|
+
entry = pluralize(locale, entry, count) if count
|
|
45
|
+
entry = interpolate(locale, entry, values) if values
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
entry
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Acts the same as +strftime+, but uses a localized version of the
|
|
52
|
+
# format string. Takes a key from the date/time formats translations as
|
|
53
|
+
# a format argument (<em>e.g.</em>, <tt>:short</tt> in <tt>:'date.formats'</tt>).
|
|
54
|
+
def localize(locale, object, format = :default, options = {})
|
|
55
|
+
raise ArgumentError, "Object must be a Date, DateTime or Time object. #{object.inspect} given." unless object.respond_to?(:strftime)
|
|
56
|
+
|
|
57
|
+
if Symbol === format
|
|
58
|
+
key = format
|
|
59
|
+
type = object.respond_to?(:sec) ? 'time' : 'date'
|
|
60
|
+
format = I18n.t(:"#{type}.formats.#{key}", :locale => locale, :raise => true)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# format = resolve(locale, object, format, options)
|
|
64
|
+
format = format.to_s.gsub(/%[aAbBp]/) do |match|
|
|
65
|
+
case match
|
|
66
|
+
when '%a' then I18n.t(:"date.abbr_day_names", :locale => locale, :format => format)[object.wday]
|
|
67
|
+
when '%A' then I18n.t(:"date.day_names", :locale => locale, :format => format)[object.wday]
|
|
68
|
+
when '%b' then I18n.t(:"date.abbr_month_names", :locale => locale, :format => format)[object.mon]
|
|
69
|
+
when '%B' then I18n.t(:"date.month_names", :locale => locale, :format => format)[object.mon]
|
|
70
|
+
when '%p' then I18n.t(:"time.#{object.hour < 12 ? :am : :pm}", :locale => locale, :format => format) if object.respond_to? :hour
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
object.strftime(format)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def initialized?
|
|
78
|
+
@initialized ||= false
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Returns an array of locales for which translations are available
|
|
82
|
+
# ignoring the reserved translation meta data key :i18n.
|
|
83
|
+
def available_locales
|
|
84
|
+
init_translations unless initialized?
|
|
85
|
+
translations.inject([]) do |locales, (locale, data)|
|
|
86
|
+
locales << locale unless (data.keys - [:i18n]).empty?
|
|
87
|
+
locales
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def reload!
|
|
92
|
+
@initialized = false
|
|
93
|
+
@translations = nil
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
protected
|
|
97
|
+
def init_translations
|
|
98
|
+
load_translations(*I18n.load_path.flatten)
|
|
99
|
+
@initialized = true
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def translations
|
|
103
|
+
@translations ||= {}
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Looks up a translation from the translations hash. Returns nil if
|
|
107
|
+
# eiher key is nil, or locale, scope or key do not exist as a key in the
|
|
108
|
+
# nested translations hash. Splits keys or scopes containing dots
|
|
109
|
+
# into multiple keys, i.e. <tt>currency.format</tt> is regarded the same as
|
|
110
|
+
# <tt>%w(currency format)</tt>.
|
|
111
|
+
def lookup(locale, key, scope = [], options = {})
|
|
112
|
+
return unless key
|
|
113
|
+
init_translations unless initialized?
|
|
114
|
+
keys = I18n.normalize_keys(locale, key, scope, options[:separator])
|
|
115
|
+
keys.inject(translations) do |result, key|
|
|
116
|
+
key = key.to_sym
|
|
117
|
+
return nil unless result.is_a?(Hash) && result.has_key?(key)
|
|
118
|
+
result = result[key]
|
|
119
|
+
result = resolve(locale, key, result, options) if result.is_a?(Symbol)
|
|
120
|
+
String === result ? result.dup : result
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Evaluates defaults.
|
|
125
|
+
# If given subject is an Array, it walks the array and returns the
|
|
126
|
+
# first translation that can be resolved. Otherwise it tries to resolve
|
|
127
|
+
# the translation directly.
|
|
128
|
+
def default(locale, object, subject, options = {})
|
|
129
|
+
options = options.dup.reject { |key, value| key == :default }
|
|
130
|
+
case subject
|
|
131
|
+
when Array
|
|
132
|
+
subject.each do |item|
|
|
133
|
+
result = resolve(locale, object, item, options) and return result
|
|
134
|
+
end and nil
|
|
135
|
+
else
|
|
136
|
+
resolve(locale, object, subject, options)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Resolves a translation.
|
|
141
|
+
# If the given subject is a Symbol, it will be translated with the
|
|
142
|
+
# given options. If it is a Proc then it will be evaluated. All other
|
|
143
|
+
# subjects will be returned directly.
|
|
144
|
+
def resolve(locale, object, subject, options = nil)
|
|
145
|
+
return subject if options[:resolve] == false
|
|
146
|
+
case subject
|
|
147
|
+
when Symbol
|
|
148
|
+
I18n.translate(subject, (options || {}).merge(:locale => locale, :raise => true))
|
|
149
|
+
when Proc
|
|
150
|
+
resolve(locale, object, subject.call(object, options), options = {})
|
|
151
|
+
else
|
|
152
|
+
subject
|
|
153
|
+
end
|
|
154
|
+
rescue MissingTranslationData
|
|
155
|
+
nil
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Picks a translation from an array according to English pluralization
|
|
159
|
+
# rules. It will pick the first translation if count is not equal to 1
|
|
160
|
+
# and the second translation if it is equal to 1. Other backends can
|
|
161
|
+
# implement more flexible or complex pluralization rules.
|
|
162
|
+
def pluralize(locale, entry, count)
|
|
163
|
+
return entry unless entry.is_a?(Hash) and count
|
|
164
|
+
|
|
165
|
+
key = :zero if count == 0 && entry.has_key?(:zero)
|
|
166
|
+
key ||= count == 1 ? :one : :other
|
|
167
|
+
raise InvalidPluralizationData.new(entry, count) unless entry.has_key?(key)
|
|
168
|
+
entry[key]
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Interpolates values into a given string.
|
|
172
|
+
#
|
|
173
|
+
# interpolate "file {{file}} opened by \\{{user}}", :file => 'test.txt', :user => 'Mr. X'
|
|
174
|
+
# # => "file test.txt opened by {{user}}"
|
|
175
|
+
#
|
|
176
|
+
# Note that you have to double escape the <tt>\\</tt> when you want to escape
|
|
177
|
+
# the <tt>{{...}}</tt> key in a string (once for the string and once for the
|
|
178
|
+
# interpolation).
|
|
179
|
+
def interpolate(locale, string, values = {})
|
|
180
|
+
return string unless string.is_a?(::String) && !values.empty?
|
|
181
|
+
|
|
182
|
+
preserve_encoding(string) do
|
|
183
|
+
s = string.gsub(INTERPOLATION_SYNTAX_PATTERN) do
|
|
184
|
+
escaped, key = $1, $2.to_sym
|
|
185
|
+
if escaped
|
|
186
|
+
"{{#{key}}}"
|
|
187
|
+
elsif RESERVED_KEYS.include?(key)
|
|
188
|
+
raise ReservedInterpolationKey.new(key, string)
|
|
189
|
+
else
|
|
190
|
+
"%{#{key}}"
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
values.each do |key, value|
|
|
195
|
+
value = value.call(values) if interpolate_lambda?(value, s, key)
|
|
196
|
+
value = value.to_s unless value.is_a?(::String)
|
|
197
|
+
values[key] = value
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
s % values
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
rescue KeyError => e
|
|
204
|
+
raise MissingInterpolationArgument.new(values, string)
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
def preserve_encoding(string)
|
|
208
|
+
if string.respond_to?(:encoding)
|
|
209
|
+
encoding = string.encoding
|
|
210
|
+
result = yield
|
|
211
|
+
result.force_encoding(encoding) if result.respond_to?(:force_encoding)
|
|
212
|
+
result
|
|
213
|
+
else
|
|
214
|
+
yield
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# returns true when the given value responds to :call and the key is
|
|
219
|
+
# an interpolation placeholder in the given string
|
|
220
|
+
def interpolate_lambda?(object, string, key)
|
|
221
|
+
object.respond_to?(:call) && string =~ /%\{#{key}\}|%\<#{key}>.*?\d*\.?\d*[bBdiouxXeEfgGcps]\}/
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Loads a single translations file by delegating to #load_rb or
|
|
225
|
+
# #load_yml depending on the file extension and directly merges the
|
|
226
|
+
# data to the existing translations. Raises I18n::UnknownFileType
|
|
227
|
+
# for all other file extensions.
|
|
228
|
+
def load_file(filename)
|
|
229
|
+
type = File.extname(filename).tr('.', '').downcase
|
|
230
|
+
raise UnknownFileType.new(type, filename) unless respond_to?(:"load_#{type}")
|
|
231
|
+
data = send(:"load_#{type}", filename) # TODO raise a meaningful exception if this does not yield a Hash
|
|
232
|
+
data.each { |locale, d| merge_translations(locale, d) }
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Loads a plain Ruby translations file. eval'ing the file must yield
|
|
236
|
+
# a Hash containing translation data with locales as toplevel keys.
|
|
237
|
+
def load_rb(filename)
|
|
238
|
+
eval(IO.read(filename), binding, filename)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Loads a YAML translations file. The data must have locales as
|
|
242
|
+
# toplevel keys.
|
|
243
|
+
def load_yml(filename)
|
|
244
|
+
YAML::load(IO.read(filename))
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Deep merges the given translations hash with the existing translations
|
|
248
|
+
# for the given locale
|
|
249
|
+
def merge_translations(locale, data, options = {})
|
|
250
|
+
locale = locale.to_sym
|
|
251
|
+
translations[locale] ||= {}
|
|
252
|
+
separator = options[:separator] || I18n.default_separator
|
|
253
|
+
data = unwind_keys(data, separator)
|
|
254
|
+
data = deep_symbolize_keys(data)
|
|
255
|
+
|
|
256
|
+
# deep_merge by Stefan Rusterholz, see http://www.ruby-forum.com/topic/142809
|
|
257
|
+
merger = proc do |key, v1, v2|
|
|
258
|
+
# TODO should probably be:
|
|
259
|
+
# raise TypeError.new("can't merge #{v1.inspect} and #{v2.inspect}") unless Hash === v1 && Hash === v2
|
|
260
|
+
Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : (v2 || v1)
|
|
261
|
+
end
|
|
262
|
+
translations[locale].merge!(data, &merger)
|
|
263
|
+
end
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
# This module allows you to easily cache all responses from the backend - thus
|
|
4
|
+
# speeding up the I18n aspects of your application quite a bit.
|
|
5
|
+
#
|
|
6
|
+
# To enable caching you can simply include the Cache module to the Simple
|
|
7
|
+
# backend - or whatever other backend you are using:
|
|
8
|
+
#
|
|
9
|
+
# I18n::Backend::Simple.send(:include, I18n::Backend::Cache)
|
|
10
|
+
#
|
|
11
|
+
# You will also need to set a cache store implementation that you want to use:
|
|
12
|
+
#
|
|
13
|
+
# I18n.cache_store = ActiveSupport::Cache.lookup_store(:memory_store)
|
|
14
|
+
#
|
|
15
|
+
# You can use any cache implementation you want that provides the same API as
|
|
16
|
+
# ActiveSupport::Cache (only the methods #fetch and #write are being used).
|
|
17
|
+
#
|
|
18
|
+
# The cache_key implementation assumes that you only pass values to
|
|
19
|
+
# I18n.translate that return a valid key from #hash (see
|
|
20
|
+
# http://www.ruby-doc.org/core/classes/Object.html#M000337).
|
|
21
|
+
module I18n
|
|
22
|
+
class << self
|
|
23
|
+
@@cache_store = nil
|
|
24
|
+
@@cache_namespace = nil
|
|
25
|
+
|
|
26
|
+
def cache_store
|
|
27
|
+
@@cache_store
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def cache_store=(store)
|
|
31
|
+
@@cache_store = store
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def cache_namespace
|
|
35
|
+
@@cache_namespace
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def cache_namespace=(namespace)
|
|
39
|
+
@@cache_namespace = namespace
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def perform_caching?
|
|
43
|
+
!cache_store.nil?
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
module Backend
|
|
48
|
+
module Cache
|
|
49
|
+
def translate(*args)
|
|
50
|
+
I18n.perform_caching? ? fetch(*args) { super } : super
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
protected
|
|
54
|
+
|
|
55
|
+
def fetch(*args, &block)
|
|
56
|
+
result = I18n.cache_store.fetch(cache_key(*args), &block)
|
|
57
|
+
raise result if result.is_a?(Exception)
|
|
58
|
+
result = result.dup if result.frozen? rescue result
|
|
59
|
+
result
|
|
60
|
+
rescue MissingTranslationData => exception
|
|
61
|
+
I18n.cache_store.write(cache_key(*args), exception)
|
|
62
|
+
raise exception
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def cache_key(*args)
|
|
66
|
+
# This assumes that only simple, native Ruby values are passed to I18n.translate.
|
|
67
|
+
# Also, in Ruby < 1.8.7 {}.hash != {}.hash
|
|
68
|
+
# (see http://paulbarry.com/articles/2009/09/14/why-rails-3-will-require-ruby-1-8-7)
|
|
69
|
+
# If args.inspect does not work for you for some reason, patches are very welcome :)
|
|
70
|
+
hash = RUBY_VERSION >= "1.8.7" ? args.hash : args.inspect
|
|
71
|
+
keys = ['i18n', I18n.cache_namespace, hash]
|
|
72
|
+
keys.compact.join('-')
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
# EXPERIMENTAL
|
|
4
|
+
#
|
|
5
|
+
# The Cascade module adds the ability to do cascading lookups to backends that
|
|
6
|
+
# are compatible to the Simple backend.
|
|
7
|
+
#
|
|
8
|
+
# By cascading lookups we mean that for any key that can not be found the
|
|
9
|
+
# Cascade module strips one segment off the scope part of the key and then
|
|
10
|
+
# tries to look up the key in that scope.
|
|
11
|
+
#
|
|
12
|
+
# E.g. when a lookup for the key :"foo.bar.baz" does not yield a result then
|
|
13
|
+
# the segment :bar will be stripped off the scope part :"foo.bar" and the new
|
|
14
|
+
# scope :foo will be used to look up the key :baz. If that does not succeed
|
|
15
|
+
# then the remaining scope segment :foo will be omitted, too, and again the
|
|
16
|
+
# key :baz will be looked up (now with no scope).
|
|
17
|
+
#
|
|
18
|
+
# To enable a cascading lookup one passes the :cascade option:
|
|
19
|
+
#
|
|
20
|
+
# I18n.t(:'foo.bar.baz', :cascade => true)
|
|
21
|
+
#
|
|
22
|
+
# This will return the first translation found for :"foo.bar.baz", :"foo.baz"
|
|
23
|
+
# or :baz in this order.
|
|
24
|
+
#
|
|
25
|
+
# The cascading lookup takes precedence over resolving any given defaults.
|
|
26
|
+
# I.e. defaults will kick in after the cascading lookups haven't succeeded.
|
|
27
|
+
#
|
|
28
|
+
# This behavior is useful for libraries like ActiveRecord validations where
|
|
29
|
+
# the library wants to give users a bunch of more or less fine-grained options
|
|
30
|
+
# of scopes for a particular key.
|
|
31
|
+
#
|
|
32
|
+
# Thanks to Clemens Kofler for the initial idea and implementation! See
|
|
33
|
+
# http://github.com/clemens/i18n-cascading-backend
|
|
34
|
+
|
|
35
|
+
module I18n
|
|
36
|
+
module Backend
|
|
37
|
+
module Cascade
|
|
38
|
+
def lookup(locale, key, scope = [], options = {})
|
|
39
|
+
return unless key
|
|
40
|
+
return super unless cascade = options[:cascade]
|
|
41
|
+
|
|
42
|
+
separator = options[:separator] || I18n.default_separator
|
|
43
|
+
skip_root = cascade.has_key?(:skip_root) ? cascade[:skip_root] : true
|
|
44
|
+
step = cascade[:step]
|
|
45
|
+
|
|
46
|
+
keys = I18n.normalize_keys(nil, key, nil, separator)
|
|
47
|
+
offset = options[:cascade][:offset] || keys.length
|
|
48
|
+
scope = I18n.normalize_keys(nil, nil, scope, separator) + keys
|
|
49
|
+
key = scope.slice!(-offset, offset).join(separator)
|
|
50
|
+
|
|
51
|
+
begin
|
|
52
|
+
result = super
|
|
53
|
+
return result unless result.nil?
|
|
54
|
+
end while !scope.empty? && scope.slice!(-step, step) && (!scope.empty? || !skip_root)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
module I18n
|
|
4
|
+
module Backend
|
|
5
|
+
# Backend that chains multiple other backends and checks each of them when
|
|
6
|
+
# a translation needs to be looked up. This is useful when you want to use
|
|
7
|
+
# standard translations with a Simple backend but store custom application
|
|
8
|
+
# translations in a database or other backends.
|
|
9
|
+
#
|
|
10
|
+
# To use the Chain backend instantiate it and set it to the I18n module.
|
|
11
|
+
# You can add chained backends through the initializer or backends
|
|
12
|
+
# accessor:
|
|
13
|
+
#
|
|
14
|
+
# # preserves the existing Simple backend set to I18n.backend
|
|
15
|
+
# I18n.backend = I18n::Backend::Chain.new(I18n::Backend::ActiveRecord.new, I18n.backend)
|
|
16
|
+
#
|
|
17
|
+
# The implementation assumes that all backends added to the Chain implement
|
|
18
|
+
# a lookup method with the same API as Simple backend does.
|
|
19
|
+
class Chain < Simple
|
|
20
|
+
attr_accessor :backends
|
|
21
|
+
|
|
22
|
+
def initialize(*backends)
|
|
23
|
+
self.backends = backends
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def reload!
|
|
27
|
+
backends.each { |backend| backend.reload! }
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def store_translations(locale, data, options = {})
|
|
31
|
+
backends.first.store_translations(locale, data, options = {})
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def available_locales
|
|
35
|
+
backends.map { |backend| backend.available_locales }.flatten.uniq
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def translate(locale, key, options = {})
|
|
39
|
+
return key.map { |k| translate(locale, k, options) } if key.is_a?(Array)
|
|
40
|
+
|
|
41
|
+
default = options.delete(:default)
|
|
42
|
+
namespace = {}
|
|
43
|
+
backends.each do |backend|
|
|
44
|
+
begin
|
|
45
|
+
options.update(:default => default) if default and backend == backends.last
|
|
46
|
+
translation = backend.translate(locale, key, options)
|
|
47
|
+
if namespace_lookup?(translation, options)
|
|
48
|
+
namespace.update(translation)
|
|
49
|
+
elsif !translation.nil?
|
|
50
|
+
return translation
|
|
51
|
+
end
|
|
52
|
+
rescue MissingTranslationData
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
return namespace unless namespace.empty?
|
|
56
|
+
raise(I18n::MissingTranslationData.new(locale, key, options))
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def localize(locale, object, format = :default, options = {})
|
|
60
|
+
backends.each do |backend|
|
|
61
|
+
begin
|
|
62
|
+
result = backend.localize(locale, object, format, options) and return result
|
|
63
|
+
rescue MissingTranslationData
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
raise(I18n::MissingTranslationData.new(locale, format, options))
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
protected
|
|
70
|
+
def namespace_lookup?(result, options)
|
|
71
|
+
result.is_a?(Hash) and not options.has_key?(:count)
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
require 'cldr'
|
|
3
|
+
|
|
4
|
+
module I18n
|
|
5
|
+
module Backend
|
|
6
|
+
module Cldr
|
|
7
|
+
include ::Cldr::Format
|
|
8
|
+
|
|
9
|
+
def localize(locale, object, format = :default, options = {})
|
|
10
|
+
options[:as] ||= detect_type(object, options)
|
|
11
|
+
send(:"format_#{options[:as]}", locale, object, format, options)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def format_decimal(locale, object, format = :default, options = {})
|
|
15
|
+
formatter(locale, :decimal, format).apply(object, options)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def format_integer(locale, object, format = :default, options = {})
|
|
19
|
+
format_object(number, options.merge(:precision => 0))
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def format_currency(locale, object, format = :default, options = {})
|
|
23
|
+
options.merge!(:currency => lookup_currency(locale, options[:currency], object)) if options[:currency].is_a?(Symbol)
|
|
24
|
+
formatter(locale, :currency, format).apply(object, options)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def format_percent(locale, object, format = :default, options = {})
|
|
28
|
+
formatter(locale, :percent, format).apply(object, options)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def format_date(locale, object, format = :default, options = {})
|
|
32
|
+
formatter(locale, :date, format).apply(object, options)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def format_time(locale, object, format = :default, options = {})
|
|
36
|
+
formatter(locale, :time, format).apply(object, options)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def format_datetime(locale, object, format = :default, options = {})
|
|
40
|
+
key = :"calendars.gregorian.formats.datetime.#{format}.pattern"
|
|
41
|
+
date = I18n.l(object, :format => options[:date_format] || format, :locale => locale, :as => :date)
|
|
42
|
+
time = I18n.l(object, :format => options[:time_format] || format, :locale => locale, :as => :time)
|
|
43
|
+
I18n.t(key, :date => date, :time => time, :locale => locale, :raise => true)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
protected
|
|
47
|
+
|
|
48
|
+
def detect_type(object, options)
|
|
49
|
+
options.has_key?(:currency) ? :currency : case object
|
|
50
|
+
when ::Numeric
|
|
51
|
+
:decimal
|
|
52
|
+
when ::Date, ::DateTime, ::Time
|
|
53
|
+
object.class.name.downcase.to_sym
|
|
54
|
+
else
|
|
55
|
+
raise_unspecified_format_type!
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def formatter(locale, type, format)
|
|
60
|
+
(@formatters ||= {})[:"#{locale}.#{type}.#{format}"] ||= begin
|
|
61
|
+
format = lookup_format(locale, type, format)
|
|
62
|
+
data = lookup_format_data(locale, type)
|
|
63
|
+
::Cldr::Format.const_get(type.to_s.camelize).new(format, data)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def lookup_format(locale, type, format)
|
|
68
|
+
key = case type
|
|
69
|
+
when :date, :time, :datetime
|
|
70
|
+
:"calendars.gregorian.formats.#{type}.#{format}.pattern"
|
|
71
|
+
else
|
|
72
|
+
:"numbers.formats.#{type}.patterns.#{format || :default}"
|
|
73
|
+
end
|
|
74
|
+
I18n.t(key, :locale => locale, :raise => true)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def lookup_format_data(locale, type)
|
|
78
|
+
key = case type
|
|
79
|
+
when :date, :time, :datetime
|
|
80
|
+
:'calendars.gregorian'
|
|
81
|
+
else
|
|
82
|
+
:'numbers.symbols'
|
|
83
|
+
end
|
|
84
|
+
I18n.t(key, :locale => locale, :raise => true)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def lookup_currency(locale, currency, count)
|
|
88
|
+
I18n.t(:"currencies.#{currency}", :locale => locale, :count => count)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def raise_unspecified_format_type!
|
|
92
|
+
raise ArgumentError.new("You have to specify a format type, e.g. :as => :number.")
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def raise_unspecified_currency!
|
|
96
|
+
raise ArgumentError.new("You have to specify a currency, e.g. :currency => 'EUR'.")
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
data/vendor/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n/backend/fallbacks.rb
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
# I18n locale fallbacks are useful when you want your application to use
|
|
4
|
+
# translations from other locales when translations for the current locale are
|
|
5
|
+
# missing. E.g. you might want to use :en translations when translations in
|
|
6
|
+
# your applications main locale :de are missing.
|
|
7
|
+
#
|
|
8
|
+
# To enable locale fallbacks you can simply include the Fallbacks module to
|
|
9
|
+
# the Simple backend - or whatever other backend you are using:
|
|
10
|
+
#
|
|
11
|
+
# I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
|
|
12
|
+
module I18n
|
|
13
|
+
@@fallbacks = nil
|
|
14
|
+
|
|
15
|
+
class << self
|
|
16
|
+
# Returns the current fallbacks implementation. Defaults to +I18n::Locale::Fallbacks+.
|
|
17
|
+
def fallbacks
|
|
18
|
+
@@fallbacks ||= I18n::Locale::Fallbacks.new
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Sets the current fallbacks implementation. Use this to set a different fallbacks implementation.
|
|
22
|
+
def fallbacks=(fallbacks)
|
|
23
|
+
@@fallbacks = fallbacks
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
module Backend
|
|
28
|
+
module Fallbacks
|
|
29
|
+
# Overwrites the Base backend translate method so that it will try each
|
|
30
|
+
# locale given by I18n.fallbacks for the given locale. E.g. for the
|
|
31
|
+
# locale :"de-DE" it might try the locales :"de-DE", :de and :en
|
|
32
|
+
# (depends on the fallbacks implementation) until it finds a result with
|
|
33
|
+
# the given options. If it does not find any result for any of the
|
|
34
|
+
# locales it will then raise a MissingTranslationData exception as
|
|
35
|
+
# usual.
|
|
36
|
+
#
|
|
37
|
+
# The default option takes precedence over fallback locales
|
|
38
|
+
# only when it's not a String. When default contains String it
|
|
39
|
+
# is evaluated after fallback locales.
|
|
40
|
+
def translate(locale, key, options = {})
|
|
41
|
+
default = extract_string_default!(options) if options[:default]
|
|
42
|
+
|
|
43
|
+
I18n.fallbacks[locale].each do |fallback|
|
|
44
|
+
begin
|
|
45
|
+
result = super(fallback, key, options)
|
|
46
|
+
return result unless result.nil?
|
|
47
|
+
rescue I18n::MissingTranslationData
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
return super(locale, nil, options.merge(:default => default)) if default
|
|
52
|
+
raise(I18n::MissingTranslationData.new(locale, key, options))
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def extract_string_default!(options)
|
|
56
|
+
defaults = Array(options[:default])
|
|
57
|
+
if index = find_first_string_default(defaults)
|
|
58
|
+
options[:default] = defaults[0, index]
|
|
59
|
+
defaults[index]
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def find_first_string_default(defaults)
|
|
64
|
+
defaults.each_index { |ix| return ix if String === defaults[ix] }
|
|
65
|
+
nil
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|