Sha256: 45e417fb580b11ff6c75d0a6130eaed5b9d1d21a54d5a8b49ac4af6dd1423fe6
Contents?: true
Size: 705 Bytes
Versions: 40
Compression:
Stored size: 705 Bytes
Contents
module Locomotive::Wagon class PullSnippetsCommand < PullBaseCommand def _pull locales.each do |locale| api_client.snippets.all(locale).each do |snippet| write_snippet(snippet, locale) end end end def write_snippet(snippet, locale = nil) if (template = snippet.template).present? _template = replace_asset_urls(template) write_to_file(snippet_filepath(snippet, locale), _template) end end private def snippet_filepath(snippet, locale) filename = locale == default_locale ? snippet.slug : "#{snippet.slug}.#{locale}" File.join('app', 'views', 'snippets', filename + '.liquid') end end end
Version data entries
40 entries across 40 versions & 1 rubygems