From bca4fec583d553a56a590fe313b18cc3af5aaf63 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Thu, 8 Feb 2018 16:03:15 +0100 Subject: [PATCH] fix hash syntax --- .rubocop.yml | 10 ------- src/include/ftp-server/dialogs.rb | 2 +- src/include/ftp-server/wizards.rb | 12 ++++---- src/modules/FtpServer.rb | 46 +++++++++++++++---------------- 4 files changed, 30 insertions(+), 40 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index ef5f58f..59a50b1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -74,16 +74,6 @@ Style/GuardClause: - 'src/include/ftp-server/dialogs.rb' - 'src/include/ftp-server/write_load.rb' -# Offense count: 57 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. -# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys -Style/HashSyntax: - Exclude: - - 'src/include/ftp-server/dialogs.rb' - - 'src/include/ftp-server/wizards.rb' - - 'src/modules/FtpServer.rb' - # Offense count: 7 Style/IfInsideElse: Exclude: diff --git a/src/include/ftp-server/dialogs.rb b/src/include/ftp-server/dialogs.rb index 73cecc1..dfe9a3d 100644 --- a/src/include/ftp-server/dialogs.rb +++ b/src/include/ftp-server/dialogs.rb @@ -83,7 +83,7 @@ def initialize_ftp_server_dialogs(include_target) # # abort functions for confirm abort # - @functions = { :abort => fun_ref(method(:AbortDialog), "boolean ()") } + @functions = { abort: fun_ref(method(:AbortDialog), "boolean ()") } end # Returns whether user confirmed aborting the configuration. diff --git a/src/include/ftp-server/wizards.rb b/src/include/ftp-server/wizards.rb index 4c6f327..62f0b8c 100644 --- a/src/include/ftp-server/wizards.rb +++ b/src/include/ftp-server/wizards.rb @@ -30,8 +30,8 @@ def MainSequence sequence = { "ws_start" => "vsftpd", "vsftpd" => { - :abort => :abort, - :next => :next + abort: :abort, + next: :next } } temp = Empty() @@ -51,9 +51,9 @@ def FtpdSequence sequence = { "ws_start" => "read", - "read" => { :abort => :abort, :next => "main" }, - "main" => { :abort => :abort, :next => "write" }, - "write" => { :abort => :abort, :next => :next } + "read" => { abort: :abort, next: "main" }, + "main" => { abort: :abort, next: "write" }, + "write" => { abort: :abort, next: :next } } Wizard.CreateDialog @@ -72,7 +72,7 @@ def FtpServerAutoSequence sequence = { "ws_start" => "main", - "main" => { :abort => :abort, :next => :next } + "main" => { abort: :abort, next: :next } } Wizard.CreateDialog diff --git a/src/modules/FtpServer.rb b/src/modules/FtpServer.rb index fb9058e..dd1ee44 100644 --- a/src/modules/FtpServer.rb +++ b/src/modules/FtpServer.rb @@ -857,14 +857,14 @@ def AutoPackages # @!attribute $1 # @return [$2] def self.publish_variable(name, type) - publish :variable => name, :type => type + publish variable: name, type: type end - publish :function => :SetModified, :type => "void (boolean)" - publish :function => :Modified, :type => "boolean ()" - publish :function => :WriteToEditMap, :type => "boolean (string, string)" - publish :function => :WriteSettings, :type => "boolean ()" - publish :function => :WriteUpload, :type => "boolean ()" + publish function: :SetModified, type: "void (boolean)" + publish function: :Modified, type: "boolean ()" + publish function: :WriteToEditMap, type: "boolean (string, string)" + publish function: :WriteSettings, type: "boolean ()" + publish function: :WriteUpload, type: "boolean ()" publish_variable :modified, "boolean" publish_variable :proposal_valid, "boolean" publish_variable :vsftpd_installed, "boolean" @@ -883,39 +883,39 @@ def self.publish_variable(name, type) # A list of setting keys yast cares about, # in the {#EDIT_SETTINGS} vocabulary. # It should be made a constant. - publish :variable => :UI_keys, :type => "list " + publish variable: :UI_keys, type: "list " # @attribute DEFAULT_CONFIG # @return [Hash] # Defaults for {#EDIT_SETTINGS} in case the value is not found # in the system settings. - publish :variable => :DEFAULT_CONFIG, :type => "map " + publish variable: :DEFAULT_CONFIG, type: "map " # @attribute VS_SETTINGS # @return [Hash] # Uses snake_case, {FtpServerWriteLoadInclude#ValueUI ValueUI} maps it # to {#EDIT_SETTINGS} and {#DEFAULT_CONFIG}. - publish :variable => :VS_SETTINGS, :type => "map " + publish variable: :VS_SETTINGS, type: "map " # @attribute EDIT_SETTINGS # @return [Hash] - publish :variable => :EDIT_SETTINGS, :type => "map " + publish variable: :EDIT_SETTINGS, type: "map " - publish :function => :ValueUI, :type => "string (string, boolean)" - publish :function => :ValueUIEdit, :type => "string (string)" + publish function: :ValueUI, type: "string (string, boolean)" + publish function: :ValueUIEdit, type: "string (string)" publish_variable :ftps, "boolean" publish_variable :write_only, "boolean" - publish :function => :GetModified, :type => "boolean ()" - publish :function => :Abort, :type => "boolean ()" - publish :function => :PollAbort, :type => "boolean ()" - publish :function => :Read, :type => "boolean ()" - publish :function => :Write, :type => "boolean ()" - publish :function => :Import, :type => "boolean (map)" - publish :function => :InitDaemon, :type => "boolean ()" - publish :function => :Export, :type => "map ()" - publish :function => :OptionsSummary, :type => "string ()" - publish :function => :Summary, :type => "string ()" - publish :function => :AutoPackages, :type => "map ()" + publish function: :GetModified, type: "boolean ()" + publish function: :Abort, type: "boolean ()" + publish function: :PollAbort, type: "boolean ()" + publish function: :Read, type: "boolean ()" + publish function: :Write, type: "boolean ()" + publish function: :Import, type: "boolean (map)" + publish function: :InitDaemon, type: "boolean ()" + publish function: :Export, type: "map ()" + publish function: :OptionsSummary, type: "string ()" + publish function: :Summary, type: "string ()" + publish function: :AutoPackages, type: "map ()" end FtpServer = FtpServerClass.new