Module: EacRubyUtils::Fs

Defined in:
lib/eac_ruby_utils/fs.rb,
lib/eac_ruby_utils/fs/temp.rb,
lib/eac_ruby_utils/fs/extname.rb,
lib/eac_ruby_utils/fs/temp/file.rb,
lib/eac_ruby_utils/fs/traverser.rb,
lib/eac_ruby_utils/fs/traversable.rb,
lib/eac_ruby_utils/fs/temp/directory.rb

Defined Under Namespace

Modules: Temp, Traversable Classes: Traverser

Class Method Summary collapse

Class Method Details

.extname(path, limit = -1)) ⇒ Object

A [File.extname] which find multiple extensions (Ex.: .tar.gz).


7
8
9
# File 'lib/eac_ruby_utils/fs/extname.rb', line 7

def extname(path, limit = -1)
  recursive_extension(::File.basename(path), limit)
end

.extname2(path) ⇒ Object

Shortcut to extname(2).


12
13
14
# File 'lib/eac_ruby_utils/fs/extname.rb', line 12

def extname2(path)
  extname(path, 2)
end