simple-client 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.bundle/config +4 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +23 -0
- data/bin/rake +16 -0
- data/lib/simple-client/simple-client.rb +229 -0
- data/lib/simple-client/version.rb +4 -0
- data/lib/simple-client.rb +1 -0
- data/test/test_simple-client.rb +236 -0
- data/vendor/bundle/ruby/1.8/bin/rake +19 -0
- data/vendor/bundle/ruby/1.8/cache/addressable-2.2.8.gem +0 -0
- data/vendor/bundle/ruby/1.8/cache/crack-0.3.1.gem +0 -0
- data/vendor/bundle/ruby/1.8/cache/rake-0.9.2.2.gem +0 -0
- data/vendor/bundle/ruby/1.8/cache/webmock-1.8.8.gem +0 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/CHANGELOG.md +126 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/Gemfile +17 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/Gemfile.lock +35 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/LICENSE.txt +202 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/README.md +83 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/Rakefile +37 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/lib/addressable/idna/native.rb +43 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/lib/addressable/idna/pure.rb +4886 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/lib/addressable/idna.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/lib/addressable/template.rb +1047 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/lib/addressable/uri.rb +2288 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/lib/addressable/version.rb +30 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/spec/addressable/idna_spec.rb +216 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/spec/addressable/net_http_compat_spec.rb +26 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/spec/addressable/template_spec.rb +2144 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/spec/addressable/uri_spec.rb +4928 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/clobber.rake +2 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/gem.rake +85 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/git.rake +45 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/metrics.rake +22 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/rspec.rake +58 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/rubyforge.rake +89 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/yard.rake +27 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/website/index.html +110 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/History +25 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/LICENSE +20 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/README.rdoc +42 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/Rakefile +32 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/crack.gemspec +53 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/lib/crack/json.rb +79 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/lib/crack/util.rb +17 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/lib/crack/xml.rb +232 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/lib/crack.rb +8 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/crack_test.rb +4 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/data/twittersearch-firefox.json +1 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/data/twittersearch-ie.json +1 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/hash_test.rb +28 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/json_test.rb +82 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/parser_test.rb +27 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/string_test.rb +31 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/test_helper.rb +12 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/xml_test.rb +499 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/CHANGES +522 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/README.rdoc +197 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/Rakefile +369 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/TODO +20 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/bin/rake +33 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/command_line_usage.rdoc +114 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/example/Rakefile1 +38 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/example/Rakefile2 +35 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/example/a.c +6 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/example/b.c +6 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/example/main.c +11 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/glossary.rdoc +51 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/jamis.rb +591 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/proto_rake.rdoc +127 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/rake.1.gz +0 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/rakefile.rdoc +557 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/rational.rdoc +151 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.6.rdoc +55 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.9.0.rdoc +112 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.9.2.rdoc +49 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/install.rb +90 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/alt_system.rb +109 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb +595 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/classic_namespace.rb +11 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/clean.rb +32 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/cloneable.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/contrib/compositepublisher.rb +21 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/contrib/ftptools.rb +150 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/contrib/publisher.rb +73 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/contrib/rubyforgepublisher.rb +16 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/contrib/sshpublisher.rb +50 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/contrib/sys.rb +191 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/default_loader.rb +10 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/dsl_definition.rb +176 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/early_time.rb +18 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/ext/core.rb +27 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/ext/module.rb +39 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/ext/string.rb +167 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/ext/time.rb +14 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/file_creation_task.rb +24 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/file_list.rb +403 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/file_task.rb +47 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/file_utils.rb +114 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb +145 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/gempackagetask.rb +15 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/invocation_chain.rb +51 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/invocation_exception_mixin.rb +16 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/loaders/makefile.rb +40 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/multi_task.rb +16 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/name_space.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/packagetask.rb +185 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/pathmap.rb +1 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/pseudo_status.rb +24 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/rake_module.rb +29 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb +22 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/rdoctask.rb +234 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/ruby182_test_unit_fix.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/runtest.rb +21 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb +327 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task_argument_error.rb +7 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task_arguments.rb +78 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task_manager.rb +307 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/tasklib.rb +22 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/testtask.rb +191 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/version.rb +8 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/win32.rb +55 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake.rb +69 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/file_creation.rb +34 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/helper.rb +492 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake.rb +40 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_application.rb +489 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_application_options.rb +335 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_clean.rb +14 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_definitions.rb +80 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_directory_task.rb +46 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_dsl.rb +77 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_early_time.rb +31 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_extension.rb +59 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_file_creation_task.rb +56 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_file_list.rb +628 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_file_list_path_map.rb +8 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_file_task.rb +102 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_file_utils.rb +305 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_ftp_file.rb +59 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_functional.rb +450 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_invocation_chain.rb +52 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_makefile_loader.rb +44 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_multi_task.rb +51 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_name_space.rb +43 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_package_task.rb +79 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_path_map.rb +157 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_path_map_explode.rb +34 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_path_map_partial.rb +18 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_pseudo_status.rb +21 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_rake_test_loader.rb +21 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_rdoc_task.rb +83 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_require.rb +40 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_rules.rb +327 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task.rb +267 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task_argument_parsing.rb +103 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task_arguments.rb +88 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task_lib.rb +9 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task_manager.rb +157 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task_manager_argument_resolution.rb +36 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task_with_arguments.rb +173 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_test_task.rb +120 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_top_level_functions.rb +111 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_win32.rb +72 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_sys.rb +20 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/CHANGELOG.md +749 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/Gemfile +21 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/Guardfile +24 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/LICENSE +20 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/README.md +728 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/Rakefile +65 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/api.rb +63 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/assertion_failure.rb +11 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/callback_registry.rb +35 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/config.rb +10 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/cucumber.rb +8 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/deprecation.rb +9 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/errors.rb +33 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/curb_adapter.rb +287 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/em_http_request/em_http_request_0_x.rb +151 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/em_http_request/em_http_request_1_x.rb +212 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +11 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/excon_adapter.rb +95 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/http_lib_adapter.rb +7 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +19 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/httpclient_adapter.rb +193 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/net_http.rb +279 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/net_http_response.rb +34 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/patron_adapter.rb +129 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +180 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/matchers/hash_including_matcher.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/minitest.rb +15 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/rack_response.rb +63 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/request_execution_verifier.rb +56 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/request_pattern.rb +282 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/request_registry.rb +35 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/request_signature.rb +50 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/request_stub.rb +97 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/response.rb +144 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/responses_sequence.rb +40 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/rspec/matchers/request_pattern_matcher.rb +42 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/rspec/matchers/webmock_matcher.rb +46 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/rspec/matchers.rb +28 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/rspec.rb +33 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/stub_registry.rb +61 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/stub_request_snippet.rb +30 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/test_unit.rb +20 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/util/hash_counter.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/util/hash_keys_stringifier.rb +23 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/util/headers.rb +43 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/util/json.rb +54 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/util/uri.rb +101 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/util/version_checker.rb +73 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/version.rb +3 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/webmock.rb +124 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock.rb +49 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/minitest/test_helper.rb +29 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/minitest/test_webmock.rb +6 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/minitest/webmock_spec.rb +50 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/curb/curb_spec.rb +340 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/curb/curb_spec_helper.rb +144 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/em_http_request/em_http_request_spec.rb +183 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/em_http_request/em_http_request_spec_helper.rb +72 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/excon/excon_spec.rb +15 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/excon/excon_spec_helper.rb +38 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/httpclient/httpclient_spec.rb +76 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/httpclient/httpclient_spec_helper.rb +48 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/net_http/net_http_shared.rb +125 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/net_http/net_http_spec.rb +255 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/net_http/net_http_spec_helper.rb +55 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/net_http/real_net_http_spec.rb +20 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/patron/patron_spec.rb +136 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/patron/patron_spec_helper.rb +50 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/allowing_and_disabling_net_connect.rb +142 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/callbacks.rb +146 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/complex_cross_concern_behaviors.rb +36 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/enabling_and_disabling_webmock.rb +95 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/precedence_of_stubs.rb +15 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/request_expectations.rb +666 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/returning_declared_responses.rb +367 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/stubbing_requests.rb +447 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/typhoeus/typhoeus_hydra_spec.rb +74 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb +56 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/webmock_shared.rb +41 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/quality_spec.rb +60 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/spec_helper.rb +57 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/support/example_curl_output.txt +22 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/support/my_rack_app.rb +48 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/support/network_connection.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/support/webmock_server.rb +65 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/errors_spec.rb +32 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb +17 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/http_lib_adapters/http_lib_adapter_spec.rb +12 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/rack_response_spec.rb +74 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/request_execution_verifier_spec.rb +100 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/request_pattern_spec.rb +479 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/request_registry_spec.rb +75 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/request_signature_spec.rb +113 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/request_stub_spec.rb +198 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/response_spec.rb +267 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/stub_registry_spec.rb +86 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/stub_request_snippet_spec.rb +95 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/util/hash_counter_spec.rb +39 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/util/hash_keys_stringifier_spec.rb +27 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/util/headers_spec.rb +28 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/util/json_spec.rb +7 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/util/uri_spec.rb +257 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/util/version_checker_spec.rb +59 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/webmock_spec.rb +7 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/test/http_request.rb +24 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/test/shared_test.rb +76 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/test/test_helper.rb +23 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/test/test_webmock.rb +6 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/webmock.gemspec +35 -0
- data/vendor/bundle/ruby/1.8/specifications/addressable-2.2.8.gemspec +38 -0
- data/vendor/bundle/ruby/1.8/specifications/crack-0.3.1.gemspec +25 -0
- data/vendor/bundle/ruby/1.8/specifications/rake-0.9.2.2.gemspec +33 -0
- data/vendor/bundle/ruby/1.8/specifications/webmock-1.8.8.gemspec +61 -0
- metadata +390 -0
data/.bundle/config
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
simple-client (0.0.2)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
addressable (2.2.8)
|
10
|
+
crack (0.3.1)
|
11
|
+
rake (0.9.2.2)
|
12
|
+
webmock (1.8.8)
|
13
|
+
addressable (~> 2.2.8)
|
14
|
+
crack (>= 0.1.7)
|
15
|
+
|
16
|
+
PLATFORMS
|
17
|
+
ruby
|
18
|
+
|
19
|
+
DEPENDENCIES
|
20
|
+
jruby-openssl (~> 0.7.7)
|
21
|
+
rake
|
22
|
+
simple-client!
|
23
|
+
webmock
|
data/bin/rake
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
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 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rake', 'rake')
|
@@ -0,0 +1,229 @@
|
|
1
|
+
require 'net/https'
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
module SimpleClient
|
5
|
+
|
6
|
+
class Client
|
7
|
+
attr_reader :response, :response_headers, :response_code, :response_body
|
8
|
+
attr_accessor :ssl_client_cert, :request_headers, :body
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
@response = nil
|
12
|
+
@response_headers = {}
|
13
|
+
end
|
14
|
+
|
15
|
+
##
|
16
|
+
# Wrapper for Net::HTTP Get
|
17
|
+
#
|
18
|
+
# @param [String] url The full request URL
|
19
|
+
# @param [Hash] params Optional parameters format e.g. {:headers =>
|
20
|
+
# {'X-Foo' => 'bar, 'User-Agent' => 'Firefox'}}
|
21
|
+
#
|
22
|
+
# @return [SimpleClient::Client] Instance of self for chaining
|
23
|
+
def get(url, params = {})
|
24
|
+
get = GetRequest.new
|
25
|
+
do_request(get, url, params)
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Wrapper for Net::HTTP Post
|
30
|
+
#
|
31
|
+
# @param [String] url The full request URL
|
32
|
+
# @param [Hash] params Optional parameters format e.g. {:headers =>
|
33
|
+
# {'X-Foo' => 'bar, 'User-Agent' => 'Firefox'}, :body => 'abc'}
|
34
|
+
#
|
35
|
+
# @return [SimpleClient::Client] Instance of self for chaining
|
36
|
+
def post(url, params = {})
|
37
|
+
post = PostRequest.new
|
38
|
+
do_request(post, url, params)
|
39
|
+
end
|
40
|
+
|
41
|
+
##
|
42
|
+
# Wrapper for Net::HTTP Put
|
43
|
+
#
|
44
|
+
# @param [String] url The full request URL
|
45
|
+
# @param [Hash] params Optional parameters format e.g. {:headers =>
|
46
|
+
# {'X-Foo' => 'bar, 'User-Agent' => 'Firefox'}, :body => 'abc'}
|
47
|
+
#
|
48
|
+
# @return [SimpleClient::Client] Instance of self for chaining
|
49
|
+
def put(url, params = {})
|
50
|
+
put = PutRequest.new
|
51
|
+
do_request(put, url, params)
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# Wrapper for Net::HTTP Delete
|
56
|
+
#
|
57
|
+
# @param [String] url The full request URL
|
58
|
+
# @param [Hash] params Optional parameters format e.g. {:headers =>
|
59
|
+
# {'X-Foo' => 'bar, 'User-Agent' => 'Firefox'}}
|
60
|
+
#
|
61
|
+
# @return [SimpleClient::Client] Instance of self for chaining
|
62
|
+
def delete(url, params = {})
|
63
|
+
delete = DeleteRequest.new
|
64
|
+
do_request(delete, url, params)
|
65
|
+
end
|
66
|
+
|
67
|
+
private
|
68
|
+
|
69
|
+
def do_request(http, url, params)
|
70
|
+
convert_api_to_hash(params)
|
71
|
+
@response = http.request(url, params)
|
72
|
+
store_response_data
|
73
|
+
self
|
74
|
+
end
|
75
|
+
|
76
|
+
def store_response_data
|
77
|
+
set_response_headers
|
78
|
+
@response_code = @response.code
|
79
|
+
@response_body = @response.body
|
80
|
+
end
|
81
|
+
|
82
|
+
def set_response_headers
|
83
|
+
@response.each_header do |h, v|
|
84
|
+
@response_headers[h] = v
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def convert_api_to_hash(params)
|
89
|
+
params[:ssl_client_cert] = @ssl_client_cert if @ssl_client_cert
|
90
|
+
params[:headers] = @request_headers if @request_headers
|
91
|
+
params[:body] = @body if @body
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
class Request
|
97
|
+
|
98
|
+
def initialize
|
99
|
+
@proxy_host = nil
|
100
|
+
@proxy_port = nil
|
101
|
+
end
|
102
|
+
|
103
|
+
##
|
104
|
+
# Base class for a HTTP Request - intended for subclassing
|
105
|
+
#
|
106
|
+
# @param [String] url The full request URL
|
107
|
+
# @param [Hash] params Optional parameters format e.g. {:headers =>
|
108
|
+
# {'X-Foo' => 'bar, 'User-Agent' => 'Firefox'}}
|
109
|
+
#
|
110
|
+
# @return [Net::HTTPResponse] Net::HTTP Response object
|
111
|
+
def request(url, params)
|
112
|
+
connection = prepare_connection(url, params)
|
113
|
+
req = create_request(params[:body])
|
114
|
+
do_request(req, params[:headers], connection)
|
115
|
+
end
|
116
|
+
|
117
|
+
private
|
118
|
+
|
119
|
+
def prepare_connection(url, params)
|
120
|
+
@parts = get_uri_parts_from url
|
121
|
+
set_proxy
|
122
|
+
connection = get_connection(@parts[:host], @parts[:port], params)
|
123
|
+
end
|
124
|
+
|
125
|
+
def do_request(req, headers, connection)
|
126
|
+
add_headers(req, headers)
|
127
|
+
connection.request req
|
128
|
+
end
|
129
|
+
|
130
|
+
def create_request(body)
|
131
|
+
raise "Not supported in base class"
|
132
|
+
end
|
133
|
+
|
134
|
+
|
135
|
+
def add_headers(request, headers)
|
136
|
+
headers.each do |header,value|
|
137
|
+
request.add_field(header, value)
|
138
|
+
end if headers
|
139
|
+
end
|
140
|
+
|
141
|
+
def set_proxy
|
142
|
+
proxy = ENV['http_proxy'] || ENV['HTTP_PROXY']
|
143
|
+
if proxy && !no_proxy_host?(@parts[:host])
|
144
|
+
parts = get_uri_parts_from proxy if proxy
|
145
|
+
@proxy_host = parts[:host]
|
146
|
+
@proxy_port = parts[:port]
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
def no_proxy_host?(host)
|
151
|
+
no_proxy = ENV['no_proxy'] || ENV['NO_PROXY']
|
152
|
+
proxy_host = []
|
153
|
+
if no_proxy
|
154
|
+
no_proxy_hosts = no_proxy.split(',')
|
155
|
+
no_proxy_hosts.map { |h| h.strip! }
|
156
|
+
proxy_host = no_proxy_hosts.map {|h| host.include? h}
|
157
|
+
end
|
158
|
+
proxy_host.include? true
|
159
|
+
end
|
160
|
+
|
161
|
+
def get_connection(host, port, params)
|
162
|
+
http = Net::HTTP::Proxy(@proxy_host, @proxy_port).new(host,port)
|
163
|
+
configure_ssl(http, params)
|
164
|
+
http
|
165
|
+
end
|
166
|
+
|
167
|
+
def configure_ssl(http, params)
|
168
|
+
http.use_ssl = true if (@parts[:scheme] == 'https')
|
169
|
+
if params[:ssl_client_cert]
|
170
|
+
pem = File.read(params[:ssl_client_cert])
|
171
|
+
http.cert = OpenSSL::X509::Certificate.new(pem)
|
172
|
+
http.key = OpenSSL::PKey::RSA.new(pem)
|
173
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
def get_uri_parts_from(base)
|
178
|
+
uri = URI.parse(base)
|
179
|
+
parts = {:scheme => uri.scheme, :host => uri.host,
|
180
|
+
:port => uri.port, :path => uri.path, :query => uri.query,
|
181
|
+
:fragment => uri.fragment}
|
182
|
+
parts[:path] = '/' if uri.path.empty?
|
183
|
+
parts
|
184
|
+
end
|
185
|
+
|
186
|
+
end
|
187
|
+
|
188
|
+
class GetRequest < Request
|
189
|
+
|
190
|
+
protected
|
191
|
+
|
192
|
+
def create_request(body)
|
193
|
+
query = @parts[:query] ? "?#{@parts[:query]}" : ""
|
194
|
+
Net::HTTP::Get.new(@parts[:path] + query)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
class PostRequest < Request
|
199
|
+
|
200
|
+
protected
|
201
|
+
|
202
|
+
def create_request(body)
|
203
|
+
post = Net::HTTP::Post.new(@parts[:path])
|
204
|
+
post.body = body
|
205
|
+
post
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
class PutRequest < Request
|
210
|
+
|
211
|
+
protected
|
212
|
+
|
213
|
+
def create_request(body)
|
214
|
+
put = Net::HTTP::Put.new(@parts[:path])
|
215
|
+
put.body = body
|
216
|
+
put
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
class DeleteRequest < Request
|
221
|
+
|
222
|
+
protected
|
223
|
+
|
224
|
+
def create_request(body)
|
225
|
+
Net::HTTP::Delete.new(@parts[:path])
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'simple-client/simple-client'
|
@@ -0,0 +1,236 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'test/unit'
|
4
|
+
require 'net/https'
|
5
|
+
require 'webmock/test_unit'
|
6
|
+
dir = File.dirname(__FILE__)
|
7
|
+
$LOAD_PATH.unshift "#{dir}/../lib"
|
8
|
+
require 'simple-client'
|
9
|
+
|
10
|
+
class SimpleClient::RequestTest < Test::Unit::TestCase
|
11
|
+
|
12
|
+
def setup
|
13
|
+
ENV.clear
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_proxy_is_set_correctly_without_no_proxy
|
17
|
+
ENV['http_proxy'] = 'http://cache.foo.co.uk:80'
|
18
|
+
r = SimpleClient::Request.new
|
19
|
+
r.send('prepare_connection', 'http://www.google.co.uk', {}) #test private method
|
20
|
+
assert_equal "cache.foo.co.uk", r.instance_variable_get(:@proxy_host)
|
21
|
+
assert_equal 80, r.instance_variable_get(:@proxy_port)
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_proxy_is_not_set_when_host_in_no_proxy
|
25
|
+
ENV['http_proxy'] = 'http://cache.foo.co.uk:80'
|
26
|
+
ENV['no_proxy'] = '.google.co.uk'
|
27
|
+
r = SimpleClient::Request.new
|
28
|
+
r.send('prepare_connection', 'http://www.google.co.uk', {}) #test private method
|
29
|
+
assert_equal nil, r.instance_variable_get(:@proxy_host)
|
30
|
+
assert_equal nil, r.instance_variable_get(:@proxy_port)
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_proxy_is_not_set_when_host_in_no_proxy_and_no_proxy_contains_multiple_hosts
|
34
|
+
ENV['http_proxy'] = 'http://cache.foo.co.uk:80'
|
35
|
+
ENV['no_proxy'] = '.google.co.uk, foo, localhost'
|
36
|
+
r = SimpleClient::Request.new
|
37
|
+
r.send('prepare_connection', 'http://localhost/foobar', {}) #test private method
|
38
|
+
assert_equal nil, r.instance_variable_get(:@proxy_host)
|
39
|
+
assert_equal nil, r.instance_variable_get(:@proxy_port)
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
class SimpleClient::ClientTest < Test::Unit::TestCase
|
45
|
+
|
46
|
+
def setup
|
47
|
+
ENV.clear
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_simple_get
|
51
|
+
#stub
|
52
|
+
stub_request(:get, "http://www.foo.co.uk")
|
53
|
+
|
54
|
+
#run
|
55
|
+
s = SimpleClient::Client.new
|
56
|
+
response = s.get('http://www.foo.co.uk')
|
57
|
+
|
58
|
+
#assert
|
59
|
+
assert_requested :get, "http://www.foo.co.uk"
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_simple_get_with_query_string
|
63
|
+
#stub
|
64
|
+
stub_request(:get, "http://www.foo.co.uk").with(:query => {"a" => "b", "c" => "d"})
|
65
|
+
#run
|
66
|
+
s = SimpleClient::Client.new
|
67
|
+
response = s.get('http://www.foo.co.uk?a=b&c=d')
|
68
|
+
|
69
|
+
#assert
|
70
|
+
assert_requested :get, "http://www.foo.co.uk?a=b&c=d"
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_simple_get_using_ssl
|
74
|
+
#stub
|
75
|
+
stub_request(:get, "https://www.foo.co.uk")
|
76
|
+
|
77
|
+
#run
|
78
|
+
s = SimpleClient::Client.new
|
79
|
+
response = s.get('https://www.foo.co.uk')
|
80
|
+
|
81
|
+
#assert
|
82
|
+
assert_requested :get, "https://www.foo.co.uk"
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_get_with_request_and_response_headers
|
86
|
+
#stub
|
87
|
+
stub_request(:get, "http://www.foo.co.uk/sport").
|
88
|
+
with(:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'}).
|
89
|
+
to_return(:status => 200, :body => "abc",
|
90
|
+
:headers => {'Cache-Control' => 'private'})
|
91
|
+
|
92
|
+
#run
|
93
|
+
s = SimpleClient::Client.new
|
94
|
+
response = s.get('http://www.foo.co.uk/sport',
|
95
|
+
:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'})
|
96
|
+
|
97
|
+
#assert
|
98
|
+
assert_requested :get, "http://www.foo.co.uk/sport",
|
99
|
+
:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'}, :times => 1 # ===> Success
|
100
|
+
assert_equal({'cache-control' => 'private'}, s.response_headers)
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_get_with_request_and_response_headers_using_api
|
104
|
+
#stub
|
105
|
+
stub_request(:get, "http://www.foo.co.uk/sport").
|
106
|
+
with(:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'}).
|
107
|
+
to_return(:status => 200, :body => "abc",
|
108
|
+
:headers => {'Cache-Control' => 'private'})
|
109
|
+
|
110
|
+
#run
|
111
|
+
s = SimpleClient::Client.new
|
112
|
+
s.request_headers = {'X-Test1'=>'foo', 'X-Test2' => 'bar'}
|
113
|
+
s.get 'http://www.foo.co.uk/sport'
|
114
|
+
|
115
|
+
#assert
|
116
|
+
assert_requested :get, "http://www.foo.co.uk/sport",
|
117
|
+
:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'}, :times => 1 # ===> Success
|
118
|
+
assert_equal({'cache-control' => 'private'}, s.response_headers)
|
119
|
+
end
|
120
|
+
|
121
|
+
def test_simple_post
|
122
|
+
#stub
|
123
|
+
stub_request(:post, "http://www.foo.co.uk/sport").with(:body => "abc")
|
124
|
+
|
125
|
+
#run
|
126
|
+
s = SimpleClient::Client.new
|
127
|
+
response = s.post('http://www.foo.co.uk/sport', :body => 'abc')
|
128
|
+
|
129
|
+
#assert
|
130
|
+
assert_requested :post, "http://www.foo.co.uk/sport",
|
131
|
+
:body => "abc", :times => 1 # ===> Success
|
132
|
+
end
|
133
|
+
|
134
|
+
def test_post_with_request_and_response_headers
|
135
|
+
#stub
|
136
|
+
stub_request(:post, "http://www.foo.co.uk/sport").
|
137
|
+
with(:body => "abc", :headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'}).
|
138
|
+
to_return(:status => 200, :headers => {'Cache-Control' => 'private'})
|
139
|
+
|
140
|
+
#run
|
141
|
+
s = SimpleClient::Client.new
|
142
|
+
response = s.post('http://www.foo.co.uk/sport',
|
143
|
+
:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'},
|
144
|
+
:body => 'abc')
|
145
|
+
|
146
|
+
|
147
|
+
#assert
|
148
|
+
assert_requested :post, "http://www.foo.co.uk/sport",
|
149
|
+
:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'},
|
150
|
+
:body => "abc", :times => 1 # ===> Success
|
151
|
+
assert_equal({'cache-control' => 'private'}, s.response_headers)
|
152
|
+
end
|
153
|
+
|
154
|
+
|
155
|
+
def test_post_with_request_and_response_headers_using_api
|
156
|
+
#stub
|
157
|
+
stub_request(:post, "http://www.foo.co.uk/sport").
|
158
|
+
with(:body => "abc", :headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'}).
|
159
|
+
to_return(:status => 200, :headers => {'Cache-Control' => 'private'})
|
160
|
+
|
161
|
+
#run
|
162
|
+
s = SimpleClient::Client.new
|
163
|
+
s.request_headers = {'X-Test1'=>'foo', 'X-Test2' => 'bar'}
|
164
|
+
s.body = 'abc'
|
165
|
+
s.post 'http://www.foo.co.uk/sport'
|
166
|
+
|
167
|
+
#assert
|
168
|
+
assert_requested :post, "http://www.foo.co.uk/sport",
|
169
|
+
:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'},
|
170
|
+
:body => "abc", :times => 1 # ===> Success
|
171
|
+
assert_equal({'cache-control' => 'private'}, s.response_headers)
|
172
|
+
end
|
173
|
+
|
174
|
+
|
175
|
+
def test_simple_put
|
176
|
+
#stub
|
177
|
+
stub_request(:put, "http://www.foo.co.uk/sport").with(:body => "abc")
|
178
|
+
|
179
|
+
#run
|
180
|
+
s = SimpleClient::Client.new
|
181
|
+
response = s.put('http://www.foo.co.uk/sport', :body => 'abc')
|
182
|
+
|
183
|
+
#assert
|
184
|
+
assert_requested :put, "http://www.foo.co.uk/sport",
|
185
|
+
:body => "abc", :times => 1 # ===> Success
|
186
|
+
end
|
187
|
+
|
188
|
+
def test_put_with_request_and_response_headers
|
189
|
+
#stub
|
190
|
+
stub_request(:put, "http://www.foo.co.uk/sport").
|
191
|
+
with(:body => "abc", :headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'}).
|
192
|
+
to_return(:status => 200, :headers => {'Cache-Control' => 'private'})
|
193
|
+
|
194
|
+
#run
|
195
|
+
s = SimpleClient::Client.new
|
196
|
+
response = s.put('http://www.foo.co.uk/sport',
|
197
|
+
:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'},
|
198
|
+
:body => 'abc')
|
199
|
+
|
200
|
+
#assert
|
201
|
+
assert_requested :put, "http://www.foo.co.uk/sport",
|
202
|
+
:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'},
|
203
|
+
:body => "abc", :times => 1 # ===> Success
|
204
|
+
assert_equal({'cache-control' => 'private'}, s.response_headers)
|
205
|
+
end
|
206
|
+
|
207
|
+
def test_simple_delete
|
208
|
+
#stub
|
209
|
+
stub_request(:delete, "http://www.foo.co.uk/sport")
|
210
|
+
|
211
|
+
#run
|
212
|
+
s = SimpleClient::Client.new
|
213
|
+
response = s.delete('http://www.foo.co.uk/sport')
|
214
|
+
|
215
|
+
#assert
|
216
|
+
assert_requested :delete, "http://www.foo.co.uk/sport"
|
217
|
+
end
|
218
|
+
|
219
|
+
def test_delete_with_request_and_response_headers
|
220
|
+
#stub
|
221
|
+
stub_request(:delete, "http://www.foo.co.uk/sport").
|
222
|
+
with(:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'}).
|
223
|
+
to_return(:status => 200, :headers => {'Cache-Control' => 'private'})
|
224
|
+
|
225
|
+
#run
|
226
|
+
s = SimpleClient::Client.new
|
227
|
+
response = s.delete('http://www.foo.co.uk/sport',
|
228
|
+
:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'})
|
229
|
+
|
230
|
+
#assert
|
231
|
+
assert_requested :delete, "http://www.foo.co.uk/sport",
|
232
|
+
:headers => {'X-Test1'=>'foo', 'X-Test2' => 'bar'}
|
233
|
+
assert_equal({'cache-control' => 'private'}, s.response_headers)
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|
@@ -0,0 +1,19 @@
|
|
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 =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
|
14
|
+
version = $1
|
15
|
+
ARGV.shift
|
16
|
+
end
|
17
|
+
|
18
|
+
gem 'rake', version
|
19
|
+
load Gem.bin_path('rake', 'rake', version)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# Addressable 2.2.8
|
2
|
+
- fixed issues with dot segment removal code
|
3
|
+
- form encoding can now handle multiple values per key
|
4
|
+
- updated development environment
|
5
|
+
|
6
|
+
# Addressable 2.2.7
|
7
|
+
- fixed issues related to Addressable::URI#query_values=
|
8
|
+
- the Addressable::URI.parse method is now polymorphic
|
9
|
+
|
10
|
+
# Addressable 2.2.6
|
11
|
+
- changed the way ambiguous paths are handled
|
12
|
+
- fixed bug with frozen URIs
|
13
|
+
- https supported in heuristic parsing
|
14
|
+
|
15
|
+
# Addressable 2.2.5
|
16
|
+
- 'parsing' a pre-parsed URI object is now a dup operation
|
17
|
+
- introduced conditional support for libidn
|
18
|
+
- fixed normalization issue on ampersands in query strings
|
19
|
+
- added additional tests around handling of query strings
|
20
|
+
|
21
|
+
# Addressable 2.2.4
|
22
|
+
- added origin support from draft-ietf-websec-origin-00
|
23
|
+
- resolved issue with attempting to navigate below root
|
24
|
+
- fixed bug with string splitting in query strings
|
25
|
+
|
26
|
+
# Addressable 2.2.3
|
27
|
+
- added :flat_array notation for query strings
|
28
|
+
|
29
|
+
# Addressable 2.2.2
|
30
|
+
- fixed issue with percent escaping of '+' character in query strings
|
31
|
+
|
32
|
+
# Addressable 2.2.1
|
33
|
+
- added support for application/x-www-form-urlencoded.
|
34
|
+
|
35
|
+
# Addressable 2.2.0
|
36
|
+
- added site methods
|
37
|
+
- improved documentation
|
38
|
+
|
39
|
+
# Addressable 2.1.2
|
40
|
+
- added HTTP request URI methods
|
41
|
+
- better handling of Windows file paths
|
42
|
+
- validation_deferred boolean replaced with defer_validation block
|
43
|
+
- normalization of percent-encoded paths should now be correct
|
44
|
+
- fixed issue with constructing URIs with relative paths
|
45
|
+
- fixed warnings
|
46
|
+
|
47
|
+
# Addressable 2.1.1
|
48
|
+
- more type checking changes
|
49
|
+
- fixed issue with unicode normalization
|
50
|
+
- added method to find template defaults
|
51
|
+
- symbolic keys are now allowed in template mappings
|
52
|
+
- numeric values and symbolic values are now allowed in template mappings
|
53
|
+
|
54
|
+
# Addressable 2.1.0
|
55
|
+
- refactored URI template support out into its own class
|
56
|
+
- removed extract method due to being useless and unreliable
|
57
|
+
- removed Addressable::URI.expand_template
|
58
|
+
- removed Addressable::URI#extract_mapping
|
59
|
+
- added partial template expansion
|
60
|
+
- fixed minor bugs in the parse and heuristic_parse methods
|
61
|
+
- fixed incompatibility with Ruby 1.9.1
|
62
|
+
- fixed bottleneck in Addressable::URI#hash and Addressable::URI#to_s
|
63
|
+
- fixed unicode normalization exception
|
64
|
+
- updated query_values methods to better handle subscript notation
|
65
|
+
- worked around issue with freezing URIs
|
66
|
+
- improved specs
|
67
|
+
|
68
|
+
# Addressable 2.0.2
|
69
|
+
- fixed issue with URI template expansion
|
70
|
+
- fixed issue with percent escaping characters 0-15
|
71
|
+
|
72
|
+
# Addressable 2.0.1
|
73
|
+
- fixed issue with query string assignment
|
74
|
+
- fixed issue with improperly encoded components
|
75
|
+
|
76
|
+
# Addressable 2.0.0
|
77
|
+
- the initialize method now takes an options hash as its only parameter
|
78
|
+
- added query_values method to URI class
|
79
|
+
- completely replaced IDNA implementation with pure Ruby
|
80
|
+
- renamed Addressable::ADDRESSABLE_VERSION to Addressable::VERSION
|
81
|
+
- completely reworked the Rakefile
|
82
|
+
- changed the behavior of the port method significantly
|
83
|
+
- Addressable::URI.encode_segment, Addressable::URI.unencode_segment renamed
|
84
|
+
- documentation is now in YARD format
|
85
|
+
- more rigorous type checking
|
86
|
+
- to_str method implemented, implicit conversion to Strings now allowed
|
87
|
+
- Addressable::URI#omit method added, Addressable::URI#merge method replaced
|
88
|
+
- updated URI Template code to match v 03 of the draft spec
|
89
|
+
- added a bunch of new specifications
|
90
|
+
|
91
|
+
# Addressable 1.0.4
|
92
|
+
- switched to using RSpec's pending system for specs that rely on IDN
|
93
|
+
- fixed issue with creating URIs with paths that are not prefixed with '/'
|
94
|
+
|
95
|
+
# Addressable 1.0.3
|
96
|
+
- implemented a hash method
|
97
|
+
|
98
|
+
# Addressable 1.0.2
|
99
|
+
- fixed minor bug with the extract_mapping method
|
100
|
+
|
101
|
+
# Addressable 1.0.1
|
102
|
+
- fixed minor bug with the extract_mapping method
|
103
|
+
|
104
|
+
# Addressable 1.0.0
|
105
|
+
- heuristic parse method added
|
106
|
+
- parsing is slightly more strict
|
107
|
+
- replaced to_h with to_hash
|
108
|
+
- fixed routing methods
|
109
|
+
- improved specifications
|
110
|
+
- improved heckle rake task
|
111
|
+
- no surviving heckle mutations
|
112
|
+
|
113
|
+
# Addressable 0.1.2
|
114
|
+
- improved normalization
|
115
|
+
- fixed bug in joining algorithm
|
116
|
+
- updated specifications
|
117
|
+
|
118
|
+
# Addressable 0.1.1
|
119
|
+
- updated documentation
|
120
|
+
- added URI Template variable extraction
|
121
|
+
|
122
|
+
# Addressable 0.1.0
|
123
|
+
- initial release
|
124
|
+
- implementation based on RFC 3986, 3987
|
125
|
+
- support for IRIs via libidn
|
126
|
+
- support for the URI Template draft spec
|