Rubocop: Lint/UnusedBlockArgument
- Unused block argument
This commit is contained in:
parent
7ca4f7cd62
commit
11f0aab4b1
|
@ -28,7 +28,7 @@ Mercenary.program(:jekyll) do |p|
|
||||||
|
|
||||||
Jekyll::Command.subclasses.each { |c| c.init_with_program(p) }
|
Jekyll::Command.subclasses.each { |c| c.init_with_program(p) }
|
||||||
|
|
||||||
p.action do |args, options|
|
p.action do |args, _|
|
||||||
if args.empty?
|
if args.empty?
|
||||||
Jekyll.logger.error "A subcommand is required."
|
Jekyll.logger.error "A subcommand is required."
|
||||||
puts p
|
puts p
|
||||||
|
|
|
@ -11,7 +11,7 @@ module Jekyll
|
||||||
|
|
||||||
add_build_options(c)
|
add_build_options(c)
|
||||||
|
|
||||||
c.action do |args, options|
|
c.action do |_, options|
|
||||||
options["serving"] = false
|
options["serving"] = false
|
||||||
Jekyll::Commands::Build.process(options)
|
Jekyll::Commands::Build.process(options)
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Jekyll
|
||||||
|
|
||||||
add_build_options(c)
|
add_build_options(c)
|
||||||
|
|
||||||
c.action do |args, options|
|
c.action do |_, options|
|
||||||
Jekyll::Commands::Clean.process(options)
|
Jekyll::Commands::Clean.process(options)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,7 +10,7 @@ module Jekyll
|
||||||
|
|
||||||
c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
||||||
|
|
||||||
c.action do |args, options|
|
c.action do |_, options|
|
||||||
Jekyll::Commands::Doctor.process(options)
|
Jekyll::Commands::Doctor.process(options)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,7 +32,7 @@ module Jekyll
|
||||||
categories_from_path(collection.relative_directory)
|
categories_from_path(collection.relative_directory)
|
||||||
end
|
end
|
||||||
|
|
||||||
data.default_proc = proc do |hash, key|
|
data.default_proc = proc do |_, key|
|
||||||
site.frontmatter_defaults.find(relative_path, collection.label, key)
|
site.frontmatter_defaults.find(relative_path, collection.label, key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns a Hash with all the keys and values resolved.
|
# Returns a Hash with all the keys and values resolved.
|
||||||
def to_h
|
def to_h
|
||||||
keys.each_with_object({}) do |(key, val), result|
|
keys.each_with_object({}) do |(key, _), result|
|
||||||
result[key] = self[key]
|
result[key] = self[key]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@ module Jekyll
|
||||||
def file(filename)
|
def file(filename)
|
||||||
filename = @site.in_source_dir(filename).sub(/\A#{Regexp.escape(@site.source)}\//, '')
|
filename = @site.in_source_dir(filename).sub(/\A#{Regexp.escape(@site.source)}\//, '')
|
||||||
|
|
||||||
LiquidRenderer::File.new(self, filename).tap do |file|
|
LiquidRenderer::File.new(self, filename).tap do
|
||||||
@stats[filename] ||= {}
|
@stats[filename] ||= {}
|
||||||
@stats[filename][:count] ||= 0
|
@stats[filename][:count] ||= 0
|
||||||
@stats[filename][:count] += 1
|
@stats[filename][:count] += 1
|
||||||
|
|
|
@ -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 { |_, 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)]
|
||||||
|
|
|
@ -41,7 +41,7 @@ module Jekyll
|
||||||
process(name)
|
process(name)
|
||||||
read_yaml(File.join(base, dir), name)
|
read_yaml(File.join(base, dir), name)
|
||||||
|
|
||||||
data.default_proc = proc do |hash, key|
|
data.default_proc = proc do |_, key|
|
||||||
site.frontmatter_defaults.find(File.join(dir, name), type, key)
|
site.frontmatter_defaults.find(File.join(dir, name), type, key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ module Jekyll
|
||||||
|
|
||||||
Jekyll::Hooks.trigger :site, :pre_render, self, payload
|
Jekyll::Hooks.trigger :site, :pre_render, self, payload
|
||||||
|
|
||||||
collections.each do |label, collection|
|
collections.each do |_, collection|
|
||||||
collection.docs.each do |document|
|
collection.docs.each do |document|
|
||||||
if regenerator.regenerate?(document)
|
if regenerator.regenerate?(document)
|
||||||
document.output = Jekyll::Renderer.new(self, document, payload).run
|
document.output = Jekyll::Renderer.new(self, document, payload).run
|
||||||
|
|
|
@ -5,7 +5,7 @@ module Jekyll
|
||||||
@level = DEBUG
|
@level = DEBUG
|
||||||
@default_formatter = Formatter.new
|
@default_formatter = Formatter.new
|
||||||
@logdev = $stdout
|
@logdev = $stdout
|
||||||
@formatter = proc do |severity, datetime, progname, msg|
|
@formatter = proc do |_, _, _, msg|
|
||||||
"#{msg}"
|
"#{msg}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue