Sha256: 8ea5866f73da308267d10f4cbcadc031b32c631e70a4280e4252b8b43575349a

Contents?: true

Size: 638 Bytes

Versions: 14

Compression:

Stored size: 638 Bytes

Contents

module Distil
  
  module FileVendor
    
    def cache_file(file)
      @file_cache={} if @file_cache.nil?
      @file_cache[file.full_path]= file
    end
    
    def file_from_path(filepath)
      return if !filepath
      @file_cache={} if @file_cache.nil?
      full_path= File.expand_path(filepath)
      file= @file_cache[full_path]
      return file if file
    
      extension= File.extname(filepath)[1..-1]
    
      SourceFile.subclasses.each { |handler|
        next if (handler.extension != extension)
        return handler.new(filepath, self)
      }
    
      return SourceFile.new(filepath, self)
    end

  end
  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
distil-0.14.5.a lib/distil/file-vendor.rb
distil-0.14.4 lib/distil/file-vendor.rb
distil-0.14.3 lib/distil/file-vendor.rb
distil-0.14.2 lib/distil/file-vendor.rb
distil-0.14.2.a lib/distil/file-vendor.rb
distil-0.14.1 lib/distil/file-vendor.rb
distil-0.14.1.a lib/distil/file-vendor.rb
distil-0.14.0 lib/distil/file-vendor.rb
distil-0.14.0.i lib/distil/file-vendor.rb
distil-0.14.0.h lib/distil/file-vendor.rb
distil-0.14.0.g lib/distil/file-vendor.rb
distil-0.14.0.d lib/distil/file-vendor.rb
distil-0.14.0.c lib/distil/file-vendor.rb
distil-0.14.0.b lib/distil/file-vendor.rb