Hello community, here is the log from the commit of package rubygem-slop for openSUSE:Factory checked in at 2020-10-05 19:33:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-slop (Old) and /work/SRC/openSUSE:Factory/.rubygem-slop.new.4249 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-slop" Mon Oct 5 19:33:56 2020 rev:27 rq:838084 version:4.8.2 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-slop/rubygem-slop.changes 2020-05-11 13:39:57.996943108 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-slop.new.4249/rubygem-slop.changes 2020-10-05 19:33:59.297250784 +0200 @@ -1,0 +2,14 @@ +Fri Sep 25 14:58:11 UTC 2020 - Stephan Kulow <co...@suse.com> + +updated to version 4.8.2 + see installed CHANGELOG.md + + v4.8.2 (2020-07-10) + ------------------- + + Bug fixes: + * Fix bug where separator position was messed up if using `help: false` + [#253](https://github.com/leejarvis/slop/issues/253) + + +------------------------------------------------------------------- Old: ---- slop-4.8.1.gem New: ---- slop-4.8.2.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-slop.spec ++++++ --- /var/tmp/diff_new_pack.A4QTS5/_old 2020-10-05 19:33:59.989251460 +0200 +++ /var/tmp/diff_new_pack.A4QTS5/_new 2020-10-05 19:33:59.993251464 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-slop -Version: 4.8.1 +Version: 4.8.2 Release: 0 %define mod_name slop %define mod_full_name %{mod_name}-%{version} ++++++ slop-4.8.1.gem -> slop-4.8.2.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2020-03-31 09:01:15.000000000 +0200 +++ new/CHANGELOG.md 2020-07-10 09:41:33.000000000 +0200 @@ -1,6 +1,13 @@ Changelog ========= +v4.8.2 (2020-07-10) +------------------- + +Bug fixes: + * Fix bug where separator position was messed up if using `help: false` + [#253](https://github.com/leejarvis/slop/issues/253) + v4.8.1 (2020-03-31) ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2020-03-31 09:01:15.000000000 +0200 +++ new/README.md 2020-07-10 09:41:33.000000000 +0200 @@ -3,9 +3,6 @@ Slop is a simple option parser with an easy to remember syntax and friendly API. -Version 4 of Slop is aimed at Ruby 2.0 or later. Please use -[Version 3](https://github.com/leejarvis/slop/tree/v3) for Ruby 1.9 support. - [![Build Status](https://travis-ci.org/leejarvis/slop.svg?branch=master)](http://travis-ci.org/leejarvis/slop) Installation @@ -275,87 +272,4 @@ Commands -------- -As of version 4, Slop does not have built in support for git-style subcommands. -You can use version 3 of Slop (see `v3` branch). - -Upgrading from version 3 ------------------------- - -Slop v4 is not backwards compatible. The code has been completely rewritten. -If you're already using version 3 you *have* to update your code to use version 4. -Here's an overview of the large changes: - -#### No more `instance_eval` - -Before: - -```ruby -Slop.parse do - on 'v', 'version' do - puts VERSION - end -end -``` - -After: - -```ruby -Slop.parse do |o| - o.on '-v', '--version' do - puts VERSION - end -end -``` - -#### No more `as` for option types - -Instead, the type is declared in the method call. Before: - -```ruby -on 'port=', as: Integer -``` - -After: - -```ruby -o.int '--port' # or integer -``` - -See the custom types section of the document. - -#### No more trailing `=` - -Instead, the "does this option expect an argument?" question is answered by -the option type (i.e `on` and `bool` options do not expect arguments, all -others do). They handle type conversion, too. - -#### Hyphens are required - -This was a hard decision to make, but you must provide prefixed hyphens when -declaring your flags. This improves the implementation nicer and makes things -much less ambiguous, which leads to less error prone code. It also means you -can easily support single hyphen prefix for a long flag, i.e `-hostname` which -you could not do before. It also means you can provide infinite flag aliases: -`o.string '-f', '-x', '--foo', '--bar', 'this is insane'` - -#### Strict is now on by default - -v3 had a `strict` option. v4 has no such option. To suppress errors you can -instead provide the `suppress_errors: true` option to Slop. - -#### No more parse! - -Where v3 has both `Slop.parse` and `Slop.parse!`, v4 only has `parse`. The -former was used to decide whether Slop should or should not mutate the -original args (usually ARGV). This is almost never what you want, and it -can lead to confusion. Instead, `Slop::Result` provides an `arguments` -methods: - -```ruby -opts = Slop.parse do |o| - o.string '--hostname', '...' -end - -# ARGV is "hello --hostname foo bar" -p opts.arguments #=> ["hello", "bar"] -``` +Slop not longer has built in support for git-style subcommands. Binary 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 2020-03-31 09:01:15.000000000 +0200 +++ new/lib/slop/options.rb 2020-07-10 09:41:33.000000000 +0200 @@ -102,13 +102,13 @@ str = config[:banner] ? "#{banner}\n" : "" len = longest_flag_length - options.select(&:help?).each_with_index.sort_by{ |o,i| [o.tail, i] }.each do |opt, i| + options.select.each_with_index.sort_by{ |o,i| [o.tail, i] }.each do |opt, i| # use the index to fetch an associated separator if sep = separators[i] str << "#{sep}\n" end - str << "#{prefix}#{opt.to_s(offset: len)}\n" + str << "#{prefix}#{opt.to_s(offset: len)}\n" if opt.help? end if sep = separators[options.size] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/slop.rb new/lib/slop.rb --- old/lib/slop.rb 2020-03-31 09:01:15.000000000 +0200 +++ new/lib/slop.rb 2020-07-10 09:41:33.000000000 +0200 @@ -6,7 +6,7 @@ require 'slop/error' module Slop - VERSION = '4.8.1' + VERSION = '4.8.2' # 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 2020-03-31 09:01:15.000000000 +0200 +++ new/metadata 2020-07-10 09:41:33.000000000 +0200 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: slop version: !ruby/object:Gem::Version - version: 4.8.1 + version: 4.8.2 platform: ruby authors: - Lee Jarvis -autorequire: +autorequire: bindir: bin cert_chain: [] -date: 2020-03-31 00:00:00.000000000 Z +date: 2020-07-10 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rake @@ -71,7 +71,7 @@ licenses: - MIT metadata: {} -post_install_message: +post_install_message: rdoc_options: [] require_paths: - lib @@ -87,7 +87,7 @@ version: '0' requirements: [] rubygems_version: 3.0.3 -signing_key: +signing_key: specification_version: 4 summary: Simple Lightweight Option Parsing test_files: 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 2020-03-31 09:01:15.000000000 +0200 +++ new/test/options_test.rb 2020-07-10 09:41:33.000000000 +0200 @@ -70,6 +70,17 @@ assert_equal [""], @options.separators end + + it "correctly handles options with `help: false`" do + @options.boolean "--opt1" + @options.boolean "--opt2", help: false + @options.separator "other options" + @options.boolean "--opt3", help: false + @options.boolean "--opt4" + + _usage, help = @options.to_s.squeeze(" ").split("\n", 2) + assert_equal "--opt1 \nother options\n --opt4", help.strip + end end describe "#method_missing" do