Hello community, here is the log from the commit of package rubygem-slop for openSUSE:Factory checked in at 2016-03-26 15:28:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2015-12-01 09:18:50.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-slop.new/rubygem-slop.changes 2016-03-26 18:14:34.000000000 +0100 @@ -1,0 +2,13 @@ +Sun Mar 20 05:32:11 UTC 2016 - co...@suse.com + +- updated to version 4.3.0 + see installed CHANGELOG.md + + v4.3.0 (2016-03-19) + ------------------- + + Features + * Allow disabling array delimiter. #189 (Mike Pastore) + * Allow passing custom banner as config. #191 (Philip Rees) + +------------------------------------------------------------------- Old: ---- slop-4.2.1.gem New: ---- slop-4.3.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-slop.spec ++++++ --- /var/tmp/diff_new_pack.LqH9lV/_old 2016-03-26 18:14:35.000000000 +0100 +++ /var/tmp/diff_new_pack.LqH9lV/_new 2016-03-26 18:14:35.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-slop # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 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-slop -Version: 4.2.1 +Version: 4.3.0 Release: 0 %define mod_name slop %define mod_full_name %{mod_name}-%{version} ++++++ slop-4.2.1.gem -> slop-4.3.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.travis.yml new/.travis.yml --- old/.travis.yml 2015-11-25 08:47:55.000000000 +0100 +++ new/.travis.yml 2016-03-19 11:25:22.000000000 +0100 @@ -1,8 +1,11 @@ cache: bundler +before_install: + - gem update bundler rvm: - 2.0.0 - 2.1 - 2.2 + - 2.3.0 - rbx-2 - jruby-head - ruby-head diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2015-11-25 08:47:55.000000000 +0100 +++ new/CHANGELOG.md 2016-03-19 11:25:22.000000000 +0100 @@ -1,6 +1,13 @@ Changelog ========= +v4.3.0 (2016-03-19) +------------------- + +Features + * Allow disabling array delimiter. #189 (Mike Pastore) + * Allow passing custom banner as config. #191 (Philip Rees) + v4.2.1 (2015-11-25) ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2015-11-25 08:47:55.000000000 +0100 +++ new/README.md 2016-03-19 11:25:22.000000000 +0100 @@ -132,6 +132,9 @@ # --files foo.txt --files bar.rb ``` +If you want to disable the built-in string-splitting, set the delimiter to +`nil`. + Custom option types ------------------- @@ -272,7 +275,7 @@ ------------------------ Slop v4 is completely non-backwards compatible. The code has been rewritten -from the group up. If you're already using version 3 you have *have* to update +from the ground up. If you're already using version 3 you *have* to update your code to use version 4. Here's an overview of the more fundamental changes: #### No more `instance_eval` Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/slop/options.rb new/lib/slop/options.rb --- old/lib/slop/options.rb 2015-11-25 08:47:55.000000000 +0100 +++ new/lib/slop/options.rb 2016-03-19 11:25:22.000000000 +0100 @@ -26,7 +26,7 @@ def initialize(**config) @options = [] @separators = [] - @banner = "usage: #{$0} [options]" + @banner = config[:banner].is_a?(String) ? config[:banner] : config.fetch(:banner, "usage: #{$0} [options]") @config = DEFAULT_CONFIG.merge(config) @parser = Parser.new(self, @config) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/slop/types.rb new/lib/slop/types.rb --- old/lib/slop/types.rb 2015-11-25 08:47:55.000000000 +0100 +++ new/lib/slop/types.rb 2016-03-19 11:25:22.000000000 +0100 @@ -62,7 +62,11 @@ class ArrayOption < Option def call(value) @value ||= [] - @value.concat value.split(delimiter, limit) + if delimiter + @value.concat value.split(delimiter, limit) + else + @value << value + end end def default_value @@ -70,7 +74,7 @@ end def delimiter - config[:delimiter] || "," + config.fetch(:delimiter, ",") end def limit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/slop.rb new/lib/slop.rb --- old/lib/slop.rb 2015-11-25 08:47:55.000000000 +0100 +++ new/lib/slop.rb 2016-03-19 11:25:22.000000000 +0100 @@ -6,7 +6,7 @@ require 'slop/error' module Slop - VERSION = '4.2.1' + VERSION = '4.3.0' # Parse an array of options (defaults to ARGV). Accepts an # optional hash of configuration options and block. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2015-11-25 08:47:55.000000000 +0100 +++ new/metadata 2016-03-19 11:25:22.000000000 +0100 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: slop version: !ruby/object:Gem::Version - version: 4.2.1 + version: 4.3.0 platform: ruby authors: - Lee Jarvis autorequire: bindir: bin cert_chain: [] -date: 2015-11-25 00:00:00.000000000 Z +date: 2016-03-19 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rake @@ -86,7 +86,7 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.4.5 +rubygems_version: 2.5.1 signing_key: specification_version: 4 summary: Simple Lightweight Option Parsing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/options_test.rb new/test/options_test.rb --- old/test/options_test.rb 2015-11-25 08:47:55.000000000 +0100 +++ new/test/options_test.rb 2016-03-19 11:25:22.000000000 +0100 @@ -55,7 +55,7 @@ end describe "#to_s" do - it "is prefixed with the banner" do + it "is prefixed with the default banner" do assert_match(/^usage/, @options.to_s) end @@ -82,4 +82,15 @@ assert_match(/^ -h, --help/, @options.to_s.lines.last) end end + + describe "custom banner" do + it "is prefixed with defined banner" do + @options_config = Slop::Options.new({banner: "custom banner"}) + assert_match(/^custom banner/, @options_config.to_s) + end + it "banner is disabled" do + @options_config = Slop::Options.new({banner: false}) + assert_match("", @options_config.to_s) + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/types_test.rb new/test/types_test.rb --- old/test/types_test.rb 2015-11-25 08:47:55.000000000 +0100 +++ new/test/types_test.rb 2016-03-19 11:25:22.000000000 +0100 @@ -67,6 +67,7 @@ before do @options = Slop::Options.new @files = @options.array "--files" + @multi = @options.array "-M", delimiter: nil @delim = @options.array "-d", delimiter: ":" @limit = @options.array "-l", limit: 2 @result = @options.parse %w(--files foo.txt,bar.rb) @@ -85,6 +86,11 @@ assert_equal %w(foo.txt bar.rb), @result[:files] end + it "collects multiple option values with no delimiter" do + @result.parser.parse %w(-M foo,bar -M bar,qux) + assert_equal %w(foo,bar bar,qux), @result[:M] + end + it "can use a custom delimiter" do @result.parser.parse %w(-d foo.txt:bar.rb) assert_equal %w(foo.txt bar.rb), @result[:d]