Created
August 14, 2011 09:40
-
-
Save icambron/1144745 to your computer and use it in GitHub Desktop.
deawkwarding?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def scss(template, options = {}, locals = {}) | |
| options, engine = Overrides.render_options(template, options, :scss) | |
| super(template, options, locals) | |
| end | |
| def sass(template, options = {}, locals = {}) | |
| options, engine = Overrides.render_options(template, options, :sass) | |
| super(template, options, locals) | |
| end | |
| def stylesheet(template, options = {}, locals = {}) | |
| options, engine = Overrides.render_options(template, options, :sass, :scss) | |
| send(engine, template, options, locals) | |
| end | |
| and later | |
| def self.render_options(template, options, *engines) | |
| if options.key?(:views) and engines.length == 1 | |
| [options, engines.first] | |
| else | |
| [local_view_path, theme_view_path].each do |path| | |
| engines.each do |engine| | |
| if template_exists?(engine, path, template) | |
| return [{:views => path}.merge(options), engine] | |
| end | |
| end | |
| end | |
| [options, nil] | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment