Sha256: cd15a7985b4a549bab63763d9d1317bb92d8f68d238e12cee7e7c62a25ed6492

Contents?: true

Size: 281 Bytes

Versions: 20

Compression:

Stored size: 281 Bytes

Contents

class File

  # Return the head of path from the rest of the path.
  #
  #   File.split_root('etc/xdg/gtk')  #=> ['etc', 'xdg/gtk']
  #
  def self.split_root(path)
    path_re = Regexp.new('[' + Regexp.escape(File::Separator + %q{\/}) + ']')
    path.split(path_re, 2)
  end

end

Version data entries

20 entries across 19 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 lib/core/facets/file/split_root.rb
facets-3.1.0 lib/core/facets/file/split_root.rb
facets-3.0.0 lib/core/facets/file/split_root.rb
facets-2.9.3 lib/core/facets/file/split_root.rb
facets-2.9.2 lib/core/facets/file/split_root.rb
facets-2.9.2 src/core/facets/file/split_root.rb
facets-2.9.1 lib/core/facets/file/split_root.rb
facets-2.9.0 lib/core/facets/file/split_root.rb
facets-2.9.0.pre.2 lib/core/facets/file/split_root.rb
facets-2.9.0.pre.1 lib/core/facets/file/split_root.rb
facets-2.8.4 lib/core/facets/file/split_root.rb
facets-2.8.3 lib/core/facets/file/split_root.rb
facets-2.8.2 lib/core/facets/file/split_root.rb
facets-2.8.1 lib/core/facets/file/split_root.rb
facets-2.8.0 lib/core/facets/file/split_root.rb
facets-2.7.0 lib/core/facets/file/split_root.rb
facets-2.6.0 lib/core/facets/file/split_root.rb
facets-2.5.0 lib/core/facets/file/split_root.rb
facets-2.5.1 lib/core/facets/file/split_root.rb
facets-2.5.2 lib/core/facets/file/split_root.rb