Rubocop: Style/CaseIndentation
- Indent when as deep as case
This commit is contained in:
parent
2c9a349f9a
commit
f6fd9014ba
|
@ -19,9 +19,9 @@ module Jekyll
|
|||
|
||||
def get_processor
|
||||
case @config["markdown"].downcase
|
||||
when "redcarpet" then return RedcarpetParser.new(@config)
|
||||
when "kramdown" then return KramdownParser.new(@config)
|
||||
when "rdiscount" then return RDiscountParser.new(@config)
|
||||
when "redcarpet" then return RedcarpetParser.new(@config)
|
||||
when "kramdown" then return KramdownParser.new(@config)
|
||||
when "rdiscount" then return RDiscountParser.new(@config)
|
||||
else
|
||||
get_custom_processor
|
||||
end
|
||||
|
|
|
@ -13,19 +13,20 @@ module Jekyll
|
|||
def update_deprecated_types(set)
|
||||
return set unless set.key?('scope') && set['scope'].key?('type')
|
||||
|
||||
set['scope']['type'] = case set['scope']['type']
|
||||
when 'page'
|
||||
Deprecator.defaults_deprecate_type('page', 'pages')
|
||||
'pages'
|
||||
when 'post'
|
||||
Deprecator.defaults_deprecate_type('post', 'posts')
|
||||
'posts'
|
||||
when 'draft'
|
||||
Deprecator.defaults_deprecate_type('draft', 'drafts')
|
||||
'drafts'
|
||||
else
|
||||
set['scope']['type']
|
||||
end
|
||||
set['scope']['type'] =
|
||||
case set['scope']['type']
|
||||
when 'page'
|
||||
Deprecator.defaults_deprecate_type('page', 'pages')
|
||||
'pages'
|
||||
when 'post'
|
||||
Deprecator.defaults_deprecate_type('post', 'posts')
|
||||
'posts'
|
||||
when 'draft'
|
||||
Deprecator.defaults_deprecate_type('draft', 'drafts')
|
||||
'drafts'
|
||||
else
|
||||
set['scope']['type']
|
||||
end
|
||||
|
||||
set
|
||||
end
|
||||
|
|
|
@ -50,13 +50,13 @@ module Jekyll
|
|||
# Returns the contents of the data file.
|
||||
def read_data_file(path)
|
||||
case File.extname(path).downcase
|
||||
when '.csv'
|
||||
CSV.read(path, {
|
||||
:headers => true,
|
||||
:encoding => site.config['encoding']
|
||||
}).map(&:to_hash)
|
||||
else
|
||||
SafeYAML.load_file(path)
|
||||
when '.csv'
|
||||
CSV.read(path, {
|
||||
:headers => true,
|
||||
:encoding => site.config['encoding']
|
||||
}).map(&:to_hash)
|
||||
else
|
||||
SafeYAML.load_file(path)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -164,16 +164,17 @@ module Jekyll
|
|||
end
|
||||
|
||||
# Replace each character sequence with a hyphen
|
||||
re = case mode
|
||||
when 'raw'
|
||||
SLUGIFY_RAW_REGEXP
|
||||
when 'default'
|
||||
SLUGIFY_DEFAULT_REGEXP
|
||||
when 'pretty'
|
||||
# "._~!$&'()+,;=@" is human readable (not URI-escaped) in URL
|
||||
# and is allowed in both extN and NTFS.
|
||||
SLUGIFY_PRETTY_REGEXP
|
||||
end
|
||||
re =
|
||||
case mode
|
||||
when 'raw'
|
||||
SLUGIFY_RAW_REGEXP
|
||||
when 'default'
|
||||
SLUGIFY_DEFAULT_REGEXP
|
||||
when 'pretty'
|
||||
# "._~!$&'()+,;=@" is human readable (not URI-escaped) in URL
|
||||
# and is allowed in both extN and NTFS.
|
||||
SLUGIFY_PRETTY_REGEXP
|
||||
end
|
||||
|
||||
# Strip according to the mode
|
||||
slug = string.gsub(re, '-')
|
||||
|
|
Loading…
Reference in New Issue