Module: FeCoreExt::CoreExt::Pathname
- Included in:
- Pathname
- Defined in:
- lib/fe_core_ext/core_ext/pathname.rb
Instance Method Summary collapse
- #delete(options = {}) ⇒ Object
- #glob(pattern, &block) ⇒ Object
- #load_yaml ⇒ Object
- #mkpath ⇒ Object
- #require_relative ⇒ Object
- #touch(options = {}) ⇒ Object
Instance Method Details
#delete(options = {}) ⇒ Object
22 23 24 25 |
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 22 def delete(={}) super if .empty? FileUtils.rm(self, ) end |
#glob(pattern, &block) ⇒ Object
14 15 16 |
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 14 def glob(pattern, &block) Pathname.glob(join(pattern), &block) end |
#load_yaml ⇒ Object
9 10 11 12 |
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 9 def load_yaml return unless exist? YAML.load_file(self) end |
#mkpath ⇒ Object
27 28 29 30 |
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 27 def mkpath super self end |
#require_relative ⇒ Object
32 33 34 |
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 32 def require_relative Kernel.require_relative(self) end |
#touch(options = {}) ⇒ Object
18 19 20 |
# File 'lib/fe_core_ext/core_ext/pathname.rb', line 18 def touch(={}) FileUtils.touch(@path, ) end |