Skip to content

Commit

Permalink
fix hash syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Feb 8, 2018
1 parent 67f64ff commit bca4fec
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 40 deletions.
10 changes: 0 additions & 10 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/include/ftp-server/dialogs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions src/include/ftp-server/wizards.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def MainSequence
sequence = {
"ws_start" => "vsftpd",
"vsftpd" => {
:abort => :abort,
:next => :next
abort: :abort,
next: :next
}
}
temp = Empty()
Expand All @@ -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
Expand All @@ -72,7 +72,7 @@ def FtpServerAutoSequence

sequence = {
"ws_start" => "main",
"main" => { :abort => :abort, :next => :next }
"main" => { abort: :abort, next: :next }
}

Wizard.CreateDialog
Expand Down
46 changes: 23 additions & 23 deletions src/modules/FtpServer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 <string>"
publish variable: :UI_keys, type: "list <string>"

# @attribute DEFAULT_CONFIG
# @return [Hash<String,String>]
# Defaults for {#EDIT_SETTINGS} in case the value is not found
# in the system settings.
publish :variable => :DEFAULT_CONFIG, :type => "map <string, string>"
publish variable: :DEFAULT_CONFIG, type: "map <string, string>"

# @attribute VS_SETTINGS
# @return [Hash<String,String>]
# Uses snake_case, {FtpServerWriteLoadInclude#ValueUI ValueUI} maps it
# to {#EDIT_SETTINGS} and {#DEFAULT_CONFIG}.
publish :variable => :VS_SETTINGS, :type => "map <string, string>"
publish variable: :VS_SETTINGS, type: "map <string, string>"

# @attribute EDIT_SETTINGS
# @return [Hash<String,String>]
publish :variable => :EDIT_SETTINGS, :type => "map <string, string>"
publish variable: :EDIT_SETTINGS, type: "map <string, string>"

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
Expand Down

0 comments on commit bca4fec

Please sign in to comment.