Hello community, here is the log from the commit of package rubygem-excon for openSUSE:Factory checked in at 2018-02-12 10:13:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-excon (Old) and /work/SRC/openSUSE:Factory/.rubygem-excon.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-excon" Mon Feb 12 10:13:36 2018 rev:22 rq:574049 version:0.60.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-excon/rubygem-excon.changes 2017-09-26 21:16:21.446074288 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-excon.new/rubygem-excon.changes 2018-02-12 10:13:36.964962360 +0100 @@ -1,0 +2,14 @@ +Tue Jan 9 07:27:41 UTC 2018 - co...@suse.com + +- updated to version 0.60.0 + see installed changelog.txt + + 0.60.0 2017-12-15 + ================= + + add requests_in_batches + cleanup rakefile, gemfile, etc + add logger/logger= and logging instrumentor + rewind response_block in idempotent instrumentor + +------------------------------------------------------------------- Old: ---- excon-0.59.0.gem New: ---- excon-0.60.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-excon.spec ++++++ --- /var/tmp/diff_new_pack.onnTt2/_old 2018-02-12 10:13:37.552941171 +0100 +++ /var/tmp/diff_new_pack.onnTt2/_new 2018-02-12 10:13:37.556941028 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-excon # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ # Name: rubygem-excon -Version: 0.59.0 +Version: 0.60.0 Release: 0 %define mod_name excon %define mod_full_name %{mod_name}-%{version} ++++++ excon-0.59.0.gem -> excon-0.60.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.document new/.document --- old/.document 1970-01-01 01:00:00.000000000 +0100 +++ new/.document 2017-12-15 21:15:57.000000000 +0100 @@ -0,0 +1,5 @@ +README.rdoc +lib/**/*.rb +bin/* +features/**/*.feature +LICENSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2017-12-15 21:15:57.000000000 +0100 @@ -0,0 +1,13 @@ +*.rbc +*.sw? +.bundle +.DS_Store +.yardoc +.rvmrc +.ruby-version +.ruby-gemset +coverage +doc +rdoc +pkg +Gemfile.lock diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.rspec new/.rspec --- old/.rspec 1970-01-01 01:00:00.000000000 +0100 +++ new/.rspec 2017-12-15 21:15:57.000000000 +0100 @@ -0,0 +1,3 @@ +--color +--require spec_helper +--format d diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.travis.yml new/.travis.yml --- old/.travis.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/.travis.yml 2017-12-15 21:15:57.000000000 +0100 @@ -0,0 +1,28 @@ +before_install: + - gem install bundler +language: ruby +matrix: + allow_failures: + - rvm: 1.8.7 + - rvm: 1.9.2 + - rvm: jruby + - rvm: rbx-3.2 + - rvm: ree + fast_finish: true +rvm: + - 1.8.7 + - 1.9.2 + - 1.9.3 + - 2.0 + - 2.1 + - 2.2 + - 2.3.3 + - 2.4.1 + - jruby + - rbx-3.2 + - ree +script: + - "bundle exec shindont" + - "bundle exec rake spec[progress]" + +sudo: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Gemfile.lock new/Gemfile.lock --- old/Gemfile.lock 2017-09-05 21:43:31.000000000 +0200 +++ new/Gemfile.lock 1970-01-01 01:00:00.000000000 +0100 @@ -1,301 +0,0 @@ -PATH - remote: . - specs: - excon (0.59.0) - -GEM - remote: https://rubygems.org/ - specs: - activesupport (3.2.6) - i18n (~> 0.6) - multi_json (~> 1.0) - backports (3.6.4) - chronic (0.6.7) - delorean (2.0.0) - chronic - diff-lcs (1.2.5) - eventmachine (1.0.4) - eventmachine (1.0.4-java) - ffi2-generators (0.1.1) - formatador (0.2.3) - i18n (0.6.0) - jruby-openssl (0.9.17-java) - json (1.8.6) - json (1.8.6-java) - kgio (2.9.2) - minitest (4.7.5) - multi_json (1.3.6) - open4 (1.3.0) - puma (3.6.0) - puma (3.6.0-java) - rack (1.6.0) - rack-protection (1.2.0) - rack - rack-test (0.6.3) - rack (>= 1.0) - raindrops (0.13.0) - rake (0.9.2.2) - rdoc (3.12) - json (~> 1.4) - rspec (3.5.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-core (3.5.0) - rspec-support (~> 3.5.0) - rspec-expectations (3.5.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-mocks (3.5.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-support (3.5.0) - rubysl (2.0.14) - rubysl-abbrev (~> 2.0) - rubysl-base64 (~> 2.0) - rubysl-benchmark (~> 2.0) - rubysl-bigdecimal (~> 2.0) - rubysl-cgi (~> 2.0) - rubysl-cgi-session (~> 2.0) - rubysl-cmath (~> 2.0) - rubysl-complex (~> 2.0) - rubysl-continuation (~> 2.0) - rubysl-coverage (~> 2.0) - rubysl-csv (~> 2.0) - rubysl-curses (~> 2.0) - rubysl-date (~> 2.0) - rubysl-delegate (~> 2.0) - rubysl-digest (~> 2.0) - rubysl-drb (~> 2.0) - rubysl-e2mmap (~> 2.0) - rubysl-english (~> 2.0) - rubysl-enumerator (~> 2.0) - rubysl-erb (~> 2.0) - rubysl-etc (~> 2.0) - rubysl-expect (~> 2.0) - rubysl-fcntl (~> 2.0) - rubysl-fiber (~> 2.0) - rubysl-fileutils (~> 2.0) - rubysl-find (~> 2.0) - rubysl-forwardable (~> 2.0) - rubysl-getoptlong (~> 2.0) - rubysl-gserver (~> 2.0) - rubysl-io-console (~> 2.0) - rubysl-io-nonblock (~> 2.0) - rubysl-io-wait (~> 2.0) - rubysl-ipaddr (~> 2.0) - rubysl-irb (~> 2.0) - rubysl-logger (~> 2.0) - rubysl-mathn (~> 2.0) - rubysl-matrix (~> 2.0) - rubysl-mkmf (~> 2.0) - rubysl-monitor (~> 2.0) - rubysl-mutex_m (~> 2.0) - rubysl-net-ftp (~> 2.0) - rubysl-net-http (~> 2.0) - rubysl-net-imap (~> 2.0) - rubysl-net-pop (~> 2.0) - rubysl-net-protocol (~> 2.0) - rubysl-net-smtp (~> 2.0) - rubysl-net-telnet (~> 2.0) - rubysl-nkf (~> 2.0) - rubysl-observer (~> 2.0) - rubysl-open-uri (~> 2.0) - rubysl-open3 (~> 2.0) - rubysl-openssl (~> 2.0) - rubysl-optparse (~> 2.0) - rubysl-ostruct (~> 2.0) - rubysl-pathname (~> 2.0) - rubysl-prettyprint (~> 2.0) - rubysl-prime (~> 2.0) - rubysl-profile (~> 2.0) - rubysl-profiler (~> 2.0) - rubysl-pstore (~> 2.0) - rubysl-pty (~> 2.0) - rubysl-rational (~> 2.0) - rubysl-readline (~> 2.0) - rubysl-resolv (~> 2.0) - rubysl-rexml (~> 2.0) - rubysl-rinda (~> 2.0) - rubysl-rss (~> 2.0) - rubysl-scanf (~> 2.0) - rubysl-securerandom (~> 2.0) - rubysl-set (~> 2.0) - rubysl-shellwords (~> 2.0) - rubysl-singleton (~> 2.0) - rubysl-socket (~> 2.0) - rubysl-stringio (~> 2.0) - rubysl-strscan (~> 2.0) - rubysl-sync (~> 2.0) - rubysl-syslog (~> 2.0) - rubysl-tempfile (~> 2.0) - rubysl-test-unit (~> 2.0) - rubysl-thread (~> 2.0) - rubysl-thwait (~> 2.0) - rubysl-time (~> 2.0) - rubysl-timeout (~> 2.0) - rubysl-tmpdir (~> 2.0) - rubysl-tsort (~> 2.0) - rubysl-un (~> 2.0) - rubysl-uri (~> 2.0) - rubysl-weakref (~> 2.0) - rubysl-webrick (~> 2.0) - rubysl-xmlrpc (~> 2.0) - rubysl-yaml (~> 2.0) - rubysl-zlib (~> 2.0) - rubysl-abbrev (2.0.4) - rubysl-base64 (2.0.0) - rubysl-benchmark (2.0.1) - rubysl-bigdecimal (2.0.2) - rubysl-cgi (2.0.1) - rubysl-cgi-session (2.0.1) - rubysl-cmath (2.0.0) - rubysl-complex (2.0.0) - rubysl-continuation (2.0.0) - rubysl-coverage (2.0.3) - rubysl-csv (2.0.2) - rubysl-english (~> 2.0) - rubysl-curses (2.0.0) - rubysl-date (2.0.6) - rubysl-delegate (2.0.1) - rubysl-digest (2.0.3) - rubysl-drb (2.0.1) - rubysl-e2mmap (2.0.0) - rubysl-english (2.0.0) - rubysl-enumerator (2.0.0) - rubysl-erb (2.0.1) - rubysl-etc (2.0.3) - ffi2-generators (~> 0.1) - rubysl-expect (2.0.0) - rubysl-fcntl (2.0.4) - ffi2-generators (~> 0.1) - rubysl-fiber (2.0.0) - rubysl-fileutils (2.0.3) - rubysl-find (2.0.1) - rubysl-forwardable (2.0.1) - rubysl-getoptlong (2.0.0) - rubysl-gserver (2.0.0) - rubysl-socket (~> 2.0) - rubysl-thread (~> 2.0) - rubysl-io-console (2.0.0) - rubysl-io-nonblock (2.0.0) - rubysl-io-wait (2.0.0) - rubysl-ipaddr (2.0.0) - rubysl-irb (2.0.4) - rubysl-e2mmap (~> 2.0) - rubysl-mathn (~> 2.0) - rubysl-readline (~> 2.0) - rubysl-thread (~> 2.0) - rubysl-logger (2.0.0) - rubysl-mathn (2.0.0) - rubysl-matrix (2.1.0) - rubysl-e2mmap (~> 2.0) - rubysl-mkmf (2.0.1) - rubysl-fileutils (~> 2.0) - rubysl-shellwords (~> 2.0) - rubysl-monitor (2.0.0) - rubysl-mutex_m (2.0.0) - rubysl-net-ftp (2.0.1) - rubysl-net-http (2.0.4) - rubysl-cgi (~> 2.0) - rubysl-erb (~> 2.0) - rubysl-singleton (~> 2.0) - rubysl-net-imap (2.0.1) - rubysl-net-pop (2.0.1) - rubysl-net-protocol (2.0.1) - rubysl-net-smtp (2.0.1) - rubysl-net-telnet (2.0.0) - rubysl-nkf (2.0.1) - rubysl-observer (2.0.0) - rubysl-open-uri (2.0.0) - rubysl-open3 (2.0.0) - rubysl-openssl (2.0.4) - rubysl-optparse (2.0.1) - rubysl-shellwords (~> 2.0) - rubysl-ostruct (2.0.4) - rubysl-pathname (2.0.0) - rubysl-prettyprint (2.0.2) - rubysl-prime (2.0.0) - rubysl-profile (2.0.0) - rubysl-profiler (2.0.1) - rubysl-pstore (2.0.0) - rubysl-pty (2.0.2) - rubysl-rational (2.0.1) - rubysl-readline (2.0.2) - rubysl-resolv (2.0.0) - rubysl-rexml (2.0.2) - rubysl-rinda (2.0.0) - rubysl-rss (2.0.0) - rubysl-scanf (2.0.0) - rubysl-securerandom (2.0.0) - rubysl-set (2.0.1) - rubysl-shellwords (2.0.0) - rubysl-singleton (2.0.0) - rubysl-socket (2.0.1) - rubysl-stringio (2.0.0) - rubysl-strscan (2.0.0) - rubysl-sync (2.0.0) - rubysl-syslog (2.0.1) - ffi2-generators (~> 0.1) - rubysl-tempfile (2.0.1) - rubysl-test-unit (2.0.1) - minitest (~> 4.7) - rubysl-thread (2.0.2) - rubysl-thwait (2.0.0) - rubysl-time (2.0.3) - rubysl-timeout (2.0.0) - rubysl-tmpdir (2.0.0) - rubysl-tsort (2.0.1) - rubysl-un (2.0.0) - rubysl-fileutils (~> 2.0) - rubysl-optparse (~> 2.0) - rubysl-uri (2.0.0) - rubysl-weakref (2.0.0) - rubysl-webrick (2.0.0) - rubysl-xmlrpc (2.0.0) - rubysl-yaml (2.0.3) - rubysl-zlib (2.0.1) - shindo (0.3.4) - formatador (>= 0.1.1) - sinatra (1.3.2) - rack (~> 1.3, >= 1.3.6) - rack-protection (~> 1.2) - tilt (~> 1.3, >= 1.3.3) - sinatra-contrib (1.3.2) - backports (>= 2.0) - eventmachine - rack-protection - rack-test - sinatra (~> 1.3.0) - tilt (~> 1.3) - tilt (1.3.3) - unicorn (4.8.3) - kgio (~> 2.6) - rack - raindrops (~> 0.7) - -PLATFORMS - java - ruby - -DEPENDENCIES - activesupport - delorean - eventmachine (>= 1.0.4) - excon! - jruby-openssl (~> 0.9) - json (>= 1.8.5) - open4 - puma - rack (~> 1.6) - rake - rdoc - rspec (>= 3.5.0) - rubysl (~> 2.0) - shindo - sinatra - sinatra-contrib - unicorn - -BUNDLED WITH - 1.15.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2017-09-05 21:43:31.000000000 +0200 +++ new/README.md 2017-12-15 21:15:57.000000000 +0100 @@ -215,6 +215,13 @@ By default, each call to `requests` will use a separate persistent socket connection. To make multiple `requests` calls using a single persistent connection, set `:persistent => true` when establishing the connection. +For large numbers of simultaneous requests please consider using the `batch_requests` method. This will automatically slice up the requests into batches based on the file descriptor limit of your operating system. The results are the same as the `requests` method, but using this method can help prevent timeout errors. + +```ruby +large_array_of_requests = [{:method => :get, :path => 'some_path'}, { ... }] # Hundreds of items +connection.batch_requests(large_array_of_requests) +``` + ## Streaming Responses You can stream responses by passing a block that will receive each chunk. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 2017-09-05 21:43:31.000000000 +0200 +++ new/Rakefile 2017-12-15 21:15:57.000000000 +0100 @@ -1,148 +1,18 @@ -require 'rubygems' -require 'rake' -require 'date' -include Rake::DSL -############################################################################# -# -# Helper functions -# -############################################################################# - -def name - @name ||= Dir['*.gemspec'].first.split('.').first -end - -def version - line = File.read("lib/#{name}/constants.rb")[/^\s*VERSION\s*=\s*.*/] - line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1] -end - -def date - Date.today.to_s -end - -def rubyforge_project - name -end - -def gemspec_file - "#{name}.gemspec" -end - -def gem_file - "#{name}-#{version}.gem" -end - -def replace_header(head, header_name) - head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"} -end - -############################################################################# -# -# Standard tasks -# -############################################################################# - require 'shindo/rake' -require "rspec/core/rake_task" - -RSpec::Core::RakeTask.new(:spec, :format) do |t, args| - format = args[:format] || 'doc' - t.rspec_opts = ["-c", "-f #{format}", "-r ./spec/spec_helper.rb"] - t.pattern = 'spec/**/*_spec.rb' -end - - -Shindo::Rake.new - -task :default => [ :tests, :test] -task :test => :spec - +require 'rspec/core/rake_task' +require 'bundler/gem_tasks' require 'rdoc/task' -Rake::RDocTask.new do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = "#{name} #{version}" - rdoc.rdoc_files.include('README*') - rdoc.rdoc_files.include('lib/**/*.rb') -end - -desc "Open an irb session preloaded with this library" -task :console do - sh "irb -rubygems -r ./lib/#{name}.rb" -end - -############################################################################# -# -# Custom tasks (add your own tasks here) -# -############################################################################# - - - -############################################################################# -# -# Packaging tasks -# -############################################################################# - -task :release => [:update_certs, :build] do - unless `git branch` =~ /^\* master$/ - puts "You must be on the master branch to release!" - exit! - end - sh "gem install pkg/#{name}-#{version}.gem" - sh "git commit --allow-empty -a -m 'Release #{version}'" - sh "git tag v#{version}" - sh "git push origin master" - sh "git push origin v#{version}" - sh "gem push pkg/#{name}-#{version}.gem" -end -task :build => :gemspec do - sh "mkdir -p pkg" - sh "gem build #{gemspec_file}" - sh "mv #{gem_file} pkg" -end +Shindo::Rake.new -task :gemspec => :validate do - # read spec file and split out manifest section - spec = File.read(gemspec_file) - head, manifest, tail = spec.split(" # = MANIFEST =\n") - - # replace name version and date - replace_header(head, :name) - replace_header(head, :version) - replace_header(head, :date) - #comment this out if your rubyforge_project has a different name - replace_header(head, :rubyforge_project) - - # determine file list from git ls-files - files = `git ls-files`. - split("\n"). - sort. - reject { |file| file =~ /^\./ }. - reject { |file| file =~ /^(rdoc|pkg)/ }. - map { |file| " #{file}" }. - join("\n") - - # piece file back together and write - manifest = " s.files = %w[\n#{files}\n ]\n" - spec = [head, manifest, tail].join(" # = MANIFEST =\n") - File.open(gemspec_file, 'w') { |io| io.write(spec) } - puts "Updated #{gemspec_file}" +RSpec::Core::RakeTask.new(:spec, :format) do |t, args| + format = args[:format] || 'doc' + t.rspec_opts = ["-c", "-f #{format}", "-r ./spec/spec_helper.rb"] + t.pattern = 'spec/**/*_spec.rb' end -task :validate do - libfiles = Dir['lib/*'] - ["lib/#{name}.rb", "lib/#{name}"] - unless libfiles.empty? - puts "Directory `lib` should only contain a `#{name}.rb` file and `#{name}` dir." - exit! - end - unless Dir['VERSION*'].empty? - puts "A `VERSION` file at root level violates Gem best practices." - exit! - end -end +task :default => [:tests, :test] +task :test => :spec desc "update bundled certs" task :update_certs do @@ -158,6 +28,10 @@ sh "openssl req -subj '/CN=127.0.0.1/O=excon' -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout tests/data/127.0.0.1.cert.key -out tests/data/127.0.0.1.cert.crt" end +desc "Open an irb session preloaded with this library" +task :console do + sh "irb -rubygems -r ./lib/#{name}.rb" +end desc "check ssl settings" task :hows_my_ssl do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/changelog.txt new/changelog.txt --- old/changelog.txt 2017-09-05 21:43:31.000000000 +0200 +++ new/changelog.txt 2017-12-15 21:15:57.000000000 +0100 @@ -1,3 +1,12 @@ +0.60.0 2017-12-15 +================= + +add requests_in_batches +cleanup rakefile, gemfile, etc +add logger/logger= and logging instrumentor +rewind response_block in idempotent instrumentor + + 0.59.0 2017-09-05 ================= Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/excon.gemspec new/excon.gemspec --- old/excon.gemspec 2017-09-05 21:43:31.000000000 +0200 +++ new/excon.gemspec 2017-12-15 21:15:57.000000000 +0100 @@ -1,59 +1,19 @@ -## This is the rakegem gemspec template. Make sure you read and understand -## all of the comments. Some sections require modification, and others can -## be deleted if you don't need them. Once you understand the contents of -## this file, feel free to delete any comments that begin with two hash marks. -## You can find comprehensive Gem::Specification documentation, at -## http://docs.rubygems.org/read/chapter/20 -Gem::Specification.new do |s| - s.specification_version = 2 if s.respond_to? :specification_version= - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.rubygems_version = '1.3.5' - - ## Leave these as is they will be modified for you by the rake gemspec task. - ## If your rubyforge_project name is different, then edit it and comment out - ## the sub! line in the Rakefile - s.name = 'excon' - s.version = '0.59.0' - s.date = '2017-09-05' - s.rubyforge_project = 'excon' - - ## Make sure your summary is short. The description may be as long - ## as you like. - s.summary = "speed, persistence, http(s)" - s.description = "EXtended http(s) CONnections" - - ## List the primary authors. If there are a bunch of authors, it's probably - ## better to set the email to an email list or something. If you don't have - ## a custom homepage, consider using your GitHub URL or the like. - s.authors = ["dpiddy (Dan Peterson)", "geemus (Wesley Beary)", "nextmat (Matt Sanders)"] - s.email = 'gee...@gmail.com' - s.homepage = 'https://github.com/excon/excon' - s.license = 'MIT' - - ## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as - ## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb' - s.require_paths = %w[lib] +require File.join(File.dirname(__FILE__), 'lib', 'excon', 'version') - ## This sections is only necessary if you have C extensions. - # s.require_paths << 'ext' - # s.extensions = %w[ext/extconf.rb] - - ## If your gem includes any executables, list them here. - # s.executables = ["name"] - # s.default_executable = 'name' - - ## Specify any RDoc options here. You'll want to add your README and - ## LICENSE files to the extra_rdoc_files list. - s.rdoc_options = ["--charset=UTF-8"] - s.extra_rdoc_files = %w[README.md] - - ## List your runtime dependencies here. Runtime dependencies are those - ## that are needed for an end user to actually USE your code. - # s.add_dependency('DEPNAME', [">= 1.1.0", "< 2.0.0"]) +Gem::Specification.new do |s| + s.name = 'excon' + s.version = Excon::VERSION + s.summary = "speed, persistence, http(s)" + s.description = "EXtended http(s) CONnections" + s.authors = ["dpiddy (Dan Peterson)", "geemus (Wesley Beary)", "nextmat (Matt Sanders)"] + s.email = 'gee...@gmail.com' + s.homepage = 'https://github.com/excon/excon' + s.license = 'MIT' + s.rdoc_options = ["--charset=UTF-8"] + s.extra_rdoc_files = %w[README.md CONTRIBUTORS.md CONTRIBUTING.md] + s.files = `git ls-files -z`.split("\x0") + s.test_files = s.files.select { |path| path =~ /^[spec|tests]\/.*_[spec|tests]\.rb/ } - ## List your development dependencies here. Development dependencies are - ## those that are only needed during development - # s.add_development_dependency('DEVDEPNAME', [">= 1.1.0", "< 2.0.0"]) s.add_development_dependency('rspec', '>= 3.5.0') s.add_development_dependency('activesupport') s.add_development_dependency('delorean') @@ -65,138 +25,5 @@ s.add_development_dependency('sinatra') s.add_development_dependency('sinatra-contrib') s.add_development_dependency('json', '>= 1.8.5') - if RUBY_VERSION.to_f >= 1.9 - s.add_development_dependency 'puma' - end - ## Leave this section as-is. It will be automatically generated from the - ## contents of your Git repository via the gemspec task. DO NOT REMOVE - ## THE MANIFEST COMMENTS, they are used as delimiters by the task. - # = MANIFEST = - s.files = %w[ - CONTRIBUTING.md - CONTRIBUTORS.md - Gemfile - Gemfile.lock - LICENSE.md - README.md - Rakefile - benchmarks/class_vs_lambda.rb - benchmarks/concat_vs_insert.rb - benchmarks/concat_vs_interpolate.rb - benchmarks/cr_lf.rb - benchmarks/downcase-eq-eq_vs_casecmp.rb - benchmarks/excon.rb - benchmarks/excon_vs.rb - benchmarks/for_vs_array_each.rb - benchmarks/for_vs_hash_each.rb - benchmarks/has_key-vs-lookup.rb - benchmarks/headers_case_sensitivity.rb - benchmarks/headers_split_vs_match.rb - benchmarks/implicit_block-vs-explicit_block.rb - benchmarks/merging.rb - benchmarks/single_vs_double_quotes.rb - benchmarks/string_ranged_index.rb - benchmarks/strip_newline.rb - benchmarks/vs_stdlib.rb - changelog.txt - data/cacert.pem - excon.gemspec - lib/excon.rb - lib/excon/connection.rb - lib/excon/constants.rb - lib/excon/error.rb - lib/excon/extensions/uri.rb - lib/excon/headers.rb - lib/excon/middlewares/base.rb - lib/excon/middlewares/capture_cookies.rb - lib/excon/middlewares/decompress.rb - lib/excon/middlewares/escape_path.rb - lib/excon/middlewares/expects.rb - lib/excon/middlewares/idempotent.rb - lib/excon/middlewares/instrumentor.rb - lib/excon/middlewares/mock.rb - lib/excon/middlewares/redirect_follower.rb - lib/excon/middlewares/response_parser.rb - lib/excon/pretty_printer.rb - lib/excon/response.rb - lib/excon/socket.rb - lib/excon/ssl_socket.rb - lib/excon/standard_instrumentor.rb - lib/excon/test/plugin/server/exec.rb - lib/excon/test/plugin/server/puma.rb - lib/excon/test/plugin/server/unicorn.rb - lib/excon/test/plugin/server/webrick.rb - lib/excon/test/server.rb - lib/excon/unix_socket.rb - lib/excon/utils.rb - spec/excon/error_spec.rb - spec/excon/test/server_spec.rb - spec/excon_spec.rb - spec/helpers/file_path_helpers.rb - spec/requests/basic_spec.rb - spec/requests/eof_requests_spec.rb - spec/requests/unix_socket_spec.rb - spec/spec_helper.rb - spec/support/shared_contexts/test_server_context.rb - spec/support/shared_examples/shared_example_for_clients.rb - spec/support/shared_examples/shared_example_for_streaming_clients.rb - spec/support/shared_examples/shared_example_for_test_servers.rb - tests/authorization_header_tests.rb - tests/bad_tests.rb - tests/basic_tests.rb - tests/complete_responses.rb - tests/data/127.0.0.1.cert.crt - tests/data/127.0.0.1.cert.key - tests/data/excon.cert.crt - tests/data/excon.cert.key - tests/data/xs - tests/error_tests.rb - tests/header_tests.rb - tests/middlewares/canned_response_tests.rb - tests/middlewares/capture_cookies_tests.rb - tests/middlewares/decompress_tests.rb - tests/middlewares/escape_path_tests.rb - tests/middlewares/idempotent_tests.rb - tests/middlewares/instrumentation_tests.rb - tests/middlewares/mock_tests.rb - tests/middlewares/redirect_follower_tests.rb - tests/pipeline_tests.rb - tests/proxy_tests.rb - tests/query_string_tests.rb - tests/rackups/basic.rb - tests/rackups/basic.ru - tests/rackups/basic_auth.ru - tests/rackups/deflater.ru - tests/rackups/proxy.ru - tests/rackups/query_string.ru - tests/rackups/redirecting.ru - tests/rackups/redirecting_with_cookie.ru - tests/rackups/request_headers.ru - tests/rackups/request_methods.ru - tests/rackups/response_header.ru - tests/rackups/ssl.ru - tests/rackups/ssl_mismatched_cn.ru - tests/rackups/ssl_verify_peer.ru - tests/rackups/streaming.ru - tests/rackups/thread_safety.ru - tests/rackups/timeout.ru - tests/rackups/webrick_patch.rb - tests/request_headers_tests.rb - tests/request_method_tests.rb - tests/request_tests.rb - tests/response_tests.rb - tests/servers/bad.rb - tests/servers/eof.rb - tests/servers/error.rb - tests/servers/good.rb - tests/test_helper.rb - tests/thread_safety_tests.rb - tests/timeout_tests.rb - tests/utils_tests.rb - ] - # = MANIFEST = - - ## Test files will be grabbed from the file list. Make sure the path glob - ## matches what you actually use. - s.test_files = s.files.select { |path| path =~ /^[spec|tests]\/.*_[spec|tests]\.rb/ } + s.add_development_dependency('puma') end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/connection.rb new/lib/excon/connection.rb --- old/lib/excon/connection.rb 2017-09-05 21:43:31.000000000 +0200 +++ new/lib/excon/connection.rb 2017-12-15 21:15:57.000000000 +0100 @@ -32,6 +32,16 @@ @data[:proxy] = new_proxy end + def logger + if @data[:instrumentor] && @data[:instrumentor].respond_to?(:logger) + @data[:instrumentor].logger + end + end + def logger=(logger) + Excon::LoggingInstrumentor.logger = logger + @data[:instrumentor] = Excon::LoggingInstrumentor + end + # Initializes a new Connection instance # @param [Hash<Symbol, >] params One or more optional params # @option params [String] :body Default text to be sent over a socket. Only used if :body absent in Connection#request params @@ -193,7 +203,7 @@ def response_call(datum) # ensure response_block is yielded to and body is empty from middlewares - if datum.has_key?(:response_block) && !datum[:response][:body].empty? + if datum.has_key?(:response_block) && !(datum[:response][:body].nil? || datum[:response][:body].empty?) response_body = datum[:response][:body].dup datum[:response][:body] = '' content_length = remaining = response_body.bytesize @@ -299,6 +309,21 @@ end responses + end + + # Sends the supplied requests to the destination host using pipelining in + # batches of @limit [Numeric] requests. This is your soft file descriptor + # limit by default, typically 256. + # @pipeline_params [Array<Hash>] pipeline_params An array of one or more optional params, override defaults set in Connection.new, see #request for details + def batch_requests(pipeline_params, limit = nil) + limit ||= Process.respond_to?(:getrlimit) ? Process.getrlimit(:NOFILE).first : 256 + responses = [] + + pipeline_params.each_slice(limit) do |params| + responses.concat(requests(params)) + end + + responses end def reset diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/constants.rb new/lib/excon/constants.rb --- old/lib/excon/constants.rb 2017-09-05 21:43:31.000000000 +0200 +++ new/lib/excon/constants.rb 2017-12-15 21:15:57.000000000 +0100 @@ -1,8 +1,6 @@ # frozen_string_literal: true module Excon - VERSION = '0.59.0' - CR_NL = "\r\n" DEFAULT_CA_FILE = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "data", "cacert.pem")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/instrumentors/logging_instrumentor.rb new/lib/excon/instrumentors/logging_instrumentor.rb --- old/lib/excon/instrumentors/logging_instrumentor.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/excon/instrumentors/logging_instrumentor.rb 2017-12-15 21:15:57.000000000 +0100 @@ -0,0 +1,59 @@ +require 'logger' + +module Excon + class LoggingInstrumentor + # Returns the Logger object for the LoggingInstrumentor. If one doesn't + # already exist, then one will be created using $stderr as the output + # stream. + # + def self.logger + @logger ||= Logger.new($stderr) + end + + # Sets the logger object for the LoggingInstrumentor. + # + def self.logger=(logger) + @logger = logger + end + + def self.instrument(name, params = {}, &block) + params = params.dup + + # reduce duplication/noise of output + params.delete(:connection) + params.delete(:stack) + + if params.has_key?(:headers) && params[:headers].has_key?('Authorization') + params[:headers] = params[:headers].dup + params[:headers]['Authorization'] = "REDACTED" + end + + if params.has_key?(:password) + params[:password] = "REDACTED" + end + + if name.include?('request') + info = "request: " + params[:scheme] + "://" + File.join(params[:host], params[:path]) + + if params[:query] + info << "?" + + if params[:query].is_a?(Hash) + info << params.to_a.map{ |key,value| "#{key}=#{value}" }.join('&') + else + info << params[:query] + end + end + else + response_type = name.split('.').last + if params[:body] + info = "#{response_type}: " + params[:body] + end + end + + self.logger.log(logger.level, info) if info + + yield if block_given? + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/instrumentors/standard_instrumentor.rb new/lib/excon/instrumentors/standard_instrumentor.rb --- old/lib/excon/instrumentors/standard_instrumentor.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/excon/instrumentors/standard_instrumentor.rb 2017-12-15 21:15:57.000000000 +0100 @@ -0,0 +1,28 @@ +# frozen_string_literal: true +module Excon + class StandardInstrumentor + def self.instrument(name, params = {}, &block) + params = params.dup + + # reduce duplication/noise of output + params.delete(:connection) + params.delete(:stack) + + if params.has_key?(:headers) && params[:headers].has_key?('Authorization') + params[:headers] = params[:headers].dup + params[:headers]['Authorization'] = REDACTED + end + + if params.has_key?(:password) + params[:password] = REDACTED + end + + $stderr.puts(name) + Excon::PrettyPrinter.pp($stderr, params) + + if block_given? + yield + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/middlewares/idempotent.rb new/lib/excon/middlewares/idempotent.rb --- old/lib/excon/middlewares/idempotent.rb 2017-09-05 21:43:31.000000000 +0200 +++ new/lib/excon/middlewares/idempotent.rb 2017-12-15 21:15:57.000000000 +0100 @@ -12,6 +12,9 @@ datum[:idempotent] = false end end + if datum.has_key?(:response_block) && datum[:response_block].respond_to?(:rewind) + datum[:response_block].rewind + end if datum.has_key?(:pipeline) Excon.display_warning("Excon requests can not be :idempotent when pipelining.") datum[:idempotent] = false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/standard_instrumentor.rb new/lib/excon/standard_instrumentor.rb --- old/lib/excon/standard_instrumentor.rb 2017-09-05 21:43:31.000000000 +0200 +++ new/lib/excon/standard_instrumentor.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,28 +0,0 @@ -# frozen_string_literal: true -module Excon - class StandardInstrumentor - def self.instrument(name, params = {}, &block) - params = params.dup - - # reduce duplication/noise of output - params.delete(:connection) - params.delete(:stack) - - if params.has_key?(:headers) && params[:headers].has_key?('Authorization') - params[:headers] = params[:headers].dup - params[:headers]['Authorization'] = REDACTED - end - - if params.has_key?(:password) - params[:password] = REDACTED - end - - $stderr.puts(name) - Excon::PrettyPrinter.pp($stderr, params) - - if block_given? - yield - end - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/version.rb new/lib/excon/version.rb --- old/lib/excon/version.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/excon/version.rb 2017-12-15 21:15:57.000000000 +0100 @@ -0,0 +1,4 @@ +# frozen_string_literal: true +module Excon + VERSION = '0.60.0' +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon.rb new/lib/excon.rb --- old/lib/excon.rb 2017-09-05 21:43:31.000000000 +0200 +++ new/lib/excon.rb 2017-12-15 21:15:57.000000000 +0100 @@ -12,6 +12,8 @@ require 'zlib' require 'stringio' +require 'excon/version' + require 'excon/extensions/uri' require 'excon/middlewares/base' @@ -35,7 +37,8 @@ require 'excon/pretty_printer' require 'excon/socket' require 'excon/ssl_socket' -require 'excon/standard_instrumentor' +require 'excon/instrumentors/standard_instrumentor' +require 'excon/instrumentors/logging_instrumentor' require 'excon/unix_socket' # Define defaults first so they will be available to other files diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2017-09-05 21:43:31.000000000 +0200 +++ new/metadata 2017-12-15 21:15:57.000000000 +0100 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: excon version: !ruby/object:Gem::Version - version: 0.59.0 + version: 0.60.0 platform: ruby authors: - dpiddy (Dan Peterson) @@ -10,7 +10,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2017-09-05 00:00:00.000000000 Z +date: 2017-12-15 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rspec @@ -186,11 +186,16 @@ extensions: [] extra_rdoc_files: - README.md +- CONTRIBUTORS.md +- CONTRIBUTING.md files: +- ".document" +- ".gitignore" +- ".rspec" +- ".travis.yml" - CONTRIBUTING.md - CONTRIBUTORS.md - Gemfile -- Gemfile.lock - LICENSE.md - README.md - Rakefile @@ -221,6 +226,8 @@ - lib/excon/error.rb - lib/excon/extensions/uri.rb - lib/excon/headers.rb +- lib/excon/instrumentors/logging_instrumentor.rb +- lib/excon/instrumentors/standard_instrumentor.rb - lib/excon/middlewares/base.rb - lib/excon/middlewares/capture_cookies.rb - lib/excon/middlewares/decompress.rb @@ -235,7 +242,6 @@ - lib/excon/response.rb - lib/excon/socket.rb - lib/excon/ssl_socket.rb -- lib/excon/standard_instrumentor.rb - lib/excon/test/plugin/server/exec.rb - lib/excon/test/plugin/server/puma.rb - lib/excon/test/plugin/server/unicorn.rb @@ -243,6 +249,7 @@ - lib/excon/test/server.rb - lib/excon/unix_socket.rb - lib/excon/utils.rb +- lib/excon/version.rb - spec/excon/error_spec.rb - spec/excon/test/server_spec.rb - spec/excon_spec.rb @@ -258,6 +265,7 @@ - tests/authorization_header_tests.rb - tests/bad_tests.rb - tests/basic_tests.rb +- tests/batch_requests.rb - tests/complete_responses.rb - tests/data/127.0.0.1.cert.crt - tests/data/127.0.0.1.cert.key @@ -327,9 +335,9 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubyforge_project: excon +rubyforge_project: rubygems_version: 2.6.13 signing_key: -specification_version: 2 +specification_version: 4 summary: speed, persistence, http(s) test_files: [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tests/batch_requests.rb new/tests/batch_requests.rb --- old/tests/batch_requests.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/tests/batch_requests.rb 2017-12-15 21:15:57.000000000 +0100 @@ -0,0 +1,133 @@ +require 'shindo' + +Shindo.tests('Batch Requests') do + with_server('good') do + tests('with batch request size 2') do + returns(%w{ 1 2 1 2 }, 'batch request size 2') do + connection = Excon.new('http://127.0.0.1:9292') + + ret = [] + ret << connection.batch_requests([ + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'} + ], 2).map(&:body) + + ret.flatten + end + end + + tests('peristent with batch request size 2') do + returns(%w{ 1 2 3 4 }, 'persistent batch request size 2') do + connection = Excon.new('http://127.0.0.1:9292', :persistent => true) + + ret = [] + ret << connection.batch_requests([ + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'} + ], 2).map(&:body) + + ret.flatten + end + end + + tests('with batch request size 3') do + returns(%w{ 1 2 3 1 }, 'batch request size 3') do + connection = Excon.new('http://127.0.0.1:9292') + + ret = [] + ret << connection.batch_requests([ + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'} + ], 3).map(&:body) + + ret.flatten + end + end + + tests('persistent with batch request size 3') do + returns(%w{ 1 2 3 4 }, 'persistent batch request size 3') do + connection = Excon.new('http://127.0.0.1:9292', :persistent => true) + + ret = [] + ret << connection.batch_requests([ + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'} + ], 3).map(&:body) + + ret.flatten + end + end + + tests('with batch request size 4') do + returns(%w{ 1 2 3 4 }, 'batch request size 4') do + connection = Excon.new('http://127.0.0.1:9292') + + ret = [] + ret << connection.batch_requests([ + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'} + ], 4).map(&:body) + + ret.flatten + end + end + + tests('persistent with batch request size 4') do + returns(%w{ 1 2 3 4 }, 'persistent batch request size 4') do + connection = Excon.new('http://127.0.0.1:9292', :persistent => true) + + ret = [] + ret << connection.batch_requests([ + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'} + ], 4).map(&:body) + + ret.flatten + end + end + + tests('with batch request size 8') do + returns(%w{ 1 2 3 4 }, 'batch request size 8') do + connection = Excon.new('http://127.0.0.1:9292') + + ret = [] + ret << connection.batch_requests([ + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'} + ], 8).map(&:body) + + ret.flatten + end + end + + tests('persistent with batch request size 8') do + returns(%w{ 1 2 3 4 }, 'persistent batch request size 8') do + connection = Excon.new('http://127.0.0.1:9292', :persistent => true) + + ret = [] + ret << connection.batch_requests([ + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'}, + {:method => :get, :path => '/echo/request_count'} + ], 8).map(&:body) + + ret.flatten + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tests/middlewares/idempotent_tests.rb new/tests/middlewares/idempotent_tests.rb --- old/tests/middlewares/idempotent_tests.rb 2017-09-05 21:43:31.000000000 +0200 +++ new/tests/middlewares/idempotent_tests.rb 2017-12-15 21:15:58.000000000 +0100 @@ -161,4 +161,46 @@ response.status end + class Block + attr_reader :rewound + def initialize + @rewound = false + end + def call(_) + end + def rewind + @rewound = true + end + end + + tests("request_block rewound").returns(true) do + run_count = 0 + Excon.stub({:method => :get}) { |params| + run_count += 1 + if run_count <= 1 # First call fails. + raise Excon::Errors::SocketError.new(Exception.new "Mock Error") + else + {:body => params[:body], :headers => params[:headers], :status => 200} + end + } + request_block = Block.new + @connection.request(:method => :get, :idempotent => true, :path => '/some-path', :request_block => request_block, :retry_limit => 2, :retry_interval => 0.1) + request_block.rewound + end + + tests("response_block rewound").returns(true) do + run_count = 0 + Excon.stub({:method => :get}) { |params| + run_count += 1 + if run_count <= 1 # First call fails. + raise Excon::Errors::SocketError.new(Exception.new "Mock Error") + else + {:body => params[:body], :headers => params[:headers], :status => 200} + end + } + response_block = Block.new + @connection.request(:method => :get, :idempotent => true, :path => '/some-path', :response_block => response_block, :retry_limit => 2, :retry_interval => 0.1) + response_block.rewound + end + end