File: to_path.rb

package info (click to toggle)
ruby-facets 2.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 9,824 kB
  • sloc: ruby: 25,483; xml: 90; makefile: 20
file content (14 lines) | stat: -rw-r--r-- 195 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Array

  # Turn an array into a file path.
  #
  #   ["usr", "local", "lib"].to_path  #=> "usr/local/lib"
  #
  #  CREDIT: Trans

  def to_path
    File.join( *(self.compact) )
  end

end