Hello community, here is the log from the commit of package rubygem-sshkit for openSUSE:Factory checked in at 2019-08-06 15:10:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-sshkit (Old) and /work/SRC/openSUSE:Factory/.rubygem-sshkit.new.4126 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-sshkit" Tue Aug 6 15:10:45 2019 rev:26 rq:717324 version:1.19.1 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-sshkit/rubygem-sshkit.changes 2019-06-19 21:01:20.150135235 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-sshkit.new.4126/rubygem-sshkit.changes 2019-08-06 15:10:46.603763466 +0200 @@ -1,0 +2,16 @@ +Fri Jul 19 09:39:24 UTC 2019 - Stephan Kulow <co...@suse.com> + +- updated to version 1.19.1 + see installed CHANGELOG.md + + ## [1.19.1][] (2019-07-02) + + * [#465](https://github.com/capistrano/sshkit/pull/456): Fix a regression in 1.19.0 that prevented `~` from being used in Capistrano paths, e.g. `:deploy_to`, etc. - [@grosser](https://github.com/grosser) + + ## [1.19.0][] (2019-06-30) + + * [#455](https://github.com/capistrano/sshkit/pull/455): Ensure UUID of commands are stable in logging - [@lazyatom](https://github.com/lazyatom) + * [#453](https://github.com/capistrano/sshkit/pull/453): `as` and `within` now properly escape their user/group/path arguments, and the command nested within an `as` block is now properly escaped before passing to `sh -c`. In the unlikely case that you were manually escaping commands passed to SSHKit as a workaround, you will no longer need to do this. See [#458](https://github.com/capistrano/sshkit/issues/458) for examples of what has been fixed. - [@grosser](https://github.com/grosser) + * [#460](https://github.com/capistrano/sshkit/pull/460): Handle IPv6 addresses without port - [@will-in-wi](https://github.com/will-in-wi) + +------------------------------------------------------------------- Old: ---- sshkit-1.18.2.gem New: ---- sshkit-1.19.1.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-sshkit.spec ++++++ --- /var/tmp/diff_new_pack.dNfz03/_old 2019-08-06 15:10:47.227763177 +0200 +++ /var/tmp/diff_new_pack.dNfz03/_new 2019-08-06 15:10:47.231763175 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-sshkit -Version: 1.18.2 +Version: 1.19.1 Release: 0 %define mod_name sshkit %define mod_full_name %{mod_name}-%{version} ++++++ sshkit-1.18.2.gem -> sshkit-1.19.1.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.rubocop.yml new/.rubocop.yml --- old/.rubocop.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/.rubocop.yml 2019-07-02 18:48:06.000000000 +0200 @@ -0,0 +1,63 @@ +inherit_from: .rubocop_todo.yml + +AllCops: + DisplayCopNames: true + DisplayStyleGuide: true + TargetRubyVersion: 2.0 + +Lint/AmbiguousBlockAssociation: + Enabled: + false +Metrics/BlockLength: + Exclude: + - "spec/**/*" + - "lib/**/*.rake" +Style/BarePercentLiterals: + EnforcedStyle: percent_q +Style/ClassAndModuleChildren: + Enabled: false +Style/DoubleNegation: + Enabled: false +Style/FileName: + Exclude: + - "Dangerfile" +Style/IndentHeredoc: + Enabled: false +Style/SpaceAroundEqualsInParameterDefault: + EnforcedStyle: no_space +Style/StringLiterals: + EnforcedStyle: double_quotes +Style/TrivialAccessors: + AllowPredicates: true +Style/PercentLiteralDelimiters: + Enabled: false +Style/SingleLineBlockParams: + Enabled: false +Style/ModuleFunction: + Enabled: false + +# Enable someday +Style/Documentation: + Enabled: false + +# Needs refactors +Metrics/PerceivedComplexity: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Style/PredicateName: + Enabled: false +Metrics/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Style/PerlBackrefs: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Style/AccessorMethodName: + Enabled: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.rubocop_todo.yml new/.rubocop_todo.yml --- old/.rubocop_todo.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/.rubocop_todo.yml 2019-07-02 18:48:06.000000000 +0200 @@ -0,0 +1,637 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2019-05-15 19:11:29 -0500 using RuboCop version 0.49.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: Include, TreatCommentsAsGroupSeparators. +# Include: **/Gemfile, **/gems.rb +Bundler/OrderedGems: + Exclude: + - 'Gemfile' + +# Offense count: 1 +# Cop supports --auto-correct. +Layout/EmptyLineAfterMagicComment: + Exclude: + - 'sshkit.gemspec' + +# Offense count: 11 +# Cop supports --auto-correct. +# Configuration parameters: AllowAdjacentOneLineDefs, NumberOfEmptyLines. +Layout/EmptyLineBetweenDefs: + Exclude: + - 'lib/core_ext/hash.rb' + - 'lib/sshkit/backends/abstract.rb' + - 'lib/sshkit/host.rb' + - 'lib/sshkit/log_message.rb' + - 'test/unit/formatters/test_pretty.rb' + - 'test/unit/test_mapping_interaction_handler.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Layout/EmptyLines: + Exclude: + - 'test/unit/formatters/test_pretty.rb' + - 'test/unit/test_mapping_interaction_handler.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Layout/EmptyLinesAroundAccessModifier: + Exclude: + - 'lib/sshkit/runners/sequential.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: + Exclude: + - 'Rakefile' + - 'sshkit.gemspec' + - 'test/helper.rb' + +# Offense count: 73 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines +Layout/EmptyLinesAroundClassBody: + Enabled: false + +# Offense count: 2 +# Cop supports --auto-correct. +Layout/EmptyLinesAroundMethodBody: + Exclude: + - 'lib/sshkit/host.rb' + +# Offense count: 100 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines +Layout/EmptyLinesAroundModuleBody: + Enabled: false + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. +Layout/ExtraSpacing: + Exclude: + - 'test/unit/backends/test_abstract.rb' + - 'test/unit/backends/test_netssh.rb' + - 'test/unit/test_host.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_brackets +Layout/IndentArray: + Exclude: + - 'test/functional/backends/test_netssh.rb' + - 'test/unit/backends/test_netssh.rb' + - 'test/unit/formatters/test_pretty.rb' + +# Offense count: 11 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_braces +Layout/IndentHash: + Exclude: + - 'test/functional/backends/test_local.rb' + - 'test/functional/backends/test_netssh.rb' + - 'test/support/vagrant_wrapper.rb' + - 'test/unit/formatters/test_custom.rb' + - 'test/unit/formatters/test_pretty.rb' + - 'test/unit/test_mapping_interaction_handler.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: Width, IgnoredPatterns. +Layout/IndentationWidth: + Exclude: + - 'lib/sshkit/exception.rb' + - 'test/functional/backends/test_netssh.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +Layout/LeadingCommentSpace: + Exclude: + - 'lib/sshkit/backends/netssh.rb' + - 'lib/sshkit/command.rb' + - 'test/helper.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineMethodCallBraceLayout: + Exclude: + - 'test/unit/test_command.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: aligned, indented, indented_relative_to_receiver +Layout/MultilineMethodCallIndentation: + Exclude: + - 'lib/sshkit/host.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: aligned, indented +Layout/MultilineOperationIndentation: + Exclude: + - 'lib/sshkit/backends/netssh.rb' + +# Offense count: 10 +# Cop supports --auto-correct. +Layout/SpaceAfterComma: + Exclude: + - 'lib/sshkit/command.rb' + - 'test/functional/backends/test_netssh.rb' + - 'test/unit/backends/test_netssh.rb' + - 'test/unit/test_configuration.rb' + +# Offense count: 16 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: space, no_space +Layout/SpaceAroundEqualsInParameterDefault: + Exclude: + - 'lib/sshkit/backends/abstract.rb' + - 'lib/sshkit/backends/local.rb' + - 'lib/sshkit/backends/netssh.rb' + - 'lib/sshkit/backends/netssh/known_hosts.rb' + - 'lib/sshkit/command_map.rb' + - 'lib/sshkit/runners/abstract.rb' + - 'lib/sshkit/runners/group.rb' + - 'lib/sshkit/runners/sequential.rb' + - 'test/helper.rb' + - 'test/unit/backends/test_netssh.rb' + +# Offense count: 12 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment. +Layout/SpaceAroundOperators: + Exclude: + - 'test/functional/backends/test_netssh.rb' + - 'test/unit/backends/test_abstract.rb' + - 'test/unit/test_command.rb' + - 'test/unit/test_deprecation_logger.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: space, no_space +Layout/SpaceBeforeBlockBraces: + Exclude: + - 'lib/sshkit/command.rb' + - 'lib/sshkit/host.rb' + - 'sshkit.gemspec' + - 'test/unit/test_command_map.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment. +Layout/SpaceBeforeFirstArg: + Exclude: + - 'test/unit/backends/test_netssh.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces, SpaceBeforeBlockParameters. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideBlockBraces: + Exclude: + - 'lib/sshkit/command.rb' + - 'lib/sshkit/host.rb' + - 'test/functional/backends/test_netssh.rb' + - 'test/unit/test_configuration.rb' + +# Offense count: 39 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideHashLiteralBraces: + Exclude: + - 'lib/sshkit/backends/abstract.rb' + - 'lib/sshkit/backends/netssh.rb' + - 'test/functional/backends/test_netssh.rb' + - 'test/unit/backends/test_abstract.rb' + - 'test/unit/formatters/test_dot.rb' + - 'test/unit/test_color.rb' + - 'test/unit/test_command.rb' + - 'test/unit/test_host.rb' + - 'test/unit/test_mapping_interaction_handler.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Layout/SpaceInsidePercentLiteralDelimiters: + Exclude: + - 'lib/sshkit/formatters/pretty.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: final_newline, final_blank_line +Layout/TrailingBlankLines: + Exclude: + - 'lib/sshkit/backends/netssh/known_hosts.rb' + +# Offense count: 16 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: prefer_alias, prefer_alias_method +Style/Alias: + Exclude: + - 'lib/sshkit/backends/printer.rb' + - 'lib/sshkit/backends/skipper.rb' + - 'lib/sshkit/command.rb' + - 'lib/sshkit/formatters/abstract.rb' + - 'lib/sshkit/host.rb' + - 'test/unit/formatters/test_custom.rb' + +# Offense count: 2 +Style/AsciiComments: + Exclude: + - 'lib/sshkit/command.rb' + - 'test/helper.rb' + +# Offense count: 11 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: percent_q, bare_percent +Style/BarePercentLiterals: + Exclude: + - 'lib/sshkit/command.rb' + - 'test/unit/test_command.rb' + +# Offense count: 10 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: braces, no_braces, context_dependent +Style/BracesAroundHashParameters: + Exclude: + - 'lib/sshkit/backends/abstract.rb' + - 'test/functional/backends/test_netssh.rb' + - 'test/unit/backends/test_abstract.rb' + - 'test/unit/formatters/test_dot.rb' + - 'test/unit/test_color.rb' + - 'test/unit/test_host.rb' + - 'test/unit/test_mapping_interaction_handler.rb' + +# Offense count: 1 +Style/CaseEquality: + Exclude: + - 'lib/sshkit/mapping_interaction_handler.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: is_a?, kind_of? +Style/ClassCheck: + Exclude: + - 'lib/sshkit/command.rb' + - 'lib/sshkit/formatters/pretty.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/ClassMethods: + Exclude: + - 'test/unit/backends/test_abstract.rb' + +# Offense count: 3 +Style/ClassVars: + Exclude: + - 'lib/sshkit.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly, IncludeTernaryExpressions. +# SupportedStyles: assign_to_condition, assign_inside_condition +Style/ConditionalAssignment: + Exclude: + - 'lib/sshkit/command_map.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/EachWithObject: + Exclude: + - 'lib/core_ext/hash.rb' + +# Offense count: 12 +# Cop supports --auto-correct. +Style/EmptyLiteral: + Exclude: + - 'lib/sshkit/command.rb' + - 'test/functional/backends/test_netssh.rb' + - 'test/unit/backends/test_printer.rb' + - 'test/unit/formatters/test_custom.rb' + - 'test/unit/formatters/test_dot.rb' + - 'test/unit/formatters/test_pretty.rb' + - 'test/unit/formatters/test_simple_text.rb' + - 'test/unit/test_coordinator.rb' + - 'test/unit/test_deprecation_logger.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: compact, expanded +Style/EmptyMethod: + Exclude: + - 'lib/sshkit/formatters/dot.rb' + - 'lib/sshkit/host.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: format, sprintf, percent +Style/FormatString: + Exclude: + - 'lib/sshkit/formatters/pretty.rb' + +# Offense count: 6 +# Configuration parameters: AllowedVariables. +Style/GlobalVars: + Exclude: + - 'test/unit/test_coordinator.rb' + +# Offense count: 7 +# Configuration parameters: MinBodyLength. +Style/GuardClause: + Exclude: + - 'lib/sshkit/backends/connection_pool.rb' + - 'lib/sshkit/backends/netssh.rb' + - 'lib/sshkit/command.rb' + - 'lib/sshkit/formatters/pretty.rb' + - 'lib/sshkit/host.rb' + - 'lib/sshkit/runners/sequential.rb' + - 'test/helper.rb' + +# Offense count: 33 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. +# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys +Style/HashSyntax: + Exclude: + - 'Rakefile' + - 'lib/sshkit/color.rb' + - 'test/functional/backends/test_netssh.rb' + - 'test/unit/backends/test_abstract.rb' + - 'test/unit/backends/test_connection_pool.rb' + - 'test/unit/formatters/test_custom.rb' + - 'test/unit/test_configuration.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: MaxLineLength. +Style/IfUnlessModifier: + Exclude: + - 'lib/sshkit/backends/connection_pool.rb' + - 'lib/sshkit/backends/netssh/known_hosts.rb' + - 'lib/sshkit/configuration.rb' + - 'lib/sshkit/runners/sequential.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: line_count_dependent, lambda, literal +Style/Lambda: + Exclude: + - 'test/unit/backends/test_abstract.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: call, braces +Style/LambdaCall: + Exclude: + - 'lib/sshkit/command_map.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +Style/LineEndConcatenation: + Exclude: + - 'lib/sshkit/backends/netssh.rb' + - 'test/unit/test_command.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/MethodCallWithoutArgsParentheses: + Exclude: + - 'test/unit/test_color.rb' + - 'test/unit/test_coordinator.rb' + - 'test/unit/test_mapping_interaction_handler.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline +Style/MethodDefParentheses: + Exclude: + - 'lib/sshkit/exception.rb' + +# Offense count: 3 +# Configuration parameters: SupportedStyles. +# SupportedStyles: snake_case, camelCase +Style/MethodName: + EnforcedStyle: snake_case + Exclude: + - 'test/unit/test_color.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/MutableConstant: + Exclude: + - 'Vagrantfile' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: Strict. +Style/NumericLiterals: + MinDigits: 6 + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles. +# SupportedStyles: predicate, comparison +Style/NumericPredicate: + Exclude: + - 'spec/**/*' + - 'lib/sshkit/command.rb' + +# Offense count: 1 +Style/OpMethod: + Exclude: + - 'lib/sshkit/host.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Style/ParallelAssignment: + Exclude: + - 'lib/sshkit/backends/netssh/known_hosts.rb' + - 'lib/sshkit/color.rb' + - 'lib/sshkit/command.rb' + - 'lib/sshkit/log_message.rb' + - 'test/helper.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: lower_case_q, upper_case_q +Style/PercentQLiterals: + Exclude: + - 'test/unit/test_command.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: short, verbose +Style/PreferredHashMethods: + Exclude: + - 'test/unit/test_host.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/RedundantBegin: + Exclude: + - 'test/unit/test_coordinator.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/RedundantParentheses: + Exclude: + - 'test/functional/backends/test_netssh.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: AllowMultipleReturnValues. +Style/RedundantReturn: + Exclude: + - 'lib/sshkit/command.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +Style/RedundantSelf: + Exclude: + - 'lib/core_ext/hash.rb' + - 'lib/sshkit/command.rb' + - 'lib/sshkit/host.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/RescueModifier: + Exclude: + - 'lib/core_ext/hash.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: AllowAsExpressionSeparator. +Style/Semicolon: + Exclude: + - 'test/unit/backends/test_connection_pool.rb' + - 'test/unit/test_command_map.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: only_raise, only_fail, semantic +Style/SignalException: + Exclude: + - 'lib/sshkit/configuration.rb' + - 'lib/sshkit/host.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: AllowIfMethodIsEmpty. +Style/SingleLineMethods: + Exclude: + - 'lib/sshkit/backends/abstract.rb' + +# Offense count: 476 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiterals: + Enabled: false + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiteralsInInterpolation: + Exclude: + - 'lib/sshkit/command.rb' + - 'lib/sshkit/runners/parallel.rb' + - 'lib/sshkit/runners/sequential.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: MinSize, SupportedStyles. +# SupportedStyles: percent, brackets +Style/SymbolArray: + EnforcedStyle: brackets + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInLiteral: + Exclude: + - 'lib/sshkit/host.rb' + - 'test/unit/backends/test_netssh.rb' + - 'test/unit/test_configuration.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist. +# Whitelist: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym +Style/TrivialAccessors: + Exclude: + - 'lib/sshkit/host.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/UnlessElse: + Exclude: + - 'lib/sshkit/backends/netssh.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/UnneededCapitalW: + Exclude: + - 'test/functional/backends/test_netssh.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/UnneededPercentQ: + Exclude: + - 'sshkit.gemspec' + - 'test/unit/test_command.rb' + +# Offense count: 1 +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: snake_case, normalcase, non_integer +Style/VariableNumber: + Exclude: + - 'test/unit/backends/test_connection_pool.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/WhileUntilDo: + Exclude: + - 'lib/sshkit/backends/local.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: SupportedStyles, WordRegex. +# SupportedStyles: percent, brackets +Style/WordArray: + EnforcedStyle: percent + MinSize: 3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.travis.yml new/.travis.yml --- old/.travis.yml 2019-02-04 00:05:41.000000000 +0100 +++ new/.travis.yml 2019-07-02 18:48:06.000000000 +0200 @@ -6,6 +6,9 @@ - 2.2 - 2.1 - 2.0 +branches: + only: + - master matrix: include: # Run Danger only once, on 2.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2019-02-04 00:05:41.000000000 +0100 +++ new/CHANGELOG.md 2019-07-02 18:48:06.000000000 +0200 @@ -7,6 +7,16 @@ * Your contribution here! +## [1.19.1][] (2019-07-02) + + * [#465](https://github.com/capistrano/sshkit/pull/456): Fix a regression in 1.19.0 that prevented `~` from being used in Capistrano paths, e.g. `:deploy_to`, etc. - [@grosser](https://github.com/grosser) + +## [1.19.0][] (2019-06-30) + + * [#455](https://github.com/capistrano/sshkit/pull/455): Ensure UUID of commands are stable in logging - [@lazyatom](https://github.com/lazyatom) + * [#453](https://github.com/capistrano/sshkit/pull/453): `as` and `within` now properly escape their user/group/path arguments, and the command nested within an `as` block is now properly escaped before passing to `sh -c`. In the unlikely case that you were manually escaping commands passed to SSHKit as a workaround, you will no longer need to do this. See [#458](https://github.com/capistrano/sshkit/issues/458) for examples of what has been fixed. - [@grosser](https://github.com/grosser) + * [#460](https://github.com/capistrano/sshkit/pull/460): Handle IPv6 addresses without port - [@will-in-wi](https://github.com/will-in-wi) + ## [1.18.2][] (2019-02-03) * [#448](https://github.com/capistrano/sshkit/pull/448): Fix misbehaving connection eviction loop when disabling connection pooling - [Sebastian Cohnen](https://github.com/tisba) @@ -758,7 +768,9 @@ First release. -[Unreleased]: https://github.com/capistrano/sshkit/compare/v1.18.2...HEAD +[Unreleased]: https://github.com/capistrano/sshkit/compare/v1.19.1...HEAD +[1.19.1]: https://github.com/capistrano/sshkit/compare/v1.19.0...v1.19.1 +[1.19.0]: https://github.com/capistrano/sshkit/compare/v1.18.2...v1.19.0 [1.18.2]: https://github.com/capistrano/sshkit/compare/v1.18.1...v1.18.2 [1.18.1]: https://github.com/capistrano/sshkit/compare/v1.18.0...v1.18.1 [1.18.0]: https://github.com/capistrano/sshkit/compare/v1.17.0...v1.18.0 Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sshkit/backends/abstract.rb new/lib/sshkit/backends/abstract.rb --- old/lib/sshkit/backends/abstract.rb 2019-02-04 00:05:41.000000000 +0100 +++ new/lib/sshkit/backends/abstract.rb 2019-07-02 18:48:06.000000000 +0200 @@ -1,3 +1,5 @@ +require 'shellwords' + module SSHKit module Backend @@ -80,13 +82,14 @@ def within(directory, &_block) (@pwd ||= []).push directory.to_s + escaped = Command.shellescape_except_tilde(pwd_path) execute <<-EOTEST, verbosity: Logger::DEBUG - if test ! -d #{File.join(@pwd)} - then echo "Directory does not exist '#{File.join(@pwd)}'" 1>&2 + if test ! -d #{escaped} + then echo "Directory does not exist '#{escaped}'" 1>&2 false fi - EOTEST - yield + EOTEST + yield ensure @pwd.pop end @@ -108,8 +111,8 @@ @group = nil end execute <<-EOTEST, verbosity: Logger::DEBUG - if ! sudo -u #{@user} whoami > /dev/null - then echo "You cannot switch to user '#{@user}' using sudo, please check the sudoers file" 1>&2 + if ! sudo -u #{@user.to_s.shellescape} whoami > /dev/null + then echo "You cannot switch to user '#{@user.to_s.shellescape}' using sudo, please check the sudoers file" 1>&2 false fi EOTEST diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sshkit/command.rb new/lib/sshkit/command.rb --- old/lib/sshkit/command.rb 2019-02-04 00:05:41.000000000 +0100 +++ new/lib/sshkit/command.rb 2019-07-02 18:48:06.000000000 +0200 @@ -1,5 +1,6 @@ require 'digest/sha1' require 'securerandom' +require 'shellwords' # @author Lee Hambley module SSHKit @@ -9,7 +10,7 @@ Failed = Class.new(SSHKit::StandardError) - attr_reader :command, :args, :options, :started_at, :started, :exit_status, :full_stdout, :full_stderr + attr_reader :command, :args, :options, :started_at, :started, :exit_status, :full_stdout, :full_stderr, :uuid # Initialize a new Command object # @@ -25,6 +26,7 @@ @args = args @options.symbolize_keys! @stdout, @stderr, @full_stdout, @full_stderr = String.new, String.new, String.new, String.new + @uuid = Digest::SHA1.hexdigest(SecureRandom.random_bytes(10))[0..7] end def complete? @@ -41,10 +43,6 @@ @started = new_started end - def uuid - @uuid ||= Digest::SHA1.hexdigest(SecureRandom.random_bytes(10))[0..7] - end - def success? exit_status.nil? ? false : exit_status.to_i == 0 end @@ -145,7 +143,7 @@ def within(&_block) return yield unless options[:in] - sprintf("cd #{options[:in]} && %s", yield) + "cd #{self.class.shellescape_except_tilde(options[:in])} && #{yield}" end def environment_hash @@ -161,28 +159,30 @@ end def with(&_block) - return yield unless environment_hash.any? - "( export #{environment_string} ; #{yield} )" + env_string = environment_string + return yield if env_string.empty? + "( export #{env_string} ; #{yield} )" end def user(&_block) return yield unless options[:user] - "sudo -u #{options[:user]} #{environment_string + " " unless environment_string.empty?}-- sh -c '#{yield}'" + env_string = environment_string + "sudo -u #{options[:user].to_s.shellescape} #{env_string + " " unless env_string.empty?}-- sh -c #{yield.shellescape}" end def in_background(&_block) return yield unless options[:run_in_background] - sprintf("( nohup %s > /dev/null & )", yield) + "( nohup #{yield} > /dev/null & )" end def umask(&_block) return yield unless SSHKit.config.umask - sprintf("umask #{SSHKit.config.umask} && %s", yield) + "umask #{SSHKit.config.umask} && #{yield}" end def group(&_block) return yield unless options[:group] - %Q(sg #{options[:group]} -c "#{yield}") + "sg #{options[:group].to_s.shellescape} -c #{yield.shellescape}" # We could also use the so-called heredoc format perhaps: #"newgrp #{options[:group]} <<EOC \\\"%s\\\" EOC" % %Q{#{yield}} end @@ -219,6 +219,11 @@ end end + # allow using home directory but escape everything else like spaces etc + def self.shellescape_except_tilde(file) + file.shellescape.gsub("\\~", "~") + end + private def default_options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sshkit/host.rb new/lib/sshkit/host.rb --- old/lib/sshkit/host.rb 2019-02-04 00:05:41.000000000 +0100 +++ new/lib/sshkit/host.rb 2019-07-02 18:48:06.000000000 +0200 @@ -151,18 +151,20 @@ # @private # :nodoc: class IPv6HostWithPortParser < SimpleHostParser + IPV6_REGEX = /\[([a-fA-F0-9:]+)\](?:\:(\d+))?/ def self.suitable?(host_string) - host_string.match(/[a-fA-F0-9:]+:\d+/) + host_string.match(IPV6_REGEX) end def port - @host_string.split(':').last.to_i + prt = @host_string.match(IPV6_REGEX)[2] + prt = prt.to_i unless prt.nil? + prt end def hostname - @host_string.gsub!(/\[|\]/, '') - @host_string.split(':')[0..-2].join(':') + @host_string.match(IPV6_REGEX)[1] end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sshkit/version.rb new/lib/sshkit/version.rb --- old/lib/sshkit/version.rb 2019-02-04 00:05:41.000000000 +0100 +++ new/lib/sshkit/version.rb 2019-07-02 18:48:06.000000000 +0200 @@ -1,3 +1,3 @@ module SSHKit - VERSION = "1.18.2".freeze + VERSION = "1.19.1".freeze end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2019-02-04 00:05:41.000000000 +0100 +++ new/metadata 2019-07-02 18:48:06.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: sshkit version: !ruby/object:Gem::Version - version: 1.18.2 + version: 1.19.1 platform: ruby authors: - Lee Hambley @@ -9,7 +9,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2019-02-03 00:00:00.000000000 Z +date: 2019-07-02 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: net-ssh @@ -181,6 +181,8 @@ extra_rdoc_files: [] files: - ".gitignore" +- ".rubocop.yml" +- ".rubocop_todo.yml" - ".travis.yml" - ".yardopts" - BREAKING_API_WISHLIST.md @@ -284,7 +286,7 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.0.1 +rubygems_version: 3.0.4 signing_key: specification_version: 4 summary: SSHKit makes it easy to write structured, testable SSH commands in Ruby diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/functional/backends/test_netssh.rb new/test/functional/backends/test_netssh.rb --- old/test/functional/backends/test_netssh.rb 2019-02-04 00:05:41.000000000 +0100 +++ new/test/functional/backends/test_netssh.rb 2019-07-02 18:48:06.000000000 +0200 @@ -38,7 +38,7 @@ "Command: /usr/bin/env ls -l\n", "Command: if test ! -d /tmp; then echo \"Directory does not exist '/tmp'\" 1>&2; false; fi\n", "Command: if ! sudo -u root whoami > /dev/null; then echo \"You cannot switch to user 'root' using sudo, please check the sudoers file\" 1>&2; false; fi\n", - "Command: cd /tmp && ( export RAILS_ENV=\"production\" ; sudo -u root RAILS_ENV=\"production\" -- sh -c '/usr/bin/env touch restart.txt' )\n" + "Command: cd /tmp && ( export RAILS_ENV=\"production\" ; sudo -u root RAILS_ENV=\"production\" -- sh -c /usr/bin/env\\ touch\\ restart.txt )\n" ], command_lines end @@ -82,7 +82,7 @@ command_lines = @output.lines.select { |line| line.start_with?('Command:') } assert_equal [ "Command: if ! sudo -u root whoami > /dev/null; then echo \"You cannot switch to user 'root' using sudo, please check the sudoers file\" 1>&2; false; fi\n", - "Command: sudo -u root -- sh -c 'sg admin -c \"/usr/bin/env touch restart.txt\"'\n" + "Command: sudo -u root -- sh -c sg\\ admin\\ -c\\ /usr/bin/env\\\\\\ touch\\\\\\ restart.txt\n" ], command_lines end @@ -96,21 +96,18 @@ end def test_ssh_option_merge - verify_host_opt = if Net::SSH::Version::MAJOR >= 5 - { verify_host_key: :always } - else - { paranoid: true } - end - a_host.ssh_options = verify_host_opt + keepalive_opt = { keepalive: true } + test_host = a_host.dup + test_host.ssh_options = keepalive_opt host_ssh_options = {} SSHKit::Backend::Netssh.config.ssh_options = { forward_agent: false } - Netssh.new(a_host) do |host| + Netssh.new(test_host) do |host| capture(:uname) host_ssh_options = host.ssh_options end.run - assert_equal [:forward_agent, *verify_host_opt.keys, :known_hosts, :logger, :password_prompt].sort, host_ssh_options.keys.sort + assert_equal [:forward_agent, *keepalive_opt.keys, :known_hosts, :logger, :password_prompt].sort, host_ssh_options.keys.sort assert_equal false, host_ssh_options[:forward_agent] - assert_equal verify_host_opt.values.first, host_ssh_options[verify_host_opt.keys.first] + assert_equal keepalive_opt.values.first, host_ssh_options[keepalive_opt.keys.first] assert_instance_of SSHKit::Backend::Netssh::KnownHosts, host_ssh_options[:known_hosts] end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/support/vagrant_wrapper.rb new/test/support/vagrant_wrapper.rb --- old/test/support/vagrant_wrapper.rb 2019-02-04 00:05:41.000000000 +0100 +++ new/test/support/vagrant_wrapper.rb 2019-07-02 18:48:06.000000000 +0200 @@ -46,10 +46,19 @@ user: vm['user'] || 'vagrant', hostname: vm['hostname'] || 'localhost', port: vm['port'] || '22', - password: vm['password'] || 'vagrant' + password: vm['password'] || 'vagrant', + ssh_options: host_verify_options } SSHKit::Host.new(host_options) end + + def host_verify_options + if Net::SSH::Version::MAJOR >= 5 + { verify_host_key: :never } + else + { paranoid: false } + end + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/backends/test_abstract.rb new/test/unit/backends/test_abstract.rb --- old/test/unit/backends/test_abstract.rb 2019-02-04 00:05:41.000000000 +0100 +++ new/test/unit/backends/test_abstract.rb 2019-07-02 18:48:06.000000000 +0200 @@ -99,6 +99,18 @@ assert_equal '/usr/bin/env cat file', backend.executed_command.to_command end + def test_within_home + backend = ExampleBackend.new do + within '~/foo' do + execute :cat, 'file', :strip => false + end + end + + backend.run + + assert_equal 'cd ~/foo && /usr/bin/env cat file', backend.executed_command.to_command + end + def test_background_logs_deprecation_warnings deprecation_out = '' SSHKit.config.deprecation_output = deprecation_out diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/test_command.rb new/test/unit/test_command.rb --- old/test/unit/test_command.rb 2019-02-04 00:05:41.000000000 +0100 +++ new/test/unit/test_command.rb 2019-07-02 18:48:06.000000000 +0200 @@ -51,13 +51,13 @@ def test_double_quotes_are_escaped_in_env SSHKit.config = nil c = Command.new(:rails, 'server', env: {foo: 'asdf"hjkl'}) - assert_equal %{( export FOO="asdf\\\"hjkl" ; /usr/bin/env rails server )}, c.to_command + assert_equal %{( export FOO="asdf\\"hjkl" ; /usr/bin/env rails server )}, c.to_command end def test_percentage_symbol_handled_in_env SSHKit.config = nil c = Command.new(:rails, 'server', env: {foo: 'asdf%hjkl'}, user: "anotheruser") - assert_equal %{( export FOO="asdf%hjkl" ; sudo -u anotheruser FOO=\"asdf%hjkl\" -- sh -c '/usr/bin/env rails server' )}, c.to_command + assert_equal %{( export FOO="asdf%hjkl" ; sudo -u anotheruser FOO=\"asdf%hjkl\" -- sh -c /usr/bin/env\\ rails\\ server )}, c.to_command end def test_including_the_env_doesnt_addressively_escape @@ -84,6 +84,16 @@ assert_equal "cd /opt/sites && /usr/bin/env ls -l", c.to_command end + def test_working_in_home_directory + c = Command.new(:ls, '-l', in: "~/sites") + assert_equal "cd ~/sites && /usr/bin/env ls -l", c.to_command + end + + def test_working_in_a_given_weird_directory + c = Command.new(:ls, '-l', in: "/opt/sites and stuff") + assert_equal "cd /opt/sites\\ and\\ stuff && /usr/bin/env ls -l", c.to_command + end + def test_working_in_a_given_directory_with_env c = Command.new(:ls, '-l', in: "/opt/sites", env: {a: :b}) assert_equal %{cd /opt/sites && ( export A="b" ; /usr/bin/env ls -l )}, c.to_command @@ -97,17 +107,27 @@ def test_working_as_a_given_user c = Command.new(:whoami, user: :anotheruser) - assert_equal "sudo -u anotheruser -- sh -c '/usr/bin/env whoami'", c.to_command + assert_equal "sudo -u anotheruser -- sh -c /usr/bin/env\\ whoami", c.to_command + end + + def test_working_as_a_given_weird_user + c = Command.new(:whoami, user: "mr space |") + assert_equal "sudo -u mr\\ space\\ \\| -- sh -c /usr/bin/env\\ whoami", c.to_command end def test_working_as_a_given_group c = Command.new(:whoami, group: :devvers) - assert_equal 'sg devvers -c "/usr/bin/env whoami"', c.to_command + assert_equal 'sg devvers -c /usr/bin/env\\ whoami', c.to_command + end + + def test_working_as_a_given_weird_group + c = Command.new(:whoami, group: "space | group") + assert_equal "sg space\\ \\|\\ group -c /usr/bin/env\\ whoami", c.to_command end def test_working_as_a_given_user_and_group c = Command.new(:whoami, user: :anotheruser, group: :devvers) - assert_equal %Q(sudo -u anotheruser -- sh -c 'sg devvers -c "/usr/bin/env whoami"'), c.to_command + assert_equal %Q(sudo -u anotheruser -- sh -c sg\\ devvers\\ -c\\ /usr/bin/env\\\\\\ whoami), c.to_command end def test_umask @@ -125,13 +145,13 @@ def test_umask_with_working_directory_and_user SSHKit.config.umask = '007' c = Command.new(:touch, 'somefile', in: '/var', user: 'alice') - assert_equal "cd /var && umask 007 && sudo -u alice -- sh -c '/usr/bin/env touch somefile'", c.to_command + assert_equal "cd /var && umask 007 && sudo -u alice -- sh -c /usr/bin/env\\ touch\\ somefile", c.to_command end def test_umask_with_env_and_working_directory_and_user SSHKit.config.umask = '007' c = Command.new(:touch, 'somefile', user: 'bob', env: {a: 'b'}, in: '/var') - assert_equal %{cd /var && umask 007 && ( export A="b" ; sudo -u bob A="b" -- sh -c '/usr/bin/env touch somefile' )}, c.to_command + assert_equal %{cd /var && umask 007 && ( export A="b" ; sudo -u bob A="b" -- sh -c /usr/bin/env\\ touch\\ somefile )}, c.to_command end def test_verbosity_defaults_to_logger_info @@ -245,5 +265,10 @@ assert_equal "whoami exit status: 1\nwhoami stdout: Nothing written\nwhoami stderr: Nothing written\n", error.message end + def test_shares_same_uuid_before_and_after_redaction + command = Command.new(:whoami) + command_with_redaction = command.with_redaction + assert_equal command.uuid, command_with_redaction.uuid, "UUID should be stable before and after redaction" + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/test_host.rb new/test/unit/test_host.rb --- old/test/unit/test_host.rb 2019-02-04 00:05:41.000000000 +0100 +++ new/test/unit/test_host.rb 2019-07-02 18:48:06.000000000 +0200 @@ -56,6 +56,11 @@ assert_equal '1fff:0:a88:85a3::ac1f', h.hostname end + def test_does_not_confuse_ipv6_hosts_without_port_specification + h = Host.new '[2001:db8:85a3:8d3:1319:8a2e:370:7348]' + assert_equal '2001:db8:85a3:8d3:1319:8a2e:370:7348', h.hostname + end + def testing_host_casting_to_a_string assert_equal "example.com", Host.new('u...@example.com:1234').to_s end