Class: File

Inherits:
Object
  • Object
show all
Defined in:
lib/benchcc/ext/file.rb

Class Method Summary collapse

Class Method Details

.basename_we(path) ⇒ Object



13
14
15
# File 'lib/benchcc/ext/file.rb', line 13

def self.basename_we(path)
  File.basename(File.remove_ext(path))
end

.remove_ext(path) ⇒ Object



5
6
7
# File 'lib/benchcc/ext/file.rb', line 5

def self.remove_ext(path)
  path.chomp(extname(path))
end

.sub_ext(path, ext) ⇒ Object



9
10
11
# File 'lib/benchcc/ext/file.rb', line 9

def self.sub_ext(path, ext)
  Pathname.new(path).sub_ext(ext).to_path
end