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
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8e6e4fbf03195f74dd0352230ec6e6d360271497
|
4
|
+
data.tar.gz: 14ce60dc7686046778ec1729c465de1a8942e079
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2aee1ff134e4f6f6e67f3f89943991c36e2bcc993bfa3a723ff896809bc48dcc0bf29f2f16bc0e17a781856d9762a0a26f938066b06ab33c6caa2d250e8d75cb
|
7
|
+
data.tar.gz: 646f99beddecde661db4f056bd974ace41670d4b4a31b15131d309fd68b2e90c1dbe90ba053be74834c3efad06165601eb23cdd9aa2a2a21ac9ab71e9fa098ea
|
data/.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
/.bundle
|
2
|
+
/.yardoc
|
3
|
+
/Gemfile.lock
|
4
|
+
/_yardoc/
|
5
|
+
/coverage/
|
6
|
+
/doc/
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/tmp/
|
10
|
+
|
11
|
+
|
12
|
+
# OS generated files #
|
13
|
+
######################
|
14
|
+
.DS_Store
|
15
|
+
.DS_Store?
|
16
|
+
._*
|
17
|
+
.Spotlight-V100
|
18
|
+
.Trashes
|
19
|
+
ehthumbs.db
|
20
|
+
Thumbs.db
|
21
|
+
dump.rdb
|
22
|
+
|
23
|
+
*.local.*
|
data/.gs/bin/rake
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by RubyGems.
|
4
|
+
#
|
5
|
+
# The application 'rake' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'rubygems'
|
10
|
+
|
11
|
+
version = ">= 0"
|
12
|
+
|
13
|
+
if ARGV.first
|
14
|
+
str = ARGV.first
|
15
|
+
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
|
16
|
+
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
|
17
|
+
version = $1
|
18
|
+
ARGV.shift
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
gem 'rake', version
|
23
|
+
load Gem.bin_path('rake', 'rake', version)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009-2015 Rick Olson, Zack Hobson
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,245 @@
|
|
1
|
+
# Faraday
|
2
|
+
|
3
|
+
Faraday is an HTTP client lib that provides a common interface over many
|
4
|
+
adapters (such as Net::HTTP) and embraces the concept of Rack middleware when
|
5
|
+
processing the request/response cycle.
|
6
|
+
|
7
|
+
Faraday supports these adapters:
|
8
|
+
|
9
|
+
* [Net::HTTP][net_http] _(default)_
|
10
|
+
* [Net::HTTP::Persistent][persistent]
|
11
|
+
* [Excon][]
|
12
|
+
* [Typhoeus][]
|
13
|
+
* [Patron][]
|
14
|
+
* [EventMachine][]
|
15
|
+
* [HTTPClient][]
|
16
|
+
|
17
|
+
It also includes a Rack adapter for hitting loaded Rack applications through
|
18
|
+
Rack::Test, and a Test adapter for stubbing requests by hand.
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
conn = Faraday.new(:url => 'http://sushi.com') do |faraday|
|
24
|
+
faraday.request :url_encoded # form-encode POST params
|
25
|
+
faraday.response :logger # log requests to STDOUT
|
26
|
+
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
|
27
|
+
end
|
28
|
+
|
29
|
+
## GET ##
|
30
|
+
|
31
|
+
response = conn.get '/nigiri/sake.json' # GET http://sushi.com/nigiri/sake.json
|
32
|
+
response.body
|
33
|
+
|
34
|
+
conn.get '/nigiri', { :name => 'Maguro' } # GET http://sushi.com/nigiri?name=Maguro
|
35
|
+
|
36
|
+
conn.get do |req| # GET http://sushi.com/search?page=2&limit=100
|
37
|
+
req.url '/search', :page => 2
|
38
|
+
req.params['limit'] = 100
|
39
|
+
end
|
40
|
+
|
41
|
+
## POST ##
|
42
|
+
|
43
|
+
conn.post '/nigiri', { :name => 'Maguro' } # POST "name=maguro" to http://sushi.com/nigiri
|
44
|
+
|
45
|
+
# post payload as JSON instead of "www-form-urlencoded" encoding:
|
46
|
+
conn.post do |req|
|
47
|
+
req.url '/nigiri'
|
48
|
+
req.headers['Content-Type'] = 'application/json'
|
49
|
+
req.body = '{ "name": "Unagi" }'
|
50
|
+
end
|
51
|
+
|
52
|
+
## Per-request options ##
|
53
|
+
|
54
|
+
conn.get do |req|
|
55
|
+
req.url '/search'
|
56
|
+
req.options.timeout = 5 # open/read timeout in seconds
|
57
|
+
req.options.open_timeout = 2 # connection open timeout in seconds
|
58
|
+
end
|
59
|
+
```
|
60
|
+
|
61
|
+
If you don't need to set up anything, you can roll with just the default middleware
|
62
|
+
stack and default adapter (see [Faraday::RackBuilder#initialize](https://github.com/lostisland/faraday/blob/master/lib/faraday/rack_builder.rb)):
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
response = Faraday.get 'http://sushi.com/nigiri/sake.json'
|
66
|
+
```
|
67
|
+
|
68
|
+
### Changing how parameters are serialized
|
69
|
+
|
70
|
+
Sometimes you need to send the same URL parameter multiple times with different
|
71
|
+
values. This requires manually setting the parameter encoder and can be done on
|
72
|
+
either per-connection or per-request basis.
|
73
|
+
|
74
|
+
```ruby
|
75
|
+
# per-connection setting
|
76
|
+
conn = Faraday.new :params_encoder => Faraday::FlatParamsEncoder
|
77
|
+
|
78
|
+
conn.get do |req|
|
79
|
+
# per-request setting:
|
80
|
+
# req.options.params_encoder = my_encoder
|
81
|
+
req.params['roll'] = ['california', 'philadelphia']
|
82
|
+
end
|
83
|
+
# GET 'http://sushi.com?roll=california&roll=philadelphia'
|
84
|
+
```
|
85
|
+
|
86
|
+
The value of Faraday `params_encoder` can be any object that responds to:
|
87
|
+
|
88
|
+
* `encode(hash) #=> String`
|
89
|
+
* `decode(string) #=> Hash`
|
90
|
+
|
91
|
+
The encoder will affect both how query strings are processed and how POST bodies
|
92
|
+
get serialized. The default encoder is Faraday::NestedParamsEncoder.
|
93
|
+
|
94
|
+
## Advanced middleware usage
|
95
|
+
|
96
|
+
The order in which middleware is stacked is important. Like with Rack, the
|
97
|
+
first middleware on the list wraps all others, while the last middleware is the
|
98
|
+
innermost one, so that must be the adapter.
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
Faraday.new(...) do |conn|
|
102
|
+
# POST/PUT params encoders:
|
103
|
+
conn.request :multipart
|
104
|
+
conn.request :url_encoded
|
105
|
+
|
106
|
+
conn.adapter :net_http
|
107
|
+
end
|
108
|
+
```
|
109
|
+
|
110
|
+
This request middleware setup affects POST/PUT requests in the following way:
|
111
|
+
|
112
|
+
1. `Request::Multipart` checks for files in the payload, otherwise leaves
|
113
|
+
everything untouched;
|
114
|
+
2. `Request::UrlEncoded` encodes as "application/x-www-form-urlencoded" if not
|
115
|
+
already encoded or of another type
|
116
|
+
|
117
|
+
Swapping middleware means giving the other priority. Specifying the
|
118
|
+
"Content-Type" for the request is explicitly stating which middleware should
|
119
|
+
process it.
|
120
|
+
|
121
|
+
Examples:
|
122
|
+
|
123
|
+
```ruby
|
124
|
+
# uploading a file:
|
125
|
+
payload[:profile_pic] = Faraday::UploadIO.new('/path/to/avatar.jpg', 'image/jpeg')
|
126
|
+
|
127
|
+
# "Multipart" middleware detects files and encodes with "multipart/form-data":
|
128
|
+
conn.put '/profile', payload
|
129
|
+
```
|
130
|
+
|
131
|
+
## Writing middleware
|
132
|
+
|
133
|
+
Middleware are classes that implement a `call` instance method. They hook into
|
134
|
+
the request/response cycle.
|
135
|
+
|
136
|
+
```ruby
|
137
|
+
def call(request_env)
|
138
|
+
# do something with the request
|
139
|
+
# request_env[:request_headers].merge!(...)
|
140
|
+
|
141
|
+
@app.call(request_env).on_complete do |response_env|
|
142
|
+
# do something with the response
|
143
|
+
# response_env[:response_headers].merge!(...)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
```
|
147
|
+
|
148
|
+
It's important to do all processing of the response only in the `on_complete`
|
149
|
+
block. This enables middleware to work in parallel mode where requests are
|
150
|
+
asynchronous.
|
151
|
+
|
152
|
+
The `env` is a hash with symbol keys that contains info about the request and,
|
153
|
+
later, response. Some keys are:
|
154
|
+
|
155
|
+
```
|
156
|
+
# request phase
|
157
|
+
:method - :get, :post, ...
|
158
|
+
:url - URI for the current request; also contains GET parameters
|
159
|
+
:body - POST parameters for :post/:put requests
|
160
|
+
:request_headers
|
161
|
+
|
162
|
+
# response phase
|
163
|
+
:status - HTTP response status code, such as 200
|
164
|
+
:body - the response body
|
165
|
+
:response_headers
|
166
|
+
```
|
167
|
+
|
168
|
+
## Using Faraday for testing
|
169
|
+
|
170
|
+
```ruby
|
171
|
+
# It's possible to define stubbed request outside a test adapter block.
|
172
|
+
stubs = Faraday::Adapter::Test::Stubs.new do |stub|
|
173
|
+
stub.get('/tamago') { |env| [200, {}, 'egg'] }
|
174
|
+
end
|
175
|
+
|
176
|
+
# You can pass stubbed request to the test adapter or define them in a block
|
177
|
+
# or a combination of the two.
|
178
|
+
test = Faraday.new do |builder|
|
179
|
+
builder.adapter :test, stubs do |stub|
|
180
|
+
stub.get('/ebi') { |env| [ 200, {}, 'shrimp' ]}
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
# It's also possible to stub additional requests after the connection has
|
185
|
+
# been initialized. This is useful for testing.
|
186
|
+
stubs.get('/uni') { |env| [ 200, {}, 'urchin' ]}
|
187
|
+
|
188
|
+
resp = test.get '/tamago'
|
189
|
+
resp.body # => 'egg'
|
190
|
+
resp = test.get '/ebi'
|
191
|
+
resp.body # => 'shrimp'
|
192
|
+
resp = test.get '/uni'
|
193
|
+
resp.body # => 'urchin'
|
194
|
+
resp = test.get '/else' #=> raises "no such stub" error
|
195
|
+
|
196
|
+
# If you like, you can treat your stubs as mocks by verifying that all of
|
197
|
+
# the stubbed calls were made. NOTE that this feature is still fairly
|
198
|
+
# experimental: It will not verify the order or count of any stub, only that
|
199
|
+
# it was called once during the course of the test.
|
200
|
+
stubs.verify_stubbed_calls
|
201
|
+
```
|
202
|
+
|
203
|
+
## TODO
|
204
|
+
|
205
|
+
* support streaming requests/responses
|
206
|
+
* better stubbing API
|
207
|
+
|
208
|
+
## Supported Ruby versions
|
209
|
+
|
210
|
+
This library aims to support and is [tested against][travis] the following Ruby
|
211
|
+
implementations:
|
212
|
+
|
213
|
+
* Ruby 1.8.7+
|
214
|
+
* [JRuby][] 1.7+
|
215
|
+
* [Rubinius][] 2+
|
216
|
+
|
217
|
+
If something doesn't work on one of these Ruby versions, it's a bug.
|
218
|
+
|
219
|
+
This library may inadvertently work (or seem to work) on other Ruby
|
220
|
+
implementations, however support will only be provided for the versions listed
|
221
|
+
above.
|
222
|
+
|
223
|
+
If you would like this library to support another Ruby version, you may
|
224
|
+
volunteer to be a maintainer. Being a maintainer entails making sure all tests
|
225
|
+
run and pass on that implementation. When something breaks on your
|
226
|
+
implementation, you will be responsible for providing patches in a timely
|
227
|
+
fashion. If critical issues for a particular implementation exist at the time
|
228
|
+
of a major release, support for that Ruby version may be dropped.
|
229
|
+
|
230
|
+
## Copyright
|
231
|
+
|
232
|
+
Copyright (c) 2009-2013 [Rick Olson](mailto:technoweenie@gmail.com), Zack Hobson.
|
233
|
+
See [LICENSE][] for details.
|
234
|
+
|
235
|
+
[net_http]: http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/Net/HTTP.html
|
236
|
+
[persistent]: https://github.com/drbrain/net-http-persistent
|
237
|
+
[travis]: http://travis-ci.org/lostisland/faraday
|
238
|
+
[excon]: https://github.com/geemus/excon#readme
|
239
|
+
[typhoeus]: https://github.com/typhoeus/typhoeus#readme
|
240
|
+
[patron]: http://toland.github.com/patron/
|
241
|
+
[eventmachine]: https://github.com/igrigorik/em-http-request#readme
|
242
|
+
[httpclient]: https://github.com/nahi/httpclient
|
243
|
+
[jruby]: http://jruby.org/
|
244
|
+
[rubinius]: http://rubini.us/
|
245
|
+
[license]: LICENSE.md
|
@@ -0,0 +1,268 @@
|
|
1
|
+
require 'thread'
|
2
|
+
require 'cgi'
|
3
|
+
require 'set'
|
4
|
+
require 'forwardable'
|
5
|
+
|
6
|
+
# Public: This is the main namespace for Faraday. You can either use it to
|
7
|
+
# create Faraday::Connection objects, or access it directly.
|
8
|
+
#
|
9
|
+
# Examples
|
10
|
+
#
|
11
|
+
# Faraday.get "http://faraday.com"
|
12
|
+
#
|
13
|
+
# conn = Faraday.new "http://faraday.com"
|
14
|
+
# conn.get '/'
|
15
|
+
#
|
16
|
+
module Faraday
|
17
|
+
VERSION = "0.9.2"
|
18
|
+
|
19
|
+
class << self
|
20
|
+
# Public: Gets or sets the root path that Faraday is being loaded from.
|
21
|
+
# This is the root from where the libraries are auto-loaded from.
|
22
|
+
attr_accessor :root_path
|
23
|
+
|
24
|
+
# Public: Gets or sets the path that the Faraday libs are loaded from.
|
25
|
+
attr_accessor :lib_path
|
26
|
+
|
27
|
+
# Public: Gets or sets the Symbol key identifying a default Adapter to use
|
28
|
+
# for the default Faraday::Connection.
|
29
|
+
attr_reader :default_adapter
|
30
|
+
|
31
|
+
# Public: Sets the default Faraday::Connection for simple scripts that
|
32
|
+
# access the Faraday constant directly.
|
33
|
+
#
|
34
|
+
# Faraday.get "https://faraday.com"
|
35
|
+
attr_writer :default_connection
|
36
|
+
|
37
|
+
# Public: Sets the default options used when calling Faraday#new.
|
38
|
+
attr_writer :default_connection_options
|
39
|
+
|
40
|
+
# Public: Initializes a new Faraday::Connection.
|
41
|
+
#
|
42
|
+
# url - The optional String base URL to use as a prefix for all
|
43
|
+
# requests. Can also be the options Hash.
|
44
|
+
# options - The optional Hash used to configure this Faraday::Connection.
|
45
|
+
# Any of these values will be set on every request made, unless
|
46
|
+
# overridden for a specific request.
|
47
|
+
# :url - String base URL.
|
48
|
+
# :params - Hash of URI query unencoded key/value pairs.
|
49
|
+
# :headers - Hash of unencoded HTTP header key/value pairs.
|
50
|
+
# :request - Hash of request options.
|
51
|
+
# :ssl - Hash of SSL options.
|
52
|
+
# :proxy - Hash of Proxy options.
|
53
|
+
#
|
54
|
+
# Examples
|
55
|
+
#
|
56
|
+
# Faraday.new 'http://faraday.com'
|
57
|
+
#
|
58
|
+
# # http://faraday.com?page=1
|
59
|
+
# Faraday.new 'http://faraday.com', :params => {:page => 1}
|
60
|
+
#
|
61
|
+
# # same
|
62
|
+
#
|
63
|
+
# Faraday.new :url => 'http://faraday.com',
|
64
|
+
# :params => {:page => 1}
|
65
|
+
#
|
66
|
+
# Returns a Faraday::Connection.
|
67
|
+
def new(url = nil, options = nil)
|
68
|
+
block = block_given? ? Proc.new : nil
|
69
|
+
options = options ? default_connection_options.merge(options) : default_connection_options.dup
|
70
|
+
Faraday::Connection.new(url, options, &block)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Internal: Requires internal Faraday libraries.
|
74
|
+
#
|
75
|
+
# *libs - One or more relative String names to Faraday classes.
|
76
|
+
#
|
77
|
+
# Returns nothing.
|
78
|
+
def require_libs(*libs)
|
79
|
+
libs.each do |lib|
|
80
|
+
require "#{lib_path}/#{lib}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Public: Updates default adapter while resetting
|
85
|
+
# #default_connection.
|
86
|
+
#
|
87
|
+
# Returns the new default_adapter.
|
88
|
+
def default_adapter=(adapter)
|
89
|
+
@default_connection = nil
|
90
|
+
@default_adapter = adapter
|
91
|
+
end
|
92
|
+
|
93
|
+
alias require_lib require_libs
|
94
|
+
|
95
|
+
private
|
96
|
+
# Internal: Proxies method calls on the Faraday constant to
|
97
|
+
# #default_connection.
|
98
|
+
def method_missing(name, *args, &block)
|
99
|
+
default_connection.send(name, *args, &block)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
self.root_path = File.expand_path "..", __FILE__
|
104
|
+
self.lib_path = File.expand_path "../faraday", __FILE__
|
105
|
+
self.default_adapter = :net_http
|
106
|
+
|
107
|
+
# Gets the default connection used for simple scripts.
|
108
|
+
#
|
109
|
+
# Returns a Faraday::Connection, configured with the #default_adapter.
|
110
|
+
def self.default_connection
|
111
|
+
@default_connection ||= Connection.new
|
112
|
+
end
|
113
|
+
|
114
|
+
# Gets the default connection options used when calling Faraday#new.
|
115
|
+
#
|
116
|
+
# Returns a Faraday::ConnectionOptions.
|
117
|
+
def self.default_connection_options
|
118
|
+
@default_connection_options ||= ConnectionOptions.new
|
119
|
+
end
|
120
|
+
|
121
|
+
if (!defined?(RUBY_ENGINE) || "ruby" == RUBY_ENGINE) && RUBY_VERSION < '1.9'
|
122
|
+
begin
|
123
|
+
require 'system_timer'
|
124
|
+
Timer = SystemTimer
|
125
|
+
rescue LoadError
|
126
|
+
warn "Faraday: you may want to install system_timer for reliable timeouts"
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
unless const_defined? :Timer
|
131
|
+
require 'timeout'
|
132
|
+
Timer = Timeout
|
133
|
+
end
|
134
|
+
|
135
|
+
# Public: Adds the ability for other modules to register and lookup
|
136
|
+
# middleware classes.
|
137
|
+
module MiddlewareRegistry
|
138
|
+
# Public: Register middleware class(es) on the current module.
|
139
|
+
#
|
140
|
+
# mapping - A Hash mapping Symbol keys to classes. Classes can be expressed
|
141
|
+
# as fully qualified constant, or a Proc that will be lazily
|
142
|
+
# called to return the former.
|
143
|
+
#
|
144
|
+
# Examples
|
145
|
+
#
|
146
|
+
# module Faraday
|
147
|
+
# class Whatever
|
148
|
+
# # Middleware looked up by :foo returns Faraday::Whatever::Foo.
|
149
|
+
# register_middleware :foo => Foo
|
150
|
+
#
|
151
|
+
# # Middleware looked up by :bar returns Faraday::Whatever.const_get(:Bar)
|
152
|
+
# register_middleware :bar => :Bar
|
153
|
+
#
|
154
|
+
# # Middleware looked up by :baz requires 'baz' and returns Faraday::Whatever.const_get(:Baz)
|
155
|
+
# register_middleware :baz => [:Baz, 'baz']
|
156
|
+
# end
|
157
|
+
# end
|
158
|
+
#
|
159
|
+
# Returns nothing.
|
160
|
+
def register_middleware(autoload_path = nil, mapping = nil)
|
161
|
+
if mapping.nil?
|
162
|
+
mapping = autoload_path
|
163
|
+
autoload_path = nil
|
164
|
+
end
|
165
|
+
middleware_mutex do
|
166
|
+
@middleware_autoload_path = autoload_path if autoload_path
|
167
|
+
(@registered_middleware ||= {}).update(mapping)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# Public: Lookup middleware class with a registered Symbol shortcut.
|
172
|
+
#
|
173
|
+
# key - The Symbol key for the registered middleware.
|
174
|
+
#
|
175
|
+
# Examples
|
176
|
+
#
|
177
|
+
# module Faraday
|
178
|
+
# class Whatever
|
179
|
+
# register_middleware :foo => Foo
|
180
|
+
# end
|
181
|
+
# end
|
182
|
+
#
|
183
|
+
# Faraday::Whatever.lookup_middleware(:foo)
|
184
|
+
# # => Faraday::Whatever::Foo
|
185
|
+
#
|
186
|
+
# Returns a middleware Class.
|
187
|
+
def lookup_middleware(key)
|
188
|
+
load_middleware(key) ||
|
189
|
+
raise(Faraday::Error.new("#{key.inspect} is not registered on #{self}"))
|
190
|
+
end
|
191
|
+
|
192
|
+
def middleware_mutex(&block)
|
193
|
+
@middleware_mutex ||= begin
|
194
|
+
require 'monitor'
|
195
|
+
Monitor.new
|
196
|
+
end
|
197
|
+
@middleware_mutex.synchronize(&block)
|
198
|
+
end
|
199
|
+
|
200
|
+
def fetch_middleware(key)
|
201
|
+
defined?(@registered_middleware) && @registered_middleware[key]
|
202
|
+
end
|
203
|
+
|
204
|
+
def load_middleware(key)
|
205
|
+
value = fetch_middleware(key)
|
206
|
+
case value
|
207
|
+
when Module
|
208
|
+
value
|
209
|
+
when Symbol, String
|
210
|
+
middleware_mutex do
|
211
|
+
@registered_middleware[key] = const_get(value)
|
212
|
+
end
|
213
|
+
when Proc
|
214
|
+
middleware_mutex do
|
215
|
+
@registered_middleware[key] = value.call
|
216
|
+
end
|
217
|
+
when Array
|
218
|
+
middleware_mutex do
|
219
|
+
const, path = value
|
220
|
+
if root = @middleware_autoload_path
|
221
|
+
path = "#{root}/#{path}"
|
222
|
+
end
|
223
|
+
require(path)
|
224
|
+
@registered_middleware[key] = const
|
225
|
+
end
|
226
|
+
load_middleware(key)
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
def self.const_missing(name)
|
232
|
+
if name.to_sym == :Builder
|
233
|
+
warn "Faraday::Builder is now Faraday::RackBuilder."
|
234
|
+
const_set name, RackBuilder
|
235
|
+
else
|
236
|
+
super
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
require_libs "utils", "options", "connection", "rack_builder", "parameters",
|
241
|
+
"middleware", "adapter", "request", "response", "upload_io", "error"
|
242
|
+
|
243
|
+
if !ENV["FARADAY_NO_AUTOLOAD"]
|
244
|
+
require_lib 'autoload'
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
# not pulling in active-support JUST for this method. And I love this method.
|
249
|
+
class Object
|
250
|
+
# The primary purpose of this method is to "tap into" a method chain,
|
251
|
+
# in order to perform operations on intermediate results within the chain.
|
252
|
+
#
|
253
|
+
# Examples
|
254
|
+
#
|
255
|
+
# (1..10).tap { |x| puts "original: #{x.inspect}" }.to_a.
|
256
|
+
# tap { |x| puts "array: #{x.inspect}" }.
|
257
|
+
# select { |x| x%2 == 0 }.
|
258
|
+
# tap { |x| puts "evens: #{x.inspect}" }.
|
259
|
+
# map { |x| x*x }.
|
260
|
+
# tap { |x| puts "squares: #{x.inspect}" }
|
261
|
+
#
|
262
|
+
# Yields self.
|
263
|
+
# Returns self.
|
264
|
+
def tap
|
265
|
+
yield(self)
|
266
|
+
self
|
267
|
+
end unless Object.respond_to?(:tap)
|
268
|
+
end
|