Sha256: a13338df52f28c255dd30379c38d075502f0c18513a13ffdc657ce03f8fd1248

Contents?: true

Size: 362 Bytes

Versions: 20

Compression:

Stored size: 362 Bytes

Contents

module Mittsu
  class FileLoader
    def initialize(manager = nil)
      @manager = manager || DefaultLoadingManager
    end

    def load(url)
      cached = Cache.get(url)

      return cached unless cached.nil?

      @manager.item_start(url)

      text = File.read(url)
      Cache.add(url, text)

      @manager.item_end(url)

      text
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
mittsu-0.5.0 lib/mittsu/loaders/file_loader.rb
mittsu-0.4.1 lib/mittsu/loaders/file_loader.rb
mittsu-0.4.0 lib/mittsu/loaders/file_loader.rb
mittsu-0.3.3 lib/mittsu/loaders/file_loader.rb
mittsu-0.3.2 lib/mittsu/loaders/file_loader.rb
mittsu-0.3.1 lib/mittsu/loaders/file_loader.rb
mittsu-0.3.0 lib/mittsu/loaders/file_loader.rb
mittsu-0.2.4 lib/mittsu/loaders/file_loader.rb
mittsu-0.2.3 lib/mittsu/loaders/file_loader.rb
mittsu-0.2.2 lib/mittsu/loaders/file_loader.rb
mittsu-0.2.1 lib/mittsu/loaders/file_loader.rb
mittsu-0.2.0 lib/mittsu/loaders/file_loader.rb
mittsu-0.1.7 lib/mittsu/loaders/file_loader.rb
mittsu-0.1.6 lib/mittsu/loaders/file_loader.rb
mittsu-0.1.5 lib/mittsu/loaders/file_loader.rb
mittsu-0.1.4 lib/mittsu/loaders/file_loader.rb
mittsu-0.1.3 lib/mittsu/loaders/file_loader.rb
mittsu-0.1.2 lib/mittsu/loaders/file_loader.rb
mittsu-0.1.1 lib/mittsu/loaders/file_loader.rb
mittsu-0.1.0 lib/mittsu/loaders/file_loader.rb