module SlimGruntHelpers::Helpers

Public Instance Methods

sg_empty_href() click to toggle source
# File lib/slim-grunt-helpers/helpers.rb, line 49
def sg_empty_href
  'javascript:void(0);'
end
sg_enclose_newline() click to toggle source
# File lib/slim-grunt-helpers/helpers.rb, line 9
def sg_enclose_newline
  %Q{\n#{ yield }\n}
end
sg_usemin_css(path, options={}) { |usemin| ... } click to toggle source

Options:

  • `alt` which allows to set alternate paths which usemin should look into

  • `absolute` which ensures all files are prepended with '/' when true

# File lib/slim-grunt-helpers/helpers.rb, line 16
def sg_usemin_css(path, options={})
  usemin  = SlimGruntHelpers::Models::UseminCss.new
  options = { alt: nil, absolute: false }.merge!(options)

  alt = ''
  alt = "(#{ options[:alt] })" unless options[:alt].nil?

  text  = "\n<!-- build:css#{ alt } #{ path } -->\n"
  yield(usemin)
  usemin.each(options) do |link|
    text << "#{ link }\n"
  end
  text << "<!-- endbuild -->\n"
end
sg_usemin_js(path, options={}) { |usemin| ... } click to toggle source

Options:

  • `alt` which allows to set alternate paths which usemin should look into

  • `absolute` which ensures all files are prepended with '/' when true

# File lib/slim-grunt-helpers/helpers.rb, line 34
def sg_usemin_js(path, options={})
  usemin  = SlimGruntHelpers::Models::UseminJs.new
  options = { alt: nil, absolute: false }.merge!(options)

  alt = ''
  alt = "(#{ options[:alt] })" unless options[:alt].nil?

  text  = "\n<!-- build:js#{ alt } #{ path } -->\n"
  yield(usemin)
  usemin.each(options) do |link|
    text << "#{ link }\n"
  end
  text << "<!-- endbuild -->\n"
end