sassc-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +28 -0
  6. data/Rakefile +6 -0
  7. data/lib/sassc-rails.rb +8 -0
  8. data/lib/sassc/rails.rb +5 -0
  9. data/lib/sassc/rails/functions.rb +12 -0
  10. data/lib/sassc/rails/importer.rb +147 -0
  11. data/lib/sassc/rails/logger.rb +21 -0
  12. data/lib/sassc/rails/railtie.rb +64 -0
  13. data/lib/sassc/rails/template.rb +42 -0
  14. data/lib/sassc/rails/version.rb +5 -0
  15. data/sassc-rails.gemspec +34 -0
  16. data/test/dummy/app/assets/images/.keep +0 -0
  17. data/test/dummy/app/assets/images/1x1.png +0 -0
  18. data/test/dummy/app/assets/images/rails.png +0 -0
  19. data/test/dummy/app/assets/stylesheets/application.scss +5 -0
  20. data/test/dummy/app/assets/stylesheets/helpers_test.scss +18 -0
  21. data/test/dummy/app/assets/stylesheets/syntax_error.scss +3 -0
  22. data/test/dummy/rails_app.rb +16 -0
  23. data/test/sassc_rails_test.rb +77 -0
  24. data/test/smoke_test.rb +20 -0
  25. data/test/test_helper.rb +12 -0
  26. data/test_old/fixtures/alternate_config_project/.gitignore +5 -0
  27. data/test_old/fixtures/alternate_config_project/Gemfile +7 -0
  28. data/test_old/fixtures/alternate_config_project/README +261 -0
  29. data/test_old/fixtures/alternate_config_project/Rakefile +7 -0
  30. data/test_old/fixtures/alternate_config_project/app/assets/images/1x1.png +0 -0
  31. data/test_old/fixtures/alternate_config_project/app/assets/images/rails.png +0 -0
  32. data/test_old/fixtures/alternate_config_project/app/assets/javascripts/application.js +9 -0
  33. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/_top_level_partial.scss +3 -0
  34. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/application.scss +32 -0
  35. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/css_application.css +11 -0
  36. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/globbed/globbed.scss +3 -0
  37. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/globbed/nested/nested_glob.scss +3 -0
  38. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/_sass_import.sass +5 -0
  39. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/_scss_import.scss +9 -0
  40. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/_without_css_ext.scss +3 -0
  41. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/subfolder/_relative_sass.sass +2 -0
  42. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/subfolder/_relative_scss.scss +3 -0
  43. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/subfolder/relative_not_a_partial.scss +3 -0
  44. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/subfolder/another_plain.css +3 -0
  45. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/subfolder/plain.css +3 -0
  46. data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/subfolder/second_level.scss +1 -0
  47. data/test_old/fixtures/alternate_config_project/app/controllers/application_controller.rb +3 -0
  48. data/test_old/fixtures/alternate_config_project/app/helpers/application_helper.rb +2 -0
  49. data/test_old/fixtures/alternate_config_project/app/mailers/.gitkeep +0 -0
  50. data/test_old/fixtures/alternate_config_project/app/models/.gitkeep +0 -0
  51. data/test_old/fixtures/alternate_config_project/app/views/layouts/application.html.erb +14 -0
  52. data/test_old/fixtures/alternate_config_project/config.ru +4 -0
  53. data/test_old/fixtures/alternate_config_project/config/application.rb +49 -0
  54. data/test_old/fixtures/alternate_config_project/config/boot.rb +6 -0
  55. data/test_old/fixtures/alternate_config_project/config/database.yml +25 -0
  56. data/test_old/fixtures/alternate_config_project/config/environment.rb +5 -0
  57. data/test_old/fixtures/alternate_config_project/config/environments/development.rb +27 -0
  58. data/test_old/fixtures/alternate_config_project/config/environments/production.rb +60 -0
  59. data/test_old/fixtures/alternate_config_project/config/environments/test.rb +42 -0
  60. data/test_old/fixtures/alternate_config_project/config/initializers/backtrace_silencers.rb +7 -0
  61. data/test_old/fixtures/alternate_config_project/config/initializers/inflections.rb +10 -0
  62. data/test_old/fixtures/alternate_config_project/config/initializers/mime_types.rb +5 -0
  63. data/test_old/fixtures/alternate_config_project/config/initializers/secret_token.rb +7 -0
  64. data/test_old/fixtures/alternate_config_project/config/initializers/session_store.rb +8 -0
  65. data/test_old/fixtures/alternate_config_project/config/initializers/wrap_parameters.rb +12 -0
  66. data/test_old/fixtures/alternate_config_project/config/locales/en.yml +5 -0
  67. data/test_old/fixtures/alternate_config_project/config/routes.rb +58 -0
  68. data/test_old/fixtures/alternate_config_project/db/seeds.rb +7 -0
  69. data/test_old/fixtures/alternate_config_project/doc/README_FOR_APP +2 -0
  70. data/test_old/fixtures/alternate_config_project/lib/tasks/.gitkeep +0 -0
  71. data/test_old/fixtures/alternate_config_project/log/.gitkeep +0 -0
  72. data/test_old/fixtures/alternate_config_project/public/404.html +26 -0
  73. data/test_old/fixtures/alternate_config_project/public/422.html +26 -0
  74. data/test_old/fixtures/alternate_config_project/public/500.html +26 -0
  75. data/test_old/fixtures/alternate_config_project/public/favicon.ico +0 -0
  76. data/test_old/fixtures/alternate_config_project/public/index.html +241 -0
  77. data/test_old/fixtures/alternate_config_project/public/robots.txt +5 -0
  78. data/test_old/fixtures/alternate_config_project/script/rails +6 -0
  79. data/test_old/fixtures/engine_project/.gitignore +8 -0
  80. data/test_old/fixtures/engine_project/Gemfile +14 -0
  81. data/test_old/fixtures/engine_project/MIT-LICENSE +20 -0
  82. data/test_old/fixtures/engine_project/README.rdoc +3 -0
  83. data/test_old/fixtures/engine_project/Rakefile +34 -0
  84. data/test_old/fixtures/engine_project/app/assets/images/engine_project/.keep +0 -0
  85. data/test_old/fixtures/engine_project/app/assets/javascripts/engine_project/application.js +16 -0
  86. data/test_old/fixtures/engine_project/app/assets/stylesheets/engine_project/application.css +13 -0
  87. data/test_old/fixtures/engine_project/app/controllers/engine_project/application_controller.rb +4 -0
  88. data/test_old/fixtures/engine_project/app/helpers/engine_project/application_helper.rb +4 -0
  89. data/test_old/fixtures/engine_project/app/views/layouts/engine_project/application.html.erb +14 -0
  90. data/test_old/fixtures/engine_project/config/routes.rb +2 -0
  91. data/test_old/fixtures/engine_project/engine_project.gemspec +23 -0
  92. data/test_old/fixtures/engine_project/lib/engine_project.rb +4 -0
  93. data/test_old/fixtures/engine_project/lib/engine_project/engine.rb +5 -0
  94. data/test_old/fixtures/engine_project/lib/engine_project/version.rb +3 -0
  95. data/test_old/fixtures/engine_project/lib/tasks/engine_project_tasks.rake +4 -0
  96. data/test_old/fixtures/engine_project/script/rails +8 -0
  97. data/test_old/fixtures/engine_project/test/dummy/README.rdoc +28 -0
  98. data/test_old/fixtures/engine_project/test/dummy/Rakefile +6 -0
  99. data/test_old/fixtures/engine_project/test/dummy/app/assets/javascripts/application.js +16 -0
  100. data/test_old/fixtures/engine_project/test/dummy/app/assets/stylesheets/application.css +13 -0
  101. data/test_old/fixtures/engine_project/test/dummy/app/controllers/application_controller.rb +5 -0
  102. data/test_old/fixtures/engine_project/test/dummy/app/controllers/concerns/.keep +0 -0
  103. data/test_old/fixtures/engine_project/test/dummy/app/helpers/application_helper.rb +2 -0
  104. data/test_old/fixtures/engine_project/test/dummy/app/mailers/.keep +0 -0
  105. data/test_old/fixtures/engine_project/test/dummy/app/models/.keep +0 -0
  106. data/test_old/fixtures/engine_project/test/dummy/app/models/concerns/.keep +0 -0
  107. data/test_old/fixtures/engine_project/test/dummy/app/views/layouts/application.html.erb +14 -0
  108. data/test_old/fixtures/engine_project/test/dummy/bin/bundle +3 -0
  109. data/test_old/fixtures/engine_project/test/dummy/bin/rails +4 -0
  110. data/test_old/fixtures/engine_project/test/dummy/bin/rake +4 -0
  111. data/test_old/fixtures/engine_project/test/dummy/config.ru +4 -0
  112. data/test_old/fixtures/engine_project/test/dummy/config/application.rb +23 -0
  113. data/test_old/fixtures/engine_project/test/dummy/config/boot.rb +9 -0
  114. data/test_old/fixtures/engine_project/test/dummy/config/database.yml +25 -0
  115. data/test_old/fixtures/engine_project/test/dummy/config/environment.rb +5 -0
  116. data/test_old/fixtures/engine_project/test/dummy/config/environments/development.rb +27 -0
  117. data/test_old/fixtures/engine_project/test/dummy/config/environments/production.rb +84 -0
  118. data/test_old/fixtures/engine_project/test/dummy/config/environments/test.rb +40 -0
  119. data/test_old/fixtures/engine_project/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  120. data/test_old/fixtures/engine_project/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  121. data/test_old/fixtures/engine_project/test/dummy/config/initializers/inflections.rb +16 -0
  122. data/test_old/fixtures/engine_project/test/dummy/config/initializers/mime_types.rb +5 -0
  123. data/test_old/fixtures/engine_project/test/dummy/config/initializers/secret_token.rb +12 -0
  124. data/test_old/fixtures/engine_project/test/dummy/config/initializers/session_store.rb +3 -0
  125. data/test_old/fixtures/engine_project/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  126. data/test_old/fixtures/engine_project/test/dummy/config/locales/en.yml +23 -0
  127. data/test_old/fixtures/engine_project/test/dummy/config/routes.rb +4 -0
  128. data/test_old/fixtures/engine_project/test/dummy/lib/assets/.keep +0 -0
  129. data/test_old/fixtures/engine_project/test/dummy/log/.keep +0 -0
  130. data/test_old/fixtures/engine_project/test/dummy/public/404.html +27 -0
  131. data/test_old/fixtures/engine_project/test/dummy/public/422.html +26 -0
  132. data/test_old/fixtures/engine_project/test/dummy/public/500.html +26 -0
  133. data/test_old/fixtures/engine_project/test/dummy/public/favicon.ico +0 -0
  134. data/test_old/fixtures/sass_project/.gitignore +5 -0
  135. data/test_old/fixtures/sass_project/Gemfile +7 -0
  136. data/test_old/fixtures/sass_project/README +261 -0
  137. data/test_old/fixtures/sass_project/Rakefile +7 -0
  138. data/test_old/fixtures/sass_project/app/assets/images/rails.png +0 -0
  139. data/test_old/fixtures/sass_project/app/assets/javascripts/application.js +9 -0
  140. data/test_old/fixtures/sass_project/app/assets/stylesheets/application.css +7 -0
  141. data/test_old/fixtures/sass_project/app/controllers/application_controller.rb +3 -0
  142. data/test_old/fixtures/sass_project/app/helpers/application_helper.rb +2 -0
  143. data/test_old/fixtures/sass_project/app/mailers/.gitkeep +0 -0
  144. data/test_old/fixtures/sass_project/app/models/.gitkeep +0 -0
  145. data/test_old/fixtures/sass_project/app/views/layouts/application.html.erb +14 -0
  146. data/test_old/fixtures/sass_project/config.ru +4 -0
  147. data/test_old/fixtures/sass_project/config/application.rb +52 -0
  148. data/test_old/fixtures/sass_project/config/boot.rb +6 -0
  149. data/test_old/fixtures/sass_project/config/database.yml +25 -0
  150. data/test_old/fixtures/sass_project/config/environment.rb +5 -0
  151. data/test_old/fixtures/sass_project/config/environments/development.rb +24 -0
  152. data/test_old/fixtures/sass_project/config/environments/production.rb +58 -0
  153. data/test_old/fixtures/sass_project/config/environments/test.rb +43 -0
  154. data/test_old/fixtures/sass_project/config/initializers/backtrace_silencers.rb +7 -0
  155. data/test_old/fixtures/sass_project/config/initializers/inflections.rb +10 -0
  156. data/test_old/fixtures/sass_project/config/initializers/mime_types.rb +5 -0
  157. data/test_old/fixtures/sass_project/config/initializers/secret_token.rb +7 -0
  158. data/test_old/fixtures/sass_project/config/initializers/session_store.rb +8 -0
  159. data/test_old/fixtures/sass_project/config/initializers/wrap_parameters.rb +12 -0
  160. data/test_old/fixtures/sass_project/config/locales/en.yml +5 -0
  161. data/test_old/fixtures/sass_project/config/routes.rb +58 -0
  162. data/test_old/fixtures/sass_project/db/seeds.rb +7 -0
  163. data/test_old/fixtures/sass_project/doc/README_FOR_APP +2 -0
  164. data/test_old/fixtures/sass_project/lib/tasks/.gitkeep +0 -0
  165. data/test_old/fixtures/sass_project/log/.gitkeep +0 -0
  166. data/test_old/fixtures/sass_project/public/404.html +26 -0
  167. data/test_old/fixtures/sass_project/public/422.html +26 -0
  168. data/test_old/fixtures/sass_project/public/500.html +26 -0
  169. data/test_old/fixtures/sass_project/public/favicon.ico +0 -0
  170. data/test_old/fixtures/sass_project/public/index.html +241 -0
  171. data/test_old/fixtures/sass_project/public/robots.txt +5 -0
  172. data/test_old/fixtures/sass_project/script/rails +6 -0
  173. data/test_old/fixtures/scss_project/.gitignore +5 -0
  174. data/test_old/fixtures/scss_project/Gemfile +7 -0
  175. data/test_old/fixtures/scss_project/README +261 -0
  176. data/test_old/fixtures/scss_project/Rakefile +7 -0
  177. data/test_old/fixtures/scss_project/app/assets/images/1x1.png +0 -0
  178. data/test_old/fixtures/scss_project/app/assets/images/rails.png +0 -0
  179. data/test_old/fixtures/scss_project/app/assets/javascripts/application.js +9 -0
  180. data/test_old/fixtures/scss_project/app/assets/stylesheets/_top_level_partial.scss +3 -0
  181. data/test_old/fixtures/scss_project/app/assets/stylesheets/application.scss +38 -0
  182. data/test_old/fixtures/scss_project/app/assets/stylesheets/css_application.css +11 -0
  183. data/test_old/fixtures/scss_project/app/assets/stylesheets/css_erb_handler.css.erb +3 -0
  184. data/test_old/fixtures/scss_project/app/assets/stylesheets/css_sass_erb_handler.sass.erb +2 -0
  185. data/test_old/fixtures/scss_project/app/assets/stylesheets/css_scss_erb_handler.scss.erb +3 -0
  186. data/test_old/fixtures/scss_project/app/assets/stylesheets/globbed/globbed.scss +3 -0
  187. data/test_old/fixtures/scss_project/app/assets/stylesheets/globbed/nested/nested_glob.scss +3 -0
  188. data/test_old/fixtures/scss_project/app/assets/stylesheets/import_css_application.scss +5 -0
  189. data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_css_sass_import.sass +5 -0
  190. data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_sass_import.sass +2 -0
  191. data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_scss_import.scss +9 -0
  192. data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_without_css_ext.scss +3 -0
  193. data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/_relative_sass.sass +2 -0
  194. data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/_relative_scss.scss +3 -0
  195. data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/relative_not_a_partial.scss +3 -0
  196. data/test_old/fixtures/scss_project/app/assets/stylesheets/sass_erb_handler.sass.erb +2 -0
  197. data/test_old/fixtures/scss_project/app/assets/stylesheets/scss_erb_handler.scss.erb +3 -0
  198. data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/_defaults.scss +3 -0
  199. data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/another_plain.css +3 -0
  200. data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/plain.css +3 -0
  201. data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/second_level.scss +2 -0
  202. data/test_old/fixtures/scss_project/app/controllers/application_controller.rb +3 -0
  203. data/test_old/fixtures/scss_project/app/helpers/application_helper.rb +2 -0
  204. data/test_old/fixtures/scss_project/app/mailers/.gitkeep +0 -0
  205. data/test_old/fixtures/scss_project/app/models/.gitkeep +0 -0
  206. data/test_old/fixtures/scss_project/app/views/layouts/application.html.erb +14 -0
  207. data/test_old/fixtures/scss_project/config.ru +4 -0
  208. data/test_old/fixtures/scss_project/config/application.rb +49 -0
  209. data/test_old/fixtures/scss_project/config/boot.rb +6 -0
  210. data/test_old/fixtures/scss_project/config/database.yml +25 -0
  211. data/test_old/fixtures/scss_project/config/environment.rb +5 -0
  212. data/test_old/fixtures/scss_project/config/environments/development.rb +23 -0
  213. data/test_old/fixtures/scss_project/config/environments/production.rb +57 -0
  214. data/test_old/fixtures/scss_project/config/environments/test.rb +42 -0
  215. data/test_old/fixtures/scss_project/config/initializers/backtrace_silencers.rb +7 -0
  216. data/test_old/fixtures/scss_project/config/initializers/inflections.rb +10 -0
  217. data/test_old/fixtures/scss_project/config/initializers/mime_types.rb +5 -0
  218. data/test_old/fixtures/scss_project/config/initializers/postprocessor.rb +3 -0
  219. data/test_old/fixtures/scss_project/config/initializers/secret_token.rb +7 -0
  220. data/test_old/fixtures/scss_project/config/initializers/session_store.rb +8 -0
  221. data/test_old/fixtures/scss_project/config/initializers/wrap_parameters.rb +12 -0
  222. data/test_old/fixtures/scss_project/config/locales/en.yml +5 -0
  223. data/test_old/fixtures/scss_project/config/routes.rb +58 -0
  224. data/test_old/fixtures/scss_project/db/seeds.rb +7 -0
  225. data/test_old/fixtures/scss_project/doc/README_FOR_APP +2 -0
  226. data/test_old/fixtures/scss_project/lib/tasks/.gitkeep +0 -0
  227. data/test_old/fixtures/scss_project/log/.gitkeep +0 -0
  228. data/test_old/fixtures/scss_project/public/404.html +26 -0
  229. data/test_old/fixtures/scss_project/public/422.html +26 -0
  230. data/test_old/fixtures/scss_project/public/500.html +26 -0
  231. data/test_old/fixtures/scss_project/public/favicon.ico +0 -0
  232. data/test_old/fixtures/scss_project/public/index.html +241 -0
  233. data/test_old/fixtures/scss_project/public/robots.txt +5 -0
  234. data/test_old/fixtures/scss_project/script/rails +6 -0
  235. data/test_old/sass_rails_test.rb +203 -0
  236. data/test_old/support/sass_rails_test_case.rb +181 -0
  237. data/test_old/test_helper.rb +27 -0
  238. metadata +416 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 523c8a396ba041547d8802a7a0803a8f9d101d15
4
+ data.tar.gz: e06a714560f3d93aca54ad05847a2d98e45761e2
5
+ SHA512:
6
+ metadata.gz: 2bac2ce68c73bfa143fa97e0e8c929630b36bfd16607133439d56d716bedc51cd5a85adf82273700d1e5a8791cafe2f5c5b38bea68a87ed87f314f086cafdcc4
7
+ data.tar.gz: 03edfdc187118fb73f5d00246476a62a556a75c9bb9d86f44df76994d1b25c546aca2954fa05afe666903d0302a373e650f80aca9936049190078ed9d1bbad93
@@ -0,0 +1,16 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ vendor
16
+ *.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in sassc-rails.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Ryan Boland
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,28 @@
1
+ # SassC::Rails
2
+
3
+ ## WIP.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'sassc-rails'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+
18
+ ## Usage
19
+
20
+ TODO: Write usage instructions here
21
+
22
+ ## Contributing
23
+
24
+ 1. Fork it ( https://github.com/[my-github-username]/sassc-rails/fork )
25
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
26
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
27
+ 4. Push to the branch (`git push origin my-new-feature`)
28
+ 5. Create a new Pull Request
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ task :test do
4
+ $LOAD_PATH.unshift('lib', 'test')
5
+ Dir.glob('./test/**/*_test.rb') { |f| require f }
6
+ end
@@ -0,0 +1,8 @@
1
+ begin
2
+ require "sass-rails"
3
+ Sass::Rails.send(:remove_const, :Railtie)
4
+ rescue LoadError
5
+ end
6
+
7
+ require_relative "sassc/rails"
8
+
@@ -0,0 +1,5 @@
1
+ require_relative "rails/version"
2
+ require_relative "rails/functions"
3
+ #require_relative "rails/importer"
4
+ require_relative "rails/template"
5
+ require_relative "rails/railtie"
@@ -0,0 +1,12 @@
1
+ require "sprockets/sass_template"
2
+ require "sassc"
3
+
4
+ module Sprockets
5
+ class SassTemplate
6
+ module Functions
7
+ def asset_data_url(path)
8
+ SassC::Script::String.new("url(" + sprockets_context.asset_data_uri(path.value) + ")")
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,147 @@
1
+ require 'active_support/deprecation/reporting'
2
+ require 'sass'
3
+ require 'sprockets/sass_importer'
4
+ require 'tilt'
5
+
6
+ module Sass
7
+ module Rails
8
+ class SassImporter < Sass::Importers::Filesystem
9
+ module Globbing
10
+ GLOB = /(\A|\/)(\*|\*\*\/\*)\z/
11
+
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
@@ -0,0 +1,21 @@
1
+ require 'sass/logger'
2
+
3
+ module Sass
4
+ module Rails
5
+ class Logger < Sass::Logger::Base
6
+ def _log(level, message)
7
+
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
@@ -0,0 +1,64 @@
1
+ require 'active_support/core_ext/class/attribute'
2
+ require 'sprockets/railtie'
3
+
4
+ module SassC::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
+ # Initialize the load paths to an empty array
12
+ config.sass.load_paths = []
13
+
14
+ # Set the default stylesheet engine
15
+ # It can be overridden by passing:
16
+ # --stylesheet_engine=sass
17
+ # to the rails generate command
18
+ config.app_generators.stylesheet_engine config.sass.preferred_syntax
19
+
20
+ if config.respond_to?(:annotations)
21
+ config.annotations.register_extensions("scss", "sass") { |annotation| /\/\/\s*(#{annotation}):?\s*(.*)$/ }
22
+ end
23
+
24
+ # Remove the sass middleware if it gets inadvertently enabled by applications.
25
+ config.after_initialize do |app|
26
+ app.config.middleware.delete(Sass::Plugin::Rack) if defined?(Sass::Plugin::Rack)
27
+ end
28
+
29
+ initializer :setup_sass, group: :all do |app|
30
+ # Only emit one kind of syntax because though we have registered two kinds of generators
31
+ syntax = app.config.sass.preferred_syntax.to_sym
32
+ alt_syntax = syntax == :sass ? "scss" : "sass"
33
+ app.config.generators.hide_namespace alt_syntax
34
+
35
+ # Override stylesheet engine to the preferred syntax
36
+ config.app_generators.stylesheet_engine syntax
37
+
38
+ # Establish configuration defaults that are evironmental in nature
39
+ # if config.sass.full_exception.nil?
40
+ # # Display a stack trace in the css output when in development-like environments.
41
+ # config.sass.full_exception = app.config.consider_all_requests_local
42
+ # end
43
+
44
+ if app.assets
45
+ app.assets.register_engine '.sass', SassC::Rails::SassTemplate
46
+ app.assets.register_engine '.scss', SassC::Rails::ScssTemplate
47
+
48
+ app.assets.context_class.class_eval do
49
+ class_attribute :sass_config
50
+ self.sass_config = app.config.sass
51
+ end
52
+ end
53
+ end
54
+
55
+ initializer :setup_compression, group: :all do |app|
56
+ if !Rails.env.development?
57
+ app.config.assets.css_compressor ||= :sass
58
+ else
59
+ # Use expanded output instead of the sass default of :nested unless specified
60
+ app.config.sass.style ||= :expanded
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,42 @@
1
+ require 'sassc'
2
+ require "sprockets/sass_template"
3
+ require "sprockets/utils"
4
+
5
+ module SassC::Rails
6
+ class SassTemplate < Sprockets::SassTemplate
7
+ def call(input)
8
+ context = input[:environment].context_class.new(input)
9
+
10
+ options = {
11
+ filename: input[:filename],
12
+ syntax: self.class.syntax,
13
+ load_paths: input[:environment].paths,
14
+ sprockets: {
15
+ context: context,
16
+ environment: input[:environment],
17
+ dependencies: context.metadata[:dependency_paths]
18
+ }
19
+ }
20
+
21
+ engine = ::SassC::Engine.new(input[:data], options)
22
+
23
+ css = Sprockets::Utils.module_include(::SassC::Script::Functions, @functions) do
24
+ engine.render
25
+ end
26
+
27
+ # Track all imported files
28
+ engine.dependencies.map do |dependency|
29
+ context.metadata[:dependency_paths] << dependency.options[:filename]
30
+ end
31
+
32
+ context.metadata.merge(data: css)
33
+ end
34
+
35
+ end
36
+
37
+ class ScssTemplate < SassTemplate
38
+ def self.syntax
39
+ :scss
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,5 @@
1
+ module SassC
2
+ module Rails
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'sassc/rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "sassc-rails"
8
+ spec.version = SassC::Rails::VERSION
9
+ spec.authors = ["Ryan Boland"]
10
+ spec.email = ["bolandryanm@gmail.com"]
11
+ spec.summary = %q{Integrate SassC-Ruby into Rails.}
12
+ spec.description = %q{Integrate SassC-Ruby into Rails.}
13
+ spec.homepage = "https://github.com/bolandrm/sassc-rails"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency 'pry'
22
+ spec.add_development_dependency "bundler", "~> 1.7"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "minitest", "~> 5.5.1"
25
+ spec.add_development_dependency 'rails'
26
+
27
+ # unfortunately we require sass for now, so that we can
28
+ # reuse portions of the sprockets template
29
+ spec.add_dependency 'sass'
30
+
31
+ spec.add_dependency "sassc", "0.0.7"
32
+ spec.add_dependency 'railties'
33
+ spec.add_dependency 'sprockets', '3.0.0.beta.6'
34
+ end
File without changes