lib/paperclip/callbacks.rb
Line is too long. [83/80] Open
Open
define_callbacks(*[callbacks, { terminator: hasta_la_vista_baby }].flatten)
- Exclude checks
The use of eval
is a serious security risk. Open
Open
eval <<-end_callbacks
- Read upRead up
- Exclude checks
This cop checks for the use of Kernel#eval
and Binding#eval
.
Example:
# bad
eval(something)
binding.eval(something)
Use uppercase heredoc delimiters. Open
Open
end_callbacks
- Read upRead up
- Exclude checks
This cop checks that your heredocs are using the configured case. By default it is configured to enforce uppercase heredocs.
Example: EnforcedStyle: uppercase (default)
# bad
<<-sql
SELECT * FROM foo
sql
# good
<<-SQL
SELECT * FROM foo
SQL
Example: EnforcedStyle: lowercase
# bad
<<-SQL
SELECT * FROM foo
SQL
# good
<<-sql
SELECT * FROM foo
sql
Pass __FILE__
and __LINE__
to eval
method, as they are used by backtraces. Open
Open
eval <<-end_callbacks
- Read upRead up
- Exclude checks
This cop checks eval
method usage. eval
can receive source location
metadata, that are filename and line number. The metadata is used by
backtraces. This cop recommends to pass the metadata to eval
method.
Example:
# bad
eval <<-RUBY
def do_something
end
RUBY
# bad
C.class_eval <<-RUBY
def do_something
end
RUBY
# good
eval <<-RUBY, binding, __FILE__, __LINE__ + 1
def do_something
end
RUBY
# good
C.class_eval <<-RUBY, __FILE__, __LINE__ + 1
def do_something
end
RUBY