1
0
Fork 0
mirror of https://github.com/twbs/bootstrap-sass.git synced 2022-11-09 12:27:02 -05:00

tests: dummy rails app server task & fixes

This commit is contained in:
Gleb Mazovetskiy 2015-02-25 00:16:59 +00:00
parent 2c51ce8870
commit 899fe20a4d
7 changed files with 63 additions and 5 deletions

View file

@ -40,7 +40,7 @@ task :compile, :css_path do |t, args|
css_path = args.with_defaults(css_path: 'tmp')[:css_path]
puts Term::ANSIColor.bold "Compiling SCSS in #{path}"
Dir.mkdir(css_path) unless File.directory?(css_path)
%w(bootstrap bootstrap/_theme).each do |file|
%w(_bootstrap bootstrap/_theme).each do |file|
save_path = "#{css_path}/#{file.sub(/(^|\/)?_+/, '\1').sub('/', '-')}.css"
puts Term::ANSIColor.cyan(" #{save_path}") + '...'
engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path])
@ -49,4 +49,15 @@ task :compile, :css_path do |t, args|
end
end
desc 'Start a dummy (test) Rails app server'
task :dummy_rails do
require 'rack'
require 'term/ansicolor'
port = ENV['PORT'] || 9292
puts %Q(Starting on #{Term::ANSIColor.cyan "http://localhost:#{port}"})
Rack::Server.start(
config: 'test/dummy_rails/config.ru',
Port: port)
end
task default: :test

View file

@ -1,4 +1,5 @@
require_relative 'char_string_scanner'
require 'bootstrap-sass/version'
# This is the script used to automatically convert all of twbs/bootstrap LESS to Sass.
#

View file

@ -1,3 +1,46 @@
.navbar.navbar-inverse: .container-fluid
.navbar-header
button.navbar-toggle.collapsed type="button" data-toggle="collapse" data-target="#c1"
span.sr-only Toggle navigation
span.icon-bar
span.icon-bar
span.icon-bar
a.navbar-brand href="#" Bootstrap for Sass Test Rails App
.collapse.navbar-collapse#c1
ul.nav.navbar-nav
li.active: a href="#"
' Home
span.sr-only (current)
li: a href="#" Link
li.dropdown
a.dropdown-toggle href="#" data-toggle="dropdown" role="button" aria-expanded="false"
' Dropdown
span.caret
ul.dropdown-menu role="menu"
li: a href="#" Action
li: a href="#" Another action
li: a href="#" Something else here
li.divider
li: a href="#" Separated link
li.divider
li: a href="#" One more separated link
form.navbar-form.navbar-left role="search"
.input-group
input.form-control type="search" placeholder="Search..."
.input-group-btn: button.btn.btn-primary type="submit" Go
ul.nav.navbar-nav.navbar-right
li: a href="#" Link
li.dropdown
a.dropdown-toggle href="#" data-toggle="dropdown" role="button" aria-expanded="false"
' Dropdown
span.caret
ul.dropdown-menu role="menu"
li: a href="#" Action
li: a href="#" Another action
li: a href="#" Something else here
li.divider
li: a href="#" Separated link
.container
.panel.panel-primary
.panel-heading: h1 Dummy App

View file

@ -16,9 +16,6 @@ Dummy::Application.configure do
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.

View file

@ -13,7 +13,13 @@ Dummy::Application.configure do
config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance.
config.serve_static_assets = true
if config.respond_to?(:serve_static_files)
# rails >= 4.2
config.serve_static_files = true
elsif config.respond_to?(:serve_static_assets)
# rails < 4.2
config.serve_static_assets = true
end
config.static_cache_control = "public, max-age=3600"
# Show full error reports and disable caching.