Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/support partial #27

Merged
merged 3 commits into from Sep 30, 2014
Merged
Changes from 2 commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -66,6 +66,11 @@
font: '나눔고딕', sans-serif; }
'''

E_EXPECTED_CSS = '''\
a {
color: red; }
'''

SUBDIR_RECUR_EXPECTED_CSS = '''\
body p {
color: blue; }
@@ -187,6 +192,8 @@ def test_compile_filename(self):
self.assertEqual(D_EXPECTED_CSS, actual)
else:
self.assertEqual(D_EXPECTED_CSS.decode('utf-8'), actual)
actual = sass.compile(filename='test/e.scss')
assert actual == E_EXPECTED_CSS
self.assertRaises(IOError, sass.compile,
filename='test/not-exist.sass')
self.assertRaises(TypeError, sass.compile, filename=1234)
@@ -234,7 +241,7 @@ def test_builder_build_directory(self):
css_path = os.path.join(temp_path, 'css')
shutil.copytree('test', sass_path)
result_files = build_directory(sass_path, css_path)
assert len(result_files) == 5
assert len(result_files) == 6
assert result_files['a.scss'] == 'a.scss.css'
with open(os.path.join(css_path, 'a.scss.css'), **utf8_if_py3) as f:
css = f.read()
@@ -251,6 +258,10 @@ def test_builder_build_directory(self):
with open(os.path.join(css_path, 'd.scss.css'), **utf8_if_py3) as f:
css = f.read()
self.assertEqual(D_EXPECTED_CSS, css)
assert result_files['e.scss'] == 'e.scss.css'
with open(os.path.join(css_path, 'e.scss.css'), **utf8_if_py3) as f:
css = f.read()
assert css == E_EXPECTED_CSS
assert (result_files[os.path.join('subdir', 'recur.scss')] ==
os.path.join('subdir', 'recur.scss.css'))
with open(os.path.join(css_path, 'subdir', 'recur.scss.css'),
@@ -46,6 +46,9 @@ def build_directory(sass_path, css_path, _root_sass=None, _root_css=None):
for name in os.listdir(sass_path):
sass_fullname = os.path.join(sass_path, name)
if SUFFIX_PATTERN.search(name) and os.path.isfile(sass_fullname):
if name[0] == '_':
"""If file is partial file. do not compile"""

This comment has been minimized.

Copy link
@miaekim

miaekim Sep 29, 2014

why don't you use # comment?

continue
css_fullname = os.path.join(css_path, name) + '.css'
css = compile(filename=sass_fullname, include_paths=[_root_sass])
with io.open(css_fullname, 'w', encoding='utf-8') as css_file:
@@ -0,0 +1 @@
$test-variable : true !default;
@@ -0,0 +1,2 @@
@import "f";
@import "subdir/sub";
@@ -0,0 +1,5 @@
@if $test-variable == true {
a {
color: red;
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.