Module: FeCoreExt::CoreExt::PathnameMethods

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

Instance Method Summary collapse

Instance Method Details

#copy(dest) ⇒ Object



36
37
38
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 36

def copy(dest)
  FileUtils.cp(self, dest)
end

#existenceObject



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

def existence
  self if exist?
end

#glob(pattern, &block) ⇒ Object



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

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

#load_yamlObject



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

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

#mkdir_pObject



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

def mkdir_p
  mkpath
  self
end

#require_relativeObject



40
41
42
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 40

def require_relative
  Kernel.require_relative(self)
end

#rm(options = {}) ⇒ Object



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

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

#touch(options = {}) ⇒ Object



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

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