Rubocop: Style/SymbolProc
- Pass &:to_sym as an argument to map instead of a block - Pass &:capitalize as an argument to select instead of a block - Pass &:to_s as an argument to map instead of a block
This commit is contained in:
parent
704ca6b8cc
commit
af5d51289f
|
@ -5,7 +5,7 @@ module Jekyll
|
||||||
def initialize(config)
|
def initialize(config)
|
||||||
Jekyll::External.require_with_graceful_fail "rdiscount"
|
Jekyll::External.require_with_graceful_fail "rdiscount"
|
||||||
@config = config
|
@config = config
|
||||||
@rdiscount_extensions = @config['rdiscount']['extensions'].map { |e| e.to_sym }
|
@rdiscount_extensions = @config['rdiscount']['extensions'].map(&:to_sym)
|
||||||
end
|
end
|
||||||
|
|
||||||
def convert(content)
|
def convert(content)
|
||||||
|
|
|
@ -291,7 +291,7 @@ module Jekyll
|
||||||
"ext" => ext
|
"ext" => ext
|
||||||
})
|
})
|
||||||
merge_data!({"date" => date}) if data['date'].nil? || data['date'].to_i == site.time.to_i
|
merge_data!({"date" => date}) if data['date'].nil? || data['date'].to_i == site.time.to_i
|
||||||
data['title'] ||= slug.split('-').select { |w| w.capitalize! || w }.join(' ')
|
data['title'] ||= slug.split('-').select(&:capitalize).join(' ')
|
||||||
end
|
end
|
||||||
populate_categories
|
populate_categories
|
||||||
populate_tags
|
populate_tags
|
||||||
|
@ -317,7 +317,7 @@ module Jekyll
|
||||||
merge_data!({
|
merge_data!({
|
||||||
'categories' => (
|
'categories' => (
|
||||||
Array(data['categories']) + Utils.pluralized_array_from_hash(data, 'category', 'categories')
|
Array(data['categories']) + Utils.pluralized_array_from_hash(data, 'category', 'categories')
|
||||||
).map { |c| c.to_s }.flatten.uniq
|
).map(&:to_s).flatten.uniq
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue