mercadopago-custom-checkout 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +23 -0
- data/.gs/bin/rake +23 -0
- data/.gs/cache/faraday-0.9.2.gem +0 -0
- data/.gs/cache/minitest-5.9.0.gem +0 -0
- data/.gs/cache/multi_json-1.12.1.gem +0 -0
- data/.gs/cache/multipart-post-2.0.0.gem +0 -0
- data/.gs/cache/rake-10.5.0.gem +0 -0
- data/.gs/gems/faraday-0.9.2/LICENSE.md +20 -0
- data/.gs/gems/faraday-0.9.2/README.md +245 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday.rb +268 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter.rb +46 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_http.rb +237 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_http_ssl_patch.rb +56 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_synchrony.rb +100 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_synchrony/parallel_manager.rb +66 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/excon.rb +81 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/httpclient.rb +117 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb +130 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/net_http_persistent.rb +49 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/patron.rb +78 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/rack.rb +58 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/test.rb +162 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/typhoeus.rb +123 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/autoload.rb +84 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/connection.rb +437 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/error.rb +53 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/middleware.rb +37 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/options.rb +359 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/parameters.rb +197 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/rack_builder.rb +213 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request.rb +92 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/authorization.rb +42 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/basic_authentication.rb +13 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/instrumentation.rb +36 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/multipart.rb +63 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/retry.rb +154 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/token_authentication.rb +15 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/url_encoded.rb +36 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/response.rb +93 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/response/logger.rb +59 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/response/raise_error.rb +21 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/upload_io.rb +67 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/utils.rb +309 -0
- data/.gs/gems/minitest-5.9.0/.autotest +34 -0
- data/.gs/gems/minitest-5.9.0/History.rdoc +1176 -0
- data/.gs/gems/minitest-5.9.0/Manifest.txt +26 -0
- data/.gs/gems/minitest-5.9.0/README.rdoc +656 -0
- data/.gs/gems/minitest-5.9.0/Rakefile +72 -0
- data/.gs/gems/minitest-5.9.0/design_rationale.rb +52 -0
- data/.gs/gems/minitest-5.9.0/lib/hoe/minitest.rb +26 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest.rb +815 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/assertions.rb +674 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/autorun.rb +13 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/benchmark.rb +424 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/expectations.rb +284 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/hell.rb +17 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/mock.rb +232 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/parallel.rb +69 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/pride.rb +4 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/pride_plugin.rb +142 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/spec.rb +331 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/test.rb +284 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/unit.rb +45 -0
- data/.gs/gems/minitest-5.9.0/test/minitest/metametameta.rb +90 -0
- data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_benchmark.rb +137 -0
- data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_mock.rb +512 -0
- data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_reporter.rb +281 -0
- data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_spec.rb +967 -0
- data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_test.rb +1983 -0
- data/.gs/gems/multi_json-1.12.1/CHANGELOG.md +245 -0
- data/.gs/gems/multi_json-1.12.1/CONTRIBUTING.md +46 -0
- data/.gs/gems/multi_json-1.12.1/LICENSE.md +20 -0
- data/.gs/gems/multi_json-1.12.1/README.md +121 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json.rb +161 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapter.rb +49 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapter_error.rb +15 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/gson.rb +20 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/jr_jackson.rb +25 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/json_common.rb +23 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/json_gem.rb +11 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/json_pure.rb +11 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/nsjsonserialization.rb +32 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/oj.rb +25 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/ok_json.rb +23 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/yajl.rb +19 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/convertible_hash_keys.rb +43 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/options.rb +39 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/options_cache.rb +29 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/parse_error.rb +17 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/vendor/okjson.rb +606 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/version.rb +17 -0
- data/.gs/gems/multi_json-1.12.1/multi_json.gemspec +20 -0
- data/.gs/gems/multipart-post-2.0.0/.gitignore +6 -0
- data/.gs/gems/multipart-post-2.0.0/.travis.yml +7 -0
- data/.gs/gems/multipart-post-2.0.0/Gemfile +14 -0
- data/.gs/gems/multipart-post-2.0.0/History.txt +60 -0
- data/.gs/gems/multipart-post-2.0.0/Manifest.txt +9 -0
- data/.gs/gems/multipart-post-2.0.0/README.md +77 -0
- data/.gs/gems/multipart-post-2.0.0/Rakefile +9 -0
- data/.gs/gems/multipart-post-2.0.0/lib/composite_io.rb +108 -0
- data/.gs/gems/multipart-post-2.0.0/lib/multipart_post.rb +9 -0
- data/.gs/gems/multipart-post-2.0.0/lib/multipartable.rb +29 -0
- data/.gs/gems/multipart-post-2.0.0/lib/net/http/post/multipart.rb +27 -0
- data/.gs/gems/multipart-post-2.0.0/lib/parts.rb +96 -0
- data/.gs/gems/multipart-post-2.0.0/multipart-post.gemspec +22 -0
- data/.gs/gems/multipart-post-2.0.0/test/multibyte.txt +1 -0
- data/.gs/gems/multipart-post-2.0.0/test/net/http/post/test_multipart.rb +110 -0
- data/.gs/gems/multipart-post-2.0.0/test/test_composite_io.rb +115 -0
- data/.gs/gems/multipart-post-2.0.0/test/test_parts.rb +86 -0
- data/.gs/gems/rake-10.5.0/.autotest +7 -0
- data/.gs/gems/rake-10.5.0/.rubocop.yml +27 -0
- data/.gs/gems/rake-10.5.0/.togglerc +7 -0
- data/.gs/gems/rake-10.5.0/CONTRIBUTING.rdoc +38 -0
- data/.gs/gems/rake-10.5.0/History.rdoc +659 -0
- data/.gs/gems/rake-10.5.0/MIT-LICENSE +21 -0
- data/.gs/gems/rake-10.5.0/Manifest.txt +166 -0
- data/.gs/gems/rake-10.5.0/README.rdoc +139 -0
- data/.gs/gems/rake-10.5.0/Rakefile +81 -0
- data/.gs/gems/rake-10.5.0/bin/rake +33 -0
- data/.gs/gems/rake-10.5.0/doc/command_line_usage.rdoc +158 -0
- data/.gs/gems/rake-10.5.0/doc/example/Rakefile1 +38 -0
- data/.gs/gems/rake-10.5.0/doc/example/Rakefile2 +35 -0
- data/.gs/gems/rake-10.5.0/doc/example/a.c +6 -0
- data/.gs/gems/rake-10.5.0/doc/example/b.c +6 -0
- data/.gs/gems/rake-10.5.0/doc/example/main.c +11 -0
- data/.gs/gems/rake-10.5.0/doc/glossary.rdoc +42 -0
- data/.gs/gems/rake-10.5.0/doc/jamis.rb +591 -0
- data/.gs/gems/rake-10.5.0/doc/proto_rake.rdoc +127 -0
- data/.gs/gems/rake-10.5.0/doc/rake.1 +141 -0
- data/.gs/gems/rake-10.5.0/doc/rakefile.rdoc +624 -0
- data/.gs/gems/rake-10.5.0/doc/rational.rdoc +151 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.6.rdoc +37 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.0.rdoc +112 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.rdoc +49 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.3.rdoc +102 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.4.rdoc +60 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.5.rdoc +55 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.6.rdoc +64 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.0.rdoc +178 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.1.rdoc +58 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.2.rdoc +53 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.3.rdoc +191 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.1.0.rdoc +61 -0
- data/.gs/gems/rake-10.5.0/lib/rake.rb +79 -0
- data/.gs/gems/rake-10.5.0/lib/rake/alt_system.rb +110 -0
- data/.gs/gems/rake-10.5.0/lib/rake/application.rb +790 -0
- data/.gs/gems/rake-10.5.0/lib/rake/backtrace.rb +23 -0
- data/.gs/gems/rake-10.5.0/lib/rake/clean.rb +76 -0
- data/.gs/gems/rake-10.5.0/lib/rake/cloneable.rb +16 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/.document +1 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +21 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +137 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +81 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +18 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +61 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/sys.rb +4 -0
- data/.gs/gems/rake-10.5.0/lib/rake/cpu_counter.rb +125 -0
- data/.gs/gems/rake-10.5.0/lib/rake/default_loader.rb +14 -0
- data/.gs/gems/rake-10.5.0/lib/rake/dsl_definition.rb +201 -0
- data/.gs/gems/rake-10.5.0/lib/rake/early_time.rb +21 -0
- data/.gs/gems/rake-10.5.0/lib/rake/ext/core.rb +25 -0
- data/.gs/gems/rake-10.5.0/lib/rake/ext/module.rb +2 -0
- data/.gs/gems/rake-10.5.0/lib/rake/ext/pathname.rb +25 -0
- data/.gs/gems/rake-10.5.0/lib/rake/ext/string.rb +175 -0
- data/.gs/gems/rake-10.5.0/lib/rake/ext/time.rb +18 -0
- data/.gs/gems/rake-10.5.0/lib/rake/file_creation_task.rb +24 -0
- data/.gs/gems/rake-10.5.0/lib/rake/file_list.rb +428 -0
- data/.gs/gems/rake-10.5.0/lib/rake/file_task.rb +46 -0
- data/.gs/gems/rake-10.5.0/lib/rake/file_utils.rb +128 -0
- data/.gs/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +144 -0
- data/.gs/gems/rake-10.5.0/lib/rake/gempackagetask.rb +4 -0
- data/.gs/gems/rake-10.5.0/lib/rake/invocation_chain.rb +56 -0
- data/.gs/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +16 -0
- data/.gs/gems/rake-10.5.0/lib/rake/late_time.rb +17 -0
- data/.gs/gems/rake-10.5.0/lib/rake/linked_list.rb +103 -0
- data/.gs/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +53 -0
- data/.gs/gems/rake-10.5.0/lib/rake/multi_task.rb +13 -0
- data/.gs/gems/rake-10.5.0/lib/rake/name_space.rb +38 -0
- data/.gs/gems/rake-10.5.0/lib/rake/packagetask.rb +199 -0
- data/.gs/gems/rake-10.5.0/lib/rake/pathmap.rb +3 -0
- data/.gs/gems/rake-10.5.0/lib/rake/phony.rb +15 -0
- data/.gs/gems/rake-10.5.0/lib/rake/private_reader.rb +20 -0
- data/.gs/gems/rake-10.5.0/lib/rake/promise.rb +99 -0
- data/.gs/gems/rake-10.5.0/lib/rake/pseudo_status.rb +29 -0
- data/.gs/gems/rake-10.5.0/lib/rake/rake_module.rb +38 -0
- data/.gs/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +22 -0
- data/.gs/gems/rake-10.5.0/lib/rake/rdoctask.rb +4 -0
- data/.gs/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +29 -0
- data/.gs/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/.gs/gems/rake-10.5.0/lib/rake/runtest.rb +27 -0
- data/.gs/gems/rake-10.5.0/lib/rake/scope.rb +42 -0
- data/.gs/gems/rake-10.5.0/lib/rake/task.rb +383 -0
- data/.gs/gems/rake-10.5.0/lib/rake/task_argument_error.rb +7 -0
- data/.gs/gems/rake-10.5.0/lib/rake/task_arguments.rb +98 -0
- data/.gs/gems/rake-10.5.0/lib/rake/task_manager.rb +307 -0
- data/.gs/gems/rake-10.5.0/lib/rake/tasklib.rb +24 -0
- data/.gs/gems/rake-10.5.0/lib/rake/testtask.rb +213 -0
- data/.gs/gems/rake-10.5.0/lib/rake/thread_history_display.rb +48 -0
- data/.gs/gems/rake-10.5.0/lib/rake/thread_pool.rb +164 -0
- data/.gs/gems/rake-10.5.0/lib/rake/trace_output.rb +22 -0
- data/.gs/gems/rake-10.5.0/lib/rake/version.rb +7 -0
- data/.gs/gems/rake-10.5.0/lib/rake/win32.rb +56 -0
- data/.gs/gems/rake-10.5.0/rakelib/publish.rake +20 -0
- data/.gs/gems/rake-10.5.0/rakelib/test_times.rake +25 -0
- data/.gs/gems/rake-10.5.0/test/file_creation.rb +34 -0
- data/.gs/gems/rake-10.5.0/test/helper.rb +129 -0
- data/.gs/gems/rake-10.5.0/test/support/rakefile_definitions.rb +478 -0
- data/.gs/gems/rake-10.5.0/test/support/ruby_runner.rb +34 -0
- data/.gs/gems/rake-10.5.0/test/test_private_reader.rb +42 -0
- data/.gs/gems/rake-10.5.0/test/test_rake.rb +40 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_application.rb +643 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_application_options.rb +468 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_backtrace.rb +119 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_clean.rb +61 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +68 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_definitions.rb +84 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_directory_task.rb +76 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_dsl.rb +40 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_early_time.rb +31 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_extension.rb +59 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +56 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_file_list.rb +670 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +8 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_file_task.rb +197 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_file_utils.rb +314 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_ftp_file.rb +74 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_functional.rb +482 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +64 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_late_time.rb +18 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_linked_list.rb +84 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +46 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_multi_task.rb +64 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_name_space.rb +57 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_package_task.rb +79 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_path_map.rb +168 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +34 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +18 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +15 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +21 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +20 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +26 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_require.rb +40 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_rules.rb +388 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_scope.rb +44 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task.rb +393 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +119 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task_arguments.rb +127 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task_lib.rb +9 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task_manager.rb +178 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +172 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_test_task.rb +146 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_thread_pool.rb +145 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +71 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_win32.rb +72 -0
- data/.gs/gems/rake-10.5.0/test/test_thread_history_display.rb +101 -0
- data/.gs/gems/rake-10.5.0/test/test_trace_output.rb +52 -0
- data/.gs/specifications/faraday-0.9.2.gemspec +31 -0
- data/.gs/specifications/minitest-5.9.0.gemspec +39 -0
- data/.gs/specifications/multi_json-1.12.1.gemspec +33 -0
- data/.gs/specifications/multipart-post-2.0.0.gemspec +22 -0
- data/.gs/specifications/rake-10.5.0.gemspec +43 -0
- data/.rubocop.yml +36 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +35 -0
- data/Rakefile +38 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/mercadopago/core/client.rb +70 -0
- data/lib/mercadopago/core/endpoints.rb +134 -0
- data/lib/mercadopago/core/errors.rb +6 -0
- data/lib/mercadopago/core/gateway.rb +84 -0
- data/lib/mercadopago/custom_checkout.rb +29 -0
- data/lib/mercadopago/custom_checkout/account.rb +162 -0
- data/lib/mercadopago/custom_checkout/card_issuer.rb +20 -0
- data/lib/mercadopago/custom_checkout/card_token.rb +57 -0
- data/lib/mercadopago/custom_checkout/customer.rb +84 -0
- data/lib/mercadopago/custom_checkout/errors.rb +6 -0
- data/lib/mercadopago/custom_checkout/identification_type.rb +19 -0
- data/lib/mercadopago/custom_checkout/payment_method.rb +42 -0
- data/lib/mercadopago/custom_checkout/payments.rb +24 -0
- data/lib/mercadopago/custom_checkout/resource.rb +14 -0
- data/lib/mercadopago/custom_checkout/version.rb +5 -0
- data/mercadopago-custom-checkout.gemspec +30 -0
- metadata +455 -0
@@ -0,0 +1,125 @@
|
|
1
|
+
module Rake
|
2
|
+
|
3
|
+
# Based on a script at:
|
4
|
+
# http://stackoverflow.com/questions/891537/ruby-detect-number-of-cpus-installed
|
5
|
+
class CpuCounter # :nodoc: all
|
6
|
+
def self.count
|
7
|
+
new.count_with_default
|
8
|
+
end
|
9
|
+
|
10
|
+
def count_with_default(default=4)
|
11
|
+
count || default
|
12
|
+
rescue StandardError
|
13
|
+
default
|
14
|
+
end
|
15
|
+
|
16
|
+
begin
|
17
|
+
require 'etc'
|
18
|
+
rescue LoadError
|
19
|
+
else
|
20
|
+
if Etc.respond_to?(:nprocessors)
|
21
|
+
def count
|
22
|
+
return Etc.nprocessors
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
unless Rake::CpuCounter.method_defined?(:count)
|
30
|
+
Rake::CpuCounter.class_eval <<-'end;', __FILE__, __LINE__+1
|
31
|
+
require 'rbconfig'
|
32
|
+
|
33
|
+
# TODO: replace with IO.popen using array-style arguments in Rake 11
|
34
|
+
require 'open3'
|
35
|
+
|
36
|
+
def count
|
37
|
+
if defined?(Java::Java)
|
38
|
+
count_via_java_runtime
|
39
|
+
else
|
40
|
+
case RbConfig::CONFIG['host_os']
|
41
|
+
when /darwin9/
|
42
|
+
count_via_hwprefs_cpu_count
|
43
|
+
when /darwin/
|
44
|
+
count_via_hwprefs_thread_count || count_via_sysctl
|
45
|
+
when /linux/
|
46
|
+
count_via_cpuinfo
|
47
|
+
when /bsd/
|
48
|
+
count_via_sysctl
|
49
|
+
when /mswin|mingw/
|
50
|
+
count_via_win32
|
51
|
+
else
|
52
|
+
# Try everything
|
53
|
+
count_via_win32 ||
|
54
|
+
count_via_sysctl ||
|
55
|
+
count_via_hwprefs_thread_count ||
|
56
|
+
count_via_hwprefs_cpu_count ||
|
57
|
+
count_via_cpuinfo
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def count_via_java_runtime
|
63
|
+
Java::Java.lang.Runtime.getRuntime.availableProcessors
|
64
|
+
rescue StandardError
|
65
|
+
nil
|
66
|
+
end
|
67
|
+
|
68
|
+
def count_via_win32
|
69
|
+
require 'win32ole'
|
70
|
+
wmi = WIN32OLE.connect("winmgmts://")
|
71
|
+
cpu = wmi.ExecQuery("select NumberOfCores from Win32_Processor") # TODO count hyper-threaded in this
|
72
|
+
cpu.to_enum.first.NumberOfCores
|
73
|
+
rescue StandardError, LoadError
|
74
|
+
nil
|
75
|
+
end
|
76
|
+
|
77
|
+
def count_via_cpuinfo
|
78
|
+
open('/proc/cpuinfo') { |f| f.readlines }.grep(/processor/).size
|
79
|
+
rescue StandardError
|
80
|
+
nil
|
81
|
+
end
|
82
|
+
|
83
|
+
def count_via_hwprefs_thread_count
|
84
|
+
run 'hwprefs', 'thread_count'
|
85
|
+
end
|
86
|
+
|
87
|
+
def count_via_hwprefs_cpu_count
|
88
|
+
run 'hwprefs', 'cpu_count'
|
89
|
+
end
|
90
|
+
|
91
|
+
def count_via_sysctl
|
92
|
+
run 'sysctl', '-n', 'hw.ncpu'
|
93
|
+
end
|
94
|
+
|
95
|
+
def run(command, *args)
|
96
|
+
cmd = resolve_command(command)
|
97
|
+
if cmd
|
98
|
+
Open3.popen3 cmd, *args do |inn, out, err,|
|
99
|
+
inn.close
|
100
|
+
err.read
|
101
|
+
out.read.to_i
|
102
|
+
end
|
103
|
+
else
|
104
|
+
nil
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
def resolve_command(command)
|
109
|
+
look_for_command("/usr/sbin", command) ||
|
110
|
+
look_for_command("/sbin", command) ||
|
111
|
+
in_path_command(command)
|
112
|
+
end
|
113
|
+
|
114
|
+
def look_for_command(dir, command)
|
115
|
+
path = File.join(dir, command)
|
116
|
+
File.exist?(path) ? path : nil
|
117
|
+
end
|
118
|
+
|
119
|
+
def in_path_command(command)
|
120
|
+
Open3.popen3 'which', command do |_, out,|
|
121
|
+
out.eof? ? nil : command
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end;
|
125
|
+
end
|
@@ -0,0 +1,201 @@
|
|
1
|
+
# Rake DSL functions.
|
2
|
+
require 'rake/file_utils_ext'
|
3
|
+
|
4
|
+
module Rake
|
5
|
+
|
6
|
+
##
|
7
|
+
# DSL is a module that provides #task, #desc, #namespace, etc. Use this
|
8
|
+
# when you'd like to use rake outside the top level scope.
|
9
|
+
#
|
10
|
+
# For a Rakefile you run from the command line this module is automatically
|
11
|
+
# included.
|
12
|
+
|
13
|
+
module DSL
|
14
|
+
|
15
|
+
#--
|
16
|
+
# Include the FileUtils file manipulation functions in the top
|
17
|
+
# level module, but mark them private so that they don't
|
18
|
+
# unintentionally define methods on other objects.
|
19
|
+
#++
|
20
|
+
|
21
|
+
include FileUtilsExt
|
22
|
+
private(*FileUtils.instance_methods(false))
|
23
|
+
private(*FileUtilsExt.instance_methods(false))
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
# :call-seq:
|
28
|
+
# task task_name
|
29
|
+
# task task_name: dependencies
|
30
|
+
# task task_name, arguments => dependencies
|
31
|
+
# task task_name, argument[, argument ...], :needs: dependencies
|
32
|
+
#
|
33
|
+
# Declare a basic task. The +task_name+ is always the first argument. If
|
34
|
+
# the task name contains a ":" it is defined in that namespace.
|
35
|
+
#
|
36
|
+
# The +dependencies+ may be a single task name or an Array of task names.
|
37
|
+
# The +argument+ (a single name) or +arguments+ (an Array of names) define
|
38
|
+
# the arguments provided to the task.
|
39
|
+
#
|
40
|
+
# The task, argument and dependency names may be either symbols or
|
41
|
+
# strings.
|
42
|
+
#
|
43
|
+
# A task with a single dependency:
|
44
|
+
#
|
45
|
+
# task clobber: %w[clean] do
|
46
|
+
# rm_rf "html"
|
47
|
+
# end
|
48
|
+
#
|
49
|
+
# A task with an argument and a dependency:
|
50
|
+
#
|
51
|
+
# task :package, [:version] => :test do |t, args|
|
52
|
+
# # ...
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# To invoke this task from the command line:
|
56
|
+
#
|
57
|
+
# $ rake package[1.2.3]
|
58
|
+
#
|
59
|
+
# Alternate definition:
|
60
|
+
#
|
61
|
+
# task :package, :version, needs: :test do |t, args|
|
62
|
+
# # ...
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
def task(*args, &block) # :doc:
|
66
|
+
Rake::Task.define_task(*args, &block)
|
67
|
+
end
|
68
|
+
|
69
|
+
# Declare a file task.
|
70
|
+
#
|
71
|
+
# Example:
|
72
|
+
# file "config.cfg" => ["config.template"] do
|
73
|
+
# open("config.cfg", "w") do |outfile|
|
74
|
+
# open("config.template") do |infile|
|
75
|
+
# while line = infile.gets
|
76
|
+
# outfile.puts line
|
77
|
+
# end
|
78
|
+
# end
|
79
|
+
# end
|
80
|
+
# end
|
81
|
+
#
|
82
|
+
def file(*args, &block) # :doc:
|
83
|
+
Rake::FileTask.define_task(*args, &block)
|
84
|
+
end
|
85
|
+
|
86
|
+
# Declare a file creation task.
|
87
|
+
# (Mainly used for the directory command).
|
88
|
+
def file_create(*args, &block)
|
89
|
+
Rake::FileCreationTask.define_task(*args, &block)
|
90
|
+
end
|
91
|
+
|
92
|
+
# Declare a set of files tasks to create the given directories on
|
93
|
+
# demand.
|
94
|
+
#
|
95
|
+
# Example:
|
96
|
+
# directory "testdata/doc"
|
97
|
+
#
|
98
|
+
def directory(*args, &block) # :doc:
|
99
|
+
result = file_create(*args, &block)
|
100
|
+
dir, _ = *Rake.application.resolve_args(args)
|
101
|
+
dir = Rake.from_pathname(dir)
|
102
|
+
Rake.each_dir_parent(dir) do |d|
|
103
|
+
file_create d do |t|
|
104
|
+
mkdir_p t.name unless File.exist?(t.name)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
result
|
108
|
+
end
|
109
|
+
|
110
|
+
# Declare a task that performs its prerequisites in
|
111
|
+
# parallel. Multitasks does *not* guarantee that its prerequisites
|
112
|
+
# will execute in any given order (which is obvious when you think
|
113
|
+
# about it)
|
114
|
+
#
|
115
|
+
# Example:
|
116
|
+
# multitask deploy: %w[deploy_gem deploy_rdoc]
|
117
|
+
#
|
118
|
+
def multitask(*args, &block) # :doc:
|
119
|
+
Rake::MultiTask.define_task(*args, &block)
|
120
|
+
end
|
121
|
+
|
122
|
+
# Create a new rake namespace and use it for evaluating the given
|
123
|
+
# block. Returns a NameSpace object that can be used to lookup
|
124
|
+
# tasks defined in the namespace.
|
125
|
+
#
|
126
|
+
# Example:
|
127
|
+
#
|
128
|
+
# ns = namespace "nested" do
|
129
|
+
# # the "nested:run" task
|
130
|
+
# task :run
|
131
|
+
# end
|
132
|
+
# task_run = ns[:run] # find :run in the given namespace.
|
133
|
+
#
|
134
|
+
# Tasks can also be defined in a namespace by using a ":" in the task
|
135
|
+
# name:
|
136
|
+
#
|
137
|
+
# task "nested:test" do
|
138
|
+
# # ...
|
139
|
+
# end
|
140
|
+
#
|
141
|
+
def namespace(name=nil, &block) # :doc:
|
142
|
+
name = name.to_s if name.kind_of?(Symbol)
|
143
|
+
name = name.to_str if name.respond_to?(:to_str)
|
144
|
+
unless name.kind_of?(String) || name.nil?
|
145
|
+
raise ArgumentError, "Expected a String or Symbol for a namespace name"
|
146
|
+
end
|
147
|
+
Rake.application.in_namespace(name, &block)
|
148
|
+
end
|
149
|
+
|
150
|
+
# Declare a rule for auto-tasks.
|
151
|
+
#
|
152
|
+
# Example:
|
153
|
+
# rule '.o' => '.c' do |t|
|
154
|
+
# sh 'cc', '-o', t.name, t.source
|
155
|
+
# end
|
156
|
+
#
|
157
|
+
def rule(*args, &block) # :doc:
|
158
|
+
Rake::Task.create_rule(*args, &block)
|
159
|
+
end
|
160
|
+
|
161
|
+
# Describes the next rake task. Duplicate descriptions are discarded.
|
162
|
+
# Descriptions are shown with <code>rake -T</code> (up to the first
|
163
|
+
# sentence) and <code>rake -D</code> (the entire description).
|
164
|
+
#
|
165
|
+
# Example:
|
166
|
+
# desc "Run the Unit Tests"
|
167
|
+
# task test: [:build]
|
168
|
+
# # ... run tests
|
169
|
+
# end
|
170
|
+
#
|
171
|
+
def desc(description) # :doc:
|
172
|
+
Rake.application.last_description = description
|
173
|
+
end
|
174
|
+
|
175
|
+
# Import the partial Rakefiles +fn+. Imported files are loaded
|
176
|
+
# _after_ the current file is completely loaded. This allows the
|
177
|
+
# import statement to appear anywhere in the importing file, and yet
|
178
|
+
# allowing the imported files to depend on objects defined in the
|
179
|
+
# importing file.
|
180
|
+
#
|
181
|
+
# A common use of the import statement is to include files
|
182
|
+
# containing dependency declarations.
|
183
|
+
#
|
184
|
+
# See also the --rakelibdir command line option.
|
185
|
+
#
|
186
|
+
# Example:
|
187
|
+
# import ".depend", "my_rules"
|
188
|
+
#
|
189
|
+
def import(*fns) # :doc:
|
190
|
+
fns.each do |fn|
|
191
|
+
Rake.application.add_import(fn)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
195
|
+
extend FileUtilsExt
|
196
|
+
end
|
197
|
+
|
198
|
+
# Extend the main object with the DSL commands. This allows top-level
|
199
|
+
# calls to task, etc. to work from a Rakefile without polluting the
|
200
|
+
# object inheritance tree.
|
201
|
+
self.extend Rake::DSL
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Rake
|
2
|
+
|
3
|
+
# EarlyTime is a fake timestamp that occurs _before_ any other time value.
|
4
|
+
class EarlyTime
|
5
|
+
include Comparable
|
6
|
+
include Singleton
|
7
|
+
|
8
|
+
##
|
9
|
+
# The EarlyTime always comes before +other+!
|
10
|
+
|
11
|
+
def <=>(other)
|
12
|
+
-1
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_s # :nodoc:
|
16
|
+
"<EARLY TIME>"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
EARLY = EarlyTime.instance
|
21
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class Module
|
2
|
+
# Check for an existing method in the current class before extending. If
|
3
|
+
# the method already exists, then a warning is printed and the extension is
|
4
|
+
# not added. Otherwise the block is yielded and any definitions in the
|
5
|
+
# block will take effect.
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
#
|
9
|
+
# class String
|
10
|
+
# rake_extension("xyz") do
|
11
|
+
# def xyz
|
12
|
+
# ...
|
13
|
+
# end
|
14
|
+
# end
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
def rake_extension(method) # :nodoc:
|
18
|
+
if method_defined?(method)
|
19
|
+
$stderr.puts "WARNING: Possible conflict with Rake extension: " +
|
20
|
+
"#{self}##{method} already exists"
|
21
|
+
else
|
22
|
+
yield
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'rake/ext/core'
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
class Pathname
|
5
|
+
|
6
|
+
rake_extension("ext") do
|
7
|
+
# Return a new Pathname with <tt>String#ext</tt> applied to it.
|
8
|
+
#
|
9
|
+
# This Pathname extension comes from Rake
|
10
|
+
def ext(newext='')
|
11
|
+
Pathname.new(Rake.from_pathname(self).ext(newext))
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
rake_extension("pathmap") do
|
16
|
+
# Apply the pathmap spec to the Pathname, returning a
|
17
|
+
# new Pathname with the modified paths. (See String#pathmap for
|
18
|
+
# details.)
|
19
|
+
#
|
20
|
+
# This Pathname extension comes from Rake
|
21
|
+
def pathmap(spec=nil, &block)
|
22
|
+
Pathname.new(Rake.from_pathname(self).pathmap(spec, &block))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,175 @@
|
|
1
|
+
require 'rake/ext/core'
|
2
|
+
|
3
|
+
class String
|
4
|
+
|
5
|
+
rake_extension("ext") do
|
6
|
+
# Replace the file extension with +newext+. If there is no extension on
|
7
|
+
# the string, append the new extension to the end. If the new extension
|
8
|
+
# is not given, or is the empty string, remove any existing extension.
|
9
|
+
#
|
10
|
+
# +ext+ is a user added method for the String class.
|
11
|
+
#
|
12
|
+
# This String extension comes from Rake
|
13
|
+
def ext(newext='')
|
14
|
+
return self.dup if ['.', '..'].include? self
|
15
|
+
if newext != ''
|
16
|
+
newext = "." + newext unless newext =~ /^\./
|
17
|
+
end
|
18
|
+
self.chomp(File.extname(self)) << newext
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
rake_extension("pathmap") do
|
23
|
+
# Explode a path into individual components. Used by +pathmap+.
|
24
|
+
#
|
25
|
+
# This String extension comes from Rake
|
26
|
+
def pathmap_explode
|
27
|
+
head, tail = File.split(self)
|
28
|
+
return [self] if head == self
|
29
|
+
return [tail] if head == '.' || tail == '/'
|
30
|
+
return [head, tail] if head == '/'
|
31
|
+
return head.pathmap_explode + [tail]
|
32
|
+
end
|
33
|
+
protected :pathmap_explode
|
34
|
+
|
35
|
+
# Extract a partial path from the path. Include +n+ directories from the
|
36
|
+
# front end (left hand side) if +n+ is positive. Include |+n+|
|
37
|
+
# directories from the back end (right hand side) if +n+ is negative.
|
38
|
+
#
|
39
|
+
# This String extension comes from Rake
|
40
|
+
def pathmap_partial(n)
|
41
|
+
dirs = File.dirname(self).pathmap_explode
|
42
|
+
partial_dirs =
|
43
|
+
if n > 0
|
44
|
+
dirs[0...n]
|
45
|
+
elsif n < 0
|
46
|
+
dirs.reverse[0...-n].reverse
|
47
|
+
else
|
48
|
+
"."
|
49
|
+
end
|
50
|
+
File.join(partial_dirs)
|
51
|
+
end
|
52
|
+
protected :pathmap_partial
|
53
|
+
|
54
|
+
# Perform the pathmap replacement operations on the given path. The
|
55
|
+
# patterns take the form 'pat1,rep1;pat2,rep2...'.
|
56
|
+
#
|
57
|
+
# This String extension comes from Rake
|
58
|
+
def pathmap_replace(patterns, &block)
|
59
|
+
result = self
|
60
|
+
patterns.split(';').each do |pair|
|
61
|
+
pattern, replacement = pair.split(',')
|
62
|
+
pattern = Regexp.new(pattern)
|
63
|
+
if replacement == '*' && block_given?
|
64
|
+
result = result.sub(pattern, &block)
|
65
|
+
elsif replacement
|
66
|
+
result = result.sub(pattern, replacement)
|
67
|
+
else
|
68
|
+
result = result.sub(pattern, '')
|
69
|
+
end
|
70
|
+
end
|
71
|
+
result
|
72
|
+
end
|
73
|
+
protected :pathmap_replace
|
74
|
+
|
75
|
+
# Map the path according to the given specification. The specification
|
76
|
+
# controls the details of the mapping. The following special patterns are
|
77
|
+
# recognized:
|
78
|
+
#
|
79
|
+
# <tt>%p</tt> :: The complete path.
|
80
|
+
# <tt>%f</tt> :: The base file name of the path, with its file extension,
|
81
|
+
# but without any directories.
|
82
|
+
# <tt>%n</tt> :: The file name of the path without its file extension.
|
83
|
+
# <tt>%d</tt> :: The directory list of the path.
|
84
|
+
# <tt>%x</tt> :: The file extension of the path. An empty string if there
|
85
|
+
# is no extension.
|
86
|
+
# <tt>%X</tt> :: Everything *but* the file extension.
|
87
|
+
# <tt>%s</tt> :: The alternate file separator if defined, otherwise use #
|
88
|
+
# the standard file separator.
|
89
|
+
# <tt>%%</tt> :: A percent sign.
|
90
|
+
#
|
91
|
+
# The <tt>%d</tt> specifier can also have a numeric prefix (e.g. '%2d').
|
92
|
+
# If the number is positive, only return (up to) +n+ directories in the
|
93
|
+
# path, starting from the left hand side. If +n+ is negative, return (up
|
94
|
+
# to) +n+ directories from the right hand side of the path.
|
95
|
+
#
|
96
|
+
# Examples:
|
97
|
+
#
|
98
|
+
# 'a/b/c/d/file.txt'.pathmap("%2d") => 'a/b'
|
99
|
+
# 'a/b/c/d/file.txt'.pathmap("%-2d") => 'c/d'
|
100
|
+
#
|
101
|
+
# Also the <tt>%d</tt>, <tt>%p</tt>, <tt>%f</tt>, <tt>%n</tt>,
|
102
|
+
# <tt>%x</tt>, and <tt>%X</tt> operators can take a pattern/replacement
|
103
|
+
# argument to perform simple string substitutions on a particular part of
|
104
|
+
# the path. The pattern and replacement are separated by a comma and are
|
105
|
+
# enclosed by curly braces. The replacement spec comes after the %
|
106
|
+
# character but before the operator letter. (e.g. "%{old,new}d").
|
107
|
+
# Multiple replacement specs should be separated by semi-colons (e.g.
|
108
|
+
# "%{old,new;src,bin}d").
|
109
|
+
#
|
110
|
+
# Regular expressions may be used for the pattern, and back refs may be
|
111
|
+
# used in the replacement text. Curly braces, commas and semi-colons are
|
112
|
+
# excluded from both the pattern and replacement text (let's keep parsing
|
113
|
+
# reasonable).
|
114
|
+
#
|
115
|
+
# For example:
|
116
|
+
#
|
117
|
+
# "src/org/onestepback/proj/A.java".pathmap("%{^src,class}X.class")
|
118
|
+
#
|
119
|
+
# returns:
|
120
|
+
#
|
121
|
+
# "class/org/onestepback/proj/A.class"
|
122
|
+
#
|
123
|
+
# If the replacement text is '*', then a block may be provided to perform
|
124
|
+
# some arbitrary calculation for the replacement.
|
125
|
+
#
|
126
|
+
# For example:
|
127
|
+
#
|
128
|
+
# "/path/to/file.TXT".pathmap("%X%{.*,*}x") { |ext|
|
129
|
+
# ext.downcase
|
130
|
+
# }
|
131
|
+
#
|
132
|
+
# Returns:
|
133
|
+
#
|
134
|
+
# "/path/to/file.txt"
|
135
|
+
#
|
136
|
+
# This String extension comes from Rake
|
137
|
+
def pathmap(spec=nil, &block)
|
138
|
+
return self if spec.nil?
|
139
|
+
result = ''
|
140
|
+
spec.scan(/%\{[^}]*\}-?\d*[sdpfnxX%]|%-?\d+d|%.|[^%]+/) do |frag|
|
141
|
+
case frag
|
142
|
+
when '%f'
|
143
|
+
result << File.basename(self)
|
144
|
+
when '%n'
|
145
|
+
result << File.basename(self).ext
|
146
|
+
when '%d'
|
147
|
+
result << File.dirname(self)
|
148
|
+
when '%x'
|
149
|
+
result << File.extname(self)
|
150
|
+
when '%X'
|
151
|
+
result << self.ext
|
152
|
+
when '%p'
|
153
|
+
result << self
|
154
|
+
when '%s'
|
155
|
+
result << (File::ALT_SEPARATOR || File::SEPARATOR)
|
156
|
+
when '%-'
|
157
|
+
# do nothing
|
158
|
+
when '%%'
|
159
|
+
result << "%"
|
160
|
+
when /%(-?\d+)d/
|
161
|
+
result << pathmap_partial($1.to_i)
|
162
|
+
when /^%\{([^}]*)\}(\d*[dpfnxX])/
|
163
|
+
patterns, operator = $1, $2
|
164
|
+
result << pathmap('%' + operator).pathmap_replace(patterns, &block)
|
165
|
+
when /^%/
|
166
|
+
fail ArgumentError, "Unknown pathmap specifier #{frag} in '#{spec}'"
|
167
|
+
else
|
168
|
+
result << frag
|
169
|
+
end
|
170
|
+
end
|
171
|
+
result
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
end
|