Module: FeCoreExt::CoreExt::Pathname
- 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
37 38 39 |
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 37 def copy(dest) FileUtils.cp(self, dest) end |
#existence ⇒ Object
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_yaml ⇒ Object
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_p ⇒ Object
32 33 34 35 |
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 32 def mkdir_p mkpath self end |
#require_relative ⇒ Object
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( = {}) FileUtils.rm(self, ) end |
#touch(options = {}) ⇒ Object
24 25 26 |
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 24 def touch( = {}) FileUtils.touch(@path, ) end |