Module: FeCoreExt::CoreExt::PathnameMethods
- Included in:
- Pathname
- Defined in:
- lib/fe_core_ext/core_ext/pathname.rb
Instance Method Summary collapse
- #copy(dest) ⇒ Object
- #existence ⇒ Object
- #glob(pattern, &block) ⇒ Object
- #load_yaml ⇒ Object
- #mkdir_p ⇒ Object
- #require_relative ⇒ Object
- #rm(options = {}) ⇒ Object
- #touch(options = {}) ⇒ Object
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 |
#existence ⇒ Object
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_yaml ⇒ Object
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_p ⇒ Object
31 32 33 34 |
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 31 def mkdir_p mkpath self end |
#require_relative ⇒ Object
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( = {}) FileUtils.rm(self, ) end |
#touch(options = {}) ⇒ Object
23 24 25 |
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 23 def touch( = {}) FileUtils.touch(@path, ) end |