Skip to content

Commit

Permalink
Revert relative imports change
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Dec 14, 2018
1 parent dcdef9b commit 3c126b3
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 17 deletions.
4 changes: 2 additions & 2 deletions assets/stylesheets/bootstrap/_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// Load core variables and mixins
// --------------------------------------------------

@import "bootstrap/variables";
@import "bootstrap/mixins";
@import "variables";
@import "mixins";


//
Expand Down
2 changes: 0 additions & 2 deletions tasks/converter/less_conversion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ def process_stylesheet_assets
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'
Expand Down
34 changes: 23 additions & 11 deletions test/compilation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,28 @@
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
2 changes: 1 addition & 1 deletion test/dummy_sass_only/Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'

gem 'sassc', '>= 1.12.1'
gem 'sassc', '>= 2.0.0'
gem 'bootstrap-sass', path: '../..'
2 changes: 1 addition & 1 deletion test/dummy_sass_only/compile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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
Expand Down
1 change: 1 addition & 0 deletions test/sass_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'test_helper'
require 'shellwords'
require 'fileutils'
require 'bootstrap-sass'

class SassTest < Minitest::Test
DUMMY_PATH = 'test/dummy_sass_only'
Expand Down

0 comments on commit 3c126b3

Please sign in to comment.