module Sinatra::Bootstrap::AssetsHelpers

Public Instance Methods

bootstrap(attrb = '') click to toggle source
# File lib/sinatra/bootstrap.rb, line 95
def bootstrap(attrb = '')
  "#{bootstrap_css(attrb)} \n#{bootstrap_js_legacy(attrb)} \n#{bootstrap_js_default(attrb)}"
end
bootstrap_css(meta = true, attrb = '') click to toggle source
# File lib/sinatra/bootstrap.rb, line 60
def bootstrap_css(meta = true, attrb = '')
  output = ''
  output += "<meta name='viewport' content='width=device-width, initial-scale=1.0'>\n" if meta

  Assets::ASSETS[:css].each do |file, _|
    output += Assets::css_tag url('/css/%s' % file), attrb 
  end

  output.chomp
end
bootstrap_js(attrb = '') click to toggle source
# File lib/sinatra/bootstrap.rb, line 91
def bootstrap_js(attrb = '')
  "#{bootstrap_js_legacy(attrb)} \n#{bootstrap_js_default(attrb)}"
end
bootstrap_js_default(attrb = '') click to toggle source
# File lib/sinatra/bootstrap.rb, line 81
def bootstrap_js_default(attrb = '')
  output = ''

  Assets::ASSETS[:default_js].each do |file, _|
    output += Assets::js_tag url('/js/%s' % file), attrb
  end

  output.chomp
end
bootstrap_js_legacy(attrb = '') click to toggle source
# File lib/sinatra/bootstrap.rb, line 71
def bootstrap_js_legacy(attrb = '')
  output = ''

  Assets::ASSETS[:legacy_js].each do |file, _|
    output += Assets::js_tag url('/js/%s' % file), attrb
  end

  "<!--[if lt IE 9]> \n#{output.chomp} \n<![endif]-->"
end