Sha256: 87f200208e4ca7a0ee2089ee742b0ceadf4ecfb17ea18f898e193eebede41fdd

Contents?: true

Size: 747 Bytes

Versions: 4

Compression:

Stored size: 747 Bytes

Contents

require 'rhet-butler/web/main-app'
require 'rhet-butler/stasis'

module RhetButler
  class ResourceLocalizer
    attr_accessor :files, :source_uri, :target_path, :store_log

    def go!
      app_url = "http://example.com/"
      transform_queue = Stasis::TransformQueue.new
      transform_queue.loader = Stasis::HTTPLoader.new
      transform_queue.mapping = Stasis::ResourceMapping.new
      transform_queue.mapping.default_uri = app_url
      transform_queue.writer = Stasis::ValiseWriter.new(@files)
      transform_queue.writer.store_log = store_log

      target_uri = transform_queue.mapping.target_link_for(source_uri)
      transform_queue.add_mapping(nil, source_uri, target_uri, target_path)
      transform_queue.go
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rhet-butler-0.14.1 lib/rhet-butler/resource-localizer.rb
rhet-butler-0.14.0 lib/rhet-butler/resource-localizer.rb
rhet-butler-0.13.0 lib/rhet-butler/resource-localizer.rb
rhet-butler-0.12.1 lib/rhet-butler/resource-localizer.rb