Sha256: 2c45a12517d8f0818cd656b918d80be5857257df8187e2573afd6730e12f763a
Contents?: true
Size: 627 Bytes
Versions: 10
Compression:
Stored size: 627 Bytes
Contents
require_relative '../../tools/yaml_ext.rb' module Locomotive::Wagon module PersistAssetsConcern def replace_with_content_assets!(text) return text if text.blank? text.to_s.gsub(/([^a-zA-Z0-9])(\/samples\/\S*\.[a-zA-Z0-9]+)/) do url = __content_assets_pusher__.persist($2) || $2 $1 + url end end def replace_with_content_assets_in_hash!(hash) Locomotive::Wagon::YamlExt.transform(hash) do |value| replace_with_content_assets!(value) end end def asset_io(local_path) __content_assets_pusher__.decorate(local_path).source end end end
Version data entries
10 entries across 10 versions & 1 rubygems