Sha256: f6a59a50d5d3a1e8ad1cc3879b048c6a8852b2fb18a13b237491c2e19eaa2ab9

Contents?: true

Size: 777 Bytes

Versions: 266

Compression:

Stored size: 777 Bytes

Contents

require 'fileutils'
require 'find'
require 'pathname'

module FSSM
  class Pathname < ::Pathname
    VIRTUAL_REGEX = /^file:([^!]*)!/

    class << self
      def for(path)
        path.is_a?(::FSSM::Pathname) ? path : new(path)
      end

      alias :[] :glob
    end

    def is_virtual?
      !!(VIRTUAL_REGEX =~ to_s)
    end

    def segments
      path  = to_s
      array = path.split(File::SEPARATOR)
      array.delete('')
      array.insert(0, File::SEPARATOR) if path[0, 1] == File::SEPARATOR
      array[0] += File::SEPARATOR if path[0, 3] =~ SEPARATOR_PAT
      array
    end

    def glob(pattern, flags = 0, &block)
      patterns = [pattern].flatten
      patterns.map! { |p| self.class.glob(to_s + p, flags, &block) }
      patterns.flatten
    end
  end
end

Version data entries

266 entries across 119 versions & 8 rubygems

Version Path
classiccms-0.5.16 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.16 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.15 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.15 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.15 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.15 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.14 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.14 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.14 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.14 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.13 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.13 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.13 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.13 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.12 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.12 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.12 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.12 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.11 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/pathname.rb
classiccms-0.5.11 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/pathname.rb