sass-rails 5.0.3 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9dca2ad9e3a47299754e3c7533fbf3925799abdf
4
- data.tar.gz: f3f726e222a54bd4a4328b5c7ce8f8d9ad4a7902
2
+ SHA256:
3
+ metadata.gz: d162298f6dcc547ef3c5e3e51d6d5bca7df731e8161737f03b01b05e3c77aba3
4
+ data.tar.gz: 2f10eb26a35786fa327e5ede671c6e487881c6bf85cce2eea5481aec63ab99db
5
5
  SHA512:
6
- metadata.gz: 44ca6e2500b867ce8fb3cec783b1492928c2ab31395c90fee8d10e721399a3fef655da362da7b1bd65828cfcb3476cf9bde5fea89626f0e0b4f98460721268ac
7
- data.tar.gz: 57fc653a7f09e242d9663cbe8740e11468c0fcb1c0bcba67307584a2ea23e6c4431276ddca678298b1c72085ae0e65c39e084ec3684e065d141fb0a2174cc2bb
6
+ metadata.gz: 4862c7852e9d3928e48ef3d8a314e8872557d94345a8a8845f6c3fc7f80e0166947c07fbf09d11505a86b3f8075d933f5576c45ef5d90eadcf0980707cbf549e
7
+ data.tar.gz: 75616f8708d8f20b2d32d84adf73d779c193c18d6ac7784a3d9ba10fc4309e7694dc39f09087daf6ec993357e363ebe2d2e3292160ae4e2944ed6e50f105a3da
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Christopher Eppstein
1
+ Copyright (c) 2011-2019 Christopher Eppstein
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -6,7 +6,9 @@ This gem provides official integration for Ruby on Rails projects with the Sass
6
6
 
7
7
  Since Rails 3.1, new Rails projects will be already configured to use Sass. If you are upgrading to Rails 3.1 you will need to add the following to your Gemfile:
8
8
 
9
- gem 'sass-rails'
9
+ ```ruby
10
+ gem 'sass-rails'
11
+ ```
10
12
 
11
13
  ## Configuration
12
14
 
@@ -30,12 +32,13 @@ can be found on the Sass Website with the following caveats:
30
32
  - `:line` - This is provided by the template handler.
31
33
 
32
34
  ### Example
33
-
34
- MyProject::Application.configure do
35
- config.sass.preferred_syntax = :sass
36
- config.sass.line_comments = false
37
- config.sass.cache = false
38
- end
35
+ ```ruby
36
+ MyProject::Application.configure do
37
+ config.sass.preferred_syntax = :sass
38
+ config.sass.line_comments = false
39
+ config.sass.cache = false
40
+ end
41
+ ```
39
42
 
40
43
  ## Important Note
41
44
 
@@ -68,24 +71,24 @@ in Sass):
68
71
  #### `asset-path($relative-asset-path)`
69
72
  Returns a string to the asset.
70
73
 
71
- * `asset-path("rails.png")` becomes `"/assets/rails.png"`
74
+ * `asset-path("rails.png")` returns `"/assets/rails.png"`
72
75
 
73
76
  #### `asset-url($relative-asset-path)`
74
77
  Returns a url reference to the asset.
75
78
 
76
- * `asset-url("rails.png")` becomes `url(/assets/rails.png)`
79
+ * `asset-url("rails.png")` returns `url(/assets/rails.png)`
77
80
 
78
81
  As a convenience, for each of the following asset classes there are
79
82
  corresponding `-path` and `-url` helpers:
80
83
  image, font, video, audio, javascript, stylesheet.
81
84
 
82
- * `image-path("rails.png")` becomes `"/assets/rails.png"`
83
- * `image-url("rails.png")` becomes `url(/assets/rails.png)`
85
+ * `image-path("rails.png")` returns `"/assets/rails.png"`
86
+ * `image-url("rails.png")` returns `url(/assets/rails.png)`
84
87
 
85
88
  #### `asset-data-url($relative-asset-path)`
86
89
  Returns a url reference to the Base64-encoded asset at the specified path.
87
90
 
88
- * `asset-data-url("rails.png")` becomes `url(data:image/png;base64,iVBORw0K...)`
91
+ * `asset-data-url("rails.png")` returns `url(data:image/png;base64,iVBORw0K...)`
89
92
 
90
93
  ## Running Tests
91
94
 
@@ -98,4 +101,3 @@ If you need to test against local gems, use Bundler's gem :path option in the Ge
98
101
 
99
102
  * [![Travis CI](https://api.travis-ci.org/rails/sass-rails.svg)](http://travis-ci.org/rails/sass-rails)
100
103
  * [![Gem Version](https://badge.fury.io/rb/sass-rails.svg)](http://badge.fury.io/rb/sass-rails)
101
- * [![Dependencies](https://gemnasium.com/rails/sass-rails.svg)](https://gemnasium.com/rails/sass-rails)
data/lib/sass-rails.rb CHANGED
@@ -1 +1 @@
1
- require 'sass/rails'
1
+ require 'sassc/rails'
data/lib/sass/rails.rb CHANGED
@@ -1,11 +1 @@
1
- module Sass
2
- module Rails
3
- autoload :Logger, 'sass/rails/logger'
4
- end
5
- end
6
-
7
- require 'sass/rails/version'
8
- require 'sass/rails/helpers'
9
- require 'sass/rails/importer'
10
- require 'sass/rails/template'
11
- require 'sass/rails/railtie'
1
+ require 'sassc/rails'
@@ -1,147 +1,5 @@
1
- require 'active_support/deprecation/reporting'
2
- require 'sass'
3
- require 'sprockets/sass_importer'
4
- require 'tilt'
1
+ # frozen_string_literal: true
5
2
 
6
- module Sass
7
- module Rails
8
- class SassImporter < Sass::Importers::Filesystem
9
- module Globbing
10
- GLOB = /(\A|\/)(\*|\*\*\/\*)\z/
3
+ require "active_support/deprecation"
11
4
 
12
- def find_relative(name, base, options)
13
- if options[:sprockets] && m = name.match(GLOB)
14
- path = name.sub(m[0], "")
15
- base = File.expand_path(path, File.dirname(base))
16
- glob_imports(base, m[2], options)
17
- else
18
- super
19
- end
20
- end
21
-
22
- def find(name, options)
23
- # globs must be relative
24
- return if name =~ GLOB
25
- super
26
- end
27
-
28
- private
29
- def glob_imports(base, glob, options)
30
- contents = ""
31
- context = options[:sprockets][:context]
32
- each_globbed_file(base, glob, context) do |filename|
33
- next if filename == options[:filename]
34
- contents << "@import #{filename.inspect};\n"
35
- end
36
- return nil if contents == ""
37
- Sass::Engine.new(contents, options.merge(
38
- :filename => base,
39
- :importer => self,
40
- :syntax => :scss
41
- ))
42
- end
43
-
44
- def each_globbed_file(base, glob, context)
45
- raise ArgumentError unless glob == "*" || glob == "**/*"
46
-
47
- exts = extensions.keys.map { |ext| Regexp.escape(".#{ext}") }.join("|")
48
- sass_re = Regexp.compile("(#{exts})$")
49
-
50
- context.depend_on(base)
51
-
52
- Dir["#{base}/#{glob}"].sort.each do |path|
53
- if File.directory?(path)
54
- context.depend_on(path)
55
- elsif sass_re =~ path
56
- yield path
57
- end
58
- end
59
- end
60
- end
61
-
62
- module ERB
63
- def extensions
64
- {
65
- 'css.erb' => :scss_erb,
66
- 'scss.erb' => :scss_erb,
67
- 'sass.erb' => :sass_erb
68
- }.merge(super)
69
- end
70
-
71
- def erb_extensions
72
- {
73
- :scss_erb => :scss,
74
- :sass_erb => :sass
75
- }
76
- end
77
-
78
- def find_relative(*args)
79
- process_erb_engine(super)
80
- end
81
-
82
- def find(*args)
83
- process_erb_engine(super)
84
- end
85
-
86
- private
87
- def process_erb_engine(engine)
88
- if engine && engine.options[:sprockets] && syntax = erb_extensions[engine.options[:syntax]]
89
- template = Tilt::ERBTemplate.new(engine.options[:filename])
90
- contents = template.render(engine.options[:sprockets][:context], {})
91
-
92
- Sass::Engine.new(contents, engine.options.merge(:syntax => syntax))
93
- else
94
- engine
95
- end
96
- end
97
- end
98
-
99
- module Deprecated
100
- def extensions
101
- {
102
- 'css.scss' => :scss,
103
- 'css.sass' => :sass,
104
- 'css.scss.erb' => :scss_erb,
105
- 'css.sass.erb' => :sass_erb
106
- }.merge(super)
107
- end
108
-
109
- def find_relative(*args)
110
- deprecate_extra_css_extension(super)
111
- end
112
-
113
- def find(*args)
114
- deprecate_extra_css_extension(super)
115
- end
116
-
117
- private
118
- def deprecate_extra_css_extension(engine)
119
- if engine && filename = engine.options[:filename]
120
- if filename.end_with?('.css.scss')
121
- msg = "Extra .css in SCSS file is unnecessary. Rename #{filename} to #{filename.sub('.css.scss', '.scss')}."
122
- elsif filename.end_with?('.css.sass')
123
- msg = "Extra .css in SASS file is unnecessary. Rename #{filename} to #{filename.sub('.css.sass', '.sass')}."
124
- elsif filename.end_with?('.css.scss.erb')
125
- msg = "Extra .css in SCSS/ERB file is unnecessary. Rename #{filename} to #{filename.sub('.css.scss.erb', '.scss.erb')}."
126
- elsif filename.end_with?('.css.sass.erb')
127
- msg = "Extra .css in SASS/ERB file is unnecessary. Rename #{filename} to #{filename.sub('.css.sass.erb', '.sass.erb')}."
128
- end
129
-
130
- ActiveSupport::Deprecation.warn(msg) if msg
131
- end
132
-
133
- engine
134
- end
135
- end
136
-
137
- include Deprecated
138
- include ERB
139
- include Globbing
140
-
141
- # Allow .css files to be @import'd
142
- def extensions
143
- { 'css' => :scss }.merge(super)
144
- end
145
- end
146
- end
147
- end
5
+ ActiveSupport::Deprecation.warn "Sass::Rails::Importer has been removed, please use SassC::Rails::Importer instead."
@@ -1,22 +1,5 @@
1
- require 'sass'
2
- require 'sass/logger'
1
+ # frozen_string_literal: true
3
2
 
4
- module Sass
5
- module Rails
6
- class Logger < Sass::Logger::Base
7
- def _log(level, message)
3
+ require "active_support/deprecation"
8
4
 
9
- case level
10
- when :trace, :debug
11
- ::Rails.logger.debug message
12
- when :warn
13
- ::Rails.logger.warn message
14
- when :error
15
- ::Rails.logger.error message
16
- when :info
17
- ::Rails.logger.info message
18
- end
19
- end
20
- end
21
- end
22
- end
5
+ ActiveSupport::Deprecation.warn "Sass::Rails::Logger has been removed, please stop requiring sass/rails/logger."
@@ -1,78 +1 @@
1
- require 'sass'
2
- require 'active_support/core_ext/class/attribute'
3
- require 'sprockets/railtie'
4
-
5
- module Sass::Rails
6
- class Railtie < ::Rails::Railtie
7
- config.sass = ActiveSupport::OrderedOptions.new
8
-
9
- # Establish static configuration defaults
10
- # Emit scss files during stylesheet generation of scaffold
11
- config.sass.preferred_syntax = :scss
12
- # Write sass cache files for performance
13
- config.sass.cache = true
14
- # Read sass cache files for performance
15
- config.sass.read_cache = true
16
- # Display line comments above each selector as a debugging aid
17
- config.sass.line_comments = true
18
- # Initialize the load paths to an empty array
19
- config.sass.load_paths = []
20
- # Send Sass logs to Rails.logger
21
- config.sass.logger = Sass::Rails::Logger.new
22
-
23
- # Set the default stylesheet engine
24
- # It can be overridden by passing:
25
- # --stylesheet_engine=sass
26
- # to the rails generate command
27
- config.app_generators.stylesheet_engine config.sass.preferred_syntax
28
-
29
- if config.respond_to?(:annotations)
30
- config.annotations.register_extensions("scss", "sass") { |annotation| /\/\/\s*(#{annotation}):?\s*(.*)$/ }
31
- end
32
-
33
- # Remove the sass middleware if it gets inadvertently enabled by applications.
34
- config.after_initialize do |app|
35
- app.config.middleware.delete(Sass::Plugin::Rack) if defined?(Sass::Plugin::Rack)
36
- end
37
-
38
- initializer :setup_sass, group: :all do |app|
39
- # Only emit one kind of syntax because though we have registered two kinds of generators
40
- syntax = app.config.sass.preferred_syntax.to_sym
41
- alt_syntax = syntax == :sass ? "scss" : "sass"
42
- app.config.generators.hide_namespace alt_syntax
43
-
44
- # Override stylesheet engine to the preferred syntax
45
- config.app_generators.stylesheet_engine syntax
46
-
47
- # Set the sass cache location
48
- config.sass.cache_location = File.join(Rails.root, "tmp/cache/sass")
49
-
50
- # Establish configuration defaults that are evironmental in nature
51
- if config.sass.full_exception.nil?
52
- # Display a stack trace in the css output when in development-like environments.
53
- config.sass.full_exception = app.config.consider_all_requests_local
54
- end
55
-
56
- config.assets.configure do |env|
57
- env.register_engine '.sass', Sass::Rails::SassTemplate
58
- env.register_engine '.scss', Sass::Rails::ScssTemplate
59
-
60
- env.context_class.class_eval do
61
- class_attribute :sass_config
62
- self.sass_config = app.config.sass
63
- end
64
- end
65
-
66
- Sass.logger = app.config.sass.logger
67
- end
68
-
69
- initializer :setup_compression, group: :all do |app|
70
- unless Rails.env.development?
71
- app.config.assets.css_compressor ||= :sass
72
- else
73
- # Use expanded output instead of the sass default of :nested unless specified
74
- app.config.sass.style ||= :expanded
75
- end
76
- end
77
- end
78
- end
1
+ require 'sassc/rails/railtie'
@@ -1,5 +1,5 @@
1
1
  module Sass
2
2
  module Rails
3
- VERSION = "5.0.3"
3
+ VERSION = "6.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.3
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - wycats
@@ -9,110 +9,28 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-31 00:00:00.000000000 Z
12
+ date: 2019-08-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: railties
15
+ name: sassc-rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: 4.0.0
21
- - - "<"
22
- - !ruby/object:Gem::Version
23
- version: '5.0'
24
- type: :runtime
25
- prerelease: false
26
- version_requirements: !ruby/object:Gem::Requirement
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- version: 4.0.0
31
- - - "<"
32
- - !ruby/object:Gem::Version
33
- version: '5.0'
34
- - !ruby/object:Gem::Dependency
35
- name: sass
36
- requirement: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '3.1'
41
- type: :runtime
42
- prerelease: false
43
- version_requirements: !ruby/object:Gem::Requirement
44
17
  requirements:
45
18
  - - "~>"
46
19
  - !ruby/object:Gem::Version
47
- version: '3.1'
48
- - !ruby/object:Gem::Dependency
49
- name: sprockets-rails
50
- requirement: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '2.0'
55
- - - "<"
56
- - !ruby/object:Gem::Version
57
- version: '4.0'
58
- type: :runtime
59
- prerelease: false
60
- version_requirements: !ruby/object:Gem::Requirement
61
- requirements:
62
- - - ">="
63
- - !ruby/object:Gem::Version
64
- version: '2.0'
65
- - - "<"
66
- - !ruby/object:Gem::Version
67
- version: '4.0'
68
- - !ruby/object:Gem::Dependency
69
- name: sprockets
70
- requirement: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: '2.8'
75
- - - "<"
76
- - !ruby/object:Gem::Version
77
- version: '4.0'
78
- type: :runtime
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
20
+ version: '2.1'
82
21
  - - ">="
83
22
  - !ruby/object:Gem::Version
84
- version: '2.8'
85
- - - "<"
86
- - !ruby/object:Gem::Version
87
- version: '4.0'
88
- - !ruby/object:Gem::Dependency
89
- name: tilt
90
- requirement: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - "~>"
93
- - !ruby/object:Gem::Version
94
- version: '1.1'
23
+ version: 2.1.1
95
24
  type: :runtime
96
25
  prerelease: false
97
26
  version_requirements: !ruby/object:Gem::Requirement
98
27
  requirements:
99
28
  - - "~>"
100
29
  - !ruby/object:Gem::Version
101
- version: '1.1'
102
- - !ruby/object:Gem::Dependency
103
- name: sqlite3
104
- requirement: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- version: '0'
109
- type: :development
110
- prerelease: false
111
- version_requirements: !ruby/object:Gem::Requirement
112
- requirements:
30
+ version: '2.1'
113
31
  - - ">="
114
32
  - !ruby/object:Gem::Version
115
- version: '0'
33
+ version: 2.1.1
116
34
  description: Sass adapter for the Rails asset pipeline.
117
35
  email:
118
36
  - wycats@gmail.com
@@ -123,21 +41,11 @@ extra_rdoc_files: []
123
41
  files:
124
42
  - MIT-LICENSE
125
43
  - README.md
126
- - lib/rails/generators/sass/assets/assets_generator.rb
127
- - lib/rails/generators/sass/assets/templates/stylesheet.sass
128
- - lib/rails/generators/sass/scaffold/scaffold_generator.rb
129
- - lib/rails/generators/sass_scaffold.rb
130
- - lib/rails/generators/scss/assets/assets_generator.rb
131
- - lib/rails/generators/scss/assets/templates/stylesheet.scss
132
- - lib/rails/generators/scss/scaffold/scaffold_generator.rb
133
44
  - lib/sass-rails.rb
134
45
  - lib/sass/rails.rb
135
- - lib/sass/rails/cache_store.rb
136
- - lib/sass/rails/helpers.rb
137
46
  - lib/sass/rails/importer.rb
138
47
  - lib/sass/rails/logger.rb
139
48
  - lib/sass/rails/railtie.rb
140
- - lib/sass/rails/template.rb
141
49
  - lib/sass/rails/version.rb
142
50
  homepage: https://github.com/rails/sass-rails
143
51
  licenses:
@@ -158,8 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
66
  - !ruby/object:Gem::Version
159
67
  version: '0'
160
68
  requirements: []
161
- rubyforge_project:
162
- rubygems_version: 2.4.5
69
+ rubygems_version: 3.0.1
163
70
  signing_key:
164
71
  specification_version: 4
165
72
  summary: Sass adapter for the Rails asset pipeline.
@@ -1,13 +0,0 @@
1
- require "rails/generators/named_base"
2
-
3
- module Sass
4
- module Generators
5
- class AssetsGenerator < ::Rails::Generators::NamedBase
6
- source_root File.expand_path("../templates", __FILE__)
7
-
8
- def copy_sass
9
- template "stylesheet.sass", File.join('app/assets/stylesheets', class_path, "#{file_name}.sass")
10
- end
11
- end
12
- end
13
- end
@@ -1,3 +0,0 @@
1
- // Place all the styles related to the <%= name %> controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass here: http://sass-lang.com/
@@ -1,9 +0,0 @@
1
- require "rails/generators/sass_scaffold"
2
-
3
- module Sass
4
- module Generators
5
- class ScaffoldGenerator < ::Sass::Generators::ScaffoldBase
6
- def syntax() :sass end
7
- end
8
- end
9
- end
@@ -1,15 +0,0 @@
1
- require "sass/css"
2
- require "rails/generators/named_base"
3
-
4
- module Sass
5
- module Generators
6
- class ScaffoldBase < ::Rails::Generators::NamedBase
7
- def copy_stylesheet
8
- dir = ::Rails::Generators::ScaffoldGenerator.source_root
9
- file = File.join(dir, "scaffold.css")
10
- converted_contents = ::Sass::CSS.new(File.read(file)).render(syntax)
11
- create_file "app/assets/stylesheets/scaffolds.#{syntax}", converted_contents
12
- end
13
- end
14
- end
15
- end
@@ -1,13 +0,0 @@
1
- require "rails/generators/named_base"
2
-
3
- module Scss
4
- module Generators
5
- class AssetsGenerator < ::Rails::Generators::NamedBase
6
- source_root File.expand_path("../templates", __FILE__)
7
-
8
- def copy_scss
9
- template "stylesheet.scss", File.join('app/assets/stylesheets', class_path, "#{file_name}.scss")
10
- end
11
- end
12
- end
13
- end
@@ -1,3 +0,0 @@
1
- // Place all the styles related to the <%= name %> controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,10 +0,0 @@
1
- require "rails/generators/sass_scaffold"
2
-
3
- module Scss
4
- module Generators
5
- class ScaffoldGenerator < ::Sass::Generators::ScaffoldBase
6
- def syntax() :scss end
7
- end
8
- end
9
- end
10
-
@@ -1,31 +0,0 @@
1
- require 'sass'
2
-
3
- module Sass
4
- module Rails
5
- class CacheStore < ::Sass::CacheStores::Base
6
- attr_reader :environment
7
-
8
- def initialize(environment)
9
- @environment = environment
10
- end
11
-
12
- def _store(key, version, sha, contents)
13
- environment.cache_set("sass/#{key}", {:version => version, :sha => sha, :contents => contents})
14
- end
15
-
16
- def _retrieve(key, version, sha)
17
- if obj = environment.cache_get("sass/#{key}")
18
- return unless obj[:version] == version
19
- return unless obj[:sha] == sha
20
- obj[:contents]
21
- else
22
- nil
23
- end
24
- end
25
-
26
- def path_to(key)
27
- key
28
- end
29
- end
30
- end
31
- end
@@ -1,12 +0,0 @@
1
- require 'sass'
2
- require 'sprockets/sass_functions'
3
-
4
- module Sprockets
5
- module SassFunctions
6
- def asset_data_url(path)
7
- Sass::Script::String.new("url(" + sprockets_context.asset_data_uri(path.value) + ")")
8
- end
9
- end
10
- end
11
-
12
- ::Sass::Script::Functions.send :include, Sprockets::SassFunctions
@@ -1,72 +0,0 @@
1
- require 'sass'
2
- require 'sass/rails/cache_store'
3
- require 'sass/rails/helpers'
4
- require 'sprockets/sass_functions'
5
- require 'tilt'
6
-
7
- module Sass
8
- module Rails
9
- class SassTemplate < Tilt::Template
10
- def self.default_mime_type
11
- 'text/css'
12
- end
13
-
14
- def self.engine_initialized?
15
- true
16
- end
17
-
18
- def initialize_engine
19
- end
20
-
21
- def prepare
22
- end
23
-
24
- def syntax
25
- :sass
26
- end
27
-
28
- def evaluate(context, locals, &block)
29
- cache_store = CacheStore.new(context.environment)
30
-
31
- options = {
32
- :filename => eval_file,
33
- :line => line,
34
- :syntax => syntax,
35
- :cache_store => cache_store,
36
- :importer => importer_class.new(context.pathname.to_s),
37
- :load_paths => context.environment.paths.map { |path| importer_class.new(path.to_s) },
38
- :sprockets => {
39
- :context => context,
40
- :environment => context.environment
41
- }
42
- }
43
-
44
- sass_config = context.sass_config.merge(options)
45
-
46
- engine = ::Sass::Engine.new(data, sass_config)
47
- css = engine.render
48
-
49
- engine.dependencies.map do |dependency|
50
- context.depend_on(dependency.options[:filename])
51
- end
52
-
53
- css
54
- rescue ::Sass::SyntaxError => e
55
- context.__LINE__ = e.sass_backtrace.first[:line]
56
- raise e
57
- end
58
-
59
- private
60
-
61
- def importer_class
62
- SassImporter
63
- end
64
- end
65
-
66
- class ScssTemplate < SassTemplate
67
- def syntax
68
- :scss
69
- end
70
- end
71
- end
72
- end