mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Small refactor using Object#in?
This commit is contained in:
parent
748cab29b4
commit
5502f0f8d1
1 changed files with 3 additions and 2 deletions
|
@ -33,6 +33,7 @@ module Ameba
|
|||
@code = corrected_code
|
||||
@lines = nil
|
||||
@ast = nil
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
|
@ -70,9 +71,9 @@ module Ameba
|
|||
path.ends_with?("_spec.cr")
|
||||
end
|
||||
|
||||
# Returns `true` if *filepath* matches the source's path, `false` if it does not.
|
||||
# Returns `true` if *filepath* matches the source's path, `false` otherwise.
|
||||
def matches_path?(filepath)
|
||||
path == filepath || path == File.expand_path(filepath)
|
||||
path.in?(filepath, File.expand_path(filepath))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue