sprockets-sass 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sprockets/sass/importer.rb +2 -2
- data/lib/sprockets/sass/version.rb +1 -1
- data/spec/sprockets-sass_spec.rb +15 -0
- metadata +4 -4
@@ -53,7 +53,7 @@ module Sprockets
|
|
53
53
|
# Create a Sass::Engine from the given path.
|
54
54
|
def engine_from_path(path, options)
|
55
55
|
pathname = resolve(path) or return nil
|
56
|
-
context.
|
56
|
+
context.depend_on_asset pathname
|
57
57
|
::Sass::Engine.new evaluate(pathname), options.merge(
|
58
58
|
:filename => pathname.to_s,
|
59
59
|
:syntax => syntax(pathname),
|
@@ -65,7 +65,7 @@ module Sprockets
|
|
65
65
|
# a glob of files.
|
66
66
|
def engine_from_glob(glob, base_path, options)
|
67
67
|
imports = resolve_glob(glob, base_path).inject("") do |imports, path|
|
68
|
-
context.
|
68
|
+
context.depend_on_asset path
|
69
69
|
relative_path = path.relative_path_from Pathname.new(context.root_path)
|
70
70
|
imports << %(@import "#{relative_path}";\n)
|
71
71
|
end
|
data/spec/sprockets-sass_spec.rb
CHANGED
@@ -118,6 +118,21 @@ describe Sprockets::Sass do
|
|
118
118
|
asset.should be_stale
|
119
119
|
end
|
120
120
|
|
121
|
+
it "adds dependencies from assets when imported" do
|
122
|
+
@assets.file "main.css.scss", %(@import "dep1";\nbody { color: $color; })
|
123
|
+
@assets.file "dep1.css.scss", %(@import "dep2";\n)
|
124
|
+
dep = @assets.file "dep2.css.scss", "$color: blue;"
|
125
|
+
|
126
|
+
asset = @env["main.css.scss"]
|
127
|
+
asset.should be_fresh
|
128
|
+
|
129
|
+
mtime = Time.now + 1
|
130
|
+
dep.open("w") { |f| f.write "$color: red;" }
|
131
|
+
dep.utime mtime, mtime
|
132
|
+
|
133
|
+
asset.should be_stale
|
134
|
+
end
|
135
|
+
|
121
136
|
it "adds dependencies when imported from a glob" do
|
122
137
|
@assets.file "main.css.scss", %(@import "folder/*";\nbody { color: $color; background: $bg-color; })
|
123
138
|
@assets.file "folder/dep1.css.scss", "$color: blue;"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Pete Browne
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-09-
|
18
|
+
date: 2011-09-23 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|