sass-rails 3.2.3 → 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.
Files changed (177) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +103 -0
  4. data/lib/sass/rails/importer.rb +3 -120
  5. data/lib/sass/rails/logger.rb +3 -19
  6. data/lib/sass/rails/railtie.rb +1 -77
  7. data/lib/sass/rails/version.rb +1 -1
  8. data/lib/sass/rails.rb +1 -16
  9. data/lib/sass-rails.rb +1 -1
  10. metadata +42 -408
  11. data/.gitignore +0 -5
  12. data/.travis.yml +0 -12
  13. data/CHANGELOG.md +0 -20
  14. data/Gemfile +0 -17
  15. data/README.markdown +0 -75
  16. data/Rakefile +0 -12
  17. data/lib/rails/generators/sass/assets/assets_generator.rb +0 -13
  18. data/lib/rails/generators/sass/assets/templates/stylesheet.css.sass +0 -3
  19. data/lib/rails/generators/sass/scaffold/scaffold_generator.rb +0 -9
  20. data/lib/rails/generators/sass_scaffold.rb +0 -16
  21. data/lib/rails/generators/scss/assets/assets_generator.rb +0 -13
  22. data/lib/rails/generators/scss/assets/templates/stylesheet.css.scss +0 -3
  23. data/lib/rails/generators/scss/scaffold/scaffold_generator.rb +0 -10
  24. data/lib/sass/rails/compressor.rb +0 -19
  25. data/lib/sass/rails/helpers.rb +0 -52
  26. data/lib/sass/rails/template_handlers.rb +0 -117
  27. data/sass-rails.gemspec +0 -25
  28. data/test/fixtures/engine_project/.gitignore +0 -6
  29. data/test/fixtures/engine_project/Gemfile +0 -5
  30. data/test/fixtures/engine_project/README.rdoc +0 -3
  31. data/test/fixtures/engine_project/Rakefile +0 -39
  32. data/test/fixtures/engine_project/app/assets/images/engine_project/.gitkeep +0 -0
  33. data/test/fixtures/engine_project/app/assets/javascripts/engine_project/application.js +0 -9
  34. data/test/fixtures/engine_project/app/assets/stylesheets/engine_project/application.css +0 -7
  35. data/test/fixtures/engine_project/app/controllers/engine_project/application_controller.rb +0 -4
  36. data/test/fixtures/engine_project/app/helpers/engine_project/application_helper.rb +0 -4
  37. data/test/fixtures/engine_project/app/views/layouts/engine_project/application.html.erb +0 -14
  38. data/test/fixtures/engine_project/config/routes.rb +0 -2
  39. data/test/fixtures/engine_project/db/seeds.rb +0 -7
  40. data/test/fixtures/engine_project/engine_project.gemspec +0 -8
  41. data/test/fixtures/engine_project/lib/engine_project/engine.rb +0 -5
  42. data/test/fixtures/engine_project/lib/engine_project/version.rb +0 -3
  43. data/test/fixtures/engine_project/lib/engine_project.rb +0 -4
  44. data/test/fixtures/engine_project/lib/tasks/engine_project_tasks.rake +0 -4
  45. data/test/fixtures/engine_project/script/rails +0 -6
  46. data/test/fixtures/engine_project/test/dummy/Rakefile +0 -7
  47. data/test/fixtures/engine_project/test/dummy/app/assets/javascripts/application.js +0 -9
  48. data/test/fixtures/engine_project/test/dummy/app/assets/stylesheets/application.css +0 -7
  49. data/test/fixtures/engine_project/test/dummy/app/controllers/application_controller.rb +0 -3
  50. data/test/fixtures/engine_project/test/dummy/app/helpers/application_helper.rb +0 -2
  51. data/test/fixtures/engine_project/test/dummy/app/mailers/.gitkeep +0 -0
  52. data/test/fixtures/engine_project/test/dummy/app/models/.gitkeep +0 -0
  53. data/test/fixtures/engine_project/test/dummy/app/views/layouts/application.html.erb +0 -14
  54. data/test/fixtures/engine_project/test/dummy/config/application.rb +0 -42
  55. data/test/fixtures/engine_project/test/dummy/config/boot.rb +0 -10
  56. data/test/fixtures/engine_project/test/dummy/config/database.yml +0 -25
  57. data/test/fixtures/engine_project/test/dummy/config/environment.rb +0 -5
  58. data/test/fixtures/engine_project/test/dummy/config/environments/development.rb +0 -27
  59. data/test/fixtures/engine_project/test/dummy/config/environments/production.rb +0 -51
  60. data/test/fixtures/engine_project/test/dummy/config/environments/test.rb +0 -39
  61. data/test/fixtures/engine_project/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  62. data/test/fixtures/engine_project/test/dummy/config/initializers/inflections.rb +0 -10
  63. data/test/fixtures/engine_project/test/dummy/config/initializers/mime_types.rb +0 -5
  64. data/test/fixtures/engine_project/test/dummy/config/initializers/secret_token.rb +0 -7
  65. data/test/fixtures/engine_project/test/dummy/config/initializers/session_store.rb +0 -8
  66. data/test/fixtures/engine_project/test/dummy/config/initializers/wrap_parameters.rb +0 -12
  67. data/test/fixtures/engine_project/test/dummy/config/locales/en.yml +0 -5
  68. data/test/fixtures/engine_project/test/dummy/config/routes.rb +0 -4
  69. data/test/fixtures/engine_project/test/dummy/config.ru +0 -4
  70. data/test/fixtures/engine_project/test/dummy/db/seeds.rb +0 -7
  71. data/test/fixtures/engine_project/test/dummy/lib/assets/.gitkeep +0 -0
  72. data/test/fixtures/engine_project/test/dummy/log/.gitkeep +0 -0
  73. data/test/fixtures/engine_project/test/dummy/public/404.html +0 -26
  74. data/test/fixtures/engine_project/test/dummy/public/422.html +0 -26
  75. data/test/fixtures/engine_project/test/dummy/public/500.html +0 -26
  76. data/test/fixtures/engine_project/test/dummy/public/favicon.ico +0 -0
  77. data/test/fixtures/engine_project/test/dummy/script/rails +0 -6
  78. data/test/fixtures/sass_project/.gitignore +0 -5
  79. data/test/fixtures/sass_project/Gemfile +0 -7
  80. data/test/fixtures/sass_project/README +0 -261
  81. data/test/fixtures/sass_project/Rakefile +0 -7
  82. data/test/fixtures/sass_project/app/assets/images/rails.png +0 -0
  83. data/test/fixtures/sass_project/app/assets/javascripts/application.js +0 -9
  84. data/test/fixtures/sass_project/app/assets/stylesheets/application.css +0 -7
  85. data/test/fixtures/sass_project/app/controllers/application_controller.rb +0 -3
  86. data/test/fixtures/sass_project/app/helpers/application_helper.rb +0 -2
  87. data/test/fixtures/sass_project/app/mailers/.gitkeep +0 -0
  88. data/test/fixtures/sass_project/app/models/.gitkeep +0 -0
  89. data/test/fixtures/sass_project/app/views/layouts/application.html.erb +0 -14
  90. data/test/fixtures/sass_project/config/application.rb +0 -52
  91. data/test/fixtures/sass_project/config/boot.rb +0 -6
  92. data/test/fixtures/sass_project/config/database.yml +0 -25
  93. data/test/fixtures/sass_project/config/environment.rb +0 -5
  94. data/test/fixtures/sass_project/config/environments/development.rb +0 -27
  95. data/test/fixtures/sass_project/config/environments/production.rb +0 -54
  96. data/test/fixtures/sass_project/config/environments/test.rb +0 -39
  97. data/test/fixtures/sass_project/config/initializers/backtrace_silencers.rb +0 -7
  98. data/test/fixtures/sass_project/config/initializers/inflections.rb +0 -10
  99. data/test/fixtures/sass_project/config/initializers/mime_types.rb +0 -5
  100. data/test/fixtures/sass_project/config/initializers/secret_token.rb +0 -7
  101. data/test/fixtures/sass_project/config/initializers/session_store.rb +0 -8
  102. data/test/fixtures/sass_project/config/initializers/wrap_parameters.rb +0 -12
  103. data/test/fixtures/sass_project/config/locales/en.yml +0 -5
  104. data/test/fixtures/sass_project/config/routes.rb +0 -58
  105. data/test/fixtures/sass_project/config.ru +0 -4
  106. data/test/fixtures/sass_project/db/seeds.rb +0 -7
  107. data/test/fixtures/sass_project/doc/README_FOR_APP +0 -2
  108. data/test/fixtures/sass_project/lib/tasks/.gitkeep +0 -0
  109. data/test/fixtures/sass_project/log/.gitkeep +0 -0
  110. data/test/fixtures/sass_project/public/404.html +0 -26
  111. data/test/fixtures/sass_project/public/422.html +0 -26
  112. data/test/fixtures/sass_project/public/500.html +0 -26
  113. data/test/fixtures/sass_project/public/favicon.ico +0 -0
  114. data/test/fixtures/sass_project/public/index.html +0 -241
  115. data/test/fixtures/sass_project/public/robots.txt +0 -5
  116. data/test/fixtures/sass_project/script/rails +0 -6
  117. data/test/fixtures/sass_project/vendor/assets/stylesheets/.gitkeep +0 -0
  118. data/test/fixtures/sass_project/vendor/plugins/.gitkeep +0 -0
  119. data/test/fixtures/scss_project/.gitignore +0 -5
  120. data/test/fixtures/scss_project/Gemfile +0 -7
  121. data/test/fixtures/scss_project/README +0 -261
  122. data/test/fixtures/scss_project/Rakefile +0 -7
  123. data/test/fixtures/scss_project/app/assets/images/1x1.png +0 -0
  124. data/test/fixtures/scss_project/app/assets/images/rails.png +0 -0
  125. data/test/fixtures/scss_project/app/assets/javascripts/application.js +0 -9
  126. data/test/fixtures/scss_project/app/assets/stylesheets/_top_level_partial.css.scss +0 -3
  127. data/test/fixtures/scss_project/app/assets/stylesheets/application.css.scss +0 -32
  128. data/test/fixtures/scss_project/app/assets/stylesheets/css_application.css +0 -7
  129. data/test/fixtures/scss_project/app/assets/stylesheets/globbed/globbed.css.scss +0 -3
  130. data/test/fixtures/scss_project/app/assets/stylesheets/globbed/nested/nested_glob.css.scss +0 -3
  131. data/test/fixtures/scss_project/app/assets/stylesheets/partials/_sass_import.css.sass +0 -5
  132. data/test/fixtures/scss_project/app/assets/stylesheets/partials/_scss_import.css.scss +0 -9
  133. data/test/fixtures/scss_project/app/assets/stylesheets/partials/_without_css_ext.scss +0 -3
  134. data/test/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/_relative_sass.css.sass +0 -2
  135. data/test/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/_relative_scss.css.scss +0 -3
  136. data/test/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/relative_not_a_partial.css.scss +0 -3
  137. data/test/fixtures/scss_project/app/assets/stylesheets/subfolder/another_plain.css +0 -3
  138. data/test/fixtures/scss_project/app/assets/stylesheets/subfolder/plain.css +0 -3
  139. data/test/fixtures/scss_project/app/assets/stylesheets/subfolder/second_level.css.scss +0 -1
  140. data/test/fixtures/scss_project/app/controllers/application_controller.rb +0 -3
  141. data/test/fixtures/scss_project/app/helpers/application_helper.rb +0 -2
  142. data/test/fixtures/scss_project/app/mailers/.gitkeep +0 -0
  143. data/test/fixtures/scss_project/app/models/.gitkeep +0 -0
  144. data/test/fixtures/scss_project/app/views/layouts/application.html.erb +0 -14
  145. data/test/fixtures/scss_project/config/application.rb +0 -49
  146. data/test/fixtures/scss_project/config/boot.rb +0 -6
  147. data/test/fixtures/scss_project/config/database.yml +0 -25
  148. data/test/fixtures/scss_project/config/environment.rb +0 -5
  149. data/test/fixtures/scss_project/config/environments/development.rb +0 -27
  150. data/test/fixtures/scss_project/config/environments/production.rb +0 -54
  151. data/test/fixtures/scss_project/config/environments/test.rb +0 -39
  152. data/test/fixtures/scss_project/config/initializers/backtrace_silencers.rb +0 -7
  153. data/test/fixtures/scss_project/config/initializers/inflections.rb +0 -10
  154. data/test/fixtures/scss_project/config/initializers/mime_types.rb +0 -5
  155. data/test/fixtures/scss_project/config/initializers/secret_token.rb +0 -7
  156. data/test/fixtures/scss_project/config/initializers/session_store.rb +0 -8
  157. data/test/fixtures/scss_project/config/initializers/wrap_parameters.rb +0 -12
  158. data/test/fixtures/scss_project/config/locales/en.yml +0 -5
  159. data/test/fixtures/scss_project/config/routes.rb +0 -58
  160. data/test/fixtures/scss_project/config.ru +0 -4
  161. data/test/fixtures/scss_project/db/seeds.rb +0 -7
  162. data/test/fixtures/scss_project/doc/README_FOR_APP +0 -2
  163. data/test/fixtures/scss_project/lib/tasks/.gitkeep +0 -0
  164. data/test/fixtures/scss_project/log/.gitkeep +0 -0
  165. data/test/fixtures/scss_project/public/404.html +0 -26
  166. data/test/fixtures/scss_project/public/422.html +0 -26
  167. data/test/fixtures/scss_project/public/500.html +0 -26
  168. data/test/fixtures/scss_project/public/favicon.ico +0 -0
  169. data/test/fixtures/scss_project/public/index.html +0 -241
  170. data/test/fixtures/scss_project/public/robots.txt +0 -5
  171. data/test/fixtures/scss_project/script/rails +0 -6
  172. data/test/fixtures/scss_project/vendor/assets/stylesheets/.gitkeep +0 -0
  173. data/test/fixtures/scss_project/vendor/plugins/.gitkeep +0 -0
  174. data/test/sass_rails_logger_test.rb +0 -24
  175. data/test/sass_rails_test.rb +0 -110
  176. data/test/support/sass_rails_test_case.rb +0 -159
  177. data/test/test_helper.rb +0 -30
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d162298f6dcc547ef3c5e3e51d6d5bca7df731e8161737f03b01b05e3c77aba3
4
+ data.tar.gz: 2f10eb26a35786fa327e5ede671c6e487881c6bf85cce2eea5481aec63ab99db
5
+ SHA512:
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 ADDED
@@ -0,0 +1,103 @@
1
+ # Official Ruby-on-Rails Integration with Sass
2
+
3
+ This gem provides official integration for Ruby on Rails projects with the Sass stylesheet language.
4
+
5
+ ## Installing
6
+
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
+
9
+ ```ruby
10
+ gem 'sass-rails'
11
+ ```
12
+
13
+ ## Configuration
14
+
15
+ To configure Sass via Rails set use `config.sass` in your
16
+ application and/or environment files to set configuration
17
+ properties that will be passed to Sass.
18
+
19
+ ### Options
20
+
21
+ - `preferred_syntax` - This option determines the default Sass syntax and file extensions that will be used by Rails generators. Can be `:scss` (default CSS-compatible SCSS syntax) or `:sass` (indented Sass syntax).
22
+
23
+ The [list of supported Sass options](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#options)
24
+ can be found on the Sass Website with the following caveats:
25
+
26
+ - `:style` - This option is not supported. This is determined by the Rails environment. It's `:expanded` only on development, otherwise it's `:compressed`.
27
+ - `:never_update` - This option is not supported. Instead set `config.assets.enabled = false`
28
+ - `:always_update` - This option is not supported. Sprockets uses a controller to access stylesheets in development mode instead of a full scan for changed files.
29
+ - `:always_check` - This option is not supported. Sprockets always checks in development.
30
+ - `:syntax` - This is determined by the file's extensions.
31
+ - `:filename` - This is determined by the file's name.
32
+ - `:line` - This is provided by the template handler.
33
+
34
+ ### Example
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
+ ```
42
+
43
+ ## Important Note
44
+
45
+ Sprockets provides some directives that are placed inside of comments called `require`, `require_tree`, and
46
+ `require_self`. **<span style="color:#c00">DO NOT USE THEM IN YOUR SASS/SCSS FILES.</span>** They are very
47
+ primitive and do not work well with Sass files. Instead, use Sass's native `@import` directive which
48
+ `sass-rails` has customized to integrate with the conventions of your Rails projects.
49
+
50
+ ## Features
51
+
52
+ ### Glob Imports
53
+
54
+ When in Rails, there is a special import syntax that allows you to
55
+ glob imports relative to the folder of the stylesheet that is doing the importing.
56
+
57
+ * `@import "mixins/*"` will import all the files in the mixins folder
58
+ * `@import "mixins/**/*"` will import all the files in the mixins tree
59
+
60
+ Any valid ruby glob may be used. The imports are sorted alphabetically.
61
+
62
+ **NOTE:** It is recommended that you only use this when importing pure library
63
+ files (containing mixins and variables) because it is difficult to control the
64
+ cascade ordering for imports that contain styles using this approach.
65
+
66
+ ### Asset Helpers
67
+ When using the asset pipeline, paths to assets must be rewritten.
68
+ When referencing assets use the following asset helpers (underscored in Ruby, hyphenated
69
+ in Sass):
70
+
71
+ #### `asset-path($relative-asset-path)`
72
+ Returns a string to the asset.
73
+
74
+ * `asset-path("rails.png")` returns `"/assets/rails.png"`
75
+
76
+ #### `asset-url($relative-asset-path)`
77
+ Returns a url reference to the asset.
78
+
79
+ * `asset-url("rails.png")` returns `url(/assets/rails.png)`
80
+
81
+ As a convenience, for each of the following asset classes there are
82
+ corresponding `-path` and `-url` helpers:
83
+ image, font, video, audio, javascript, stylesheet.
84
+
85
+ * `image-path("rails.png")` returns `"/assets/rails.png"`
86
+ * `image-url("rails.png")` returns `url(/assets/rails.png)`
87
+
88
+ #### `asset-data-url($relative-asset-path)`
89
+ Returns a url reference to the Base64-encoded asset at the specified path.
90
+
91
+ * `asset-data-url("rails.png")` returns `url(data:image/png;base64,iVBORw0K...)`
92
+
93
+ ## Running Tests
94
+
95
+ $ bundle install
96
+ $ bundle exec rake test
97
+
98
+ If you need to test against local gems, use Bundler's gem :path option in the Gemfile and also edit `test/support/test_helper.rb` and tell the tests where the gem is checked out.
99
+
100
+ ## Code Status
101
+
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,122 +1,5 @@
1
- require 'sprockets'
1
+ # frozen_string_literal: true
2
2
 
3
- module Sass::Rails
4
- class Importer
5
- GLOB = /\*|\[.+\]/
6
- PARTIAL = /^_/
7
- HAS_EXTENSION = /\.css(.s[ac]ss)?$/
3
+ require "active_support/deprecation"
8
4
 
9
- SASS_EXTENSIONS = {
10
- ".css.sass" => :sass,
11
- ".css.scss" => :scss,
12
- ".sass" => :sass,
13
- ".scss" => :scss
14
- }
15
- attr_reader :context
16
-
17
- def initialize(context)
18
- @context = context
19
- @resolver = Resolver.new(context)
20
- end
21
-
22
- def sass_file?(filename)
23
- filename = filename.to_s
24
- SASS_EXTENSIONS.keys.any?{|ext| filename[ext]}
25
- end
26
-
27
- def syntax(filename)
28
- filename = filename.to_s
29
- SASS_EXTENSIONS.each {|ext, syntax| return syntax if filename[(ext.size+2)..-1][ext]}
30
- nil
31
- end
32
-
33
- def resolve(name, base_pathname = nil)
34
- name = Pathname.new(name)
35
- if base_pathname && base_pathname.to_s.size > 0
36
- root = Pathname.new(context.root_path)
37
- name = base_pathname.relative_path_from(root).join(name)
38
- end
39
- partial_name = name.dirname.join("_#{name.basename}")
40
- @resolver.resolve(name) || @resolver.resolve(partial_name)
41
- end
42
-
43
- def find_relative(name, base, options)
44
- base_pathname = Pathname.new(base)
45
- if name =~ GLOB
46
- glob_imports(name, base_pathname, options)
47
- elsif pathname = resolve(name, base_pathname.dirname)
48
- context.depend_on(pathname)
49
- if sass_file?(pathname)
50
- Sass::Engine.new(pathname.read, options.merge(:filename => pathname.to_s, :importer => self, :syntax => syntax(pathname)))
51
- else
52
- Sass::Engine.new(@resolver.process(pathname), options.merge(:filename => pathname.to_s, :importer => self, :syntax => :scss))
53
- end
54
- else
55
- nil
56
- end
57
- end
58
-
59
- def find(name, options)
60
- if name =~ GLOB
61
- nil # globs must be relative
62
- elsif pathname = resolve(name)
63
- context.depend_on(pathname)
64
- if sass_file?(pathname)
65
- Sass::Engine.new(pathname.read, options.merge(:filename => pathname.to_s, :importer => self, :syntax => syntax(pathname)))
66
- else
67
- Sass::Engine.new(@resolver.process(pathname), options.merge(:filename => pathname.to_s, :importer => self, :syntax => :scss))
68
- end
69
- else
70
- nil
71
- end
72
- end
73
-
74
- def each_globbed_file(glob, base_pathname, options)
75
- Dir["#{base_pathname}/#{glob}"].sort.each do |filename|
76
- next if filename == options[:filename]
77
- yield filename if File.directory?(filename) || context.asset_requirable?(filename)
78
- end
79
- end
80
-
81
- def glob_imports(glob, base_pathname, options)
82
- contents = ""
83
- each_globbed_file(glob, base_pathname.dirname, options) do |filename|
84
- if File.directory?(filename)
85
- context.depend_on(filename)
86
- elsif context.asset_requirable?(filename)
87
- context.depend_on(filename)
88
- contents << "@import #{Pathname.new(filename).relative_path_from(base_pathname.dirname).to_s.inspect};\n"
89
- end
90
- end
91
- return nil if contents.empty?
92
- Sass::Engine.new(contents, options.merge(
93
- :filename => base_pathname.to_s,
94
- :importer => self,
95
- :syntax => :scss
96
- ))
97
- end
98
-
99
- def mtime(name, options)
100
- if name =~ GLOB && options[:filename]
101
- mtime = nil
102
- each_globbed_file(name, Pathname.new(options[:filename]).dirname, options) do |p|
103
- mtime ||= File.mtime(p)
104
- mtime = [mtime, File.mtime(p)].max
105
- end
106
- mtime
107
- elsif pathname = resolve(name)
108
- pathname.mtime
109
- end
110
- end
111
-
112
- def key(name, options)
113
- ["Sprockets:" + File.dirname(File.expand_path(name)), File.basename(name)]
114
- end
115
-
116
- def to_s
117
- "Sass::Rails::Importer(#{context.pathname})"
118
- end
119
-
120
- end
121
-
122
- 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 'sprockets/railtie'
2
-
3
- module Sass::Rails
4
- class Railtie < ::Rails::Railtie
5
- module SassContext
6
- attr_accessor :sass_config
7
- end
8
-
9
- config.sass = ActiveSupport::OrderedOptions.new
10
-
11
- # Establish static configuration defaults
12
- # Emit scss files during stylesheet generation of scaffold
13
- config.sass.preferred_syntax = :scss
14
- # Use expanded output instead of the sass default of :nested
15
- config.sass.style = :expanded
16
- # Write sass cache files for performance
17
- config.sass.cache = true
18
- # Read sass cache files for performance
19
- config.sass.read_cache = true
20
- # Display line comments above each selector as a debugging aid
21
- config.sass.line_comments = true
22
- # Initialize the load paths to an empty array
23
- config.sass.load_paths = []
24
- # Send Sass logs to Rails.logger
25
- config.sass.logger = Sass::Rails::Logger.new
26
-
27
- # Set the default stylesheet engine
28
- # It can be overridedden by passing:
29
- # --stylesheet_engine=sass
30
- # to the rails generate command
31
- config.app_generators.stylesheet_engine config.sass.preferred_syntax
32
-
33
- config.before_initialize do |app|
34
- require 'sass'
35
-
36
- if app.config.assets.enabled
37
- require 'sprockets'
38
- Sprockets::Engines #force autoloading
39
- Sprockets.register_engine '.sass', Sass::Rails::SassTemplate
40
- Sprockets.register_engine '.scss', Sass::Rails::ScssTemplate
41
- end
42
- end
43
-
44
- initializer :setup_sass, :group => :all do |app|
45
- # Only emit one kind of syntax because though we have registered two kinds of generators
46
- syntax = app.config.sass.preferred_syntax.to_sym
47
- alt_syntax = syntax == :sass ? "scss" : "sass"
48
- app.config.generators.hide_namespace alt_syntax
49
-
50
- # Override stylesheet engine to the preferred syntax
51
- config.app_generators.stylesheet_engine syntax
52
-
53
- # Set the sass cache location
54
- config.sass.cache_location = File.join(Rails.root, "tmp/cache/sass")
55
-
56
- # Establish configuration defaults that are evironmental in nature
57
- if config.sass.full_exception.nil?
58
- # Display a stack trace in the css output when in development-like environments.
59
- config.sass.full_exception = app.config.consider_all_requests_local
60
- end
61
-
62
- if app.assets
63
- app.assets.context_class.extend(SassContext)
64
- app.assets.context_class.sass_config = app.config.sass
65
- end
66
-
67
- Sass.logger = app.config.sass.logger
68
- end
69
-
70
- initializer :setup_compression, :group => :all do |app|
71
- if app.config.assets.compress
72
- app.config.sass.style = :compressed
73
- app.config.assets.css_compressor = CssCompressor.new
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 = "3.2.3"
3
+ VERSION = "6.0.0"
4
4
  end
5
5
  end
data/lib/sass/rails.rb CHANGED
@@ -1,16 +1 @@
1
- module Sass
2
- autoload :Script, 'sass/rails/helpers'
3
-
4
- module Rails
5
- autoload :CssCompressor, 'sass/rails/compressor'
6
- autoload :Importer, 'sass/rails/importer'
7
- autoload :Logger, 'sass/rails/logger'
8
- autoload :Resolver, 'sass/rails/template_handlers'
9
- autoload :SassTemplate, 'sass/rails/template_handlers'
10
- autoload :ScssTemplate, 'sass/rails/template_handlers'
11
- end
12
- end
13
-
14
- require 'sass/rails/version'
15
- require 'sass/rails/helpers'
16
- require 'sass/rails/railtie'
1
+ require 'sassc/rails'
data/lib/sass-rails.rb CHANGED
@@ -1 +1 @@
1
- require 'sass/rails'
1
+ require 'sassc/rails'