lib/geminabox.rb
Pass array contents as separate arguments. Open
Open
public_folder: File.join(File.dirname(__FILE__), *%w[.. public]),
- Read upRead up
- Exclude checks
This cop checks for unneeded usages of splat expansion
Example:
# bad
a = *[1, 2, 3]
a = *'a'
a = *1
begin
foo
rescue *[StandardError, ApplicationError]
bar
end
case foo
when *[1, 2, 3]
bar
else
baz
end
Example:
# good
c = [1, 2, 3]
a = *c
a, b = *c
a, *b = *c
a = *1..10
a = ['a']
begin
foo
rescue StandardError, ApplicationError
bar
end
case foo
when *[1, 2, 3]
bar
else
baz
end
Pass array contents as separate arguments. Open
Open
views: File.join(File.dirname(__FILE__), *%w[.. views]),
- Read upRead up
- Exclude checks
This cop checks for unneeded usages of splat expansion
Example:
# bad
a = *[1, 2, 3]
a = *'a'
a = *1
begin
foo
rescue *[StandardError, ApplicationError]
bar
end
case foo
when *[1, 2, 3]
bar
else
baz
end
Example:
# good
c = [1, 2, 3]
a = *c
a, b = *c
a, *b = *c
a = *1..10
a = ['a']
begin
foo
rescue StandardError, ApplicationError
bar
end
case foo
when *[1, 2, 3]
bar
else
baz
end
Pass array contents as separate arguments. Open
Open
data: File.join(File.dirname(__FILE__), *%w[.. data]),
- Read upRead up
- Exclude checks
This cop checks for unneeded usages of splat expansion
Example:
# bad
a = *[1, 2, 3]
a = *'a'
a = *1
begin
foo
rescue *[StandardError, ApplicationError]
bar
end
case foo
when *[1, 2, 3]
bar
else
baz
end
Example:
# good
c = [1, 2, 3]
a = *c
a, b = *c
a, *b = *c
a = *1..10
a = ['a']
begin
foo
rescue StandardError, ApplicationError
bar
end
case foo
when *[1, 2, 3]
bar
else
baz
end