Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-commander for openSUSE:Factory checked in at 2021-07-02 13:27:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-commander (Old) and /work/SRC/openSUSE:Factory/.rubygem-commander.new.2625 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-commander" Fri Jul 2 13:27:32 2021 rev:28 rq:903491 version:4.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-commander/rubygem-commander.changes 2020-05-11 13:40:39.585031110 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-commander.new.2625/rubygem-commander.changes 2021-07-02 13:28:26.096310014 +0200 @@ -1,0 +2,13 @@ +Thu Jun 24 17:11:36 UTC 2021 - Stephan Kulow <co...@suse.com> + +updated to version 4.6.0 + see installed History.rdoc + + === 4.6.0 / 2021-04-09 + + * Fix error with SortedSet on Ruby 3.0 (#98). + * Remove `#reset_io` as it didn't do anything. + * Drop support for Ruby < 2.4. + + +------------------------------------------------------------------- Old: ---- commander-4.5.2.gem New: ---- commander-4.6.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-commander.spec ++++++ --- /var/tmp/diff_new_pack.7bLM9L/_old 2021-07-02 13:28:26.532306631 +0200 +++ /var/tmp/diff_new_pack.7bLM9L/_new 2021-07-02 13:28:26.532306631 +0200 @@ -1,7 +1,7 @@ # # spec file for package rubygem-commander # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,13 +24,13 @@ # Name: rubygem-commander -Version: 4.5.2 +Version: 4.6.0 Release: 0 %define mod_name commander %define mod_full_name %{mod_name}-%{version} BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: %{ruby >= 2.4} BuildRequires: %{rubygem gem2rpm} -BuildRequires: %{ruby} BuildRequires: ruby-macros >= 5 BuildRequires: update-alternatives URL: https://github.com/commander-rb/commander ++++++ commander-4.5.2.gem -> commander-4.6.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.rubocop.yml new/.rubocop.yml --- old/.rubocop.yml 2020-03-12 22:42:42.000000000 +0100 +++ new/.rubocop.yml 2021-04-09 22:54:22.000000000 +0200 @@ -1,18 +1,20 @@ inherit_from: .rubocop_todo.yml AllCops: - TargetRubyVersion: 1.9 + TargetRubyVersion: 2.4 + NewCops: enable + SuggestExtensions: false # not Ruby 1.9.3 compatible Style/PercentLiteralDelimiters: Enabled: false -# Offense count: 5 -Encoding: - Enabled: false +# Enforce trailing comma after last item of multiline arrays. +Style/TrailingCommaInArrayLiteral: + EnforcedStyleForMultiline: comma # Enforce trailing comma after last item of multiline hashes. -Style/TrailingCommaInLiteral: +Style/TrailingCommaInHashLiteral: EnforcedStyleForMultiline: comma Metrics/BlockLength: @@ -27,7 +29,7 @@ Style/NumericLiteralPrefix: EnforcedOctalStyle: zero_only -Style/MethodMissing: +Style/MissingRespondToMissing: Enabled: false Layout/SpaceInsideStringInterpolation: @@ -42,3 +44,21 @@ Metrics/ModuleLength: CountComments: false # count full line comments? Max: 150 + +Lint/EmptyBlock: + Enabled: false + +Style/FormatStringToken: + Enabled: false + +Style/MixinUsage: + Enabled: false + +Lint/ErbNewArguments: + Enabled: false + +Style/DocumentDynamicEvalDefinition: + Enabled: false + +Naming/HeredocDelimiterNaming: + Enabled: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.rubocop_todo.yml new/.rubocop_todo.yml --- old/.rubocop_todo.yml 2020-03-12 22:42:42.000000000 +0100 +++ new/.rubocop_todo.yml 2021-04-09 22:54:22.000000000 +0200 @@ -10,12 +10,12 @@ Enabled: false # Offense count: 2 -Lint/HandleExceptions: +Lint/SuppressedException: Enabled: false # Offense count: 5 Metrics/AbcSize: - Max: 29 + Max: 30 # Offense count: 1 # Configuration parameters: CountComments. @@ -28,7 +28,7 @@ # Offense count: 89 # Configuration parameters: AllowURI, URISchemes. -Metrics/LineLength: +Layout/LineLength: Max: 242 # Offense count: 7 @@ -41,7 +41,7 @@ Max: 14 # Offense count: 1 -Style/AccessorMethodName: +Naming/AccessorMethodName: Enabled: false # Offense count: 18 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.travis.yml new/.travis.yml --- old/.travis.yml 2020-03-12 22:42:42.000000000 +0100 +++ new/.travis.yml 2021-04-09 22:54:22.000000000 +0200 @@ -4,10 +4,10 @@ - gem update --system - gem update bundler rvm: - - 2.3 - 2.4 - 2.5 - 2.6 - 2.7 + - 3.0 - jruby - ruby-head diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Gemfile new/Gemfile --- old/Gemfile 2020-03-12 22:42:42.000000000 +0100 +++ new/Gemfile 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source 'https://rubygems.org' gemspec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/History.rdoc new/History.rdoc --- old/History.rdoc 2020-03-12 22:42:42.000000000 +0100 +++ new/History.rdoc 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,9 @@ +=== 4.6.0 / 2021-04-09 + +* Fix error with SortedSet on Ruby 3.0 (#98). +* Remove `#reset_io` as it didn't do anything. +* Drop support for Ruby < 2.4. + === 4.5.2 / 2020-03-12 * Fix bug handling global options provided in option=value form (#47). (@orien) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 2020-03-12 22:42:42.000000000 +0100 +++ new/Rakefile 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'bundler/gem_tasks' require 'rspec/core/rake_task' require 'rubocop/rake_task' @@ -10,4 +12,4 @@ RuboCop::RakeTask.new -task default: [:spec, :rubocop] +task default: %i[spec rubocop] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bin/commander new/bin/commander --- old/bin/commander 2020-03-12 22:42:42.000000000 +0100 +++ new/bin/commander 2021-04-09 22:54:22.000000000 +0200 @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require 'rubygems' require 'commander/import' @@ -97,7 +98,7 @@ File.chmod 0755, file say "Initialized template in #{file}" end - rescue => e + rescue StandardError => e abort e end end Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commander.gemspec new/commander.gemspec --- old/commander.gemspec 2020-03-12 22:42:42.000000000 +0100 +++ new/commander.gemspec 2021-04-09 22:54:22.000000000 +0200 @@ -1,6 +1,6 @@ -# -*- encoding: utf-8 -*- +# frozen_string_literal: true -$LOAD_PATH.push File.expand_path('../lib', __FILE__) +$LOAD_PATH.push File.expand_path('lib', __dir__) require 'commander/version' Gem::Specification.new do |s| @@ -13,12 +13,13 @@ s.summary = 'The complete solution for Ruby command-line executables' s.description = 'The complete solution for Ruby command-line executables. Commander bridges the gap between other terminal related libraries you know and love (OptionParser, HighLine), while providing many new features, and an elegant API.' s.metadata = { - 'bug_tracker_uri' => "#{s.homepage}/issues", - 'changelog_uri' => "#{s.homepage}/blob/master/History.rdoc", + 'bug_tracker_uri' => "#{s.homepage}/issues", + 'changelog_uri' => "#{s.homepage}/blob/master/History.rdoc", 'documentation_uri' => "https://www.rubydoc.info/gems/commander/#{s.version}", - 'homepage_uri' => s.homepage, - 'source_code_uri' => "#{s.homepage}/tree/v#{s.version}", + 'homepage_uri' => s.homepage, + 'source_code_uri' => "#{s.homepage}/tree/v#{s.version}", } + s.required_ruby_version = '>= 2.4' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") @@ -27,13 +28,8 @@ s.add_runtime_dependency('highline', '~> 2.0.0') - s.add_development_dependency('rspec', '~> 3.2') s.add_development_dependency('rake') + s.add_development_dependency('rspec', '~> 3.2') + s.add_development_dependency('rubocop', '~> 1.12.1') s.add_development_dependency('simplecov') - if RUBY_VERSION < '2.0' - s.add_development_dependency('rubocop', '~> 0.41.1') - s.add_development_dependency('json', '< 2.0') - else - s.add_development_dependency('rubocop', '~> 0.49.1') - end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/blank.rb new/lib/commander/blank.rb --- old/lib/commander/blank.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/blank.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Blank def self.included(base) base.class_eval do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/command.rb new/lib/commander/command.rb --- old/lib/commander/command.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/command.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,9 +1,10 @@ +# frozen_string_literal: true + require 'optparse' module Commander class Command - attr_accessor :name, :examples, :syntax, :description - attr_accessor :summary, :proxy_options, :options + attr_accessor :name, :examples, :syntax, :description, :summary, :proxy_options, :options attr_reader :global_options ## @@ -140,6 +141,7 @@ def when_called(*args, &block) fail ArgumentError, 'must pass an object, class, or block.' if args.empty? && !block + @when_called = block ? [block] : args end alias action when_called @@ -163,6 +165,7 @@ def parse_options_and_call_procs(*args) return args if args.empty? + # empty proxy_options before populating via OptionParser # prevents duplication of options if the command is run twice proxy_options.clear @@ -182,8 +185,8 @@ case object when Proc then object.call(args, options) - when Class then meth != :call ? object.new.send(meth, args, options) : object.new(args, options) - else object.send(meth, args, options) if object + when Class then meth == :call ? object.new(args, options) : object.new.send(meth, args, options) + else object&.send(meth, args, options) end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/configure.rb new/lib/commander/configure.rb --- old/lib/commander/configure.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/configure.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Commander def configure(*configuration_opts, &configuration_block) configuration_module = Module.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/core_ext/array.rb new/lib/commander/core_ext/array.rb --- old/lib/commander/core_ext/array.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/core_ext/array.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Array ## # Split _string_ into an array. Used in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/core_ext/object.rb new/lib/commander/core_ext/object.rb --- old/lib/commander/core_ext/object.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/core_ext/object.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Object ## # Return the current binding. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/core_ext.rb new/lib/commander/core_ext.rb --- old/lib/commander/core_ext.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/core_ext.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,2 +1,4 @@ +# frozen_string_literal: true + require 'commander/core_ext/array' require 'commander/core_ext/object' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/delegates.rb new/lib/commander/delegates.rb --- old/lib/commander/delegates.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/delegates.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Commander module Delegates %w( @@ -11,7 +13,7 @@ always_trace! never_trace! ).each do |meth| - eval <<-END, binding, __FILE__, __LINE__ + eval <<-END, binding, __FILE__, __LINE__ + 1 def #{meth}(*args, &block) ::Commander::Runner.instance.#{meth}(*args, &block) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/help_formatters/base.rb new/lib/commander/help_formatters/base.rb --- old/lib/commander/help_formatters/base.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/help_formatters/base.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Commander ## # = Help Formatter diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/help_formatters/terminal.rb new/lib/commander/help_formatters/terminal.rb --- old/lib/commander/help_formatters/terminal.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/help_formatters/terminal.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'erb' module Commander diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/help_formatters/terminal_compact.rb new/lib/commander/help_formatters/terminal_compact.rb --- old/lib/commander/help_formatters/terminal_compact.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/help_formatters/terminal_compact.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'erb' module Commander diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/help_formatters.rb new/lib/commander/help_formatters.rb --- old/lib/commander/help_formatters.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/help_formatters.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Commander module HelpFormatter autoload :Base, 'commander/help_formatters/base' @@ -43,7 +45,7 @@ module_function def indent(amount, text) - text.to_s.gsub("\n", "\n" + (' ' * amount)) + text.to_s.gsub("\n", "\n#{' ' * amount}") end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/import.rb new/lib/commander/import.rb --- old/lib/commander/import.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/import.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'commander' include Commander::Methods diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/methods.rb new/lib/commander/methods.rb --- old/lib/commander/methods.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/methods.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Commander module Methods include Commander::UI diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/platform.rb new/lib/commander/platform.rb --- old/lib/commander/platform.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/platform.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Commander module Platform def self.jruby? diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/runner.rb new/lib/commander/runner.rb --- old/lib/commander/runner.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/runner.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'optparse' module Commander @@ -7,22 +9,10 @@ #++ class CommandError < StandardError; end - class InvalidCommandError < CommandError; end - - ## - # Array of commands. - - attr_reader :commands - ## - # Global options. - - attr_reader :options - - ## - # Hash of help formatter aliases. + class InvalidCommandError < CommandError; end - attr_reader :help_formatter_aliases + attr_reader :commands, :options, :help_formatter_aliases ## # Initialize a new command runner. Optionally @@ -41,7 +31,7 @@ # Return singleton Runner instance. def self.instance - @singleton ||= new + @instance ||= new end ## @@ -76,7 +66,7 @@ OptionParser::InvalidArgument, OptionParser::MissingArgument => e abort e.to_s - rescue => e + rescue StandardError => e if @never_trace abort "error: #{e}." else @@ -231,15 +221,16 @@ # Get active command within arguments passed to this runner. def active_command - @__active_command ||= command(command_name_from_args) + @active_command ||= command(command_name_from_args) end ## # Attempts to locate a command name from within the arguments. # Supports multi-word commands, using the largest possible match. + # Returns the default command, if no valid commands found in the args. def command_name_from_args - @__command_name_from_args ||= (valid_command_names_from(*@args.dup).sort.last || @default_command) + @command_name_from_args ||= (longest_valid_command_name_from(@args) || @default_command) end ## @@ -255,7 +246,7 @@ # Help formatter instance. def help_formatter - @__help_formatter ||= program(:help_formatter).new self + @help_formatter ||= program(:help_formatter).new self end ## @@ -304,7 +295,7 @@ if args.empty? say help_formatter.render else - command = command args.join(' ') + command = command(longest_valid_command_name_from(args)) begin require_valid_command command rescue InvalidCommandError => e @@ -332,6 +323,7 @@ options.each do |option| switches = option[:switches] next if switches.empty? + option_takes_argument = switches.any? { |s| s =~ /[ =]/ } switches = expand_optionally_negative_switches(switches) @@ -456,5 +448,15 @@ def say(*args) #:nodoc: HighLine.default_instance.say(*args) end + + private + + ## + # Attempts to locate a command name from within the provided arguments. + # Supports multi-word commands, using the largest possible match. + + def longest_valid_command_name_from(args) + valid_command_names_from(*args.dup).max + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/user_interaction.rb new/lib/commander/user_interaction.rb --- old/lib/commander/user_interaction.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/user_interaction.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tempfile' require 'shellwords' @@ -218,21 +220,17 @@ # def io(input = nil, output = nil, &block) + orig_stdin, orig_stdout = $stdin, $stdout $stdin = File.new(input) if input $stdout = File.new(output, 'r+') if output return unless block + yield + $stdin, $stdout = orig_stdin, orig_stdout reset_io end ## - # Reset IO to initial constant streams. - - def reset_io - $stdin, $stdout = STDIN, STDOUT - end - - ## # Find an editor available in path. Optionally supply the _preferred_ # editor. Returns the name as a string, nil if none is available. @@ -274,6 +272,7 @@ def enable_paging return unless $stdout.tty? return unless Process.respond_to? :fork + read, write = IO.pipe # Kernel.fork is not supported on all platforms and configurations. @@ -324,7 +323,7 @@ # Implements ask_for_CLASS methods. module AskForClass - DEPRECATED_CONSTANTS = [:Config, :TimeoutError, :MissingSourceFile, :NIL, :TRUE, :FALSE, :Fixnum, :Bignum, :Data].freeze + DEPRECATED_CONSTANTS = %i[Config TimeoutError MissingSourceFile NIL TRUE FALSE Fixnum Bignum Data].freeze # define methods for common classes [Float, Integer, String, Symbol, Regexp, Array, File, Pathname].each do |klass| @@ -338,15 +337,21 @@ if arguments.count != 1 fail ArgumentError, "wrong number of arguments (given #{arguments.count}, expected 1)" end + prompt = arguments.first requested_class = Regexp.last_match[1] # All Classes that respond to #parse # Ignore constants that trigger deprecation warnings available_classes = (Object.constants - DEPRECATED_CONSTANTS).map do |const| - Object.const_get(const) - end.select do |const| - const.class == Class && const.respond_to?(:parse) + begin + Object.const_get(const) + rescue RuntimeError + # Rescue errors in Ruby 3 for SortedSet: + # The `SortedSet` class has been extracted from the `set` library. + end + end.compact.select do |const| + const.instance_of?(Class) && const.respond_to?(:parse) end klass = available_classes.find { |k| k.to_s.downcase == requested_class } @@ -498,7 +503,7 @@ steps_remaining: steps_remaining, total_steps: @total_steps, time_elapsed: format('%0.2fs', time_elapsed), - time_remaining: @step > 0 ? format('%0.2fs', time_remaining) : '', + time_remaining: @step.positive? ? format('%0.2fs', time_remaining) : '', }.merge! @tokens end @@ -507,6 +512,7 @@ def show return if finished? + erase_line if completed? HighLine.default_instance.say UI.replace_tokens(@complete_message, generate_tokens) if @complete_message.is_a? String diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander/version.rb new/lib/commander/version.rb --- old/lib/commander/version.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander/version.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Commander - VERSION = '4.5.2'.freeze + VERSION = '4.6.0' end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/commander.rb new/lib/commander.rb --- old/lib/commander.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/lib/commander.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- # Copyright (c) 2008-2009 TJ Holowaychuk <t...@vision-media.ca> # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2020-03-12 22:42:42.000000000 +0100 +++ new/metadata 2021-04-09 22:54:22.000000000 +0200 @@ -1,15 +1,15 @@ --- !ruby/object:Gem::Specification name: commander version: !ruby/object:Gem::Version - version: 4.5.2 + version: 4.6.0 platform: ruby authors: - TJ Holowaychuk - Gabriel Gilder -autorequire: +autorequire: bindir: bin cert_chain: [] -date: 2020-03-12 00:00:00.000000000 Z +date: 2021-04-09 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: highline @@ -26,6 +26,20 @@ - !ruby/object:Gem::Version version: 2.0.0 - !ruby/object:Gem::Dependency + name: rake + requirement: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: '0' + type: :development + prerelease: false + version_requirements: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: '0' +- !ruby/object:Gem::Dependency name: rspec requirement: !ruby/object:Gem::Requirement requirements: @@ -40,19 +54,19 @@ - !ruby/object:Gem::Version version: '3.2' - !ruby/object:Gem::Dependency - name: rake + name: rubocop requirement: !ruby/object:Gem::Requirement requirements: - - - ">=" + - - "~>" - !ruby/object:Gem::Version - version: '0' + version: 1.12.1 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - - ">=" + - - "~>" - !ruby/object:Gem::Version - version: '0' + version: 1.12.1 - !ruby/object:Gem::Dependency name: simplecov requirement: !ruby/object:Gem::Requirement @@ -67,20 +81,6 @@ - - ">=" - !ruby/object:Gem::Version version: '0' -- !ruby/object:Gem::Dependency - name: rubocop - requirement: !ruby/object:Gem::Requirement - requirements: - - - "~>" - - !ruby/object:Gem::Version - version: 0.49.1 - type: :development - prerelease: false - version_requirements: !ruby/object:Gem::Requirement - requirements: - - - "~>" - - !ruby/object:Gem::Version - version: 0.49.1 description: The complete solution for Ruby command-line executables. Commander bridges the gap between other terminal related libraries you know and love (OptionParser, HighLine), while providing many new features, and an elegant API. @@ -143,10 +143,10 @@ metadata: bug_tracker_uri: https://github.com/commander-rb/commander/issues changelog_uri: https://github.com/commander-rb/commander/blob/master/History.rdoc - documentation_uri: https://www.rubydoc.info/gems/commander/4.5.2 + documentation_uri: https://www.rubydoc.info/gems/commander/4.6.0 homepage_uri: https://github.com/commander-rb/commander - source_code_uri: https://github.com/commander-rb/commander/tree/v4.5.2 -post_install_message: + source_code_uri: https://github.com/commander-rb/commander/tree/v4.6.0 +post_install_message: rdoc_options: [] require_paths: - lib @@ -154,15 +154,15 @@ requirements: - - ">=" - !ruby/object:Gem::Version - version: '0' + version: '2.4' required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.0.6 -signing_key: +rubygems_version: 3.2.15 +signing_key: specification_version: 4 summary: The complete solution for Ruby command-line executables test_files: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/command_spec.rb new/spec/command_spec.rb --- old/spec/command_spec.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/spec/command_spec.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Commander::Command do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/configure_spec.rb new/spec/configure_spec.rb --- old/spec/configure_spec.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/spec/configure_spec.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'commander/configure' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/core_ext/array_spec.rb new/spec/core_ext/array_spec.rb --- old/spec/core_ext/array_spec.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/spec/core_ext/array_spec.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Array do @@ -12,7 +14,7 @@ it 'should match %w behavior with multiple backslashes' do str = 'just a\\ test' - expect(Array.parse(str)).to eq(eval("%w(#{str})")) + expect(Array.parse(str)).to eq(['just', 'a test']) end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/core_ext/object_spec.rb new/spec/core_ext/object_spec.rb --- old/spec/core_ext/object_spec.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/spec/core_ext/object_spec.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Object do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/help_formatters/terminal_compact_spec.rb new/spec/help_formatters/terminal_compact_spec.rb --- old/spec/help_formatters/terminal_compact_spec.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/spec/help_formatters/terminal_compact_spec.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Commander::HelpFormatter::TerminalCompact do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/help_formatters/terminal_spec.rb new/spec/help_formatters/terminal_spec.rb --- old/spec/help_formatters/terminal_spec.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/spec/help_formatters/terminal_spec.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Commander::HelpFormatter::Terminal do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/methods_spec.rb new/spec/methods_spec.rb --- old/spec/methods_spec.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/spec/methods_spec.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'commander/methods' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/runner_spec.rb new/spec/runner_spec.rb --- old/spec/runner_spec.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/spec/runner_spec.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Commander do @@ -484,6 +486,22 @@ expect(run('test', '--help')).to eq("Implement help for test here\n") end + it 'can be used after the command and command arguments' do + expect(run('test', 'command-arg', '--help')).to eq("Implement help for test here\n") + end + + it 'can be used before a single-word command with command arguments' do + expect(run('help', 'test', 'command-arg')).to eq("Implement help for test here\n") + end + + it 'can be used before a multi-word command with command arguments' do + expect( + run('help', 'module', 'install', 'command-arg') do + command('module install') { |c| c.when_called { say 'whee!' } } + end + ).to eq("Implement help for module install here\n") + end + describe 'help_paging program information' do it 'enables paging when enabled' do run('--help') { program :help_paging, true } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/spec_helper.rb new/spec/spec_helper.rb --- old/spec/spec_helper.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/spec/spec_helper.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rubygems' require 'stringio' require 'simplecov' @@ -6,7 +8,7 @@ end # Unshift so that local files load instead of something in gems -$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib' +$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib" # This basically replicates the behavior of `require 'commander/import'` # but without adding an `at_exit` hook, which interferes with exit code @@ -49,7 +51,7 @@ # Create a new command runner def new_command_runner(*args, &block) - Commander::Runner.instance_variable_set :"@singleton", Commander::Runner.new(args) + Commander::Runner.instance_variable_set :@instance, Commander::Runner.new(args) program :name, 'test' program :version, '1.2.3' program :description, 'something' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/ui_spec.rb new/spec/ui_spec.rb --- old/spec/ui_spec.rb 2020-03-12 22:42:42.000000000 +0100 +++ new/spec/ui_spec.rb 2021-04-09 22:54:22.000000000 +0200 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Commander::UI do @@ -5,7 +7,7 @@ describe '.replace_tokens' do it 'should replace tokens within a string, with hash values' do - result = Commander::UI.replace_tokens 'Welcome :name, enjoy your :object'.freeze, name: 'TJ', object: 'cookie' + result = Commander::UI.replace_tokens 'Welcome :name, enjoy your :object', name: 'TJ', object: 'cookie' expect(result).to eq('Welcome TJ, enjoy your cookie') end end @@ -15,7 +17,7 @@ exception = false begin progress([]) {} - rescue + rescue StandardError exception = true end expect(exception).not_to be true