Sha256: 7f6bae8642effd8ad7e631f25bc2fedfe9aecbc95ad6acae2b14d733d35c097a

Contents?: true

Size: 455 Bytes

Versions: 1

Compression:

Stored size: 455 Bytes

Contents

module Esvg::Helpers

  def embed_svgs(*keys)
    if Rails.env.production?
      esvg_files.build_paths(keys).each do |path|
        javascript_include_tag(path)
      end.join("\n")
    else
      esvg_files.embed_script(keys).html_safe
    end
  end

  def use_svg(name, options={})
    esvg_files.use(name, options).html_safe
  end

  def esvg_files
    svgs = Esvg.svgs || Esvg.new()

    svgs.read_files if Rails.env.development?

    svgs
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
esvg-4.0.0 lib/esvg/helpers.rb