Module: FeCoreExt::CoreExt::Pathname

Included in:
Pathname
Defined in:
lib/fe_core_ext/core_ext/pathname.rb

Instance Method Summary collapse

Instance Method Details

#glob(pattern, &block) ⇒ Object



14
15
16
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 14

def glob(pattern, &block)
  Pathname.glob(join(pattern), &block)
end

#load_yamlObject



9
10
11
12
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 9

def load_yaml
  return unless exist?
  YAML.load_file(self)
end

#mkdir_pObject



26
27
28
29
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 26

def mkdir_p
  mkpath
  self
end

#require_relativeObject



31
32
33
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 31

def require_relative
  Kernel.require_relative(self)
end

#rm(options = {}) ⇒ Object



22
23
24
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 22

def rm(options={})
  FileUtils.rm(self, options)
end

#touch(options = {}) ⇒ Object



18
19
20
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 18

def touch(options={})
  FileUtils.touch(@path, options)
end