Hello community,

here is the log from the commit of package rubygem-slop for openSUSE:Factory 
checked in at 2020-03-07 21:40:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-slop (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-slop.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-slop"

Sat Mar  7 21:40:09 2020 rev:25 rq:773853 version:4.8.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-slop/rubygem-slop.changes        
2019-08-06 15:10:44.547764418 +0200
+++ /work/SRC/openSUSE:Factory/.rubygem-slop.new.26092/rubygem-slop.changes     
2020-03-07 21:40:13.832352851 +0100
@@ -1,0 +2,19 @@
+Mon Feb 10 15:50:51 UTC 2020 - Stephan Kulow <co...@suse.com>
+
+- updated to version 4.8.0
+ see installed CHANGELOG.md
+
+  v4.8.0 (2020-01-17)
+  -------------------
+  
+  Features:
+    * Add support for prefixing integer values with `+` character
+    [#243](https://github.com/leejarvis/slop/pull/243) (Juha Ylitalo)
+    * Add support for parsing floats with scientific notation
+    [#250](https://github.com/leejarvis/slop/pull/250) (Hansuk Hong)
+  
+  Maintenance:
+    * Add 2.7.0 to CI and fix warnings
+    [#248](https://github.com/leejarvis/slop/pull/248) (Juha Ylitalo, Andrew 
Kane)
+
+-------------------------------------------------------------------

Old:
----
  slop-4.7.0.gem

New:
----
  slop-4.8.0.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-slop.spec ++++++
--- /var/tmp/diff_new_pack.YTz0p2/_old  2020-03-07 21:40:14.612353377 +0100
+++ /var/tmp/diff_new_pack.YTz0p2/_new  2020-03-07 21:40:14.616353380 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-slop
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # 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.7.0
+Version:        4.8.0
 Release:        0
 %define mod_name slop
 %define mod_full_name %{mod_name}-%{version}
@@ -32,7 +32,7 @@
 BuildRequires:  %{ruby >= 2.0.0}
 BuildRequires:  %{rubygem gem2rpm}
 BuildRequires:  ruby-macros >= 5
-Url:            http://github.com/leejarvis/slop
+URL:            http://github.com/leejarvis/slop
 Source:         https://rubygems.org/gems/%{mod_full_name}.gem
 Source1:        gem2rpm.yml
 Summary:        Simple Lightweight Option Parsing

++++++ slop-4.7.0.gem -> slop-4.8.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/.travis.yml new/.travis.yml
--- old/.travis.yml     2019-06-29 16:39:12.000000000 +0200
+++ new/.travis.yml     2020-01-17 09:53:14.000000000 +0100
@@ -13,12 +13,15 @@
   - 2.1
   - 2.2
   - 2.3.4
-  - 2.4.1
-  - 2.5.3
-  - 2.6.0
-  - jruby-9.2.5.0
+  - 2.4.9
+  - 2.5.7
+  - 2.6.5
+  - 2.7.0
+  - jruby-9.2.9.0
   - jruby-head
   - ruby-head
+jdk:
+  - openjdk8
 notifications:
   email:
     on_success: change
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md    2019-06-29 16:39:12.000000000 +0200
+++ new/CHANGELOG.md    2020-01-17 09:53:14.000000000 +0100
@@ -1,12 +1,26 @@
 Changelog
 =========
 
+v4.8.0 (2020-01-17)
+-------------------
+
+Features:
+  * Add support for prefixing integer values with `+` character
+  [#243](https://github.com/leejarvis/slop/pull/243) (Juha Ylitalo)
+  * Add support for parsing floats with scientific notation
+  [#250](https://github.com/leejarvis/slop/pull/250) (Hansuk Hong)
+
+Maintenance:
+  * Add 2.7.0 to CI and fix warnings
+  [#248](https://github.com/leejarvis/slop/pull/248) (Juha Ylitalo, Andrew 
Kane)
+
 v4.7.0 (2019-06-29)
 -------------------
 
 Features:
   * Add `Slop::Result#fetch`. It returns the value of given option, or raises 
an error if given option is not present. 
[#232](https://github.com/leejarvis/slop/pull/232) ([Giovanni 
Benussi](https://github.com/giovannibenussi))
   * Adding a separator without passing any arguments now creates a separator 
with the empty string. [#238](https://github.com/leejarvis/slop/pull/238) 
([Teemu Matilainen](https://github.com/tmatilai))
+
 Bug fixes
   * Ensure non-string option types have their flags consumed properly [#241] 
(Sutou Kouhei)
 
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     2019-06-29 16:39:12.000000000 +0200
+++ new/lib/slop/options.rb     2020-01-17 09:53:14.000000000 +0100
@@ -24,12 +24,12 @@
     # The String banner prefixed to the help string.
     attr_accessor :banner
 
-    def initialize(**config)
+    def initialize(**config, &block)
       @options    = []
       @separators = []
       @banner     = config[:banner].is_a?(String) ? config[:banner] : 
config.fetch(:banner, "usage: #{$0} [options]")
       @config     = DEFAULT_CONFIG.merge(config)
-      @parser     = Parser.new(self, @config)
+      @parser     = Parser.new(self, **@config)
 
       yield self if block_given?
     end
@@ -52,7 +52,7 @@
       desc   = flags.pop unless flags.last.start_with?('-')
       config = self.config.merge(config)
       klass  = Slop.string_to_option_class(config[:type].to_s)
-      option = klass.new(flags, desc, config, &block)
+      option = klass.new(flags, desc, **config, &block)
 
       add_option option
     end
@@ -82,7 +82,7 @@
     def method_missing(name, *args, **config, &block)
       if respond_to_missing?(name)
         config[:type] = name
-        on(*args, config, &block)
+        on(*args, **config, &block)
       else
         super
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/slop/parser.rb new/lib/slop/parser.rb
--- old/lib/slop/parser.rb      2019-06-29 16:39:12.000000000 +0200
+++ new/lib/slop/parser.rb      2020-01-17 09:53:14.000000000 +0100
@@ -52,7 +52,6 @@
 
         # support `foo=bar`
         orig_flag = flag.dup
-        orig_arg = arg
         if match = flag.match(/([^=]+)=([^=]+)/)
           flag, arg = match.captures
         end
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       2019-06-29 16:39:12.000000000 +0200
+++ new/lib/slop/types.rb       2020-01-17 09:53:14.000000000 +0100
@@ -44,16 +44,17 @@
   # Cast the option argument to an Integer.
   class IntegerOption < Option
     def call(value)
-      value =~ /\A-?\d+\z/ && value.to_i
+      value =~ /\A[+-]?\d+\z/ && value.to_i
     end
   end
   IntOption = IntegerOption
 
   # Cast the option argument to a Float.
   class FloatOption < Option
+    FLOAT_STRING_REGEXP = 
/\A[+-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?\z/.freeze
+
     def call(value)
-      # TODO: scientific notation, etc.
-      value =~ /\A-?\d*\.*\d+\z/ && value.to_f
+      value =~ FLOAT_STRING_REGEXP && value.to_f
     end
   end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/slop.rb new/lib/slop.rb
--- old/lib/slop.rb     2019-06-29 16:39:12.000000000 +0200
+++ new/lib/slop.rb     2020-01-17 09:53:14.000000000 +0100
@@ -6,7 +6,7 @@
 require 'slop/error'
 
 module Slop
-  VERSION = '4.7.0'
+  VERSION = '4.8.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        2019-06-29 16:39:12.000000000 +0200
+++ new/metadata        2020-01-17 09:53:14.000000000 +0100
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: slop
 version: !ruby/object:Gem::Version
-  version: 4.7.0
+  version: 4.8.0
 platform: ruby
 authors:
 - Lee Jarvis
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2019-06-29 00:00:00.000000000 Z
+date: 2020-01-17 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: rake
@@ -86,8 +86,7 @@
     - !ruby/object:Gem::Version
       version: '0'
 requirements: []
-rubyforge_project: 
-rubygems_version: 2.7.6
+rubygems_version: 3.0.3
 signing_key: 
 specification_version: 4
 summary: Simple Lightweight Option Parsing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/option_test.rb new/test/option_test.rb
--- old/test/option_test.rb     2019-06-29 16:39:12.000000000 +0200
+++ new/test/option_test.rb     2020-01-17 09:53:14.000000000 +0100
@@ -1,8 +1,8 @@
 require 'test_helper'
 
 describe Slop::Option do
-  def option(*args)
-    Slop::Option.new(*args)
+  def option(*args, **kwargs, &block)
+    Slop::Option.new(*args, **kwargs, &block)
   end
 
   describe "#flag" do
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    2019-06-29 16:39:12.000000000 +0200
+++ new/test/options_test.rb    2020-01-17 09:53:14.000000000 +0100
@@ -121,11 +121,11 @@
 
   describe "custom banner" do
     it "is prefixed with defined banner" do
-      @options_config = Slop::Options.new({banner: "custom banner"})
+      @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})
+      @options_config = Slop::Options.new(**{banner: false})
       assert_match("", @options_config.to_s)
     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      2019-06-29 16:39:12.000000000 +0200
+++ new/test/types_test.rb      2020-01-17 09:53:14.000000000 +0100
@@ -32,11 +32,15 @@
   before do
     @options = Slop::Options.new
     @age     = @options.integer "--age"
-    @result  = @options.parse %w(--age 20)
+    @minus   = @options.integer "--minus"
+    @plus    = @options.integer "--plus"
+    @result  = @options.parse %w(--age 20 --minus -10 --plus +30)
   end
 
   it "returns the value as an integer" do
     assert_equal 20, @result[:age]
+    assert_equal (-10), @result[:minus]
+    assert_equal 30, @result[:plus]
   end
 
   it "returns nil for non-numbers by default" do
@@ -50,11 +54,37 @@
     @options = Slop::Options.new
     @apr     = @options.float "--apr"
     @apr_value = 2.9
-    @result  = @options.parse %W(--apr #{@apr_value})
+    @minus = @options.float "--minus"
+    @plus = @options.float "--plus"
+    @scientific_notation = @options.float "--scientific-notation"
+    @scientific_notation_value = 4e21
+    @result  = @options.parse %W(--apr #{@apr_value} --minus -6.1 --plus +9.4 
--scientific-notation #{@scientific_notation_value})
   end
 
   it "returns the value as a float" do
     assert_equal @apr_value, @result[:apr]
+    assert_equal (-6.1), @result[:minus]
+    assert_equal 9.4, @result[:plus]
+  end
+
+  it "parses scientific notations" do
+    assert_equal @scientific_notation_value, @result[:scientific_notation]
+
+    @scientific_notation_value = 4E21
+    @result  = @options.parse %W(--scientific-notation 
#{@scientific_notation_value})
+    assert_equal @scientific_notation_value, @result[:scientific_notation]
+
+    @scientific_notation_value = 4.0e21
+    @result  = @options.parse %W(--scientific-notation 
#{@scientific_notation_value})
+    assert_equal @scientific_notation_value, @result[:scientific_notation]
+
+    @scientific_notation_value = -4e21
+    @result  = @options.parse %W(--scientific-notation 
#{@scientific_notation_value})
+    assert_equal @scientific_notation_value, @result[:scientific_notation]
+
+    @scientific_notation_value = 4e-21
+    @result  = @options.parse %W(--scientific-notation 
#{@scientific_notation_value})
+    assert_equal @scientific_notation_value, @result[:scientific_notation]
   end
 
   it "returns nil for non-numbers by default" do


Reply via email to