Skip to content

Commit

Permalink
File refinement/monkeypatch use TypeError
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpclark committed Sep 12, 2017
1 parent 144941e commit 46bd9c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/faster_path/optional/monkeypatches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def self._ruby_core_file!
::File.class_eval do
def self.basename(pth, ext = '')
pth = pth.to_path if pth.respond_to? :to_path
raise TypeError unless pth.is_a? String
raise TypeError unless pth.is_a?(String) && ext.is_a?(String)
FasterPath.basename(pth, ext)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/faster_path/optional/refinements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module RefineFile
refine File do
def self.basename(pth, ext = '')
pth = pth.to_path if pth.respond_to? :to_path
raise TypeError unless pth.is_a? String
raise TypeError unless pth.is_a?(String) && ext.is_a?(String)
FasterPath.basename(pth, ext)
end

Expand Down

0 comments on commit 46bd9c0

Please sign in to comment.