Revert relative imports change

This commit is contained in:
Gleb Mazovetskiy 2018-12-14 11:30:59 +00:00
parent dcdef9bfd8
commit 3c126b3d96
6 changed files with 28 additions and 17 deletions

View File

@ -8,8 +8,8 @@
// Load core variables and mixins
// --------------------------------------------------
@import "bootstrap/variables";
@import "bootstrap/mixins";
@import "variables";
@import "mixins";
//

View File

@ -124,8 +124,6 @@ class Converter
file = replace_all file, /(\s*)\.navbar-(right|left)\s*\{\s*@extend\s*\.pull-(right|left);\s*/, "\\1.navbar-\\2 {\\1 float: \\2 !important;\\1"
when 'tables.less'
file = replace_all file, /(@include\s*table-row-variant\()(\w+)/, "\\1'\\2'"
when 'theme.less'
file = replace_all file, /@import "/, '\0bootstrap/'
when 'thumbnails.less', 'labels.less', 'badges.less', 'buttons.less'
file = extract_nested_rule file, 'a&'
when 'glyphicons.less'

View File

@ -3,16 +3,28 @@ require 'fileutils'
require 'sassc'
class CompilationTest < Minitest::Test
def test_compilation
path = 'assets/stylesheets'
%w(_bootstrap bootstrap/_theme).each do |file|
FileUtils.rm_rf('.sass-cache', secure: true)
engine = SassC::Engine.new(File.read("#{path}/#{file}.scss"), syntax: :scss, load_paths: [path])
FileUtils.mkdir_p("tmp/#{File.dirname(file)}")
File.open("tmp/#{file}.css", 'w') { |f|
f.write engine.render
}
assert true # nothing was raised
end
def test_compilation_bootstrap
compile 'bootstrap'
assert true # nothing was raised
end
def test_compilation_bootstrap_theme
compile 'bootstrap/theme'
assert true # nothing was raised
end
private
def compile(file)
path = File.expand_path('../assets/stylesheets', __dir__)
FileUtils.rm_rf('.sass-cache', secure: true)
engine = SassC::Engine.new(
%Q{@import "#{path}/#{file}"},
syntax: :scss, load_paths: ['.']
)
FileUtils.mkdir_p("tmp/#{File.dirname(file)}")
File.open("tmp/#{file}.css", 'w') { |f|
f.write engine.render
}
end
end

View File

@ -1,4 +1,4 @@
source 'https://rubygems.org'
gem 'sassc', '>= 1.12.1'
gem 'sassc', '>= 2.0.0'
gem 'bootstrap-sass', path: '../..'

View File

@ -9,7 +9,7 @@ out_path = ARGV[1]
output = SassC::Engine.new(
File.read(File.expand_path('./import_all.scss', __dir__)),
syntax: :scss, load_paths: [load_path]
syntax: :scss, load_paths: ['.', load_path]
).render
if out_path

View File

@ -3,6 +3,7 @@
require 'test_helper'
require 'shellwords'
require 'fileutils'
require 'bootstrap-sass'
class SassTest < Minitest::Test
DUMMY_PATH = 'test/dummy_sass_only'