Sha256: 08cca169c8b809637f12a58a473bad3abc4eaf5613fb2635c80d85465bc54e5d

Contents?: true

Size: 663 Bytes

Versions: 1

Compression:

Stored size: 663 Bytes

Contents

# encoding: utf-8
#
# This file is part of the lazier gem. Copyright (C) 2013 and above Shogun <shogun_panda@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

1 entries across 1 versions & 1 rubygems

Version Path
lazier-3.3.6 lib/lazier/pathname.rb