Hello community, here is the log from the commit of package rubygem-slop for openSUSE:Factory checked in at 2016-10-10 16:22:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-slop (Old) and /work/SRC/openSUSE:Factory/.rubygem-slop.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-slop" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-slop/rubygem-slop.changes 2016-09-12 13:26:30.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-slop.new/rubygem-slop.changes 2016-10-10 16:22:38.000000000 +0200 @@ -1,0 +2,13 @@ +Sat Sep 10 04:39:20 UTC 2016 - coolo@suse.com + +- updated to version 4.4.1 + see installed CHANGELOG.md + + v4.4.1 (2016-08-21) + ------------------- + + Bug fixes: + * Handle bad constant names in `Slop.option_defined?`. #198 + (Ellen Marie Dash) + +------------------------------------------------------------------- Old: ---- slop-4.4.0.gem New: ---- slop-4.4.1.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-slop.spec ++++++ --- /var/tmp/diff_new_pack.M2awSI/_old 2016-10-10 16:22:42.000000000 +0200 +++ /var/tmp/diff_new_pack.M2awSI/_new 2016-10-10 16:22:42.000000000 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-slop -Version: 4.4.0 +Version: 4.4.1 Release: 0 %define mod_name slop %define mod_full_name %{mod_name}-%{version} ++++++ slop-4.4.0.gem -> slop-4.4.1.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2016-08-15 11:18:08.000000000 +0200 +++ new/CHANGELOG.md 2016-08-21 15:52:42.000000000 +0200 @@ -1,6 +1,13 @@ Changelog ========= +v4.4.1 (2016-08-21) +------------------- + +Bug fixes: + * Handle bad constant names in `Slop.option_defined?`. #198 + (Ellen Marie Dash) + v4.4.0 (2016-08-15) ------------------- Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/slop.rb new/lib/slop.rb --- old/lib/slop.rb 2016-08-15 11:18:08.000000000 +0200 +++ new/lib/slop.rb 2016-08-21 15:52:42.000000000 +0200 @@ -6,7 +6,7 @@ require 'slop/error' module Slop - VERSION = '4.4.0' + VERSION = '4.4.1' # Parse an array of options (defaults to ARGV). Accepts an # optional hash of configuration options and block. @@ -31,6 +31,10 @@ # Returns true if an option is defined. def self.option_defined?(name) const_defined?(string_to_option(name.to_s)) + rescue NameError + # If a NameError is raised, it wasn't a valid constant name, + # and thus couldn't have been defined. + false end # Example: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2016-08-15 11:18:08.000000000 +0200 +++ new/metadata 2016-08-21 15:52:42.000000000 +0200 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: slop version: !ruby/object:Gem::Version - version: 4.4.0 + version: 4.4.1 platform: ruby authors: - Lee Jarvis autorequire: bindir: bin cert_chain: [] -date: 2016-08-15 00:00:00.000000000 Z +date: 2016-08-21 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rake @@ -64,6 +64,7 @@ - test/options_test.rb - test/parser_test.rb - test/result_test.rb +- test/slop_test.rb - test/test_helper.rb - test/types_test.rb homepage: http://github.com/leejarvis/slop @@ -96,6 +97,7 @@ - test/options_test.rb - test/parser_test.rb - test/result_test.rb +- test/slop_test.rb - test/test_helper.rb - test/types_test.rb has_rdoc: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/slop_test.rb new/test/slop_test.rb --- old/test/slop_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/test/slop_test.rb 2016-08-21 15:52:42.000000000 +0200 @@ -0,0 +1,17 @@ +require "test_helper" + +describe Slop do + describe ".option_defined?" do + it "handles bad constant names" do + assert_equal false, Slop.option_defined?("Foo?Bar") + end + + it "returns false if the option is not defined" do + assert_equal false, Slop.option_defined?("Foo") + end + + it "returns true if the option is defined" do + assert_equal true, Slop.option_defined?("String") + end + end +end