Class: Pathname
Overview
Copyright: 2015 Jordon Bedwell - Apache v2.0 License Encoding: utf-8
Instance Method Summary collapse
- #all_children ⇒ Object
- #expanded_path ⇒ Object
- #expanded_realpath ⇒ Object
- #glob(*args) ⇒ Object
- #in_path?(path) ⇒ Boolean
- #write(data) ⇒ Object
Instance Method Details
#all_children ⇒ Object
35 36 37 |
# File 'lib/docker/template/patches/pathname.rb', line 35 def all_children glob "**/*" end |
#expanded_path ⇒ Object
19 20 21 22 23 |
# File 'lib/docker/template/patches/pathname.rb', line 19 def ||= begin Dir.pwd end end |
#expanded_realpath ⇒ Object
27 28 29 30 31 |
# File 'lib/docker/template/patches/pathname.rb', line 27 def ||= begin .realpath end end |
#glob(*args) ⇒ Object
41 42 43 44 45 |
# File 'lib/docker/template/patches/pathname.rb', line 41 def glob(*args) Dir.glob(join(*args)).map do |path| self.class.new(path) end end |
#in_path?(path) ⇒ Boolean
6 7 8 9 |
# File 'lib/docker/template/patches/pathname.rb', line 6 def in_path?(path) path_str = path.is_a?(self.class) ? path..to_s : path.to_s .to_s.start_with?(path_str) end |
#write(data) ⇒ Object
13 14 15 |
# File 'lib/docker/template/patches/pathname.rb', line 13 def write(data) File.write(to_s, data) end |