Sha256: 58621d2c92745fcb8372df49b6ab80656004e021d338513539b19f46ace9e2dd

Contents?: true

Size: 698 Bytes

Versions: 23

Compression:

Stored size: 698 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
      rv = []
      self.each_filename { |p| rv << p }
      rv
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
lazier-2.8.1 lib/lazier/pathname.rb
lazier-2.8.0 lib/lazier/pathname.rb
lazier-2.7.0 lib/lazier/pathname.rb
lazier-2.6.7 lib/lazier/pathname.rb
lazier-2.6.6 lib/lazier/pathname.rb
lazier-2.6.5 lib/lazier/pathname.rb
lazier-2.6.4 lib/lazier/pathname.rb
lazier-2.6.3 lib/lazier/pathname.rb
lazier-2.6.2 lib/lazier/pathname.rb
lazier-2.6.1 lib/lazier/pathname.rb
lazier-2.6.0 lib/lazier/pathname.rb
lazier-2.5.3 lib/lazier/pathname.rb
lazier-2.5.2 lib/lazier/pathname.rb
lazier-2.5.1 lib/lazier/pathname.rb
lazier-2.5.0 lib/lazier/pathname.rb
lazier-2.4.0 lib/lazier/pathname.rb
lazier-2.3.1 lib/lazier/pathname.rb
lazier-2.3.0 lib/lazier/pathname.rb
lazier-2.2.0 lib/lazier/pathname.rb
lazier-2.1.1 lib/lazier/pathname.rb