sprockets-sass 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/Appraisals +32 -13
- data/Gemfile +1 -1
- data/gemfiles/compass_0.11.gemfile +2 -1
- data/gemfiles/sass_3.1.gemfile +2 -1
- data/gemfiles/sprockets_2.1.gemfile +3 -1
- data/gemfiles/sprockets_2.10.gemfile +9 -0
- data/gemfiles/sprockets_2.11.gemfile +9 -0
- data/gemfiles/sprockets_2.2.gemfile +3 -1
- data/gemfiles/sprockets_2.3.gemfile +3 -1
- data/gemfiles/sprockets_2.4.gemfile +3 -1
- data/gemfiles/sprockets_2.5.gemfile +3 -1
- data/gemfiles/sprockets_2.6.gemfile +3 -1
- data/gemfiles/sprockets_2.7.gemfile +3 -1
- data/gemfiles/sprockets_2.8.gemfile +3 -2
- data/gemfiles/sprockets_2.9.gemfile +3 -1
- data/lib/sprockets/sass/importer.rb +10 -16
- data/lib/sprockets/sass/sass_template.rb +1 -6
- data/lib/sprockets/sass/version.rb +1 -1
- data/spec/spec_helper.rb +2 -2
- data/spec/sprockets-sass_spec.rb +5 -1
- data/sprockets-sass.gemspec +3 -3
- metadata +13 -11
data/.gitignore
CHANGED
data/Appraisals
CHANGED
@@ -1,56 +1,75 @@
|
|
1
|
-
appraise '
|
2
|
-
gem '
|
1
|
+
appraise 'sass_3.1' do
|
2
|
+
gem 'sass', '~> 3.1.0'
|
3
|
+
gem 'compass', '~> 0.12.0'
|
4
|
+
end
|
5
|
+
|
6
|
+
appraise 'compass_0.11' do
|
7
|
+
gem 'sass', '~> 3.2.0'
|
8
|
+
gem 'compass', '~> 0.11.0'
|
3
9
|
end
|
4
10
|
|
5
11
|
appraise 'sprockets_2.1' do
|
6
12
|
gem 'sprockets', '~> 2.1.0'
|
13
|
+
gem 'sass', '~> 3.2.0'
|
14
|
+
gem 'compass', '~> 0.12.0'
|
7
15
|
end
|
8
16
|
|
9
17
|
appraise 'sprockets_2.2' do
|
10
18
|
gem 'sprockets', '~> 2.2.0'
|
19
|
+
gem 'sass', '~> 3.2.0'
|
20
|
+
gem 'compass', '~> 0.12.0'
|
11
21
|
end
|
12
22
|
|
13
23
|
appraise 'sprockets_2.3' do
|
14
24
|
gem 'sprockets', '~> 2.3.0'
|
25
|
+
gem 'sass', '~> 3.2.0'
|
26
|
+
gem 'compass', '~> 0.12.0'
|
15
27
|
end
|
16
28
|
|
17
29
|
appraise 'sprockets_2.4' do
|
18
30
|
gem 'sprockets', '~> 2.4.0'
|
31
|
+
gem 'sass', '~> 3.2.0'
|
32
|
+
gem 'compass', '~> 0.12.0'
|
19
33
|
end
|
20
34
|
|
21
35
|
appraise 'sprockets_2.5' do
|
22
36
|
gem 'sprockets', '~> 2.5.0'
|
37
|
+
gem 'sass', '~> 3.2.0'
|
38
|
+
gem 'compass', '~> 0.12.0'
|
23
39
|
end
|
24
40
|
|
25
41
|
appraise 'sprockets_2.6' do
|
26
42
|
gem 'sprockets', '~> 2.6.0'
|
43
|
+
gem 'sass', '~> 3.2.0'
|
44
|
+
gem 'compass', '~> 0.12.0'
|
27
45
|
end
|
28
46
|
|
29
47
|
appraise 'sprockets_2.7' do
|
30
48
|
gem 'sprockets', '~> 2.7.0'
|
49
|
+
gem 'sass', '~> 3.2.0'
|
50
|
+
gem 'compass', '~> 0.12.0'
|
31
51
|
end
|
32
52
|
|
33
53
|
appraise 'sprockets_2.8' do
|
34
54
|
gem 'sprockets', '~> 2.8.0'
|
35
|
-
gem 'sass', '~> 3.
|
55
|
+
gem 'sass', '~> 3.2.0'
|
56
|
+
gem 'compass', '~> 0.12.0'
|
36
57
|
end
|
37
58
|
|
38
59
|
appraise 'sprockets_2.9' do
|
39
60
|
gem 'sprockets', '~> 2.9.0'
|
40
|
-
end
|
41
|
-
|
42
|
-
appraise 'sass_3.1' do
|
43
|
-
gem 'sass', '~> 3.1.0'
|
44
|
-
end
|
45
|
-
|
46
|
-
appraise 'sass_3.2' do
|
47
61
|
gem 'sass', '~> 3.2.0'
|
62
|
+
gem 'compass', '~> 0.12.0'
|
48
63
|
end
|
49
64
|
|
50
|
-
appraise '
|
51
|
-
gem '
|
65
|
+
appraise 'sprockets_2.10' do
|
66
|
+
gem 'sprockets', '~> 2.9.0'
|
67
|
+
gem 'sass', '~> 3.2.0'
|
68
|
+
gem 'compass', '~> 0.12.0'
|
52
69
|
end
|
53
70
|
|
54
|
-
appraise '
|
71
|
+
appraise 'sprockets_2.11' do
|
72
|
+
gem 'sprockets', '~> 2.9.0'
|
73
|
+
gem 'sass', '~> 3.2.0'
|
55
74
|
gem 'compass', '~> 0.12.0'
|
56
75
|
end
|
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
gemspec
|
data/gemfiles/sass_3.1.gemfile
CHANGED
@@ -6,14 +6,6 @@ module Sprockets
|
|
6
6
|
class Importer < ::Sass::Importers::Base
|
7
7
|
GLOB = /\*|\[.+\]/
|
8
8
|
|
9
|
-
# Reference to the Sprockets context
|
10
|
-
attr_reader :context
|
11
|
-
|
12
|
-
#
|
13
|
-
def initialize(context)
|
14
|
-
@context = context
|
15
|
-
end
|
16
|
-
|
17
9
|
# @see Sass::Importers::Base#find_relative
|
18
10
|
def find_relative(path, base_path, options)
|
19
11
|
if path =~ GLOB
|
@@ -52,9 +44,10 @@ module Sprockets
|
|
52
44
|
|
53
45
|
# Create a Sass::Engine from the given path.
|
54
46
|
def engine_from_path(path, base_path, options)
|
55
|
-
|
47
|
+
context = options[:custom][:sprockets_context]
|
48
|
+
pathname = resolve(context, path, base_path) or return nil
|
56
49
|
context.depend_on pathname
|
57
|
-
::Sass::Engine.new evaluate(pathname), options.merge(
|
50
|
+
::Sass::Engine.new evaluate(context, pathname), options.merge(
|
58
51
|
:filename => pathname.to_s,
|
59
52
|
:syntax => syntax(pathname),
|
60
53
|
:importer => self
|
@@ -64,7 +57,8 @@ module Sprockets
|
|
64
57
|
# Create a Sass::Engine that will handle importing
|
65
58
|
# a glob of files.
|
66
59
|
def engine_from_glob(glob, base_path, options)
|
67
|
-
|
60
|
+
context = options[:custom][:sprockets_context]
|
61
|
+
imports = resolve_glob(context, glob, base_path).inject('') do |imports, path|
|
68
62
|
context.depend_on path
|
69
63
|
relative_path = path.relative_path_from Pathname.new(context.root_path)
|
70
64
|
imports << %(@import "#{relative_path}";\n)
|
@@ -80,8 +74,8 @@ module Sprockets
|
|
80
74
|
# Finds an asset from the given path. This is where
|
81
75
|
# we make Sprockets behave like Sass, and import partial
|
82
76
|
# style paths.
|
83
|
-
def resolve(path, base_path)
|
84
|
-
possible_files(path, base_path).each do |file|
|
77
|
+
def resolve(context, path, base_path)
|
78
|
+
possible_files(context, path, base_path).each do |file|
|
85
79
|
context.resolve(file) { |found| return found if context.asset_requirable?(found) }
|
86
80
|
end
|
87
81
|
|
@@ -89,7 +83,7 @@ module Sprockets
|
|
89
83
|
end
|
90
84
|
|
91
85
|
# Finds all of the assets using the given glob.
|
92
|
-
def resolve_glob(glob, base_path)
|
86
|
+
def resolve_glob(context, glob, base_path)
|
93
87
|
base_path = Pathname.new(base_path)
|
94
88
|
path_with_glob = base_path.dirname.join(glob).to_s
|
95
89
|
|
@@ -100,7 +94,7 @@ module Sprockets
|
|
100
94
|
|
101
95
|
# Returns all of the possible paths (including partial variations)
|
102
96
|
# to attempt to resolve with the given path.
|
103
|
-
def possible_files(path, base_path)
|
97
|
+
def possible_files(context, path, base_path)
|
104
98
|
path = Pathname.new(path)
|
105
99
|
base_path = Pathname.new(base_path).dirname
|
106
100
|
root_path = Pathname.new(context.root_path)
|
@@ -132,7 +126,7 @@ module Sprockets
|
|
132
126
|
# Returns the string to be passed to the Sass engine. We use
|
133
127
|
# Sprockets to process the file, but we remove any Sass processors
|
134
128
|
# because we need to let the Sass::Engine handle that.
|
135
|
-
def evaluate(path)
|
129
|
+
def evaluate(context, path)
|
136
130
|
attributes = context.environment.attributes_for(path)
|
137
131
|
processors = context.environment.preprocessors(attributes.content_type) + attributes.engines.reverse
|
138
132
|
processors.delete_if { |processor| processor < Tilt::SassTemplate }
|
@@ -71,11 +71,6 @@ module Sprockets
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
# A reference to the custom Sass importer, `Sprockets::Sass::Importer`.
|
75
|
-
def importer
|
76
|
-
Importer.new context
|
77
|
-
end
|
78
|
-
|
79
74
|
# Assemble the options for the `Sass::Engine`
|
80
75
|
def sass_options
|
81
76
|
merge_sass_options(default_sass_options, options).merge(
|
@@ -83,7 +78,7 @@ module Sprockets
|
|
83
78
|
:line => line,
|
84
79
|
:syntax => syntax,
|
85
80
|
:cache_store => cache_store,
|
86
|
-
:importer =>
|
81
|
+
:importer => Importer.new,
|
87
82
|
:custom => { :sprockets_context => context }
|
88
83
|
)
|
89
84
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,7 +2,7 @@ require 'sprockets'
|
|
2
2
|
require 'sprockets-sass'
|
3
3
|
require 'sprockets-helpers'
|
4
4
|
require 'compass'
|
5
|
-
require '
|
5
|
+
require 'test_construct'
|
6
6
|
|
7
7
|
Compass.configuration do |compass|
|
8
8
|
compass.line_comments = false
|
@@ -14,5 +14,5 @@ end
|
|
14
14
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
15
15
|
|
16
16
|
RSpec.configure do |config|
|
17
|
-
config.include
|
17
|
+
config.include TestConstruct::Helpers
|
18
18
|
end
|
data/spec/sprockets-sass_spec.rb
CHANGED
@@ -231,7 +231,11 @@ describe Sprockets::Sass do
|
|
231
231
|
@assets.file 'main.css.scss', %($color: blue;\nbody { color: $color; })
|
232
232
|
|
233
233
|
@env['main.css'].to_s
|
234
|
-
|
234
|
+
if Sass.version[:minor] > 2
|
235
|
+
sass_cache = cache.detect.detect { |key, value| value['pathname'] =~ /main\.css\.scss/ }
|
236
|
+
else
|
237
|
+
sass_cache = cache.keys.detect { |key| key =~ /main\.css\.scss/ }
|
238
|
+
end
|
235
239
|
expect(sass_cache).to_not be_nil
|
236
240
|
end
|
237
241
|
|
data/sprockets-sass.gemspec
CHANGED
@@ -22,10 +22,10 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_dependency 'tilt', '~> 1.1'
|
23
23
|
s.add_development_dependency 'appraisal', '~> 0.5'
|
24
24
|
s.add_development_dependency 'rspec', '~> 2.13'
|
25
|
-
s.add_development_dependency '
|
25
|
+
s.add_development_dependency 'test_construct', '~> 2.0'
|
26
26
|
s.add_development_dependency 'sprockets-helpers', '~> 1.0'
|
27
|
-
s.add_development_dependency 'sass', '~> 3.
|
28
|
-
s.add_development_dependency 'compass', '~> 0.
|
27
|
+
s.add_development_dependency 'sass', '~> 3.3'
|
28
|
+
s.add_development_dependency 'compass', '~> 1.0.0.alpha.19'
|
29
29
|
s.add_development_dependency 'rake'
|
30
30
|
s.add_development_dependency 'pry'
|
31
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sprockets
|
@@ -76,13 +76,13 @@ dependencies:
|
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '2.13'
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
|
-
name:
|
79
|
+
name: test_construct
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
81
81
|
none: false
|
82
82
|
requirements:
|
83
83
|
- - ~>
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: '
|
85
|
+
version: '2.0'
|
86
86
|
type: :development
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '
|
93
|
+
version: '2.0'
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: sprockets-helpers
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '3.
|
117
|
+
version: '3.3'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - ~>
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '3.
|
125
|
+
version: '3.3'
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: compass
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - ~>
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
133
|
+
version: 1.0.0.alpha.19
|
134
134
|
type: :development
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
requirements:
|
139
139
|
- - ~>
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
141
|
+
version: 1.0.0.alpha.19
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
143
|
name: rake
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -194,6 +194,8 @@ files:
|
|
194
194
|
- gemfiles/sass_3.2.gemfile
|
195
195
|
- gemfiles/sprockets_2.0.gemfile
|
196
196
|
- gemfiles/sprockets_2.1.gemfile
|
197
|
+
- gemfiles/sprockets_2.10.gemfile
|
198
|
+
- gemfiles/sprockets_2.11.gemfile
|
197
199
|
- gemfiles/sprockets_2.2.gemfile
|
198
200
|
- gemfiles/sprockets_2.3.gemfile
|
199
201
|
- gemfiles/sprockets_2.4.gemfile
|
@@ -230,7 +232,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
230
232
|
version: '0'
|
231
233
|
segments:
|
232
234
|
- 0
|
233
|
-
hash:
|
235
|
+
hash: 3623172445139916864
|
234
236
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
235
237
|
none: false
|
236
238
|
requirements:
|
@@ -239,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
241
|
version: '0'
|
240
242
|
segments:
|
241
243
|
- 0
|
242
|
-
hash:
|
244
|
+
hash: 3623172445139916864
|
243
245
|
requirements: []
|
244
246
|
rubyforge_project: sprockets-sass
|
245
247
|
rubygems_version: 1.8.23
|