Class: Pathname
Instance Method Summary collapse
Instance Method Details
#child_of?(p2) ⇒ Boolean
8 9 10 |
# File 'lib/ruby/pathname.rb', line 8 def child_of?(p2) .to_s.include?(p2..to_s) end |
#hidden? ⇒ Boolean
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ruby/pathname.rb', line 16 def hidden? path = until path.root? return true if path.basename.to_s.start_with? "." path = path.parent end false end |
#to_url ⇒ Object
12 13 14 |
# File 'lib/ruby/pathname.rb', line 12 def to_url java.io.File.new(to_s).to_url.to_s end |
#touch(path) ⇒ Object
2 3 4 5 6 |
# File 'lib/ruby/pathname.rb', line 2 def touch(path) file = self + path file.open("w+") { nil } unless file.exist? file end |