Sha256: 3fa99f94bee9e81073b77a7aa0fd2d5b17535c639f67d61399d3e24e58a8b9ca

Contents?: true

Size: 640 Bytes

Versions: 8

Compression:

Stored size: 640 Bytes

Contents

#
# This file is part of the lazier gem. Copyright (C) 2013 and above Shogun <shogun@cowtech.it>.
# Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
#

module Lazier
  # Extensions for the Pathname class.
  module Pathname
    extend ::ActiveSupport::Concern

    # Returns all the components that are included in this path.
    #
    # ```ruby
    # Pathname.new("/usr/bin/ruby").components
    # # => ["usr", "bin", "ruby"]
    # ```
    #
    # @return [Array] A list of all components that are included in this path.
    def components
      each_filename.to_a
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
lazier-4.1.0 lib/lazier/pathname.rb
lazier-4.0.6 lib/lazier/pathname.rb
lazier-4.0.5 lib/lazier/pathname.rb
lazier-4.0.4 lib/lazier/pathname.rb
lazier-4.0.3 lib/lazier/pathname.rb
lazier-4.0.2 lib/lazier/pathname.rb
lazier-4.0.1 lib/lazier/pathname.rb
lazier-4.0.0 lib/lazier/pathname.rb