Module: SlimGruntHelpers::Helpers
- Defined in:
- lib/slim-grunt-helpers/helpers.rb
Instance Method Summary collapse
- #sg_empty_href ⇒ Object
- #sg_enclose_newline ⇒ Object
-
#sg_usemin_css(path, options = {}) {|usemin| ... } ⇒ Object
Options: - ‘alt` which allows to set alternate paths which usemin should look into - `absolute` which ensures all files are prepended with ’/‘ when true.
-
#sg_usemin_js(path, options = {}) {|usemin| ... } ⇒ Object
Options: - ‘alt` which allows to set alternate paths which usemin should look into - `absolute` which ensures all files are prepended with ’/‘ when true.
Instance Method Details
#sg_empty_href ⇒ Object
49 50 51 |
# File 'lib/slim-grunt-helpers/helpers.rb', line 49 def sg_empty_href 'javascript:void(0);' end |
#sg_enclose_newline ⇒ Object
9 10 11 |
# File 'lib/slim-grunt-helpers/helpers.rb', line 9 def sg_enclose_newline %Q{\n#{ yield }\n} end |
#sg_usemin_css(path, options = {}) {|usemin| ... } ⇒ Object
Options:
-
‘alt` which allows to set alternate paths which usemin should look into
-
‘absolute` which ensures all files are prepended with ’/‘ when true
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/slim-grunt-helpers/helpers.rb', line 16 def sg_usemin_css(path, ={}) usemin = SlimGruntHelpers::Models::UseminCss.new = { alt: nil, absolute: false }.merge!() alt = '' alt = "(#{ options[:alt] })" unless [:alt].nil? text = "\n<!-- build:css#{ alt } #{ path } -->\n" yield(usemin) usemin.each() do |link| text << "#{ link }\n" end text << "<!-- endbuild -->\n" end |
#sg_usemin_js(path, options = {}) {|usemin| ... } ⇒ Object
Options:
-
‘alt` which allows to set alternate paths which usemin should look into
-
‘absolute` which ensures all files are prepended with ’/‘ when true
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/slim-grunt-helpers/helpers.rb', line 34 def sg_usemin_js(path, ={}) usemin = SlimGruntHelpers::Models::UseminJs.new = { alt: nil, absolute: false }.merge!() alt = '' alt = "(#{ options[:alt] })" unless [:alt].nil? text = "\n<!-- build:js#{ alt } #{ path } -->\n" yield(usemin) usemin.each() do |link| text << "#{ link }\n" end text << "<!-- endbuild -->\n" end |