Sha256: 0222c887f02ccc02ec0f8b153cc3a6c0dd3e4b7d0961d6926f3c1594f3113629

Contents?: true

Size: 659 Bytes

Versions: 16

Compression:

Stored size: 659 Bytes

Contents

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

16 entries across 16 versions & 1 rubygems

Version Path
lazier-3.3.5 lib/lazier/pathname.rb
lazier-3.3.3 lib/lazier/pathname.rb
lazier-3.3.2 lib/lazier/pathname.rb
lazier-3.3.1 lib/lazier/pathname.rb
lazier-3.3.0 lib/lazier/pathname.rb
lazier-3.2.7 lib/lazier/pathname.rb
lazier-3.2.6 lib/lazier/pathname.rb
lazier-3.2.5 lib/lazier/pathname.rb
lazier-3.2.4 lib/lazier/pathname.rb
lazier-3.2.3 lib/lazier/pathname.rb
lazier-3.2.2 lib/lazier/pathname.rb
lazier-3.2.1 lib/lazier/pathname.rb
lazier-3.2.0 lib/lazier/pathname.rb
lazier-3.1.0 lib/lazier/pathname.rb
lazier-3.0.1 lib/lazier/pathname.rb
lazier-3.0.0 lib/lazier/pathname.rb