Rubocop: Lint/UnusedBlockArgument

- Unused block argument
This commit is contained in:
Pat Hawks 2016-01-03 16:24:13 -08:00
parent 7ca4f7cd62
commit 11f0aab4b1
No known key found for this signature in database
GPG Key ID: F1746FF5F18B3D1B
11 changed files with 11 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

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 { |_, file_stats| -file_stats[:time] }
sorted = sorted.slice(0, n)
table = [%w(Filename Count Bytes Time)]

View File

@ -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

View File

@ -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

View File

@ -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