Sha256: 3ebd0bcd09c7d77074ef0570949a7a91379173e80b3ea266ef679dd564b8e1db

Contents?: true

Size: 274 Bytes

Versions: 3

Compression:

Stored size: 274 Bytes

Contents

module Fiona7
  module NameAndParentFromPath
    def name_and_parent_path_from_path(path)
      components = path.split('/')
      name       = components.pop.presence
      parent_path= components.join('/').presence || '/'

      return name, parent_path
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
infopark_fiona7-1.6.1.1.5 lib/fiona7/name_and_parent_from_path.rb
infopark_fiona7-1.6.1.1.1 lib/fiona7/name_and_parent_from_path.rb
infopark_fiona7-1.6.1.1.0 lib/fiona7/name_and_parent_from_path.rb