Sha256: 843bd159081d5bec45f8d395acd81ea564ed744c78954520f492d1da40503e1c

Contents?: true

Size: 615 Bytes

Versions: 3

Compression:

Stored size: 615 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 https://choosealicense.com/licenses/mit.
#

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.9 lib/lazier/pathname.rb
lazier-4.2.8 lib/lazier/pathname.rb
lazier-4.2.3 lib/lazier/pathname.rb