Sha256: 046a47feee51a73f11219f6ffdd7924f648b0e2cead576686afa164d24ed3fe7

Contents?: true

Size: 626 Bytes

Versions: 3

Compression:

Stored size: 626 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.
    #
    #     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

3 entries across 3 versions & 1 rubygems

Version Path
lazier-4.2.2 lib/lazier/pathname.rb
lazier-4.2.1 lib/lazier/pathname.rb
lazier-4.2.0 lib/lazier/pathname.rb