Rubocop: Style/SpaceBeforeBlockBraces

Rubocop: Style/SpaceInsideBlockBraces
This commit is contained in:
Pat Hawks 2016-01-03 15:58:02 -08:00
parent a70d89a862
commit 663a2d3279
No known key found for this signature in database
GPG Key ID: F1746FF5F18B3D1B
8 changed files with 13 additions and 13 deletions

View File

@ -273,7 +273,7 @@ module Jekyll
return config if config['collections'].nil?
if config['collections'].is_a?(Array)
config['collections'] = Hash[config['collections'].map{|c| [c, {}]}]
config['collections'] = Hash[config['collections'].map { |c| [c, {}] }]
end
config['collections']['posts'] ||= {}
config['collections']['posts']['output'] = true

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 { |w| w.capitalize! || w }.join(' ')
end
populate_categories
populate_tags
@ -386,7 +386,7 @@ module Jekyll
end
def next_doc
pos = collection.docs.index {|post| post.equal?(self) }
pos = collection.docs.index { |post| post.equal?(self) }
if pos && pos < collection.docs.length - 1
collection.docs[pos + 1]
else
@ -395,7 +395,7 @@ module Jekyll
end
def previous_doc
pos = collection.docs.index {|post| post.equal?(self) }
pos = collection.docs.index { |post| post.equal?(self) }
if pos && pos > 0
collection.docs[pos - 1]
else

View File

@ -337,7 +337,7 @@ module Jekyll
pairs = item.map { |k, v| as_liquid([k, v]) }
Hash[pairs]
when Array
item.map{ |i| as_liquid(i) }
item.map { |i| as_liquid(i) }
else
if item.respond_to?(:to_liquid)
liquidated = item.to_liquid

View File

@ -69,7 +69,7 @@ module Jekyll
end
def data_for_table(n)
sorted = @stats.sort_by{ |filename, file_stats| -file_stats[:time] }
sorted = @stats.sort_by { |filename, file_stats| -file_stats[:time] }
sorted = sorted.slice(0, n)
table = [%w(Filename Count Bytes Time)]

View File

@ -22,7 +22,7 @@ module Jekyll
# Sorts posts, pages, and static files.
def sort_files!
site.collections.values.each{|c| c.docs.sort!}
site.collections.values.each { |c| c.docs.sort! }
site.pages.sort_by!(&:name)
site.static_files.sort_by!(&:relative_path)
end
@ -38,9 +38,9 @@ module Jekyll
base = site.in_source_dir(dir)
dot = Dir.chdir(base) { filter_entries(Dir.entries('.'), base) }
dot_dirs = dot.select{ |file| File.directory?(@site.in_source_dir(base, file)) }
dot_dirs = dot.select { |file| File.directory?(@site.in_source_dir(base, file)) }
dot_files = (dot - dot_dirs)
dot_pages = dot_files.select{ |file| Utils.has_yaml_header?(@site.in_source_dir(base, file)) }
dot_pages = dot_files.select { |file| Utils.has_yaml_header?(@site.in_source_dir(base, file)) }
dot_static_files = dot_files - dot_pages
retrieve_posts(dir)

View File

@ -14,8 +14,8 @@ module Jekyll
#
# Returns an array of static pages.
def read(files)
files.map{ |page| @unfiltered_content << Page.new(@site, @site.source, @dir, page) }
@unfiltered_content.select{ |page| site.publisher.publish?(page) }
files.map { |page| @unfiltered_content << Page.new(@site, @site.source, @dir, page) }
@unfiltered_content.select { |page| site.publisher.publish?(page) }
end
end
end

View File

@ -14,7 +14,7 @@ module Jekyll
#
# Returns an array of static files.
def read(files)
files.map{ |file| @unfiltered_content << StaticFile.new(@site, @site.source, @dir, file)}
files.map { |file| @unfiltered_content << StaticFile.new(@site, @site.source, @dir, file) }
@unfiltered_content
end
end

View File

@ -68,7 +68,7 @@ eos
[:linenos, opts.fetch(:linenos, nil)],
[:encoding, opts.fetch(:encoding, 'utf-8')],
[:cssclass, opts.fetch(:cssclass, nil)]
].reject {|f| f.last.nil? }]
].reject { |f| f.last.nil? }]
else
opts
end