Sha256: f5d302a3713ebb85fec9d7cdb1e8870cc8f6bea69dfa2e8b85a639bb41695aa6

Contents?: true

Size: 594 Bytes

Versions: 4

Compression:

Stored size: 594 Bytes

Contents

# copy the assets from extensions public dir into #{Rails.root}/public
destination = "#{Rails.root}/public"
paths_to_mirror = Spree::ExtensionLoader.instance.load_extension_roots

paths_to_mirror.each do |extension_path|
  source = "#{extension_path}/public"
  if File.directory?(source)
    begin
      RAILS_DEFAULT_LOGGER.info "INFO: Mirroring assets from #{source} to #{destination}"
      Spree::FileUtilz.mirror_files(source, destination)
    rescue LoadError, NameError => e
      $stderr.puts "Could not copy extension assets from : #{source}.\n#{e.inspect}"
      nil
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spree-0.11.4 lib/plugins/extension_patches/lib/asset_copy.rb
spree-0.11.3 lib/plugins/extension_patches/lib/asset_copy.rb
spree-0.11.2 lib/plugins/extension_patches/lib/asset_copy.rb
spree-0.11.1 lib/plugins/extension_patches/lib/asset_copy.rb