J
Jochen Kaechelin
line = `tree /Users/aragon/Documents -d`
line.each { |l|
l = l.gsub(/\|/,' ')
l = l.gsub(/\-/,' ')
l = l.gsub(/\`/,' ')
line = l
puts line
}
I use the gsub commands because the tree command produces the
following output:
|-- DUMMY
|-- lesen.rb
|-- test.txt
|-- test1.rb
|-- test2.rb
`-- tree.rb
Is there a way to reduce the code?
line.each { |l|
l = l.gsub(/\|/,' ')
l = l.gsub(/\-/,' ')
l = l.gsub(/\`/,' ')
line = l
puts line
}
I use the gsub commands because the tree command produces the
following output:
|-- DUMMY
|-- lesen.rb
|-- test.txt
|-- test1.rb
|-- test2.rb
`-- tree.rb
Is there a way to reduce the code?