basename(suffix = "") -> Pathname
[permalink][rdoc]Pathname.new(File.basename(self.to_s, suffix)) と同じです。
require "pathname"
Pathname("ruby/ruby.c").basename #=> #<Pathname:"ruby.c">
Pathname("ruby/ruby.c").basename(".c") #=> #<Pathname:"ruby">
Pathname("ruby/ruby.c").basename(".*") #=> #<Pathname:"ruby">
Pathname("ruby/ruby.exe").basename(".*") #=> #<Pathname:"ruby">
Pathname("ruby/y.tab.c").basename(".*") #=> #<Pathname:"y.tab">
[SEE_ALSO] File.basename