abiquo-etk 0.4.13
Sign up to get free protection for your applications and to get access to all the features.
- 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,53 @@
|
|
1
|
+
module ActiveSupport #:nodoc:
|
2
|
+
module CoreExtensions #:nodoc:
|
3
|
+
module Array #:nodoc:
|
4
|
+
# Makes it easier to access parts of an array.
|
5
|
+
module Access
|
6
|
+
# Returns the tail of the array from +position+.
|
7
|
+
#
|
8
|
+
# %w( a b c d ).from(0) # => %w( a b c d )
|
9
|
+
# %w( a b c d ).from(2) # => %w( c d )
|
10
|
+
# %w( a b c d ).from(10) # => nil
|
11
|
+
# %w().from(0) # => nil
|
12
|
+
def from(position)
|
13
|
+
self[position..-1]
|
14
|
+
end
|
15
|
+
|
16
|
+
# Returns the beginning of the array up to +position+.
|
17
|
+
#
|
18
|
+
# %w( a b c d ).to(0) # => %w( a )
|
19
|
+
# %w( a b c d ).to(2) # => %w( a b c )
|
20
|
+
# %w( a b c d ).to(10) # => %w( a b c d )
|
21
|
+
# %w().to(0) # => %w()
|
22
|
+
def to(position)
|
23
|
+
self[0..position]
|
24
|
+
end
|
25
|
+
|
26
|
+
# Equal to <tt>self[1]</tt>.
|
27
|
+
def second
|
28
|
+
self[1]
|
29
|
+
end
|
30
|
+
|
31
|
+
# Equal to <tt>self[2]</tt>.
|
32
|
+
def third
|
33
|
+
self[2]
|
34
|
+
end
|
35
|
+
|
36
|
+
# Equal to <tt>self[3]</tt>.
|
37
|
+
def fourth
|
38
|
+
self[3]
|
39
|
+
end
|
40
|
+
|
41
|
+
# Equal to <tt>self[4]</tt>.
|
42
|
+
def fifth
|
43
|
+
self[4]
|
44
|
+
end
|
45
|
+
|
46
|
+
# Equal to <tt>self[41]</tt>. Also known as accessing "the reddit".
|
47
|
+
def forty_two
|
48
|
+
self[41]
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,197 @@
|
|
1
|
+
module ActiveSupport #:nodoc:
|
2
|
+
module CoreExtensions #:nodoc:
|
3
|
+
module Array #:nodoc:
|
4
|
+
module Conversions
|
5
|
+
# Converts the array to a comma-separated sentence where the last element is joined by the connector word. Options:
|
6
|
+
# * <tt>:words_connector</tt> - The sign or word used to join the elements in arrays with two or more elements (default: ", ")
|
7
|
+
# * <tt>:two_words_connector</tt> - The sign or word used to join the elements in arrays with two elements (default: " and ")
|
8
|
+
# * <tt>:last_word_connector</tt> - The sign or word used to join the last element in arrays with three or more elements (default: ", and ")
|
9
|
+
def to_sentence(options = {})
|
10
|
+
default_words_connector = I18n.translate(:'support.array.words_connector', :locale => options[:locale])
|
11
|
+
default_two_words_connector = I18n.translate(:'support.array.two_words_connector', :locale => options[:locale])
|
12
|
+
default_last_word_connector = I18n.translate(:'support.array.last_word_connector', :locale => options[:locale])
|
13
|
+
|
14
|
+
# Try to emulate to_senteces previous to 2.3
|
15
|
+
if options.has_key?(:connector) || options.has_key?(:skip_last_comma)
|
16
|
+
::ActiveSupport::Deprecation.warn(":connector has been deprecated. Use :words_connector instead", caller) if options.has_key? :connector
|
17
|
+
::ActiveSupport::Deprecation.warn(":skip_last_comma has been deprecated. Use :last_word_connector instead", caller) if options.has_key? :skip_last_comma
|
18
|
+
|
19
|
+
skip_last_comma = options.delete :skip_last_comma
|
20
|
+
if connector = options.delete(:connector)
|
21
|
+
options[:last_word_connector] ||= skip_last_comma ? connector : ", #{connector}"
|
22
|
+
else
|
23
|
+
options[:last_word_connector] ||= skip_last_comma ? default_two_words_connector : default_last_word_connector
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
options.assert_valid_keys(:words_connector, :two_words_connector, :last_word_connector, :locale)
|
28
|
+
options.reverse_merge! :words_connector => default_words_connector, :two_words_connector => default_two_words_connector, :last_word_connector => default_last_word_connector
|
29
|
+
|
30
|
+
case length
|
31
|
+
when 0
|
32
|
+
""
|
33
|
+
when 1
|
34
|
+
self[0].to_s
|
35
|
+
when 2
|
36
|
+
"#{self[0]}#{options[:two_words_connector]}#{self[1]}"
|
37
|
+
else
|
38
|
+
"#{self[0...-1].join(options[:words_connector])}#{options[:last_word_connector]}#{self[-1]}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
# Calls <tt>to_param</tt> on all its elements and joins the result with
|
44
|
+
# slashes. This is used by <tt>url_for</tt> in Action Pack.
|
45
|
+
def to_param
|
46
|
+
collect { |e| e.to_param }.join '/'
|
47
|
+
end
|
48
|
+
|
49
|
+
# Converts an array into a string suitable for use as a URL query string,
|
50
|
+
# using the given +key+ as the param name.
|
51
|
+
#
|
52
|
+
# ['Rails', 'coding'].to_query('hobbies') # => "hobbies%5B%5D=Rails&hobbies%5B%5D=coding"
|
53
|
+
def to_query(key)
|
54
|
+
prefix = "#{key}[]"
|
55
|
+
collect { |value| value.to_query(prefix) }.join '&'
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.included(base) #:nodoc:
|
59
|
+
base.class_eval do
|
60
|
+
alias_method :to_default_s, :to_s
|
61
|
+
alias_method :to_s, :to_formatted_s
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Converts a collection of elements into a formatted string by calling
|
66
|
+
# <tt>to_s</tt> on all elements and joining them:
|
67
|
+
#
|
68
|
+
# Blog.find(:all).to_formatted_s # => "First PostSecond PostThird Post"
|
69
|
+
#
|
70
|
+
# Adding in the <tt>:db</tt> argument as the format yields a prettier
|
71
|
+
# output:
|
72
|
+
#
|
73
|
+
# Blog.find(:all).to_formatted_s(:db) # => "First Post,Second Post,Third Post"
|
74
|
+
def to_formatted_s(format = :default)
|
75
|
+
case format
|
76
|
+
when :db
|
77
|
+
if respond_to?(:empty?) && self.empty?
|
78
|
+
"null"
|
79
|
+
else
|
80
|
+
collect { |element| element.id }.join(",")
|
81
|
+
end
|
82
|
+
else
|
83
|
+
to_default_s
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Returns a string that represents this array in XML by sending +to_xml+
|
88
|
+
# to each element. Active Record collections delegate their representation
|
89
|
+
# in XML to this method.
|
90
|
+
#
|
91
|
+
# All elements are expected to respond to +to_xml+, if any of them does
|
92
|
+
# not an exception is raised.
|
93
|
+
#
|
94
|
+
# The root node reflects the class name of the first element in plural
|
95
|
+
# if all elements belong to the same type and that's not Hash:
|
96
|
+
#
|
97
|
+
# customer.projects.to_xml
|
98
|
+
#
|
99
|
+
# <?xml version="1.0" encoding="UTF-8"?>
|
100
|
+
# <projects type="array">
|
101
|
+
# <project>
|
102
|
+
# <amount type="decimal">20000.0</amount>
|
103
|
+
# <customer-id type="integer">1567</customer-id>
|
104
|
+
# <deal-date type="date">2008-04-09</deal-date>
|
105
|
+
# ...
|
106
|
+
# </project>
|
107
|
+
# <project>
|
108
|
+
# <amount type="decimal">57230.0</amount>
|
109
|
+
# <customer-id type="integer">1567</customer-id>
|
110
|
+
# <deal-date type="date">2008-04-15</deal-date>
|
111
|
+
# ...
|
112
|
+
# </project>
|
113
|
+
# </projects>
|
114
|
+
#
|
115
|
+
# Otherwise the root element is "records":
|
116
|
+
#
|
117
|
+
# [{:foo => 1, :bar => 2}, {:baz => 3}].to_xml
|
118
|
+
#
|
119
|
+
# <?xml version="1.0" encoding="UTF-8"?>
|
120
|
+
# <records type="array">
|
121
|
+
# <record>
|
122
|
+
# <bar type="integer">2</bar>
|
123
|
+
# <foo type="integer">1</foo>
|
124
|
+
# </record>
|
125
|
+
# <record>
|
126
|
+
# <baz type="integer">3</baz>
|
127
|
+
# </record>
|
128
|
+
# </records>
|
129
|
+
#
|
130
|
+
# If the collection is empty the root element is "nil-classes" by default:
|
131
|
+
#
|
132
|
+
# [].to_xml
|
133
|
+
#
|
134
|
+
# <?xml version="1.0" encoding="UTF-8"?>
|
135
|
+
# <nil-classes type="array"/>
|
136
|
+
#
|
137
|
+
# To ensure a meaningful root element use the <tt>:root</tt> option:
|
138
|
+
#
|
139
|
+
# customer_with_no_projects.projects.to_xml(:root => "projects")
|
140
|
+
#
|
141
|
+
# <?xml version="1.0" encoding="UTF-8"?>
|
142
|
+
# <projects type="array"/>
|
143
|
+
#
|
144
|
+
# By default root children have as node name the one of the root
|
145
|
+
# singularized. You can change it with the <tt>:children</tt> option.
|
146
|
+
#
|
147
|
+
# The +options+ hash is passed downwards:
|
148
|
+
#
|
149
|
+
# Message.all.to_xml(:skip_types => true)
|
150
|
+
#
|
151
|
+
# <?xml version="1.0" encoding="UTF-8"?>
|
152
|
+
# <messages>
|
153
|
+
# <message>
|
154
|
+
# <created-at>2008-03-07T09:58:18+01:00</created-at>
|
155
|
+
# <id>1</id>
|
156
|
+
# <name>1</name>
|
157
|
+
# <updated-at>2008-03-07T09:58:18+01:00</updated-at>
|
158
|
+
# <user-id>1</user-id>
|
159
|
+
# </message>
|
160
|
+
# </messages>
|
161
|
+
#
|
162
|
+
def to_xml(options = {})
|
163
|
+
raise "Not all elements respond to to_xml" unless all? { |e| e.respond_to? :to_xml }
|
164
|
+
require 'builder' unless defined?(Builder)
|
165
|
+
|
166
|
+
options = options.dup
|
167
|
+
options[:root] ||= all? { |e| e.is_a?(first.class) && first.class.to_s != "Hash" } ? first.class.to_s.underscore.pluralize.tr('/', '-') : "records"
|
168
|
+
options[:children] ||= options[:root].singularize
|
169
|
+
options[:indent] ||= 2
|
170
|
+
options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
|
171
|
+
|
172
|
+
root = options.delete(:root).to_s
|
173
|
+
children = options.delete(:children)
|
174
|
+
|
175
|
+
if !options.has_key?(:dasherize) || options[:dasherize]
|
176
|
+
root = root.dasherize
|
177
|
+
end
|
178
|
+
|
179
|
+
options[:builder].instruct! unless options.delete(:skip_instruct)
|
180
|
+
|
181
|
+
opts = options.merge({ :root => children })
|
182
|
+
|
183
|
+
xml = options[:builder]
|
184
|
+
if empty?
|
185
|
+
xml.tag!(root, options[:skip_types] ? {} : {:type => "array"})
|
186
|
+
else
|
187
|
+
xml.tag!(root, options[:skip_types] ? {} : {:type => "array"}) {
|
188
|
+
yield xml if block_given?
|
189
|
+
each { |e| e.to_xml(opts.merge({ :skip_instruct => true })) }
|
190
|
+
}
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module ActiveSupport #:nodoc:
|
2
|
+
module CoreExtensions #:nodoc:
|
3
|
+
module Array #:nodoc:
|
4
|
+
module ExtractOptions
|
5
|
+
# Extracts options from a set of arguments. Removes and returns the last
|
6
|
+
# element in the array if it's a hash, otherwise returns a blank hash.
|
7
|
+
#
|
8
|
+
# def options(*args)
|
9
|
+
# args.extract_options!
|
10
|
+
# end
|
11
|
+
#
|
12
|
+
# options(1, 2) # => {}
|
13
|
+
# options(1, 2, :a => :b) # => {:a=>:b}
|
14
|
+
def extract_options!
|
15
|
+
last.is_a?(::Hash) ? pop : {}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
require 'enumerator'
|
2
|
+
|
3
|
+
module ActiveSupport #:nodoc:
|
4
|
+
module CoreExtensions #:nodoc:
|
5
|
+
module Array #:nodoc:
|
6
|
+
module Grouping
|
7
|
+
# Splits or iterates over the array in groups of size +number+,
|
8
|
+
# padding any remaining slots with +fill_with+ unless it is +false+.
|
9
|
+
#
|
10
|
+
# %w(1 2 3 4 5 6 7).in_groups_of(3) {|group| p group}
|
11
|
+
# ["1", "2", "3"]
|
12
|
+
# ["4", "5", "6"]
|
13
|
+
# ["7", nil, nil]
|
14
|
+
#
|
15
|
+
# %w(1 2 3).in_groups_of(2, ' ') {|group| p group}
|
16
|
+
# ["1", "2"]
|
17
|
+
# ["3", " "]
|
18
|
+
#
|
19
|
+
# %w(1 2 3).in_groups_of(2, false) {|group| p group}
|
20
|
+
# ["1", "2"]
|
21
|
+
# ["3"]
|
22
|
+
def in_groups_of(number, fill_with = nil)
|
23
|
+
if fill_with == false
|
24
|
+
collection = self
|
25
|
+
else
|
26
|
+
# size % number gives how many extra we have;
|
27
|
+
# subtracting from number gives how many to add;
|
28
|
+
# modulo number ensures we don't add group of just fill.
|
29
|
+
padding = (number - size % number) % number
|
30
|
+
collection = dup.concat([fill_with] * padding)
|
31
|
+
end
|
32
|
+
|
33
|
+
if block_given?
|
34
|
+
collection.each_slice(number) { |slice| yield(slice) }
|
35
|
+
else
|
36
|
+
returning [] do |groups|
|
37
|
+
collection.each_slice(number) { |group| groups << group }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Splits or iterates over the array in +number+ of groups, padding any
|
43
|
+
# remaining slots with +fill_with+ unless it is +false+.
|
44
|
+
#
|
45
|
+
# %w(1 2 3 4 5 6 7 8 9 10).in_groups(3) {|group| p group}
|
46
|
+
# ["1", "2", "3", "4"]
|
47
|
+
# ["5", "6", "7", nil]
|
48
|
+
# ["8", "9", "10", nil]
|
49
|
+
#
|
50
|
+
# %w(1 2 3 4 5 6 7).in_groups(3, ' ') {|group| p group}
|
51
|
+
# ["1", "2", "3"]
|
52
|
+
# ["4", "5", " "]
|
53
|
+
# ["6", "7", " "]
|
54
|
+
#
|
55
|
+
# %w(1 2 3 4 5 6 7).in_groups(3, false) {|group| p group}
|
56
|
+
# ["1", "2", "3"]
|
57
|
+
# ["4", "5"]
|
58
|
+
# ["6", "7"]
|
59
|
+
def in_groups(number, fill_with = nil)
|
60
|
+
# size / number gives minor group size;
|
61
|
+
# size % number gives how many objects need extra accomodation;
|
62
|
+
# each group hold either division or division + 1 items.
|
63
|
+
division = size / number
|
64
|
+
modulo = size % number
|
65
|
+
|
66
|
+
# create a new array avoiding dup
|
67
|
+
groups = []
|
68
|
+
start = 0
|
69
|
+
|
70
|
+
number.times do |index|
|
71
|
+
length = division + (modulo > 0 && modulo > index ? 1 : 0)
|
72
|
+
padding = fill_with != false &&
|
73
|
+
modulo > 0 && length == division ? 1 : 0
|
74
|
+
groups << slice(start, length).concat([fill_with] * padding)
|
75
|
+
start += length
|
76
|
+
end
|
77
|
+
|
78
|
+
if block_given?
|
79
|
+
groups.each{|g| yield(g) }
|
80
|
+
else
|
81
|
+
groups
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Divides the array into one or more subarrays based on a delimiting +value+
|
86
|
+
# or the result of an optional block.
|
87
|
+
#
|
88
|
+
# [1, 2, 3, 4, 5].split(3) # => [[1, 2], [4, 5]]
|
89
|
+
# (1..10).to_a.split { |i| i % 3 == 0 } # => [[1, 2], [4, 5], [7, 8], [10]]
|
90
|
+
def split(value = nil)
|
91
|
+
using_block = block_given?
|
92
|
+
|
93
|
+
inject([[]]) do |results, element|
|
94
|
+
if (using_block && yield(element)) || (value == element)
|
95
|
+
results << []
|
96
|
+
else
|
97
|
+
results.last << element
|
98
|
+
end
|
99
|
+
|
100
|
+
results
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module ActiveSupport #:nodoc:
|
2
|
+
module CoreExtensions #:nodoc:
|
3
|
+
module Array #:nodoc:
|
4
|
+
module RandomAccess
|
5
|
+
# This method is deprecated because it masks Kernel#rand within the Array class itself,
|
6
|
+
# which may be used by a 3rd party library extending Array in turn. See
|
7
|
+
#
|
8
|
+
# https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4555
|
9
|
+
#
|
10
|
+
def rand # :nodoc:
|
11
|
+
ActiveSupport::Deprecation.warn 'Array#rand is deprecated and will be removed in Rails 3. Use "random_element" instead', caller
|
12
|
+
random_element
|
13
|
+
end
|
14
|
+
|
15
|
+
# Returns a random element from the array.
|
16
|
+
def random_element
|
17
|
+
self[Kernel.rand(length)]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module ActiveSupport #:nodoc:
|
2
|
+
module CoreExtensions #:nodoc:
|
3
|
+
module Array #:nodoc:
|
4
|
+
module Wrapper
|
5
|
+
# Wraps the object in an Array unless it's an Array. Converts the
|
6
|
+
# object to an Array using #to_ary if it implements that.
|
7
|
+
def wrap(object)
|
8
|
+
case object
|
9
|
+
when nil
|
10
|
+
[]
|
11
|
+
when self
|
12
|
+
object
|
13
|
+
else
|
14
|
+
if object.respond_to?(:to_ary)
|
15
|
+
object.to_ary
|
16
|
+
else
|
17
|
+
[object]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'active_support/core_ext/array/access'
|
2
|
+
require 'active_support/core_ext/array/conversions'
|
3
|
+
require 'active_support/core_ext/array/extract_options'
|
4
|
+
require 'active_support/core_ext/array/grouping'
|
5
|
+
require 'active_support/core_ext/array/random_access'
|
6
|
+
require 'active_support/core_ext/array/wrapper'
|
7
|
+
|
8
|
+
class Array #:nodoc:
|
9
|
+
include ActiveSupport::CoreExtensions::Array::Access
|
10
|
+
include ActiveSupport::CoreExtensions::Array::Conversions
|
11
|
+
include ActiveSupport::CoreExtensions::Array::ExtractOptions
|
12
|
+
include ActiveSupport::CoreExtensions::Array::Grouping
|
13
|
+
include ActiveSupport::CoreExtensions::Array::RandomAccess
|
14
|
+
extend ActiveSupport::CoreExtensions::Array::Wrapper
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module ActiveSupport #:nodoc:
|
2
|
+
module CoreExtensions #:nodoc:
|
3
|
+
module Base64 #:nodoc:
|
4
|
+
module Encoding
|
5
|
+
# Encodes the value as base64 without the newline breaks. This makes the base64 encoding readily usable as URL parameters
|
6
|
+
# or memcache keys without further processing.
|
7
|
+
#
|
8
|
+
# ActiveSupport::Base64.encode64s("Original unencoded string")
|
9
|
+
# # => "T3JpZ2luYWwgdW5lbmNvZGVkIHN0cmluZw=="
|
10
|
+
def encode64s(value)
|
11
|
+
encode64(value).gsub(/\n/, '')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'benchmark'
|
2
|
+
|
3
|
+
class << Benchmark
|
4
|
+
# Earlier Ruby had a slower implementation.
|
5
|
+
if RUBY_VERSION < '1.8.7'
|
6
|
+
remove_method :realtime
|
7
|
+
|
8
|
+
def realtime
|
9
|
+
r0 = Time.now
|
10
|
+
yield
|
11
|
+
r1 = Time.now
|
12
|
+
r1.to_f - r0.to_f
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def ms
|
17
|
+
1000 * realtime { yield }
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module ActiveSupport #:nodoc:
|
4
|
+
module CoreExtensions #:nodoc:
|
5
|
+
module BigDecimal #:nodoc:
|
6
|
+
module Conversions
|
7
|
+
DEFAULT_STRING_FORMAT = 'F'.freeze
|
8
|
+
YAML_TAG = 'tag:yaml.org,2002:float'.freeze
|
9
|
+
YAML_MAPPING = { 'Infinity' => '.Inf', '-Infinity' => '-.Inf', 'NaN' => '.NaN' }
|
10
|
+
|
11
|
+
def self.included(base) #:nodoc:
|
12
|
+
base.class_eval do
|
13
|
+
alias_method :_original_to_s, :to_s
|
14
|
+
alias_method :to_s, :to_formatted_s
|
15
|
+
|
16
|
+
yaml_as YAML_TAG
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_formatted_s(format = DEFAULT_STRING_FORMAT)
|
21
|
+
_original_to_s(format)
|
22
|
+
end
|
23
|
+
|
24
|
+
# This emits the number without any scientific notation.
|
25
|
+
# This is better than self.to_f.to_s since it doesn't lose precision.
|
26
|
+
#
|
27
|
+
# Note that reconstituting YAML floats to native floats may lose precision.
|
28
|
+
def to_yaml(opts = {})
|
29
|
+
YAML.quick_emit(nil, opts) do |out|
|
30
|
+
string = to_s
|
31
|
+
out.scalar(YAML_TAG, YAML_MAPPING[string] || string, :plain)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module ActiveSupport #:nodoc:
|
2
|
+
module CoreExtensions #:nodoc:
|
3
|
+
module CGI #:nodoc:
|
4
|
+
module EscapeSkippingSlashes #:nodoc:
|
5
|
+
if RUBY_VERSION >= '1.9'
|
6
|
+
def escape_skipping_slashes(str)
|
7
|
+
str = str.join('/') if str.respond_to? :join
|
8
|
+
str.gsub(/([^ \/a-zA-Z0-9_.-])/n) do
|
9
|
+
"%#{$1.unpack('H2' * $1.bytesize).join('%').upcase}"
|
10
|
+
end.tr(' ', '+')
|
11
|
+
end
|
12
|
+
else
|
13
|
+
def escape_skipping_slashes(str)
|
14
|
+
str = str.join('/') if str.respond_to? :join
|
15
|
+
str.gsub(/([^ \/a-zA-Z0-9_.-])/n) do
|
16
|
+
"%#{$1.unpack('H2').first.upcase}"
|
17
|
+
end.tr(' ', '+')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# Extends the class object with class and instance accessors for class attributes,
|
2
|
+
# just like the native attr* accessors for instance attributes.
|
3
|
+
#
|
4
|
+
# class Person
|
5
|
+
# cattr_accessor :hair_colors
|
6
|
+
# end
|
7
|
+
#
|
8
|
+
# Person.hair_colors = [:brown, :black, :blonde, :red]
|
9
|
+
class Class
|
10
|
+
def cattr_reader(*syms)
|
11
|
+
options = syms.extract_options!
|
12
|
+
syms.each do |sym|
|
13
|
+
next if sym.is_a?(Hash)
|
14
|
+
class_eval(<<-EOS, __FILE__, __LINE__ + 1)
|
15
|
+
unless defined? @@#{sym}
|
16
|
+
@@#{sym} = nil
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.#{sym}
|
20
|
+
@@#{sym}
|
21
|
+
end
|
22
|
+
EOS
|
23
|
+
|
24
|
+
unless options[:instance_reader] == false
|
25
|
+
class_eval(<<-EOS, __FILE__, __LINE__ + 1)
|
26
|
+
def #{sym}
|
27
|
+
@@#{sym}
|
28
|
+
end
|
29
|
+
EOS
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def cattr_writer(*syms)
|
35
|
+
options = syms.extract_options!
|
36
|
+
syms.each do |sym|
|
37
|
+
class_eval(<<-EOS, __FILE__, __LINE__ + 1)
|
38
|
+
unless defined? @@#{sym}
|
39
|
+
@@#{sym} = nil
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.#{sym}=(obj)
|
43
|
+
@@#{sym} = obj
|
44
|
+
end
|
45
|
+
EOS
|
46
|
+
|
47
|
+
unless options[:instance_writer] == false
|
48
|
+
class_eval(<<-EOS, __FILE__, __LINE__ + 1)
|
49
|
+
def #{sym}=(obj)
|
50
|
+
@@#{sym} = obj
|
51
|
+
end
|
52
|
+
EOS
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def cattr_accessor(*syms)
|
58
|
+
cattr_reader(*syms)
|
59
|
+
cattr_writer(*syms)
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# These class attributes behave something like the class
|
2
|
+
# inheritable accessors. But instead of copying the hash over at
|
3
|
+
# the time the subclass is first defined, the accessors simply
|
4
|
+
# delegate to their superclass unless they have been given a
|
5
|
+
# specific value. This stops the strange situation where values
|
6
|
+
# set after class definition don't get applied to subclasses.
|
7
|
+
class Class
|
8
|
+
def superclass_delegating_reader(*names)
|
9
|
+
class_name_to_stop_searching_on = self.superclass.name.blank? ? "Object" : self.superclass.name
|
10
|
+
names.each do |name|
|
11
|
+
class_eval <<-EOS
|
12
|
+
def self.#{name} # def self.only_reader
|
13
|
+
if defined?(@#{name}) # if defined?(@only_reader)
|
14
|
+
@#{name} # @only_reader
|
15
|
+
elsif superclass < #{class_name_to_stop_searching_on} && # elsif superclass < Object &&
|
16
|
+
superclass.respond_to?(:#{name}) # superclass.respond_to?(:only_reader)
|
17
|
+
superclass.#{name} # superclass.only_reader
|
18
|
+
end # end
|
19
|
+
end # end
|
20
|
+
def #{name} # def only_reader
|
21
|
+
self.class.#{name} # self.class.only_reader
|
22
|
+
end # end
|
23
|
+
def self.#{name}? # def self.only_reader?
|
24
|
+
!!#{name} # !!only_reader
|
25
|
+
end # end
|
26
|
+
def #{name}? # def only_reader?
|
27
|
+
!!#{name} # !!only_reader
|
28
|
+
end # end
|
29
|
+
EOS
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def superclass_delegating_writer(*names)
|
34
|
+
names.each do |name|
|
35
|
+
class_eval <<-EOS
|
36
|
+
def self.#{name}=(value) # def self.only_writer=(value)
|
37
|
+
@#{name} = value # @only_writer = value
|
38
|
+
end # end
|
39
|
+
EOS
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def superclass_delegating_accessor(*names)
|
44
|
+
superclass_delegating_reader(*names)
|
45
|
+
superclass_delegating_writer(*names)
|
46
|
+
end
|
47
|
+
end
|