Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simplified from_file to from.

  • Loading branch information...
commit 8ead972430fbf39bd2a4d576b5d3a8264f74ca2c 1 parent 3c82051
@postmodern authored
Showing with 2 additions and 10 deletions.
  1. +2 −10 lib/warnings/warnings.rb
View
12 lib/warnings/warnings.rb
@@ -24,16 +24,8 @@ def self.grep(pattern)
# @return [Warning]
# The warnings from the sub-path.
#
- def self.from_file(path)
- if File.extname(path).empty?
- # default the file extension to `.rb`
- path = "#{path}.rb"
- end
-
- $WARNINGS.select do |warning|
- (warning.source_file == path) ||
- warning.source_file.end_with?("/#{path}")
- end
+ def self.from(path)
+ $WARNINGS.select { |warning| warning.source_file.include?(path) }
end
#
Please sign in to comment.
Something went wrong with that request. Please try again.