Module: RunKit::CoreExt::Pathname

Defined in:
lib/run_kit/core_ext.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Replacements for Pathname built-ins removed below.



87
88
89
# File 'lib/run_kit/core_ext.rb', line 87

def self.included(base)
  base.remove_method :mkdir, :chown, :chmod
end

Instance Method Details

#absObject

one-liners



74
# File 'lib/run_kit/core_ext.rb', line 74

def abs = expand_path

#cdObject



75
# File 'lib/run_kit/core_ext.rb', line 75

def cd(...) = FileUtils.cd(self, ...)

#chmod(mode, **kwargs) ⇒ Object



91
# File 'lib/run_kit/core_ext.rb', line 91

def chmod(mode, **kwargs) = FileUtils.chmod(mode, self, **kwargs)

#chmod_r(mode, **kwargs) ⇒ Object



76
# File 'lib/run_kit/core_ext.rb', line 76

def chmod_r(mode, **kwargs) = FileUtils.chmod_R(mode, self, **kwargs)

#chown(user, group, **kwargs) ⇒ Object



92
# File 'lib/run_kit/core_ext.rb', line 92

def chown(user, group, **kwargs) = FileUtils.chown(user, group, self, **kwargs)

#chown_r(user, group, **kwargs) ⇒ Object



77
# File 'lib/run_kit/core_ext.rb', line 77

def chown_r(user, group, **kwargs) = FileUtils.chown_R(user, group, self, **kwargs)

#cp(dest, **kwargs) ⇒ Object



78
# File 'lib/run_kit/core_ext.rb', line 78

def cp(dest, **kwargs) = FileUtils.cp_r(self, dest, **kwargs.merge(preserve: true))

#escapeObject



79
# File 'lib/run_kit/core_ext.rb', line 79

def escape = Shellwords.escape(to_s)

#lnObject



80
# File 'lib/run_kit/core_ext.rb', line 80

def ln(...) = FileUtils.ln_sf(self, ...)

#mkdirObject



93
# File 'lib/run_kit/core_ext.rb', line 93

def mkdir(...) = FileUtils.mkdir_p(self, ...)

#mvObject



81
# File 'lib/run_kit/core_ext.rb', line 81

def mv(...) = FileUtils.mv(self, ...)

#rmObject



82
# File 'lib/run_kit/core_ext.rb', line 82

def rm(...) = FileUtils.rm_f(self, ...)

#rm_rfObject



83
# File 'lib/run_kit/core_ext.rb', line 83

def rm_rf(...) = FileUtils.rm_rf(self, ...)

#touchObject



84
# File 'lib/run_kit/core_ext.rb', line 84

def touch(...) = FileUtils.touch(self, ...)