Sha256: 30862946a692f272f68be406ede089dc714b1c99c952ab42dc2fd550794ec1fd
Contents?: true
Size: 645 Bytes
Versions: 10
Compression:
Stored size: 645 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\/[\/a-zA-Z0-9_-]+(\.[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