class Locomotive::Wagon::PullThemeAssetsCommand
Public Instance Methods
_pull()
click to toggle source
# File lib/locomotive/wagon/commands/pull_sub_commands/pull_theme_assets_command.rb, line 5 def _pull api_client.theme_assets.all.each do |asset| write_theme_asset(asset) end end
write_theme_asset(asset)
click to toggle source
# File lib/locomotive/wagon/commands/pull_sub_commands/pull_theme_assets_command.rb, line 11 def write_theme_asset(asset) binary = get_asset_binary(asset.url) if %w(javascript stylesheet).include?(asset.content_type) binary = replace_asset_urls(binary) end write_to_file(theme_asset_filepath(asset), binary) end
Private Instance Methods
theme_asset_filepath(asset)
click to toggle source
# File lib/locomotive/wagon/commands/pull_sub_commands/pull_theme_assets_command.rb, line 23 def theme_asset_filepath(asset) File.join('public', asset.local_path) end