roger_sassc 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/roger_sassc/middleware.rb +4 -1
- data/lib/roger_sassc/processor.rb +1 -0
- data/lib/roger_sassc/version.rb +1 -1
- data/lib/roger_sassc.rb +10 -2
- data/test/fixtures/errors/syntax.css +4 -4
- data/test/roger_sassc_test.rb +14 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12e1ad5d6540f6f729149ba33963dcdd213a0f01
|
4
|
+
data.tar.gz: fe0e7f8ac7b66ec60a66cf1453da6a276f13dced
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bc91a459dc49212ecd8ea0731cdba18080c3d7bd46812aedd24798fdf0f9979ba42d309e3cb27f18d52bc3470ffd1dcfc9172ac425718ea3c0d69e0277070c4
|
7
|
+
data.tar.gz: 607de8dfa9f142251e03618f8c807d6a9b3b9c9b2e75865e464d5a296e9b401ad49376d950259c7842108bd8dbe763e46c08f61e84f86c10d999e09250ee9473
|
@@ -54,6 +54,9 @@ module RogerSassc
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def compile_scss(scss_path)
|
57
|
+
# Supply the filename for load path resolving
|
58
|
+
@options[:filename] = scss_path.to_s
|
59
|
+
|
57
60
|
SassC::Engine.new(File.read(scss_path), @options).render
|
58
61
|
end
|
59
62
|
|
@@ -65,7 +68,7 @@ module RogerSassc
|
|
65
68
|
# Build debug string
|
66
69
|
debug = "/*\n"
|
67
70
|
debug << "#{sassc_error}\n\n"
|
68
|
-
debug << "Load paths
|
71
|
+
debug << "Load paths:\n"
|
69
72
|
debug << "#{@options[:load_paths]}\n\n"
|
70
73
|
debug << "*/\n"
|
71
74
|
debug << "body:before {\n"
|
data/lib/roger_sassc/version.rb
CHANGED
data/lib/roger_sassc.rb
CHANGED
@@ -2,23 +2,31 @@ require "roger_sassc/version"
|
|
2
2
|
|
3
3
|
# The RogerSassc namespace
|
4
4
|
module RogerSassc
|
5
|
-
|
5
|
+
# Loading default bower_components here,
|
6
|
+
# just as a little reward for using the default
|
7
|
+
# but you can overwrite or append any path you like
|
8
|
+
DEFAULT_LOAD_PATHS = ["bower_components"]
|
6
9
|
|
7
10
|
class << self
|
8
11
|
attr_accessor :load_paths
|
9
12
|
|
10
13
|
# Add one or more paths to the array,
|
11
14
|
# that will be given to libsass
|
15
|
+
# in general load paths are only required
|
16
|
+
# once a file is hard or impossible to reach by a relative path
|
12
17
|
def append_path(*paths)
|
13
18
|
@load_paths.push(*(paths.flatten))
|
14
19
|
end
|
20
|
+
|
21
|
+
alias_method :append_paths, :append_path
|
15
22
|
end
|
16
23
|
end
|
17
24
|
|
18
25
|
# Add some sensible paths, convention over configuration
|
19
26
|
RogerSassc.load_paths = RogerSassc::DEFAULT_LOAD_PATHS.dup
|
20
27
|
|
21
|
-
# Legacy Sass load_paths copy
|
28
|
+
# Legacy Sass load_paths copy, this is mainly used in gems that
|
29
|
+
# supply assets such as bourbon and neat
|
22
30
|
RogerSassc.append_path(Sass.load_paths) if defined?(Sass.load_paths)
|
23
31
|
|
24
32
|
require "roger_sassc/middleware"
|
@@ -1,15 +1,15 @@
|
|
1
1
|
/*
|
2
2
|
Error: invalid property name
|
3
|
-
on line 2 of
|
3
|
+
on line 2 of test/fixtures/errors/syntax.scss
|
4
4
|
>> background: #fff;
|
5
5
|
-------------------^
|
6
6
|
|
7
7
|
|
8
|
-
Load paths:
|
9
|
-
["
|
8
|
+
Load paths:
|
9
|
+
["bower_components", "test/fixtures"]
|
10
10
|
|
11
11
|
*/
|
12
12
|
body:before {
|
13
13
|
white-space: pre;
|
14
14
|
font-family: monospace;
|
15
|
-
content: 'Error: invalid property name\A on line 2 of
|
15
|
+
content: 'Error: invalid property name\A on line 2 of test/fixtures/errors/syntax.scss\A>> background: #fff;\A -------------------^\A'; }
|
data/test/roger_sassc_test.rb
CHANGED
@@ -15,25 +15,31 @@ module RogerSassc
|
|
15
15
|
|
16
16
|
def test_append_load_path
|
17
17
|
RogerSassc.append_path("a/b")
|
18
|
-
assert_equal
|
19
|
-
|
18
|
+
assert_equal ["bower_components", "a/b"],
|
19
|
+
RogerSassc.load_paths
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_append_load_path_with_multiple_params
|
23
23
|
RogerSassc.append_path("a/b", "b/c")
|
24
|
-
assert_equal
|
25
|
-
|
24
|
+
assert_equal ["bower_components", "a/b", "b/c"],
|
25
|
+
RogerSassc.load_paths
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_append_load_path_with_array
|
29
29
|
RogerSassc.append_path(["a/b", "b/c"])
|
30
|
-
assert_equal
|
31
|
-
|
30
|
+
assert_equal ["bower_components", "a/b", "b/c"],
|
31
|
+
RogerSassc.load_paths
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_appends_path_alias
|
35
|
+
RogerSassc.append_path("a/b", "b/c")
|
36
|
+
assert_equal ["bower_components", "a/b", "b/c"],
|
37
|
+
RogerSassc.load_paths
|
32
38
|
end
|
33
39
|
|
34
40
|
def test_default_load_path
|
35
|
-
assert_equal
|
36
|
-
|
41
|
+
assert_equal ["bower_components"],
|
42
|
+
RogerSassc.load_paths
|
37
43
|
end
|
38
44
|
end
|
39
45
|
end
|