Sha256: 6e82a6bfce685071d9f78fb0259f69b82b6334f1a77fd061d7ccfbc8788df9c4

Contents?: true

Size: 752 Bytes

Versions: 8

Compression:

Stored size: 752 Bytes

Contents

# encoding: utf-8
#
# This file is part of the cowtech-extensions gem. Copyright (C) 2011 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 Cowtech
	module Extensions
    # 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
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cowtech-extensions-2.7.4 lib/cowtech-extensions/pathname.rb
cowtech-extensions-2.7.3 lib/cowtech-extensions/pathname.rb
cowtech-extensions-2.7.2 lib/cowtech-extensions/pathname.rb
cowtech-extensions-2.7.1 lib/cowtech-extensions/pathname.rb
cowtech-extensions-2.7.0 lib/cowtech-extensions/pathname.rb
cowtech-extensions-2.6.0 lib/cowtech-extensions/pathname.rb
cowtech-extensions-2.5.1 lib/cowtech-extensions/pathname.rb
cowtech-extensions-2.5.0 lib/cowtech-extensions/pathname.rb