New Upstream Snapshot - ruby-xpath

Ready changes

Summary

Merged new upstream version: 3.2.0+git20220413.1.445d0c5 (was: 3.2.0).

Resulting package

Built on 2023-01-19T07:25 (took 4m6s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots ruby-xpath

Lintian Result

Diff

diff --git a/.rubocop.yml b/.rubocop.yml
new file mode 100644
index 0000000..d6d14ff
--- /dev/null
+++ b/.rubocop.yml
@@ -0,0 +1,151 @@
+require:
+  - rubocop-rspec
+  - rubocop-performance
+  
+AllCops:
+  DisabledByDefault: false
+  TargetRubyVersion: 2.5
+  Exclude:
+      - 'xpath.gemspec'
+
+##### New Cops #####
+
+Layout/EmptyLinesAroundAttributeAccessor:
+  Enabled: true
+Layout/SpaceAroundMethodCallOperator:
+  Enabled: true
+Lint/DeprecatedOpenSSLConstant:
+  Enabled: true
+Lint/DuplicateElsifCondition:
+  Enabled: true
+Lint/MixedRegexpCaptureTypes:
+  Enabled: true
+Lint/RaiseException:
+  Enabled: true
+Lint/StructNewOverride:
+  Enabled: true
+Style/AccessorGrouping:
+  Enabled: true
+Style/ArrayCoercion:
+  Enabled: true
+Style/BisectedAttrAccessor:
+  Enabled: true
+Style/CaseLikeIf:
+  Enabled: true
+Style/ExponentialNotation:
+  Enabled: true
+Style/HashAsLastArrayItem:
+  Enabled: true
+Style/HashEachMethods:
+  Enabled: true
+Style/HashLikeCase:
+  Enabled: true
+Style/HashTransformKeys:
+  Enabled: true
+Style/HashTransformValues:
+  Enabled: true
+Style/RedundantAssignment:
+  Enabled: true
+Style/RedundantFetchBlock:
+  Enabled: true
+Style/RedundantFileExtensionInRequire:
+  Enabled: true
+Style/RedundantRegexpCharacterClass:
+  Enabled: true
+Style/RedundantRegexpEscape:
+  Enabled: true
+Style/SlicingWithRange:
+  Enabled: true
+Performance/AncestorsInclude:
+  Enabled: true
+Performance/BigDecimalWithNumericArgument:
+  Enabled: true
+Performance/RedundantSortBlock:
+  Enabled: true
+Performance/RedundantStringChars:
+  Enabled: true
+Performance/ReverseFirst:
+  Enabled: true
+Performance/SortReverse:
+  Enabled: true
+Performance/Squeeze:
+  Enabled: true
+Performance/StringInclude:
+  Enabled: true
+
+#################### Lint ################################
+
+Layout/LineLength:
+  Exclude:
+    - 'spec/**/*'
+  Max: 120
+  Enabled: false
+
+Metrics/BlockLength:
+  Exclude:
+    - 'spec/**/*'
+
+Metrics/AbcSize:
+  Enabled: false
+
+Metrics/ClassLength:
+  CountComments: false
+  Enabled: false
+
+Metrics/CyclomaticComplexity:
+  Enabled: false
+
+Metrics/MethodLength:
+  CountComments: false
+  Enabled: false
+
+Metrics/ModuleLength:
+  Enabled: false
+  CountComments: false
+
+Metrics/PerceivedComplexity:
+  Enabled: false
+
+Metrics/ParameterLists:
+  Enabled: false
+
+Layout/EndAlignment:
+  EnforcedStyleAlignWith: variable
+
+Style/Alias:
+  Enabled: false
+
+Style/Documentation:
+  Exclude:
+    - 'spec/**/*'
+  Enabled: false
+
+Style/EvenOdd:
+  Enabled: false
+
+Lint/BooleanSymbol:
+  Enabled: false
+
+Style/Attr:
+  Enabled: false
+
+Layout/AccessModifierIndentation:
+  EnforcedStyle: outdent
+
+RSpec/ExampleWording:
+  Enabled: false
+
+RSpec/InstanceVariable:
+  Enabled: false
+
+RSpec/ExampleLength:
+  Enabled: false
+
+RSpec/DescribedClass:
+  Enabled: false
+
+RSpec/DescribeClass:
+  Enabled: false
+
+RSpec/FilePath:
+  Enabled: false
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..feb5b20
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,13 @@
+env:
+  global:
+    - JAVA_OPTS=-Djava.security.egd=file:/dev/urandom
+
+rvm:
+  - 2.5
+  - 2.6
+  - 2.7
+  - jruby-9.2.12.0
+  
+
+before_install:
+  - gem update bundler
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..dad1130
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,71 @@
+# Change Log
+## 3.2.0 - 2018-10-15
+
+### Added
+
+- `lowercase`/`uppercase`
+- ability for `attr` to use names that aren't valid in XML but are in HTML
+
+## 3.1.0 - 2018-05-26
+
+### Added
+
+- `where`/`[]` with a nil parameter is now a no-op
+- `ends_with`
+
+## 3.0.0 - 2017-12-30
+
+### Breaking Changes
+
+- Remove xpath/html
+- Rename `name` to `qname`, closes #76
+
+### Added
+
+- Contains word function for matching space separated attributes
+- Unary band as alias of `not`
+- `not_equals`
+
+### Fixed
+
+- None
+
+## 2.1.0 - 2017-05-25
+
+No documentation yet. Contributions welcome!
+
+## 2.0.0 - 2013-04-09
+
+No documentation yet. Contributions welcome!
+
+## 2.0.0.beta1 - 2013-03-16
+
+No documentation yet. Contributions welcome!
+
+## 1.0.0 - 2012-11-14
+
+No documentation yet. Contributions welcome!
+
+## 1.0.0.beta1 - 2012-07-13
+
+No documentation yet. Contributions welcome!
+
+## 0.1.4 - 2011-04-24
+
+No documentation yet. Contributions welcome!
+
+## 0.1.3 - 2011-01-08
+
+No documentation yet. Contributions welcome!
+
+## 0.1.2 - 2010-10-07
+
+No documentation yet. Contributions welcome!
+
+## 0.1.1 - 2010-10-05
+
+No documentation yet. Contributions welcome!
+
+## 0.1.0 - 2010-08-14
+
+No documentation yet. Contributions welcome!
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..7f4f5e9
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+source 'https://rubygems.org'
+
+gemspec
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..0fd24be
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Jonas Nicklas
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..55ed35f
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+require 'bundler/gem_tasks'
+require 'rspec/core/rake_task'
+require 'yard'
+
+desc 'Run all examples'
+RSpec::Core::RakeTask.new(:spec) do |t|
+  # t.rspec_path = 'bin/rspec'
+  t.rspec_opts = %w[--color]
+end
+
+YARD::Rake::YardocTask.new do |t|
+  t.files = ['lib/**/*.rb', 'README.md']
+  # t.options = ['--any', '--extra', '--opts'] # optional
+end
+
+task default: :spec
diff --git a/debian/changelog b/debian/changelog
index 19bd1df..33346b6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-ruby-xpath (3.2.0-2) UNRELEASED; urgency=medium
+ruby-xpath (3.2.0+git20220413.1.445d0c5-1) UNRELEASED; urgency=medium
 
   [ Utkarsh Gupta ]
   * Add salsa-ci.yml
@@ -18,8 +18,9 @@ ruby-xpath (3.2.0-2) UNRELEASED; urgency=medium
     + Build-Depends: Drop versioned constraint on ruby-nokogiri.
     + ruby-xpath: Drop versioned constraint on ruby-nokogiri in Depends.
   * Update standards version to 4.6.1, no changes needed.
+  * New upstream snapshot.
 
- -- Utkarsh Gupta <guptautkarsh2102@gmail.com>  Tue, 13 Aug 2019 08:19:06 +0530
+ -- Utkarsh Gupta <guptautkarsh2102@gmail.com>  Thu, 19 Jan 2023 07:22:47 -0000
 
 ruby-xpath (3.2.0-1) unstable; urgency=medium
 
diff --git a/gem-public_cert.pem b/gem-public_cert.pem
new file mode 100644
index 0000000..883d1dd
--- /dev/null
+++ b/gem-public_cert.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDhTCCAm2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMRYwFAYDVQQDDA1qb25h
+cy5uaWNrbGFzMRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZ
+FgNjb20wHhcNMTMwMzE2MDEzMTExWhcNMTQwMzE2MDEzMTExWjBEMRYwFAYDVQQD
+DA1qb25hcy5uaWNrbGFzMRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJ
+k/IsZAEZFgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC+B9mx
+0TVkvXIN31JC4s4Ni6mchJL/98h+euMIENt5LoxceYlijP0nGdYHAMoA2CUl7E+J
+/Km3W1ziSC0Mr3YIqCwp4fygP1woyRKRYmoyBRZdW5JiPAQzYxXaib0+BCB+JhSm
+Rev2+BaHJuRRKWq+S3bzZ61U6RMVp/tAfeInXOQdvm3ycyhOGWx6XpEW2ON6oRDl
+mBuAM8b9hjpOAzFXh3OLXBC9zq5Z5pl2frlfAVB2hKztwiEiNkGjx/qBXixvo7du
+Mx+O296WpLuuWwrOaIsR3Q37aNvLBvieh74D9QJjcwR3Mr0RRQLbXxNGsSQa6gY4
+l9j0EtUVSDZB54H5AgMBAAGjgYEwfzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAd
+BgNVHQ4EFgQUf8GtjwnaRtSqgvJDzCc3Ta7LHMswIgYDVR0RBBswGYEXam9uYXMu
+bmlja2xhc0BnbWFpbC5jb20wIgYDVR0SBBswGYEXam9uYXMubmlja2xhc0BnbWFp
+bC5jb20wDQYJKoZIhvcNAQEFBQADggEBAGlsnpcev4fu+FDAygbObfc73pltKnQF
+Ewy88+HgJ4AhjwHER7OWDVMwh6vHkmEep1rhLnNWGztD/ym5iFk4FGIz1D5J7TqQ
+k4v2w+Oje3YW/pSAGgAVPGCCrlqiw4hKZUzPob8NWhuS4tKDPWMGBQx3ZSRyqILc
+/WQ/FmnbVa9xRUo+RWiP9TpzKQJiR3BP9OpVrRx13m0euFxzTi6ikJzC45Q3Dq5V
+iQxUmCCRsJVcsSFORJLdWNVqzBOWZRnqrLDunzouCbcqziNWk8KqjZCr5itRi319
+/2kZgwc32FHlCdCBXkhElEHT/bGCFk2+ajnmWRtqZpz/poTgEehiIUY=
+-----END CERTIFICATE-----
diff --git a/lib/xpath/expression.rb b/lib/xpath/expression.rb
index fd3a61b..bd19303 100644
--- a/lib/xpath/expression.rb
+++ b/lib/xpath/expression.rb
@@ -3,6 +3,7 @@
 module XPath
   class Expression
     attr_accessor :expression, :arguments
+
     include XPath::DSL
 
     def initialize(expression, *arguments)
diff --git a/lib/xpath/literal.rb b/lib/xpath/literal.rb
index 42620da..ba2b6ee 100644
--- a/lib/xpath/literal.rb
+++ b/lib/xpath/literal.rb
@@ -3,6 +3,7 @@
 module XPath
   class Literal
     attr_reader :value
+
     def initialize(value)
       @value = value
     end
diff --git a/lib/xpath/renderer.rb b/lib/xpath/renderer.rb
index 199b3f9..af3f459 100644
--- a/lib/xpath/renderer.rb
+++ b/lib/xpath/renderer.rb
@@ -120,7 +120,7 @@ module XPath
     end
 
     def valid_xml_name?(name)
-      name =~ /^[a-zA-Z_:][a-zA-Z0-9_:\.\-]*$/
+      name =~ /^[a-zA-Z_:][a-zA-Z0-9_:.\-]*$/
     end
   end
 end
diff --git a/spec/xpath_spec.rb b/spec/xpath_spec.rb
index a9c714b..2006cc5 100644
--- a/spec/xpath_spec.rb
+++ b/spec/xpath_spec.rb
@@ -452,7 +452,7 @@ describe XPath do
 
   describe '#last' do
     it 'returns the number of elements in the context' do
-      @results = xpath { |x| x.descendant(:p)[XPath.position() == XPath.last()] }
+      @results = xpath { |x| x.descendant(:p)[XPath.position == XPath.last] }
       @results[0].text.should eq 'Bax'
       @results[1].text.should eq 'Blah'
       @results[2].text.should eq 'llama'
@@ -461,7 +461,7 @@ describe XPath do
 
   describe '#position' do
     it 'returns the position of elements in the context' do
-      @results = xpath { |x| x.descendant(:p)[XPath.position() == 2] }
+      @results = xpath { |x| x.descendant(:p)[XPath.position == 2] }
       @results[0].text.should eq 'Bax'
       @results[1].text.should eq 'Bax'
     end
@@ -476,7 +476,7 @@ describe XPath do
 
   describe '#lte' do
     it 'checks lesser than or equal' do
-      @results = xpath { |x| x.descendant(:p)[XPath.position() <= 2] }
+      @results = xpath { |x| x.descendant(:p)[XPath.position <= 2] }
       @results[0].text.should eq 'Blah'
       @results[1].text.should eq 'Bax'
       @results[2][:title].should eq 'gorilla'
@@ -486,7 +486,7 @@ describe XPath do
 
   describe '#lt' do
     it 'checks lesser than' do
-      @results = xpath { |x| x.descendant(:p)[XPath.position() < 2] }
+      @results = xpath { |x| x.descendant(:p)[XPath.position < 2] }
       @results[0].text.should eq 'Blah'
       @results[1][:title].should eq 'gorilla'
     end
@@ -494,7 +494,7 @@ describe XPath do
 
   describe '#gte' do
     it 'checks greater than or equal' do
-      @results = xpath { |x| x.descendant(:p)[XPath.position() >= 2] }
+      @results = xpath { |x| x.descendant(:p)[XPath.position >= 2] }
       @results[0].text.should eq 'Bax'
       @results[1][:title].should eq 'monkey'
       @results[2].text.should eq 'Bax'
@@ -504,7 +504,7 @@ describe XPath do
 
   describe '#gt' do
     it 'checks greater than' do
-      @results = xpath { |x| x.descendant(:p)[XPath.position() > 2] }
+      @results = xpath { |x| x.descendant(:p)[XPath.position > 2] }
       @results[0][:title].should eq 'monkey'
       @results[1].text.should eq 'Blah'
     end
@@ -512,7 +512,7 @@ describe XPath do
 
   describe '#plus' do
     it 'adds stuff' do
-      @results = xpath { |x| x.descendant(:p)[XPath.position().plus(1) == 2] }
+      @results = xpath { |x| x.descendant(:p)[XPath.position.plus(1) == 2] }
       @results[0][:id].should eq 'fooDiv'
       @results[1][:title].should eq 'gorilla'
     end
@@ -520,7 +520,7 @@ describe XPath do
 
   describe '#minus' do
     it 'subtracts stuff' do
-      @results = xpath { |x| x.descendant(:p)[XPath.position().minus(1) == 0] }
+      @results = xpath { |x| x.descendant(:p)[XPath.position.minus(1) == 0] }
       @results[0][:id].should eq 'fooDiv'
       @results[1][:title].should eq 'gorilla'
     end
@@ -528,7 +528,7 @@ describe XPath do
 
   describe '#multiply' do
     it 'multiplies stuff' do
-      @results = xpath { |x| x.descendant(:p)[XPath.position() * 3 == 3] }
+      @results = xpath { |x| x.descendant(:p)[XPath.position * 3 == 3] }
       @results[0][:id].should eq 'fooDiv'
       @results[1][:title].should eq 'gorilla'
     end
@@ -536,7 +536,7 @@ describe XPath do
 
   describe '#divide' do
     it 'divides stuff' do
-      @results = xpath { |x| x.descendant(:p)[XPath.position() / 2 == 1] }
+      @results = xpath { |x| x.descendant(:p)[XPath.position / 2 == 1] }
       @results[0].text.should eq 'Bax'
       @results[1].text.should eq 'Bax'
     end
@@ -544,7 +544,7 @@ describe XPath do
 
   describe '#mod' do
     it 'take modulo' do
-      @results = xpath { |x| x.descendant(:p)[XPath.position() % 2 == 1] }
+      @results = xpath { |x| x.descendant(:p)[XPath.position % 2 == 1] }
       @results[0].text.should eq 'Blah'
       @results[1][:title].should eq 'monkey'
       @results[2][:title].should eq 'gorilla'
diff --git a/xpath.gemspec b/xpath.gemspec
index 28b56a4..dd91680 100644
--- a/xpath.gemspec
+++ b/xpath.gemspec
@@ -1,48 +1,31 @@
-#########################################################
-# This file has been automatically generated by gem2tgz #
-#########################################################
-# -*- encoding: utf-8 -*-
-# stub: xpath 3.2.0 ruby lib
+# frozen_string_literal: true
+
+lib = File.expand_path('lib', File.dirname(__FILE__))
+$:.unshift lib unless $:.include?(lib)
+require 'xpath/version'
 
 Gem::Specification.new do |s|
-  s.name = "xpath".freeze
-  s.version = "3.2.0"
-
-  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
-  s.require_paths = ["lib".freeze]
-  s.authors = ["Jonas Nicklas".freeze]
-  s.cert_chain = ["gem-public_cert.pem".freeze]
-  s.date = "2018-10-15"
-  s.description = "XPath is a Ruby DSL for generating XPath expressions".freeze
-  s.email = ["jonas.nicklas@gmail.com".freeze]
-  s.files = ["README.md".freeze, "lib/xpath.rb".freeze, "lib/xpath/dsl.rb".freeze, "lib/xpath/expression.rb".freeze, "lib/xpath/literal.rb".freeze, "lib/xpath/renderer.rb".freeze, "lib/xpath/union.rb".freeze, "lib/xpath/version.rb".freeze, "spec/fixtures/form.html".freeze, "spec/fixtures/simple.html".freeze, "spec/fixtures/stuff.html".freeze, "spec/spec_helper.rb".freeze, "spec/union_spec.rb".freeze, "spec/xpath_spec.rb".freeze]
-  s.homepage = "https://github.com/teamcapybara/xpath".freeze
-  s.licenses = ["MIT".freeze]
-  s.required_ruby_version = Gem::Requirement.new(">= 2.3".freeze)
-  s.rubygems_version = "2.5.2.1".freeze
-  s.summary = "Generate XPath expressions from Ruby".freeze
-
-  if s.respond_to? :specification_version then
-    s.specification_version = 4
-
-    if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
-      s.add_runtime_dependency(%q<nokogiri>.freeze, ["~> 1.8"])
-      s.add_development_dependency(%q<pry>.freeze, [">= 0"])
-      s.add_development_dependency(%q<rake>.freeze, [">= 0"])
-      s.add_development_dependency(%q<rspec>.freeze, ["~> 3.0"])
-      s.add_development_dependency(%q<yard>.freeze, [">= 0.5.8"])
-    else
-      s.add_dependency(%q<nokogiri>.freeze, ["~> 1.8"])
-      s.add_dependency(%q<pry>.freeze, [">= 0"])
-      s.add_dependency(%q<rake>.freeze, [">= 0"])
-      s.add_dependency(%q<rspec>.freeze, ["~> 3.0"])
-      s.add_dependency(%q<yard>.freeze, [">= 0.5.8"])
-    end
-  else
-    s.add_dependency(%q<nokogiri>.freeze, ["~> 1.8"])
-    s.add_dependency(%q<pry>.freeze, [">= 0"])
-    s.add_dependency(%q<rake>.freeze, [">= 0"])
-    s.add_dependency(%q<rspec>.freeze, ["~> 3.0"])
-    s.add_dependency(%q<yard>.freeze, [">= 0.5.8"])
-  end
+  s.name = 'xpath'
+  s.version = XPath::VERSION
+  s.required_ruby_version = '>= 2.5'
+
+  s.authors = ['Jonas Nicklas']
+  s.email = ['jonas.nicklas@gmail.com']
+  s.description = 'XPath is a Ruby DSL for generating XPath expressions'
+  s.license = 'MIT'
+
+  s.files = Dir.glob('lib/**/*') + %w[README.md] + %w[LICENSE]
+
+  s.homepage = 'https://github.com/teamcapybara/xpath'
+  s.summary = 'Generate XPath expressions from Ruby'
+
+  s.add_dependency('nokogiri', ['~> 1.8'])
+
+  s.add_development_dependency('pry')
+  s.add_development_dependency('rake')
+  s.add_development_dependency('rspec', ['~> 3.0'])
+  s.add_development_dependency('yard', ['>= 0.5.8'])
+
+  s.signing_key = 'gem-private_key.pem' if File.exist?('gem-private_key.pem')
+  s.cert_chain = ['gem-public_cert.pem']
 end

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/share/doc/ruby-xpath/changelog.gz

Control files: lines which differ (wdiff format)

  • Ruby-Versions: all

More details

Full run details