Module: FeCoreExt::CoreExt::Pathname

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

Instance Method Summary collapse

Instance Method Details

#copy(dest) ⇒ Object



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

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

#existenceObject



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

def existence
  self if exist?
end

#glob(pattern, &block) ⇒ Object



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

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

#load_yamlObject



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

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

#mkdir_pObject



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

def mkdir_p
  mkpath
  self
end

#require_relativeObject



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

def require_relative
  Kernel.require_relative(self)
end

#rm(options = {}) ⇒ Object



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

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

#touch(options = {}) ⇒ Object



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

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