Fix Naming/MethodParameterName cop in the samples.

This commit is contained in:
Robert Haines 2020-02-17 22:51:53 +00:00
parent 846e704048
commit fcadea61e2
3 changed files with 14 additions and 12 deletions

View File

@ -42,7 +42,9 @@ Naming/AccessorMethodName:
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip, db, os
Naming/MethodParameterName:
Enabled: false
Exclude:
- 'lib/**/*.rb'
- 'test/**/*.rb'
# Offense count: 721
# Configuration parameters: EnforcedStyle.

View File

@ -20,12 +20,12 @@ class ZipDialog < ZipDialogUI
self, SLOT('extract_files()'))
end
def zipfile(&proc)
Zip::File.open(@zip_filename, &proc)
def zipfile(&a_proc)
Zip::File.open(@zip_filename, &a_proc)
end
def each(&proc)
Zip::File.foreach(@zip_filename, &proc)
def each(&a_proc)
Zip::File.foreach(@zip_filename, &a_proc)
end
def refresh

View File

@ -9,10 +9,10 @@ require 'find'
module Zip
module ZipFind
def self.find(path, zipFilePattern = /\.zip$/i)
def self.find(path, zip_file_pattern = /\.zip$/i)
Find.find(path) do |filename|
yield(filename)
next unless zipFilePattern.match(filename) && File.file?(filename)
next unless zip_file_pattern.match(filename) && File.file?(filename)
begin
Zip::File.foreach(filename) do |entry|
@ -24,9 +24,9 @@ module Zip
end
end
def self.find_file(path, fileNamePattern, zipFilePattern = /\.zip$/i)
find(path, zipFilePattern) do |filename|
yield(filename) if fileNamePattern.match(filename)
def self.find_file(path, filename_pattern, zip_file_pattern = /\.zip$/i)
find(path, zip_file_pattern) do |filename|
yield(filename) if filename_pattern.match(filename)
end
end
end
@ -58,8 +58,8 @@ if $PROGRAM_NAME == __FILE__
puts "Usage: #{$PROGRAM_NAME} PATH ZIPFILENAME_PATTERN FILNAME_PATTERN"
end
def self.report_entry_found(fileName)
puts fileName
def self.report_entry_found(filename)
puts filename
end
end