lib/ronin/path.rb in ronin-support-0.1.0 vs lib/ronin/path.rb in ronin-support-0.2.0.rc1

- old
+ new

@@ -39,10 +39,12 @@ # The root path. # # @return [Path] # The root path. # + # @api public + # def Path.root Path.new('/') end # @@ -67,10 +69,12 @@ # @example Generate multiple relative paths, going up 1 to 3 directories. # Path.up(1..3) # # => [#<Ronin::Path:..>, #<Ronin::Path:../..>, # #<Ronin::Path:../../..>] # + # @api public + # def self.up(n,separator=File::SEPARATOR) case n when Integer if n == 0 return separator @@ -102,9 +106,11 @@ # The joined path. # # @example # Path.up(7).join('etc/passwd') # # => #<Ronin::Path:../../../../../../../etc/passwd> + # + # @api public # def join(*names) names.map! { |name| name.to_s } # filter out errant directory separators