lib/faster_path.rb in faster_path-0.1.1 vs lib/faster_path.rb in faster_path-0.1.2
- old
+ new
@@ -24,10 +24,14 @@
def self.blank?(str)
Rust.is_blank(str)
end
+ def self.basename(pth, ext="")
+ Rust.basename(pth, ext)
+ end unless true # WAY_TOO_SLOW! 5600X slower
+
# EXAMPLE
#def self.one_and_two
# Rust.one_and_two.to_a
#end
@@ -50,10 +54,10 @@
attach_function :is_absolute, [ :string ], :bool
attach_function :is_relative, [ :string ], :bool
attach_function :is_blank, [ :string ], :bool
attach_function :both_are_blank, [ :string, :string ], :bool
- attach_function :basename, [ :string ], :string
+ #attach_function :basename, [ :string, :string ], :string
attach_function :dirname, [ :string ], :string
attach_function :basename_for_chop, [ :string ], :string # decoupling behavior
attach_function :dirname_for_chop, [ :string ], :string # decoupling behavior
# EXAMPLE