Project

General

Profile

« Previous | Next » 

Revision d7c67746

Added by Michael Moll almost 6 years ago

Fixes #19873 - Fix Style/MultilineIfModifier cop (#5705)

  • Refs #20891 - fix for new rubocop rules
  • Fixes #19873 - Fix Style/MultilineIfModifier cop

View differences:

app/services/foreman/importer_puppetclass.rb
def self.suggest_key_type(value, default = nil, detect_json_or_yaml = false)
case value
when String
begin
return "json" if JSON.load value
rescue
return "yaml" if YAML.load value
end if detect_json_or_yaml
if detect_json_or_yaml
begin
return "json" if JSON.load value
rescue
return "yaml" if YAML.load value
end
end
"string"
when TrueClass, FalseClass
"boolean"

Also available in: Unified diff