Module: CSD::Extensions::Core::Pathname

Included in:
Pathname
Defined in:
lib/csd/extensions/core/pathname.rb

Instance Method Summary collapse

Instance Method Details

#children_directories(&block) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/csd/extensions/core/pathname.rb', line 8

def children_directories(&block)
  result = []
  children.map do |child|
    next unless child.directory?
    block_given? ? yield(child) : result << child
  end
  result
end

#current_path?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/csd/extensions/core/pathname.rb', line 21

def current_path?
  self.exist? and self.realpath == self.class.getwd.realpath
end

#enquoteObject



17
18
19
# File 'lib/csd/extensions/core/pathname.rb', line 17

def enquote
  to_s.enquote
end