lib/faster_path/optional/monkeypatches.rb in faster_path-0.2.6 vs lib/faster_path/optional/monkeypatches.rb in faster_path-0.3.1
- old
+ new
@@ -8,11 +8,11 @@
::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) && ext.is_a?(String)
FasterPath.basename(pth, ext)
- end
+ end if !!ENV['WITH_REGRESSION']
def self.extname(pth)
pth = pth.to_path if pth.respond_to? :to_path
raise TypeError unless pth.is_a? String
FasterPath.extname(pth)
@@ -20,11 +20,11 @@
def self.dirname(pth)
pth = pth.to_path if pth.respond_to? :to_path
raise TypeError unless pth.is_a? String
FasterPath.dirname(pth)
- end
+ end if !!ENV['WITH_REGRESSION']
end
end
# rubocop:disable Metrics/MethodLength
def self._ruby_library_pathname!
@@ -94,11 +94,11 @@
end
end
end
private_constant :MonkeyPatches
- def self.sledgehammer_everything!(include_file = !!ENV['WITH_REGRESSION'])
- MonkeyPatches._ruby_core_file! if include_file # SLOW; DON'T AUTO INCLUDE
+ def self.sledgehammer_everything!()
+ MonkeyPatches._ruby_core_file!
MonkeyPatches._ruby_library_pathname!
"CAUTION: Monkey patching effects everything! Be very sure you want this!"
end
end