Hello community,
here is the log from the commit of package rubygem-addressable for openSUSE:Factory checked in at 2019-09-04 09:34:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-addressable (Old)
and /work/SRC/openSUSE:Factory/.rubygem-addressable.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-addressable"
Wed Sep 4 09:34:00 2019 rev:20 rq:728020 version:2.7.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-addressable/rubygem-addressable.changes 2019-08-29 17:19:31.223347432 +0200
+++ /work/SRC/openSUSE:Factory/.rubygem-addressable.new.7948/rubygem-addressable.changes 2019-09-04 09:34:07.386709380 +0200
@@ -1,0 +2,12 @@
+Mon Sep 2 07:45:01 UTC 2019 - Dan Čermák
+
+- New upstream release 2.7.0
+
+ * added `:compacted` flag to `normalized_query`
+ * `heuristic_parse` handles `mailto:` more intuitively
+ * refactored validation to use a prepended module
+ * dropped explicit support for JRuby 9.0.5.0
+ * compatibility w/ public_suffix 4.x
+ * performance improvements
+
+-------------------------------------------------------------------
Old:
----
addressable-2.6.0.gem
New:
----
addressable-2.7.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-addressable.spec ++++++
--- /var/tmp/diff_new_pack.DGOl4K/_old 2019-09-04 09:34:08.070709229 +0200
+++ /var/tmp/diff_new_pack.DGOl4K/_new 2019-09-04 09:34:08.070709229 +0200
@@ -24,7 +24,7 @@
#
Name: rubygem-addressable
-Version: 2.6.0
+Version: 2.7.0
Release: 0
%define mod_name addressable
%define mod_full_name %{mod_name}-%{version}
@@ -41,17 +41,11 @@
Group: Development/Languages/Ruby
%description
-Addressable is a replacement for the URI implementation that is part of
-Ruby's standard library. It more closely conforms to the relevant RFCs and
-adds support for IRIs and URI templates.
+Addressable is an alternative implementation to the URI implementation that is
+part of Ruby's standard library. It is flexible, offers heuristic parsing, and
+additionally provides extensive support for IRIs and URI templates.
%prep
-# MANUAL
-# !!trully manual because gem2rpm doesn't support anything like this!!
-%gem_unpack
-sed -i 's/"< 4.0"/"< 5.0"/' %{mod_full_name}.gemspec
-%gem_build
-# /MANUAL
%build
++++++ addressable-2.6.0.gem -> addressable-2.7.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2019-01-18 08:16:17.000000000 +0100
+++ new/CHANGELOG.md 2019-08-31 05:32:55.000000000 +0200
@@ -1,3 +1,11 @@
+# Addressable 2.7.0
+- added `:compacted` flag to `normalized_query`
+- `heuristic_parse` handles `mailto:` more intuitively
+- refactored validation to use a prepended module
+- dropped explicit support for JRuby 9.0.5.0
+- compatibility w/ public_suffix 4.x
+- performance improvements
+
# Addressable 2.6.0
- added `tld=` method to allow assignment to the public suffix
- most `heuristic_parse` patterns are now case-insensitive
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Gemfile new/Gemfile
--- old/Gemfile 2019-01-18 08:16:17.000000000 +0100
+++ new/Gemfile 2019-08-31 05:32:55.000000000 +0200
@@ -3,8 +3,8 @@
gemspec
group :test do
- gem 'rspec', '~> 3.5'
- gem 'rspec-its', '~> 1.1'
+ gem 'rspec', '~> 3.8'
+ gem 'rspec-its', '~> 1.3'
end
group :development do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2019-01-18 08:16:17.000000000 +0100
+++ new/README.md 2019-08-31 05:32:55.000000000 +0200
@@ -19,9 +19,11 @@
# Description
-Addressable is a replacement for the URI implementation that is part of
-Ruby's standard library. It more closely conforms to RFC 3986, RFC 3987, and
-RFC 6570 (level 4), providing support for IRIs and URI templates.
+Addressable is an alternative implementation to the URI implementation
+that is part of Ruby's standard library. It is flexible, offers heuristic
+parsing, and additionally provides extensive support for IRIs and URI templates.
+
+Addressable closely conforms to RFC 3986, RFC 3987, and RFC 6570 (level 4).
# Reference
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile
--- old/Rakefile 2019-01-18 08:16:17.000000000 +0100
+++ new/Rakefile 2019-08-31 05:32:55.000000000 +0200
@@ -14,9 +14,9 @@
PKG_SUMMARY = "URI Implementation"
PKG_DESCRIPTION = <<-TEXT
-Addressable is a replacement for the URI implementation that is part of
-Ruby's standard library. It more closely conforms to the relevant RFCs and
-adds support for IRIs and URI templates.
+Addressable is an alternative implementation to the URI implementation that is
+part of Ruby's standard library. It is flexible, offers heuristic parsing, and
+additionally provides extensive support for IRIs and URI templates.
TEXT
PKG_FILES = FileList[
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/addressable/idna/pure.rb new/lib/addressable/idna/pure.rb
--- old/lib/addressable/idna/pure.rb 2019-01-18 08:16:17.000000000 +0100
+++ new/lib/addressable/idna/pure.rb 2019-08-31 05:32:55.000000000 +0200
@@ -135,7 +135,7 @@
unpacked.map! { |codepoint| lookup_unicode_lowercase(codepoint) }
return unpacked.pack("U*")
end
- (class <= HANGUL_LBASE && ch_one < HANGUL_LBASE + HANGUL_LCOUNT &&
@@ -214,7 +214,7 @@
return lookup_unicode_composition(p)
end
- (class < 0
- new_authority = authority.gsub(/\\/, '/').gsub(/ /, '%20')
+ new_authority = authority.tr("\\", "/").gsub(" ", "%20")
# NOTE: We want offset 4, not 3!
offset = match.offset(4)
uri = uri.dup
@@ -218,8 +218,9 @@
parsed = self.parse(hints[:scheme] + "://" + uri)
end
if parsed.path.include?(".")
- new_host = parsed.path[/^([^\/]+\.[^\/]*)/, 1]
- if new_host
+ if parsed.path[/\b@\b/]
+ parsed.scheme = "mailto" unless parsed.scheme
+ elsif new_host = parsed.path[/^([^\/]+\.[^\/]*)/, 1]
parsed.defer_validation do
new_path = parsed.path.sub(
Regexp.new("^" + Regexp.escape(new_host)), EMPTY_STR)
@@ -281,15 +282,15 @@
uri.path.sub!(/^\/?([a-zA-Z])[\|:][\\\/]/) do
"/#{$1.downcase}:/"
end
- uri.path.gsub!(/\\/, SLASH)
+ uri.path.tr!("\\", SLASH)
if File.exist?(uri.path) &&
File.stat(uri.path).directory?
- uri.path.sub!(/\/$/, EMPTY_STR)
+ uri.path.chomp!(SLASH)
uri.path = uri.path + '/'
end
# If the path is absolute, set the scheme and host.
- if uri.path =~ /^\//
+ if uri.path.start_with?(SLASH)
uri.scheme = "file"
uri.host = EMPTY_STR
end
@@ -327,6 +328,21 @@
end
##
+ # Tables used to optimize encoding operations in `self.encode_component`
+ # and `self.normalize_component`
+ SEQUENCE_ENCODING_TABLE = Hash.new do |hash, sequence|
+ hash[sequence] = sequence.unpack("C*").map do |c|
+ format("%02x", c)
+ end.join
+ end
+
+ SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE = Hash.new do |hash, sequence|
+ hash[sequence] = sequence.unpack("C*").map do |c|
+ format("%%%02X", c)
+ end.join
+ end
+
+ ##
# Percent encodes a URI component.
#
# @param [String, #to_str] component The URI component to encode.
@@ -392,12 +408,14 @@
component.force_encoding(Encoding::ASCII_8BIT)
# Avoiding gsub! because there are edge cases with frozen strings
component = component.gsub(character_class) do |sequence|
- (sequence.unpack('C*').map { |c| "%" + ("%02x" % c).upcase }).join
+ SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE[sequence]
end
if upcase_encoded.length > 0
- component = component.gsub(/%(#{upcase_encoded.chars.map do |char|
- char.unpack('C*').map { |c| '%02x' % c }.join
- end.join('|')})/i) { |s| s.upcase }
+ upcase_encoded_chars = upcase_encoded.chars.map do |char|
+ SEQUENCE_ENCODING_TABLE[char]
+ end
+ component = component.gsub(/%(#{upcase_encoded_chars.join('|')})/,
+ &:upcase)
end
return component
end
@@ -531,7 +549,7 @@
character_class = "#{character_class}%" unless character_class.include?('%')
"|%(?!#{leave_encoded.chars.map do |char|
- seq = char.unpack('C*').map { |c| '%02x' % c }.join
+ seq = SEQUENCE_ENCODING_TABLE[char]
[seq.upcase, seq.downcase]
end.flatten.join('|')})"
end
@@ -1172,7 +1190,7 @@
# Returns the top-level domain for this host.
#
# @example
- # Addressable::URI.parse("www.example.co.uk").tld # => "co.uk"
+ # Addressable::URI.parse("http://www.example.co.uk").tld # => "co.uk"
def tld
PublicSuffix.parse(self.host, ignore_private: true).tld
end
@@ -1182,7 +1200,7 @@
#
# @param [String, #to_str] new_tld The new top-level domain.
def tld=(new_tld)
- replaced_tld = domain.sub(/#{tld}\z/, new_tld)
+ replaced_tld = host.sub(/#{tld}\z/, new_tld)
self.host = PublicSuffix::Domain.new(replaced_tld).to_s
end
@@ -1190,7 +1208,7 @@
# Returns the public suffix domain for this host.
#
# @example
- # Addressable::URI.parse("www.example.co.uk").domain # => "example.co.uk"
+ # Addressable::URI.parse("http://www.example.co.uk").domain # => "example.co.uk"
def domain
PublicSuffix.domain(self.host, ignore_private: true)
end
@@ -1595,6 +1613,7 @@
# Make sure possible key-value pair delimiters are escaped.
modified_query_class.sub!("\\&", "").sub!("\\;", "")
pairs = (self.query || "").split("&", -1)
+ pairs.delete_if(&:empty?) if flags.include?(:compacted)
pairs.sort! if flags.include?(:sorted)
component = pairs.map do |pair|
Addressable::URI.normalize_component(pair, modified_query_class, "+")
@@ -1660,7 +1679,7 @@
# Treating '+' as a space was just an unbelievably bad idea.
# There was nothing wrong with '%20'!
# If it ain't broke, don't fix it!
- pair[1] = URI.unencode_component(pair[1].to_str.gsub(/\+/, " "))
+ pair[1] = URI.unencode_component(pair[1].to_str.tr("+", " "))
end
if return_type == Hash
accu[pair[0]] = pair[1]
@@ -1917,7 +1936,7 @@
# Section 5.2.3 of RFC 3986
#
# Removes the right-most path segment from the base path.
- if base_path =~ /\//
+ if base_path.include?(SLASH)
base_path.sub!(/\/[^\/]+$/, SLASH)
else
base_path = EMPTY_STR
@@ -2367,10 +2386,10 @@
#
# @param [Proc] block
# A set of operations to perform on a given URI.
- def defer_validation(&block)
- raise LocalJumpError, "No block given." unless block
+ def defer_validation
+ raise LocalJumpError, "No block given." unless block_given?
@validation_deferred = true
- block.call()
+ yield
@validation_deferred = false
validate
return nil
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/addressable/version.rb new/lib/addressable/version.rb
--- old/lib/addressable/version.rb 2019-01-18 08:16:17.000000000 +0100
+++ new/lib/addressable/version.rb 2019-08-31 05:32:55.000000000 +0200
@@ -23,7 +23,7 @@
module Addressable
module VERSION
MAJOR = 2
- MINOR = 6
+ MINOR = 7
TINY = 0
STRING = [MAJOR, MINOR, TINY].join('.')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2019-01-18 08:16:17.000000000 +0100
+++ new/metadata 2019-08-31 05:32:55.000000000 +0200
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: addressable
version: !ruby/object:Gem::Version
- version: 2.6.0
+ version: 2.7.0
platform: ruby
authors:
- Bob Aman
autorequire:
bindir: bin
cert_chain: []
-date: 2019-01-18 00:00:00.000000000 Z
+date: 2019-08-31 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: public_suffix
@@ -19,7 +19,7 @@
version: 2.0.2
- - "<"
- !ruby/object:Gem::Version
- version: '4.0'
+ version: '5.0'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@
version: 2.0.2
- - "<"
- !ruby/object:Gem::Version
- version: '4.0'
+ version: '5.0'
- !ruby/object:Gem::Dependency
name: bundler
requirement: !ruby/object:Gem::Requirement
@@ -51,9 +51,9 @@
- !ruby/object:Gem::Version
version: '3.0'
description: |
- Addressable is a replacement for the URI implementation that is part of
- Ruby's standard library. It more closely conforms to the relevant RFCs and
- adds support for IRIs and URI templates.
+ Addressable is an alternative implementation to the URI implementation that is
+ part of Ruby's standard library. It is flexible, offers heuristic parsing, and
+ additionally provides extensive support for IRIs and URI templates.
email: bob@sporkmonger.com
executables: []
extensions: []
@@ -108,7 +108,7 @@
version: '0'
requirements: []
rubyforge_project:
-rubygems_version: 2.5.1
+rubygems_version: 2.5.2.3
signing_key:
specification_version: 4
summary: URI Implementation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/addressable/uri_spec.rb new/spec/addressable/uri_spec.rb
--- old/spec/addressable/uri_spec.rb 2019-01-18 08:16:17.000000000 +0100
+++ new/spec/addressable/uri_spec.rb 2019-08-31 05:32:55.000000000 +0200
@@ -3944,7 +3944,7 @@
it "should raise an error if assigning a bogus object to the hostname" do
expect(lambda do
@uri.hostname = Object.new
- end).to raise_error
+ end).to raise_error(TypeError)
end
it "should have the correct port after assignment" do
@@ -4303,6 +4303,26 @@
end
end
+describe Addressable::URI, "when parsed from 'http://example/?b=1&a=2&c=3'" do
+ before do
+ @uri = Addressable::URI.parse("http://example/?b=1&a=2&c=3")
+ end
+
+ it "should have a sorted normalized query of 'a=2&b=1&c=3'" do
+ expect(@uri.normalized_query(:sorted)).to eq("a=2&b=1&c=3")
+ end
+end
+
+describe Addressable::URI, "when parsed from 'http://example/?&a&&c&'" do
+ before do
+ @uri = Addressable::URI.parse("http://example/?&a&&c&")
+ end
+
+ it "should have a compacted normalized query of 'a&c'" do
+ expect(@uri.normalized_query(:compacted)).to eq("a&c")
+ end
+end
+
describe Addressable::URI, "when parsed from " +
"'http://example.com/sound%2bvision'" do
before do
@@ -4417,7 +4437,7 @@
expect(lambda do
# This would create an invalid URI
@uri.authority = nil
- end).to raise_error
+ end).to raise_error(Addressable::URI::InvalidURIError)
end
end
@@ -4820,7 +4840,7 @@
it "should raise an error for invalid return type values" do
expect(lambda do
- @uri.query_values(Fixnum)
+ @uri.query_values(Integer)
end).to raise_error(ArgumentError)
end
@@ -5515,18 +5535,18 @@
end
context "which " do
- let (:uri) { Addressable::URI.parse("http://comrade.net/path/to/source/") }
+ let (:uri) { Addressable::URI.parse("http://www.comrade.net/path/to/source/") }
it "contains a subdomain" do
uri.tld = "co.uk"
- expect(uri.to_s).to eq("http://comrade.co.uk/path/to/source/")
+ expect(uri.to_s).to eq("http://www.comrade.co.uk/path/to/source/")
end
it "is part of the domain" do
uri.tld = "com"
- expect(uri.to_s).to eq("http://comrade.com/path/to/source/")
+ expect(uri.to_s).to eq("http://www.comrade.com/path/to/source/")
end
end
end
@@ -6352,6 +6372,44 @@
end
end
+describe Addressable::URI, "when given the input: 'user@domain.com'" do
+ before do
+ @input = "user@domain.com"
+ end
+
+ context "for heuristic parse" do
+ it "should remain 'mailto:user@domain.com'" do
+ uri = Addressable::URI.heuristic_parse("mailto:#{@input}")
+ expect(uri.to_s).to eq("mailto:user@domain.com")
+ end
+
+ it "should have a scheme of 'mailto'" do
+ uri = Addressable::URI.heuristic_parse(@input)
+ expect(uri.to_s).to eq("mailto:user@domain.com")
+ expect(uri.scheme).to eq("mailto")
+ end
+
+ it "should remain 'acct:user@domain.com'" do
+ uri = Addressable::URI.heuristic_parse("acct:#{@input}")
+ expect(uri.to_s).to eq("acct:user@domain.com")
+ end
+
+ context "HTTP" do
+ before do
+ @uri = Addressable::URI.heuristic_parse("http://#{@input}/")
+ end
+
+ it "should remain 'http://user@domain.com/'" do
+ expect(@uri.to_s).to eq("http://user@domain.com/")
+ end
+
+ it "should have the username 'user' for HTTP basic authentication" do
+ expect(@uri.user).to eq("user")
+ end
+ end
+ end
+end
+
describe Addressable::URI, "when assigning query values" do
before do
@uri = Addressable::URI.new
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tasks/gem.rake new/tasks/gem.rake
--- old/tasks/gem.rake 2019-01-18 08:16:17.000000000 +0100
+++ new/tasks/gem.rake 2019-08-31 05:32:55.000000000 +0200
@@ -20,10 +20,10 @@
exit(1)
end
- s.required_ruby_version = '>= 2.0'
+ s.required_ruby_version = ">= 2.0"
- s.add_runtime_dependency 'public_suffix', '>= 2.0.2', '< 4.0'
- s.add_development_dependency 'bundler', '>= 1.0', '< 3.0'
+ s.add_runtime_dependency "public_suffix", ">= 2.0.2", "< 5.0"
+ s.add_development_dependency "bundler", ">= 1.0", "< 3.0"
s.require_path = "lib"
@@ -42,7 +42,7 @@
desc "Generates .gemspec file"
task :gemspec do
spec_string = GEM_SPEC.to_ruby
- File.open("#{GEM_SPEC.name}.gemspec", 'w') do |file|
+ File.open("#{GEM_SPEC.name}.gemspec", "w") do |file|
file.write spec_string
end
end
@@ -72,9 +72,9 @@
desc "Reinstall the gem"
task :reinstall => [:uninstall, :install]
- desc 'Package for release'
+ desc "Package for release"
task :release => ["gem:package", "gem:gemspec"] do |t|
- v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
+ v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
abort "Versions don't match #{v} vs #{PROJ.version}" if v != PKG_VERSION
pkg = "pkg/#{GEM_SPEC.full_name}"