Skip to content

Commit 3c126b3

Browse files
committed
Revert relative imports change
1 parent dcdef9b commit 3c126b3

File tree

6 files changed

+28
-17
lines changed

6 files changed

+28
-17
lines changed

assets/stylesheets/bootstrap/_theme.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// Load core variables and mixins
99
// --------------------------------------------------
1010

11-
@import "bootstrap/variables";
12-
@import "bootstrap/mixins";
11+
@import "variables";
12+
@import "mixins";
1313

1414

1515
//

tasks/converter/less_conversion.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ def process_stylesheet_assets
124124
file = replace_all file, /(\s*)\.navbar-(right|left)\s*\{\s*@extend\s*\.pull-(right|left);\s*/, "\\1.navbar-\\2 {\\1 float: \\2 !important;\\1"
125125
when 'tables.less'
126126
file = replace_all file, /(@include\s*table-row-variant\()(\w+)/, "\\1'\\2'"
127-
when 'theme.less'
128-
file = replace_all file, /@import "/, '\0bootstrap/'
129127
when 'thumbnails.less', 'labels.less', 'badges.less', 'buttons.less'
130128
file = extract_nested_rule file, 'a&'
131129
when 'glyphicons.less'

test/compilation_test.rb

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,28 @@
33
require 'sassc'
44

55
class CompilationTest < Minitest::Test
6-
def test_compilation
7-
path = 'assets/stylesheets'
8-
%w(_bootstrap bootstrap/_theme).each do |file|
9-
FileUtils.rm_rf('.sass-cache', secure: true)
10-
engine = SassC::Engine.new(File.read("#{path}/#{file}.scss"), syntax: :scss, load_paths: [path])
11-
FileUtils.mkdir_p("tmp/#{File.dirname(file)}")
12-
File.open("tmp/#{file}.css", 'w') { |f|
13-
f.write engine.render
14-
}
15-
assert true # nothing was raised
16-
end
6+
def test_compilation_bootstrap
7+
compile 'bootstrap'
8+
assert true # nothing was raised
9+
end
10+
11+
def test_compilation_bootstrap_theme
12+
compile 'bootstrap/theme'
13+
assert true # nothing was raised
14+
end
15+
16+
private
17+
18+
def compile(file)
19+
path = File.expand_path('../assets/stylesheets', __dir__)
20+
FileUtils.rm_rf('.sass-cache', secure: true)
21+
engine = SassC::Engine.new(
22+
%Q{@import "#{path}/#{file}"},
23+
syntax: :scss, load_paths: ['.']
24+
)
25+
FileUtils.mkdir_p("tmp/#{File.dirname(file)}")
26+
File.open("tmp/#{file}.css", 'w') { |f|
27+
f.write engine.render
28+
}
1729
end
1830
end

test/dummy_sass_only/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
source 'https://rubygems.org'
22

3-
gem 'sassc', '>= 1.12.1'
3+
gem 'sassc', '>= 2.0.0'
44
gem 'bootstrap-sass', path: '../..'

test/dummy_sass_only/compile.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
output = SassC::Engine.new(
1111
File.read(File.expand_path('./import_all.scss', __dir__)),
12-
syntax: :scss, load_paths: [load_path]
12+
syntax: :scss, load_paths: ['.', load_path]
1313
).render
1414

1515
if out_path

test/sass_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require 'test_helper'
44
require 'shellwords'
55
require 'fileutils'
6+
require 'bootstrap-sass'
67

78
class SassTest < Minitest::Test
89
DUMMY_PATH = 'test/dummy_sass_only'

0 commit comments

Comments
 (0)