Module: RailsWayback::HistoricalAssetHelper

Defined in:
lib/rails_wayback/historical_asset_helper.rb

Constant Summary collapse

MATERIALIZATION_ROOT_ENV =
"rails_wayback.materialization_root"

Instance Method Summary collapse

Instance Method Details

#compute_asset_host(source = "", options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/rails_wayback/historical_asset_helper.rb', line 15

def compute_asset_host(source = "", options = {})
  if historical_asset_url?(source)
    return request.base_url if options[:protocol] == :request

    return nil
  end

  super
end

#compute_asset_path(source, options = {}) ⇒ Object



7
8
9
# File 'lib/rails_wayback/historical_asset_helper.rb', line 7

def compute_asset_path(source, options = {})
  resolve_historical_asset(source, options) || track_current_asset(source) { super }
end

#public_compute_asset_path(source, options = {}) ⇒ Object



11
12
13
# File 'lib/rails_wayback/historical_asset_helper.rb', line 11

def public_compute_asset_path(source, options = {})
  resolve_historical_asset(source, options) || track_current_asset(source) { super }
end