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) }
|
||||
|
||||
p.action do |args, options|
|
||||
p.action do |args, _|
|
||||
if args.empty?
|
||||
Jekyll.logger.error "A subcommand is required."
|
||||
puts p
|
||||
|
|
|
@ -11,7 +11,7 @@ module Jekyll
|
|||
|
||||
add_build_options(c)
|
||||
|
||||
c.action do |args, options|
|
||||
c.action do |_, options|
|
||||
options["serving"] = false
|
||||
Jekyll::Commands::Build.process(options)
|
||||
end
|
||||
|
|
|
@ -9,7 +9,7 @@ module Jekyll
|
|||
|
||||
add_build_options(c)
|
||||
|
||||
c.action do |args, options|
|
||||
c.action do |_, options|
|
||||
Jekyll::Commands::Clean.process(options)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,7 +10,7 @@ module Jekyll
|
|||
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -32,7 +32,7 @@ module Jekyll
|
|||
categories_from_path(collection.relative_directory)
|
||||
end
|
||||
|
||||
data.default_proc = proc do |hash, key|
|
||||
data.default_proc = proc do |_, key|
|
||||
site.frontmatter_defaults.find(relative_path, collection.label, key)
|
||||
end
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ module Jekyll
|
|||
#
|
||||
# Returns a Hash with all the keys and values resolved.
|
||||
def to_h
|
||||
keys.each_with_object({}) do |(key, val), result|
|
||||
keys.each_with_object({}) do |(key, _), result|
|
||||
result[key] = self[key]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -15,7 +15,7 @@ module Jekyll
|
|||
def file(filename)
|
||||
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][:count] ||= 0
|
||||
@stats[filename][:count] += 1
|
||||
|
|
|
@ -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 { |_, file_stats| -file_stats[:time] }
|
||||
sorted = sorted.slice(0, n)
|
||||
|
||||
table = [%w(Filename Count Bytes Time)]
|
||||
|
|
|
@ -41,7 +41,7 @@ module Jekyll
|
|||
process(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)
|
||||
end
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ module Jekyll
|
|||
|
||||
Jekyll::Hooks.trigger :site, :pre_render, self, payload
|
||||
|
||||
collections.each do |label, collection|
|
||||
collections.each do |_, collection|
|
||||
collection.docs.each do |document|
|
||||
if regenerator.regenerate?(document)
|
||||
document.output = Jekyll::Renderer.new(self, document, payload).run
|
||||
|
|
|
@ -5,7 +5,7 @@ module Jekyll
|
|||
@level = DEBUG
|
||||
@default_formatter = Formatter.new
|
||||
@logdev = $stdout
|
||||
@formatter = proc do |severity, datetime, progname, msg|
|
||||
@formatter = proc do |_, _, _, msg|
|
||||
"#{msg}"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue