Class: File
- Defined in:
- lib/vex/base/filesystem/parse_filename.rb
Defined Under Namespace
Modules: Etest, Grep, Lock, Write
Class Method Summary collapse
- .basename_wo_ext(s) ⇒ Object
-
.extname_wo_dot(s) ⇒ Object
File.extname_wo_dot(“x.y”) => “y” File.extname_wo_dot(“x.”) => “” File.extname_wo_dot(“.y”) => “” File.extname_wo_dot(“x”) => “”.
Methods included from Write
Methods included from Lock
Methods included from Grep
Class Method Details
.basename_wo_ext(s) ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/vex/base/filesystem/parse_filename.rb', line 2 def self.basename_wo_ext(s) bn = File.basename(s) if bn =~ /^(.*)\.([^.]*)$/ $1 else bn end end |
.extname_wo_dot(s) ⇒ Object
File.extname_wo_dot(“x.y”) => “y” File.extname_wo_dot(“x.”) => “” File.extname_wo_dot(“.y”) => “” File.extname_wo_dot(“x”) => “”
17 18 19 |
# File 'lib/vex/base/filesystem/parse_filename.rb', line 17 def self.extname_wo_dot(s) File.extname(s) =~ /^\.([^.]*)$/ ? $1 : "" end |