sass-rails 5.0.0 → 6.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7e8d1de04c3b2051b0aab8f75e4aab8fb1bbd150
4
- data.tar.gz: 510bf6be01cd389f355589ef1e323e47b18cea7d
2
+ SHA256:
3
+ metadata.gz: d162298f6dcc547ef3c5e3e51d6d5bca7df731e8161737f03b01b05e3c77aba3
4
+ data.tar.gz: 2f10eb26a35786fa327e5ede671c6e487881c6bf85cce2eea5481aec63ab99db
5
5
  SHA512:
6
- metadata.gz: 7d78a7e4a55fd6d9ca44a612051ed5d260b379f92ac763b421f053f525a468e31644d468d759fba9015db5d4641276ed63a86b0ea732cf0f072e4cbacf6a67e0
7
- data.tar.gz: 86b70308e42217a83c48f0ba8899bfcd2a135a02ddd78517f1a99e8206ea8def3c87deb0814fe9612dc58669a39cc4c1c38f229c7bbdae20c4c5b0d13ea9f57a
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
 
@@ -96,6 +99,5 @@ If you need to test against local gems, use Bundler's gem :path option in the Ge
96
99
 
97
100
  ## Code Status
98
101
 
99
- * [![Travis CI](https://api.travis-ci.org/rails/sass-rails.png)](http://travis-ci.org/rails/sass-rails)
100
- * [![Gem Version](https://badge.fury.io/rb/sass-rails.png)](http://badge.fury.io/rb/sass-rails)
101
- * [![Dependencies](https://gemnasium.com/rails/sass-rails.png)](https://gemnasium.com/rails/sass-rails)
102
+ * [![Travis CI](https://api.travis-ci.org/rails/sass-rails.svg)](http://travis-ci.org/rails/sass-rails)
103
+ * [![Gem Version](https://badge.fury.io/rb/sass-rails.svg)](http://badge.fury.io/rb/sass-rails)
@@ -1,146 +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
- :importer => self,
39
- :syntax => :scss
40
- ))
41
- end
42
-
43
- def each_globbed_file(base, glob, context)
44
- raise ArgumentError unless glob == "*" || glob == "**/*"
45
-
46
- exts = extensions.keys.map { |ext| Regexp.escape(".#{ext}") }.join("|")
47
- sass_re = Regexp.compile("(#{exts})$")
48
-
49
- context.depend_on(base)
50
-
51
- Dir["#{base}/#{glob}"].sort.each do |path|
52
- if File.directory?(path)
53
- context.depend_on(path)
54
- elsif sass_re =~ path
55
- yield path
56
- end
57
- end
58
- end
59
- end
60
-
61
- module ERB
62
- def extensions
63
- {
64
- 'css.erb' => :scss_erb,
65
- 'scss.erb' => :scss_erb,
66
- 'sass.erb' => :sass_erb
67
- }.merge(super)
68
- end
69
-
70
- def erb_extensions
71
- {
72
- :scss_erb => :scss,
73
- :sass_erb => :sass
74
- }
75
- end
76
-
77
- def find_relative(*args)
78
- process_erb_engine(super)
79
- end
80
-
81
- def find(*args)
82
- process_erb_engine(super)
83
- end
84
-
85
- private
86
- def process_erb_engine(engine)
87
- if engine && engine.options[:sprockets] && syntax = erb_extensions[engine.options[:syntax]]
88
- template = Tilt::ERBTemplate.new(engine.options[:filename])
89
- contents = template.render(engine.options[:sprockets][:context], {})
90
-
91
- Sass::Engine.new(contents, engine.options.merge(:syntax => syntax))
92
- else
93
- engine
94
- end
95
- end
96
- end
97
-
98
- module Deprecated
99
- def extensions
100
- {
101
- 'css.scss' => :scss,
102
- 'css.sass' => :sass,
103
- 'css.scss.erb' => :scss_erb,
104
- 'css.sass.erb' => :sass_erb
105
- }.merge(super)
106
- end
107
-
108
- def find_relative(*args)
109
- deprecate_extra_css_extension(super)
110
- end
111
-
112
- def find(*args)
113
- deprecate_extra_css_extension(super)
114
- end
115
-
116
- private
117
- def deprecate_extra_css_extension(engine)
118
- if engine && filename = engine.options[:filename]
119
- if filename.end_with?('.css.scss')
120
- msg = "Extra .css in SCSS file is unnecessary. Rename #{filename} to #{filename.sub('.css.scss', '.scss')}."
121
- elsif filename.end_with?('.css.sass')
122
- msg = "Extra .css in SASS file is unnecessary. Rename #{filename} to #{filename.sub('.css.sass', '.sass')}."
123
- elsif filename.end_with?('.css.scss.erb')
124
- msg = "Extra .css in SCSS/ERB file is unnecessary. Rename #{filename} to #{filename.sub('.css.scss.erb', '.scss.erb')}."
125
- elsif filename.end_with?('.css.sass.erb')
126
- msg = "Extra .css in SASS/ERB file is unnecessary. Rename #{filename} to #{filename.sub('.css.sass.erb', '.sass.erb')}."
127
- end
128
-
129
- ActiveSupport::Deprecation.warn(msg) if msg
130
- end
131
-
132
- engine
133
- end
134
- end
135
-
136
- include Deprecated
137
- include ERB
138
- include Globbing
139
-
140
- # Allow .css files to be @import'd
141
- def extensions
142
- { 'css' => :scss }.merge(super)
143
- end
144
- end
145
- end
146
- end
5
+ ActiveSupport::Deprecation.warn "Sass::Rails::Importer has been removed, please use SassC::Rails::Importer instead."
@@ -1,21 +1,5 @@
1
- require 'sass/logger'
1
+ # frozen_string_literal: true
2
2
 
3
- module Sass
4
- module Rails
5
- class Logger < Sass::Logger::Base
6
- def _log(level, message)
3
+ require "active_support/deprecation"
7
4
 
8
- case level
9
- when :trace, :debug
10
- ::Rails.logger.debug message
11
- when :warn
12
- ::Rails.logger.warn message
13
- when :error
14
- ::Rails.logger.error message
15
- when :info
16
- ::Rails.logger.info message
17
- end
18
- end
19
- end
20
- end
21
- end
5
+ ActiveSupport::Deprecation.warn "Sass::Rails::Logger has been removed, please stop requiring sass/rails/logger."
@@ -1,77 +1 @@
1
- require 'active_support/core_ext/class/attribute'
2
- require 'sprockets/railtie'
3
-
4
- module Sass::Rails
5
- class Railtie < ::Rails::Railtie
6
- config.sass = ActiveSupport::OrderedOptions.new
7
-
8
- # Establish static configuration defaults
9
- # Emit scss files during stylesheet generation of scaffold
10
- config.sass.preferred_syntax = :scss
11
- # Write sass cache files for performance
12
- config.sass.cache = true
13
- # Read sass cache files for performance
14
- config.sass.read_cache = true
15
- # Display line comments above each selector as a debugging aid
16
- config.sass.line_comments = true
17
- # Initialize the load paths to an empty array
18
- config.sass.load_paths = []
19
- # Send Sass logs to Rails.logger
20
- config.sass.logger = Sass::Rails::Logger.new
21
-
22
- # Set the default stylesheet engine
23
- # It can be overridden by passing:
24
- # --stylesheet_engine=sass
25
- # to the rails generate command
26
- config.app_generators.stylesheet_engine config.sass.preferred_syntax
27
-
28
- if config.respond_to?(:annotations)
29
- config.annotations.register_extensions("scss", "sass") { |annotation| /\/\/\s*(#{annotation}):?\s*(.*)$/ }
30
- end
31
-
32
- # Remove the sass middleware if it gets inadvertently enabled by applications.
33
- config.after_initialize do |app|
34
- app.config.middleware.delete(Sass::Plugin::Rack) if defined?(Sass::Plugin::Rack)
35
- end
36
-
37
- initializer :setup_sass, group: :all do |app|
38
- # Only emit one kind of syntax because though we have registered two kinds of generators
39
- syntax = app.config.sass.preferred_syntax.to_sym
40
- alt_syntax = syntax == :sass ? "scss" : "sass"
41
- app.config.generators.hide_namespace alt_syntax
42
-
43
- # Override stylesheet engine to the preferred syntax
44
- config.app_generators.stylesheet_engine syntax
45
-
46
- # Set the sass cache location
47
- config.sass.cache_location = File.join(Rails.root, "tmp/cache/sass")
48
-
49
- # Establish configuration defaults that are evironmental in nature
50
- if config.sass.full_exception.nil?
51
- # Display a stack trace in the css output when in development-like environments.
52
- config.sass.full_exception = app.config.consider_all_requests_local
53
- end
54
-
55
- if app.assets
56
- app.assets.register_engine '.sass', Sass::Rails::SassTemplate
57
- app.assets.register_engine '.scss', Sass::Rails::ScssTemplate
58
-
59
- app.assets.context_class.class_eval do
60
- class_attribute :sass_config
61
- self.sass_config = app.config.sass
62
- end
63
- end
64
-
65
- Sass.logger = app.config.sass.logger
66
- end
67
-
68
- initializer :setup_compression, group: :all do |app|
69
- unless Rails.env.development?
70
- app.config.assets.css_compressor ||= :sass
71
- else
72
- # Use expanded output instead of the sass default of :nested unless specified
73
- app.config.sass.style ||= :expanded
74
- end
75
- end
76
- end
77
- end
1
+ require 'sassc/rails/railtie'
@@ -1,5 +1,5 @@
1
1
  module Sass
2
2
  module Rails
3
- VERSION = "5.0.0"
3
+ VERSION = "6.0.0"
4
4
  end
5
5
  end
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'
data/lib/sass-rails.rb CHANGED
@@ -1 +1 @@
1
- require 'sass/rails'
1
+ require 'sassc/rails'
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.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - wycats
@@ -9,124 +9,28 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-12 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
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
15
+ name: sassc-rails
36
16
  requirement: !ruby/object:Gem::Requirement
37
17
  requirements:
38
18
  - - "~>"
39
19
  - !ruby/object:Gem::Version
40
- version: '3.1'
41
- type: :runtime
42
- prerelease: false
43
- version_requirements: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !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: rails
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:
113
- - - ">="
114
- - !ruby/object:Gem::Version
115
- version: '0'
116
- - !ruby/object:Gem::Dependency
117
- name: sqlite3
118
- requirement: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- version: '0'
123
- type: :development
124
- prerelease: false
125
- version_requirements: !ruby/object:Gem::Requirement
126
- requirements:
30
+ version: '2.1'
127
31
  - - ">="
128
32
  - !ruby/object:Gem::Version
129
- version: '0'
33
+ version: 2.1.1
130
34
  description: Sass adapter for the Rails asset pipeline.
131
35
  email:
132
36
  - wycats@gmail.com
@@ -135,24 +39,13 @@ executables: []
135
39
  extensions: []
136
40
  extra_rdoc_files: []
137
41
  files:
138
- - CHANGELOG.md
139
42
  - MIT-LICENSE
140
43
  - README.md
141
- - lib/rails/generators/sass/assets/assets_generator.rb
142
- - lib/rails/generators/sass/assets/templates/stylesheet.sass
143
- - lib/rails/generators/sass/scaffold/scaffold_generator.rb
144
- - lib/rails/generators/sass_scaffold.rb
145
- - lib/rails/generators/scss/assets/assets_generator.rb
146
- - lib/rails/generators/scss/assets/templates/stylesheet.scss
147
- - lib/rails/generators/scss/scaffold/scaffold_generator.rb
148
44
  - lib/sass-rails.rb
149
45
  - lib/sass/rails.rb
150
- - lib/sass/rails/cache_store.rb
151
- - lib/sass/rails/helpers.rb
152
46
  - lib/sass/rails/importer.rb
153
47
  - lib/sass/rails/logger.rb
154
48
  - lib/sass/rails/railtie.rb
155
- - lib/sass/rails/template.rb
156
49
  - lib/sass/rails/version.rb
157
50
  homepage: https://github.com/rails/sass-rails
158
51
  licenses:
@@ -173,8 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
66
  - !ruby/object:Gem::Version
174
67
  version: '0'
175
68
  requirements: []
176
- rubyforge_project:
177
- rubygems_version: 2.4.4
69
+ rubygems_version: 3.0.1
178
70
  signing_key:
179
71
  specification_version: 4
180
72
  summary: Sass adapter for the Rails asset pipeline.
data/CHANGELOG.md DELETED
@@ -1,64 +0,0 @@
1
- # CHANGELOG
2
-
3
- ## 5.0.0 (Dec 12, 2014)
4
-
5
- * Register scss and sass extensions for rake notes
6
- * Make possible to use sprockes > 2.8 and < 4
7
- * Make possible to use sass ~> 3.1
8
- * Deprecate .css.scss and .css.sass extentions
9
-
10
- ## 4.0.5 (Nov 25, 2014)
11
-
12
- * Make possible to use sprockets 2.12.
13
-
14
- ## 4.0.4 (Oct 29, 2014)
15
-
16
- * Make possible to use any sprockets version in the 2.11 series.
17
- * Require at least sass 3.2.2.
18
-
19
- ## 4.0.3 (Apr 4, 2014)
20
-
21
- * Make possible to use sprockets-rails 2.1.
22
-
23
- ## 4.0.2 (Mar 13, 2014)
24
-
25
- * Lock sprockets version to <= 2.11.0. Fixes #191.
26
-
27
- ## 4.0.1 (Oct 15, 2013)
28
-
29
- * Remove Post Processors from asset evaluation.
30
-
31
- ## 4.0.0 (Jun 25, 2013)
32
-
33
- * Add support for importing ERB files.
34
- * Remove `Sass::Rails::Compressor`. Use `Sprockets::SassCompressor` (`:sass` option) instead.
35
- * Remove `tilt` dependency.
36
- * Bump `sprockets-rails` to `2.0.0.rc4`.
37
-
38
- ## 4.0.0.rc1 (Apr 18, 2013)
39
-
40
- * No changes.
41
-
42
- ## 4.0.0.beta1 (Feb 25, 2013)
43
-
44
- * Remove `compress` option from `config.assets`. Instead, turn on
45
- compression for all environments except development.
46
- * Deprecate `asset_path` and `asset_url` with two arguments.
47
- * Add Rails 4 support.
48
- * Drop Ruby 1.8 support.
49
-
50
- ## 3.1.5.rc.1 (Oct 16, 2011)
51
-
52
- * Several bug fixes.
53
- * Performance and bug fixes when compressing stylesheets.
54
- * Update dependency to latest sass stable release to fix caching issues.
55
-
56
- ## 3.1.2 (Sept 15, 2011)
57
-
58
- * Add `asset-data-url` helper for base-64 encoding of assets within stylesheets.
59
- * Add explicit dependency on sprockets.
60
-
61
- ## 3.1.1 (Sept 13, 2011)
62
-
63
- * Add explicit version dependency on tilt.
64
- * Add MIT License.
@@ -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,11 +0,0 @@
1
- require 'sprockets/sass_functions'
2
-
3
- module Sprockets
4
- module SassFunctions
5
- def asset_data_url(path)
6
- Sass::Script::String.new("url(" + sprockets_context.asset_data_uri(path.value) + ")")
7
- end
8
- end
9
- end
10
-
11
- ::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