lib/tasks/emails.rake
Unused block argument - t
. If it's necessary, use _
or _t
as an argument name to indicate that it won't be used. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars) Open
Open
task :emails, [:file] => :environment do |t, args|
- Read upRead up
- Exclude checks
This cop checks for unused block arguments.
Example:
# bad
do_something do |used, unused|
puts used
end
do_something do |bar|
puts :foo
end
define_method(:foo) do |bar|
puts :baz
end
Example:
#good
do_something do |used, _unused|
puts used
end
do_something do
puts :foo
end
define_method(:foo) do |_bar|
puts :baz
end
Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://github.com/bbatsov/ruby-style-guide#consistent-string-literals) Open
Open
require File.expand_path("../../config/environment", File.dirname(__FILE__))
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Line is too long. [100/90] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
#this is needed because rake tasks load classes lazily; from the command line, the task will
- Exclude checks
Line is too long. [104/90] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
Organisation.import_emails(args[:file],1000).split("\n").each { |msg| Rails.logger.info(msg) }
- Exclude checks
Line is too long. [91/90] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
#otherwise fail because it takes the below intended monkeypatch as first definition
- Exclude checks