Rubocop: Style/SpaceBeforeBlockBraces
Rubocop: Style/SpaceInsideBlockBraces
This commit is contained in:
parent
a70d89a862
commit
663a2d3279
|
@ -273,7 +273,7 @@ module Jekyll
|
||||||
return config if config['collections'].nil?
|
return config if config['collections'].nil?
|
||||||
|
|
||||||
if config['collections'].is_a?(Array)
|
if config['collections'].is_a?(Array)
|
||||||
config['collections'] = Hash[config['collections'].map{|c| [c, {}]}]
|
config['collections'] = Hash[config['collections'].map { |c| [c, {}] }]
|
||||||
end
|
end
|
||||||
config['collections']['posts'] ||= {}
|
config['collections']['posts'] ||= {}
|
||||||
config['collections']['posts']['output'] = true
|
config['collections']['posts']['output'] = true
|
||||||
|
|
|
@ -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 { |w| w.capitalize! || w }.join(' ')
|
||||||
end
|
end
|
||||||
populate_categories
|
populate_categories
|
||||||
populate_tags
|
populate_tags
|
||||||
|
@ -386,7 +386,7 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
def next_doc
|
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
|
if pos && pos < collection.docs.length - 1
|
||||||
collection.docs[pos + 1]
|
collection.docs[pos + 1]
|
||||||
else
|
else
|
||||||
|
@ -395,7 +395,7 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
def previous_doc
|
def previous_doc
|
||||||
pos = collection.docs.index {|post| post.equal?(self) }
|
pos = collection.docs.index { |post| post.equal?(self) }
|
||||||
if pos && pos > 0
|
if pos && pos > 0
|
||||||
collection.docs[pos - 1]
|
collection.docs[pos - 1]
|
||||||
else
|
else
|
||||||
|
|
|
@ -337,7 +337,7 @@ module Jekyll
|
||||||
pairs = item.map { |k, v| as_liquid([k, v]) }
|
pairs = item.map { |k, v| as_liquid([k, v]) }
|
||||||
Hash[pairs]
|
Hash[pairs]
|
||||||
when Array
|
when Array
|
||||||
item.map{ |i| as_liquid(i) }
|
item.map { |i| as_liquid(i) }
|
||||||
else
|
else
|
||||||
if item.respond_to?(:to_liquid)
|
if item.respond_to?(:to_liquid)
|
||||||
liquidated = item.to_liquid
|
liquidated = item.to_liquid
|
||||||
|
|
|
@ -69,7 +69,7 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
def data_for_table(n)
|
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)
|
sorted = sorted.slice(0, n)
|
||||||
|
|
||||||
table = [%w(Filename Count Bytes Time)]
|
table = [%w(Filename Count Bytes Time)]
|
||||||
|
|
|
@ -22,7 +22,7 @@ module Jekyll
|
||||||
|
|
||||||
# Sorts posts, pages, and static files.
|
# Sorts posts, pages, and static files.
|
||||||
def sort_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.pages.sort_by!(&:name)
|
||||||
site.static_files.sort_by!(&:relative_path)
|
site.static_files.sort_by!(&:relative_path)
|
||||||
end
|
end
|
||||||
|
@ -38,9 +38,9 @@ module Jekyll
|
||||||
base = site.in_source_dir(dir)
|
base = site.in_source_dir(dir)
|
||||||
|
|
||||||
dot = Dir.chdir(base) { filter_entries(Dir.entries('.'), base) }
|
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_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
|
dot_static_files = dot_files - dot_pages
|
||||||
|
|
||||||
retrieve_posts(dir)
|
retrieve_posts(dir)
|
||||||
|
|
|
@ -14,8 +14,8 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns an array of static pages.
|
# Returns an array of static pages.
|
||||||
def read(files)
|
def read(files)
|
||||||
files.map{ |page| @unfiltered_content << Page.new(@site, @site.source, @dir, page) }
|
files.map { |page| @unfiltered_content << Page.new(@site, @site.source, @dir, page) }
|
||||||
@unfiltered_content.select{ |page| site.publisher.publish?(page) }
|
@unfiltered_content.select { |page| site.publisher.publish?(page) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,7 +14,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns an array of static files.
|
# Returns an array of static files.
|
||||||
def read(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
|
@unfiltered_content
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -68,7 +68,7 @@ eos
|
||||||
[:linenos, opts.fetch(:linenos, nil)],
|
[:linenos, opts.fetch(:linenos, nil)],
|
||||||
[:encoding, opts.fetch(:encoding, 'utf-8')],
|
[:encoding, opts.fetch(:encoding, 'utf-8')],
|
||||||
[:cssclass, opts.fetch(:cssclass, nil)]
|
[:cssclass, opts.fetch(:cssclass, nil)]
|
||||||
].reject {|f| f.last.nil? }]
|
].reject { |f| f.last.nil? }]
|
||||||
else
|
else
|
||||||
opts
|
opts
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue