Sorry a bit late to respond, but there's a File.extname method, which you
can cominbe with String#chomp

file_name.chomp(File.extname(file_name))






On 27 June 2013 15:34, Todd Pickell <notifications@github.com> wrote:

> In lib/shoes/font.rb:
>
> > +
> > +    def self.add_font_names_to_fonts_constant
> > +      Shoes::FONTS.clear
> > +      Shoes::FONTS << fonts_from_dir(FONT_DIR).keys
> > +      system_font_dirs.each do |dir|
> > +        Shoes::FONTS << fonts_from_dir(dir).keys
> > +      end
> > +      Shoes::FONTS.flatten!
> > +    end
> > +
> > +    def self.parse_filename_from_path(file_path)
> > +      Pathname.new(file_path).basename.to_s
> > +    end
> > +
> > +    def self.remove_file_ext(file_name)
> > +      file_name[0...-4]
>
> Thank you, I like that much better.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/shoes/shoes4/pull/298/files#r4915578>
> .
>