Sha256: 85e93dfc745a960bd26bacdaa926cb8159225e9064b6324acb4b96c7555279d3
Contents?: true
Size: 648 Bytes
Versions: 4
Compression:
Stored size: 648 Bytes
Contents
module Esvg::Helpers def esvg svgs = Esvg.svgs || Esvg.new() svgs.read_files if Rails.env.development? svgs end def embed_svgs(*keys) if !Rails.env.production? esvg.build_paths(keys).map do |path| javascript_include_tag(path) end.join("\n").html_safe else esvg.embed_script(keys).html_safe end end def use_svg(name, options={}, &block) use_svg_with_files(esvg, name, options, &block) end private def use_svg_with_files(files, name, options, &block) if block_given? options[:content] = capture(&block) end files.use(name, options).html_safe end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
esvg-4.1.4 | lib/esvg/helpers.rb |
esvg-4.1.3 | lib/esvg/helpers.rb |
esvg-4.1.2 | lib/esvg/helpers.rb |
esvg-4.1.1 | lib/esvg/helpers.rb |