Class: Pathname

Inherits:
Object show all
Extended by:
Garcon::Pathref
Defined in:
lib/garcon/core_ext/pathname.rb

Constant Summary

Constants included from Garcon::Pathref

Garcon::Pathref::ROOT_PATHS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Garcon::Pathref

of, register_default_paths, register_path, register_paths, relpath_to, unregister_path

Class Method Details

.receive(obj) ⇒ Object



132
133
134
135
# File 'lib/garcon/core_ext/pathname.rb', line 132

def self.receive(obj)
  return obj if obj.nil?
  obj.is_a?(self) ? obj : new(obj)
end

Instance Method Details

#corenamePathname

Returns The basename without extension (using self.extname as the extension).

Returns:

  • (Pathname)

    The basename without extension (using self.extname as the extension).



141
142
143
# File 'lib/garcon/core_ext/pathname.rb', line 141

def corename
  basename(self.extname)
end

#find_allObject

Like find, but returns an enumerable



128
129
130
# File 'lib/garcon/core_ext/pathname.rb', line 128

def find_all
  Enumerator.new{|yielder| find{|path| yielder << path } }
end

#inspect_compactString

Returns Compact string rendering.

Returns:

  • (String)

    Compact string rendering



149
# File 'lib/garcon/core_ext/pathname.rb', line 149

def inspect_compact() to_path.dump ; end