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:
Pat Hawks 2016-01-03 16:02:32 -08:00
parent 704ca6b8cc
commit af5d51289f
No known key found for this signature in database
GPG Key ID: F1746FF5F18B3D1B
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ module Jekyll
def initialize(config)
Jekyll::External.require_with_graceful_fail "rdiscount"
@config = config
@rdiscount_extensions = @config['rdiscount']['extensions'].map { |e| e.to_sym }
@rdiscount_extensions = @config['rdiscount']['extensions'].map(&:to_sym)
end
def convert(content)

View File

@ -291,7 +291,7 @@ module Jekyll
"ext" => ext
})
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
populate_categories
populate_tags
@ -317,7 +317,7 @@ module Jekyll
merge_data!({
'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