radiant 0.6.6 → 0.6.7

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 (208) hide show
  1. data/CHANGELOG +15 -0
  2. data/CONTRIBUTORS +8 -0
  3. data/app/controllers/admin/page_controller.rb +1 -11
  4. data/app/controllers/admin/welcome_controller.rb +5 -6
  5. data/app/controllers/application.rb +2 -0
  6. data/app/controllers/site_controller.rb +1 -0
  7. data/app/helpers/admin/page_helper.rb +36 -0
  8. data/app/helpers/admin/regions_helper.rb +28 -0
  9. data/app/helpers/admin/user_helper.rb +6 -0
  10. data/app/helpers/application_helper.rb +2 -1
  11. data/app/models/user.rb +7 -8
  12. data/app/views/admin/extension/index.html.haml +28 -0
  13. data/app/views/admin/layout/edit.html.haml +44 -0
  14. data/app/views/admin/layout/index.html.haml +25 -0
  15. data/app/views/admin/layout/remove.html.haml +16 -0
  16. data/app/views/admin/page/_meta_row.html.haml +6 -0
  17. data/app/views/admin/page/_node.html.haml +25 -0
  18. data/app/views/admin/page/_part.html.haml +17 -0
  19. data/app/views/admin/page/_tag_reference.html.haml +3 -0
  20. data/app/views/admin/page/children.html.haml +2 -0
  21. data/app/views/admin/page/edit.html.haml +114 -0
  22. data/app/views/admin/page/index.html.haml +28 -0
  23. data/app/views/admin/page/remove.html.haml +20 -0
  24. data/app/views/admin/snippet/edit.html.haml +36 -0
  25. data/app/views/admin/snippet/index.html.haml +20 -0
  26. data/app/views/admin/snippet/remove.html.haml +19 -0
  27. data/app/views/admin/user/edit.html.haml +80 -0
  28. data/app/views/admin/user/index.html.haml +23 -0
  29. data/app/views/admin/user/preferences.html.haml +28 -0
  30. data/app/views/admin/user/remove.html.haml +18 -0
  31. data/app/views/admin/welcome/login.html.haml +44 -0
  32. data/app/views/layouts/application.html.haml +54 -0
  33. data/app/views/site/not_found.html.haml +3 -0
  34. data/db/migrate/019_add_salt_to_users.rb +11 -0
  35. data/db/schema.rb +2 -1
  36. data/lib/login_system.rb +1 -0
  37. data/lib/radiant.rb +1 -1
  38. data/lib/radiant/admin_ui.rb +65 -0
  39. data/lib/radiant/admin_ui/region_partials.rb +18 -0
  40. data/lib/radiant/admin_ui/region_set.rb +35 -0
  41. data/lib/tasks/extensions.rake +33 -0
  42. data/public/javascripts/admin/admin.js +8 -2
  43. data/public/javascripts/admin/sitemap.js +2 -1
  44. data/public/stylesheets/admin/main.css +4 -0
  45. data/spec/controllers/admin/abstract_model_controller_spec.rb +2 -0
  46. data/spec/controllers/admin/page_controller_spec.rb +3 -28
  47. data/spec/controllers/admin/user_controller_spec.rb +1 -1
  48. data/spec/controllers/admin/welcome_controller_spec.rb +26 -0
  49. data/spec/helpers/admin/page_helper_spec.rb +4 -0
  50. data/spec/helpers/admin/regions_helper_spec.rb +47 -0
  51. data/spec/helpers/admin/user_helper_spec.rb +7 -0
  52. data/spec/helpers/application_helper_spec.rb +7 -3
  53. data/spec/lib/login_system_spec.rb +5 -0
  54. data/spec/lib/radiant/admin_ui/region_partials_spec.rb +35 -0
  55. data/spec/lib/radiant/admin_ui/region_set_spec.rb +61 -0
  56. data/spec/lib/radiant/admin_ui_spec.rb +74 -18
  57. data/spec/models/user_spec.rb +11 -4
  58. data/spec/scenarios/users_scenario.rb +2 -2
  59. data/vendor/plugins/haml/MIT-LICENSE +20 -0
  60. data/vendor/plugins/haml/README.rdoc +319 -0
  61. data/vendor/plugins/haml/Rakefile +158 -0
  62. data/vendor/plugins/haml/TODO +9 -0
  63. data/vendor/plugins/haml/VERSION +1 -0
  64. data/vendor/plugins/haml/bin/css2sass +7 -0
  65. data/vendor/plugins/haml/bin/haml +8 -0
  66. data/vendor/plugins/haml/bin/html2haml +7 -0
  67. data/vendor/plugins/haml/bin/sass +8 -0
  68. data/vendor/plugins/haml/extra/haml-mode.el +328 -0
  69. data/vendor/plugins/haml/extra/sass-mode.el +88 -0
  70. data/vendor/plugins/haml/init.rb +2 -0
  71. data/vendor/plugins/haml/lib/haml.rb +977 -0
  72. data/vendor/plugins/haml/lib/haml/buffer.rb +229 -0
  73. data/vendor/plugins/haml/lib/haml/engine.rb +274 -0
  74. data/vendor/plugins/haml/lib/haml/error.rb +23 -0
  75. data/vendor/plugins/haml/lib/haml/exec.rb +347 -0
  76. data/vendor/plugins/haml/lib/haml/filters.rb +249 -0
  77. data/vendor/plugins/haml/lib/haml/helpers.rb +413 -0
  78. data/vendor/plugins/haml/lib/haml/helpers/action_view_extensions.rb +45 -0
  79. data/vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb +122 -0
  80. data/vendor/plugins/haml/lib/haml/html.rb +188 -0
  81. data/vendor/plugins/haml/lib/haml/precompiler.rb +757 -0
  82. data/vendor/plugins/haml/lib/haml/template.rb +43 -0
  83. data/vendor/plugins/haml/lib/haml/template/patch.rb +58 -0
  84. data/vendor/plugins/haml/lib/haml/template/plugin.rb +72 -0
  85. data/vendor/plugins/haml/lib/sass.rb +833 -0
  86. data/vendor/plugins/haml/lib/sass/constant.rb +245 -0
  87. data/vendor/plugins/haml/lib/sass/constant/color.rb +101 -0
  88. data/vendor/plugins/haml/lib/sass/constant/literal.rb +53 -0
  89. data/vendor/plugins/haml/lib/sass/constant/number.rb +87 -0
  90. data/vendor/plugins/haml/lib/sass/constant/operation.rb +30 -0
  91. data/vendor/plugins/haml/lib/sass/constant/string.rb +22 -0
  92. data/vendor/plugins/haml/lib/sass/css.rb +378 -0
  93. data/vendor/plugins/haml/lib/sass/engine.rb +459 -0
  94. data/vendor/plugins/haml/lib/sass/error.rb +35 -0
  95. data/vendor/plugins/haml/lib/sass/plugin.rb +165 -0
  96. data/vendor/plugins/haml/lib/sass/plugin/merb.rb +56 -0
  97. data/vendor/plugins/haml/lib/sass/plugin/rails.rb +24 -0
  98. data/vendor/plugins/haml/lib/sass/tree/attr_node.rb +53 -0
  99. data/vendor/plugins/haml/lib/sass/tree/comment_node.rb +20 -0
  100. data/vendor/plugins/haml/lib/sass/tree/directive_node.rb +46 -0
  101. data/vendor/plugins/haml/lib/sass/tree/node.rb +42 -0
  102. data/vendor/plugins/haml/lib/sass/tree/rule_node.rb +89 -0
  103. data/vendor/plugins/haml/lib/sass/tree/value_node.rb +16 -0
  104. data/vendor/plugins/haml/test/benchmark.rb +82 -0
  105. data/vendor/plugins/haml/test/haml/engine_test.rb +587 -0
  106. data/vendor/plugins/haml/test/haml/helper_test.rb +187 -0
  107. data/vendor/plugins/haml/test/haml/html2haml_test.rb +60 -0
  108. data/vendor/plugins/haml/test/haml/markaby/standard.mab +52 -0
  109. data/vendor/plugins/haml/test/haml/mocks/article.rb +6 -0
  110. data/vendor/plugins/haml/test/haml/results/content_for_layout.xhtml +16 -0
  111. data/vendor/plugins/haml/test/haml/results/eval_suppressed.xhtml +11 -0
  112. data/vendor/plugins/haml/test/haml/results/filters.xhtml +82 -0
  113. data/vendor/plugins/haml/test/haml/results/helpers.xhtml +94 -0
  114. data/vendor/plugins/haml/test/haml/results/helpful.xhtml +10 -0
  115. data/vendor/plugins/haml/test/haml/results/just_stuff.xhtml +64 -0
  116. data/vendor/plugins/haml/test/haml/results/list.xhtml +12 -0
  117. data/vendor/plugins/haml/test/haml/results/original_engine.xhtml +22 -0
  118. data/vendor/plugins/haml/test/haml/results/partials.xhtml +21 -0
  119. data/vendor/plugins/haml/test/haml/results/silent_script.xhtml +74 -0
  120. data/vendor/plugins/haml/test/haml/results/standard.xhtml +42 -0
  121. data/vendor/plugins/haml/test/haml/results/tag_parsing.xhtml +28 -0
  122. data/vendor/plugins/haml/test/haml/results/very_basic.xhtml +7 -0
  123. data/vendor/plugins/haml/test/haml/results/whitespace_handling.xhtml +94 -0
  124. data/vendor/plugins/haml/test/haml/rhtml/_av_partial_1.rhtml +12 -0
  125. data/vendor/plugins/haml/test/haml/rhtml/_av_partial_2.rhtml +8 -0
  126. data/vendor/plugins/haml/test/haml/rhtml/action_view.rhtml +62 -0
  127. data/vendor/plugins/haml/test/haml/rhtml/standard.rhtml +54 -0
  128. data/vendor/plugins/haml/test/haml/template_test.rb +168 -0
  129. data/vendor/plugins/haml/test/haml/templates/_av_partial_1.haml +9 -0
  130. data/vendor/plugins/haml/test/haml/templates/_av_partial_2.haml +5 -0
  131. data/vendor/plugins/haml/test/haml/templates/_partial.haml +8 -0
  132. data/vendor/plugins/haml/test/haml/templates/_text_area.haml +3 -0
  133. data/vendor/plugins/haml/test/haml/templates/action_view.haml +47 -0
  134. data/vendor/plugins/haml/test/haml/templates/breakage.haml +8 -0
  135. data/vendor/plugins/haml/test/haml/templates/content_for_layout.haml +10 -0
  136. data/vendor/plugins/haml/test/haml/templates/eval_suppressed.haml +11 -0
  137. data/vendor/plugins/haml/test/haml/templates/filters.haml +81 -0
  138. data/vendor/plugins/haml/test/haml/templates/helpers.haml +69 -0
  139. data/vendor/plugins/haml/test/haml/templates/helpful.haml +11 -0
  140. data/vendor/plugins/haml/test/haml/templates/just_stuff.haml +77 -0
  141. data/vendor/plugins/haml/test/haml/templates/list.haml +12 -0
  142. data/vendor/plugins/haml/test/haml/templates/original_engine.haml +17 -0
  143. data/vendor/plugins/haml/test/haml/templates/partialize.haml +1 -0
  144. data/vendor/plugins/haml/test/haml/templates/partials.haml +12 -0
  145. data/vendor/plugins/haml/test/haml/templates/silent_script.haml +40 -0
  146. data/vendor/plugins/haml/test/haml/templates/standard.haml +42 -0
  147. data/vendor/plugins/haml/test/haml/templates/tag_parsing.haml +24 -0
  148. data/vendor/plugins/haml/test/haml/templates/very_basic.haml +4 -0
  149. data/vendor/plugins/haml/test/haml/templates/whitespace_handling.haml +87 -0
  150. data/vendor/plugins/haml/test/haml/test_helper.rb +15 -0
  151. data/vendor/plugins/haml/test/profile.rb +65 -0
  152. data/vendor/plugins/haml/test/sass/engine_test.rb +276 -0
  153. data/vendor/plugins/haml/test/sass/plugin_test.rb +159 -0
  154. data/vendor/plugins/haml/test/sass/results/alt.css +4 -0
  155. data/vendor/plugins/haml/test/sass/results/basic.css +9 -0
  156. data/vendor/plugins/haml/test/sass/results/compact.css +5 -0
  157. data/vendor/plugins/haml/test/sass/results/complex.css +87 -0
  158. data/vendor/plugins/haml/test/sass/results/compressed.css +1 -0
  159. data/vendor/plugins/haml/test/sass/results/constants.css +14 -0
  160. data/vendor/plugins/haml/test/sass/results/expanded.css +19 -0
  161. data/vendor/plugins/haml/test/sass/results/import.css +29 -0
  162. data/vendor/plugins/haml/test/sass/results/mixins.css +95 -0
  163. data/vendor/plugins/haml/test/sass/results/multiline.css +24 -0
  164. data/vendor/plugins/haml/test/sass/results/nested.css +22 -0
  165. data/vendor/plugins/haml/test/sass/results/parent_ref.css +13 -0
  166. data/vendor/plugins/haml/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
  167. data/vendor/plugins/haml/test/sass/results/subdir/subdir.css +1 -0
  168. data/vendor/plugins/haml/test/sass/templates/_partial.sass +2 -0
  169. data/vendor/plugins/haml/test/sass/templates/alt.sass +16 -0
  170. data/vendor/plugins/haml/test/sass/templates/basic.sass +23 -0
  171. data/vendor/plugins/haml/test/sass/templates/bork.sass +2 -0
  172. data/vendor/plugins/haml/test/sass/templates/bork2.sass +2 -0
  173. data/vendor/plugins/haml/test/sass/templates/compact.sass +17 -0
  174. data/vendor/plugins/haml/test/sass/templates/complex.sass +310 -0
  175. data/vendor/plugins/haml/test/sass/templates/compressed.sass +15 -0
  176. data/vendor/plugins/haml/test/sass/templates/constants.sass +97 -0
  177. data/vendor/plugins/haml/test/sass/templates/expanded.sass +17 -0
  178. data/vendor/plugins/haml/test/sass/templates/import.sass +11 -0
  179. data/vendor/plugins/haml/test/sass/templates/importee.sass +14 -0
  180. data/vendor/plugins/haml/test/sass/templates/mixins.sass +76 -0
  181. data/vendor/plugins/haml/test/sass/templates/multiline.sass +20 -0
  182. data/vendor/plugins/haml/test/sass/templates/nested.sass +25 -0
  183. data/vendor/plugins/haml/test/sass/templates/parent_ref.sass +25 -0
  184. data/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
  185. data/vendor/plugins/haml/test/sass/templates/subdir/subdir.sass +6 -0
  186. metadata +185 -24
  187. data/app/views/admin/extension/index.html.erb +0 -40
  188. data/app/views/admin/layout/edit.html.erb +0 -39
  189. data/app/views/admin/layout/index.html.erb +0 -38
  190. data/app/views/admin/layout/remove.html.erb +0 -17
  191. data/app/views/admin/page/_meta_row.html.erb +0 -4
  192. data/app/views/admin/page/_node.html.erb +0 -28
  193. data/app/views/admin/page/_part.html.erb +0 -13
  194. data/app/views/admin/page/_tag_reference.html.erb +0 -4
  195. data/app/views/admin/page/children.html.erb +0 -4
  196. data/app/views/admin/page/edit.html.erb +0 -140
  197. data/app/views/admin/page/index.html.erb +0 -31
  198. data/app/views/admin/page/remove.html.erb +0 -14
  199. data/app/views/admin/snippet/edit.html.erb +0 -29
  200. data/app/views/admin/snippet/index.html.erb +0 -36
  201. data/app/views/admin/snippet/remove.html.erb +0 -16
  202. data/app/views/admin/user/edit.html.erb +0 -54
  203. data/app/views/admin/user/index.html.erb +0 -43
  204. data/app/views/admin/user/preferences.html.erb +0 -29
  205. data/app/views/admin/user/remove.html.erb +0 -16
  206. data/app/views/admin/welcome/login.html.erb +0 -51
  207. data/app/views/layouts/application.html.erb +0 -83
  208. data/app/views/site/not_found.html.erb +0 -3
@@ -0,0 +1,43 @@
1
+ require 'haml/engine'
2
+
3
+ module Haml
4
+ class Template
5
+ class << self
6
+ @@options = {}
7
+
8
+ # Gets various options for Haml. See README.rdoc for details.
9
+ def options
10
+ @@options
11
+ end
12
+
13
+ # Sets various options for Haml. See README.rdoc for details.
14
+ def options=(value)
15
+ @@options = value
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ # Decide how we want to load Haml into Rails.
22
+ # Patching was necessary for versions <= 2.0.1,
23
+ # but we can make it a normal handler for higher versions.
24
+ if defined?(ActionView::TemplateHandler)
25
+ require 'haml/template/plugin'
26
+ else
27
+ require 'haml/template/patch'
28
+ end
29
+
30
+ if defined?(RAILS_ROOT)
31
+ # Update init.rb to the current version
32
+ # if it's out of date.
33
+ #
34
+ # We can probably remove this as of v1.9,
35
+ # because the new init file is sufficiently flexible
36
+ # to not need updating.
37
+ rails_init_file = File.join(RAILS_ROOT, 'vendor', 'plugins', 'haml', 'init.rb')
38
+ haml_init_file = Haml.scope('init.rb')
39
+ if File.exists?(rails_init_file)
40
+ require 'fileutils'
41
+ FileUtils.cp(haml_init_file, rails_init_file) unless FileUtils.cmp(rails_init_file, haml_init_file)
42
+ end
43
+ end
@@ -0,0 +1,58 @@
1
+ # This file makes Haml work with Rails
2
+ # by monkeypatching the core template-compilation methods.
3
+ # This is necessary for versions <= 2.0.1 because the template handler API
4
+ # wasn't sufficiently powerful to deal with caching and so forth.
5
+
6
+ # This module refers to the ActionView module that's part of Ruby on Rails.
7
+ # Haml can be used as an alternate templating engine for it,
8
+ # and includes several modifications to make it more Haml-friendly.
9
+ # The documentation can be found
10
+ # here[http://rubyonrails.org/api/classes/ActionView/Base.html].
11
+ module ActionView
12
+ class Base # :nodoc:
13
+ def delegate_template_exists_with_haml(template_path)
14
+ template_exists?(template_path, :haml) && [:haml]
15
+ end
16
+ alias_method :delegate_template_exists_without_haml, :delegate_template_exists?
17
+ alias_method :delegate_template_exists?, :delegate_template_exists_with_haml
18
+
19
+ def compile_template_with_haml(extension, template, file_name, local_assigns)
20
+ return compile_haml(template, file_name, local_assigns) if extension.to_s == "haml"
21
+ compile_template_without_haml(extension, template, file_name, local_assigns)
22
+ end
23
+ alias_method :compile_template_without_haml, :compile_template
24
+ alias_method :compile_template, :compile_template_with_haml
25
+
26
+ def compile_haml(template, file_name, local_assigns)
27
+ render_symbol = assign_method_name(:haml, template, file_name)
28
+ locals = local_assigns.keys
29
+
30
+ @@template_args[render_symbol] ||= {}
31
+ locals_keys = @@template_args[render_symbol].keys | locals
32
+ @@template_args[render_symbol] = locals_keys.inject({}) { |h, k| h[k] = true; h }
33
+
34
+ options = Haml::Template.options.dup
35
+ options[:filename] = file_name || 'compiled-template'
36
+
37
+ begin
38
+ Haml::Engine.new(template, options).def_method(CompiledTemplates, render_symbol, *locals)
39
+ rescue Exception => e
40
+ if logger
41
+ logger.debug "ERROR: compiling #{render_symbol} RAISED #{e}"
42
+ logger.debug "Backtrace: #{e.backtrace.join("\n")}"
43
+ end
44
+
45
+ base_path = if defined?(extract_base_path_from)
46
+ # Rails 2.0.x
47
+ extract_base_path_from(file_name) || view_paths.first
48
+ else
49
+ # Rails <=1.2.6
50
+ @base_path
51
+ end
52
+ raise ActionView::TemplateError.new(base_path, file_name || template, @assigns, template, e)
53
+ end
54
+
55
+ @@compile_time[render_symbol] = Time.now
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,72 @@
1
+ # :stopdoc:
2
+ # This file makes Haml work with Rails
3
+ # using the > 2.0.1 template handler API.
4
+
5
+ module Haml
6
+ class Plugin < ActionView::TemplateHandler
7
+ include ActionView::TemplateHandlers::Compilable if defined?(ActionView::TemplateHandlers::Compilable)
8
+
9
+ def compile(template)
10
+ options = Haml::Template.options.dup
11
+
12
+ # template is a template object in Rails >=2.1.0,
13
+ # a source string previously
14
+ if template.respond_to? :source
15
+ options[:filename] = template.filename
16
+ source = template.source
17
+ else
18
+ source = template
19
+ end
20
+
21
+ Haml::Engine.new(source, options).send(:precompiled_with_ambles, [])
22
+ end
23
+
24
+ def cache_fragment(block, name = {}, options = nil)
25
+ @view.fragment_for(block, name, options) do
26
+ eval("_hamlout.buffer", block.binding)
27
+ end
28
+ end
29
+ end
30
+ end
31
+
32
+ if defined? ActionView::Template and ActionView::Template.respond_to? :register_template_handler
33
+ ActionView::Template
34
+ else
35
+ ActionView::Base
36
+ end.register_template_handler(:haml, Haml::Plugin)
37
+
38
+ # In Rails 2.0.2, ActionView::TemplateError took arguments
39
+ # that we can't fill in from the Haml::Plugin context.
40
+ # Thus, we've got to monkeypatch ActionView::Base to catch the error.
41
+ if ActionView::TemplateError.instance_method(:initialize).arity == 5
42
+ class ActionView::Base
43
+ def compile_template(handler, template, file_name, local_assigns)
44
+ render_symbol = assign_method_name(handler, template, file_name)
45
+
46
+ # Move begin up two lines so it captures compilation exceptions.
47
+ begin
48
+ render_source = create_template_source(handler, template, render_symbol, local_assigns.keys)
49
+ line_offset = @@template_args[render_symbol].size + handler.line_offset
50
+
51
+ file_name = 'compiled-template' if file_name.blank?
52
+ CompiledTemplates.module_eval(render_source, file_name, -line_offset)
53
+ rescue Exception => e # errors from template code
54
+ if logger
55
+ logger.debug "ERROR: compiling #{render_symbol} RAISED #{e}"
56
+ logger.debug "Function body: #{render_source}"
57
+ logger.debug "Backtrace: #{e.backtrace.join("\n")}"
58
+ end
59
+
60
+ # There's no way to tell Haml about the filename,
61
+ # so we've got to insert it ourselves.
62
+ e.backtrace[0].gsub!('(haml)', file_name) if e.is_a?(Haml::Error)
63
+
64
+ raise ActionView::TemplateError.new(extract_base_path_from(file_name) || view_paths.first, file_name || template, @assigns, template, e)
65
+ end
66
+
67
+ @@compile_time[render_symbol] = Time.now
68
+ # logger.debug "Compiled template #{file_name || template}\n ==> #{render_symbol}" if logger
69
+ end
70
+ end
71
+ end
72
+ # :startdoc:
@@ -0,0 +1,833 @@
1
+ dir = File.dirname(__FILE__)
2
+ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
3
+
4
+ # = Sass (Syntactically Awesome StyleSheets)
5
+ #
6
+ # Sass is a meta-language on top of CSS
7
+ # that's used to describe the style of a document
8
+ # cleanly and structurally,
9
+ # with more power than flat CSS allows.
10
+ # Sass both provides a simpler, more elegant syntax for CSS
11
+ # and implements various features that are useful
12
+ # for creating manageable stylesheets.
13
+ #
14
+ # == Features
15
+ #
16
+ # * Whitespace active
17
+ # * Well-formatted output
18
+ # * Elegant input
19
+ # * Feature-rich
20
+ #
21
+ # == Using Sass
22
+ #
23
+ # Sass can be used in several ways:
24
+ # As a plugin for Ruby on Rails or Merb,
25
+ # or as a standalone parser.
26
+ # Sass is bundled with Haml,
27
+ # so if the Haml plugin or RubyGem is installed,
28
+ # Sass will already be installed as a plugin or gem, respectively.
29
+ # The first step for all of these is to install the Haml gem:
30
+ #
31
+ # gem install haml
32
+ #
33
+ # To enable it as a Rails plugin,
34
+ # then run
35
+ #
36
+ # haml --rails path/to/rails/app
37
+ #
38
+ # To enable Sass in Merb,
39
+ # add
40
+ #
41
+ # dependency "merb-haml"
42
+ #
43
+ # to config/dependencies.rb.
44
+ #
45
+ # Sass templates in Rails and Merb don't quite function in the same way as views,
46
+ # because they don't contain dynamic content,
47
+ # and so only need to be compiled when the template file has been updated.
48
+ # By default (see options, below),
49
+ # ".sass" files are placed in public/stylesheets/sass.
50
+ # Then, whenever necessary, they're compiled into corresponding CSS files in public/stylesheets.
51
+ # For instance, public/stylesheets/sass/main.sass would be compiled to public/stylesheets/main.css.
52
+ #
53
+ # Using Sass in Ruby code is very simple.
54
+ # After installing the Haml gem,
55
+ # you can use it by running <tt>require "sass"</tt>
56
+ # and using Sass::Engine like so:
57
+ #
58
+ # engine = Sass::Engine.new("#main\n :background-color #0000ff")
59
+ # engine.render #=> "#main { background-color: #0000ff; }\n"
60
+ #
61
+ # == CSS Rules
62
+ #
63
+ # Rules in flat CSS have two elements:
64
+ # the selector
65
+ # (e.g. "#main", "div p", "li a:hover")
66
+ # and the attributes
67
+ # (e.g. "color: #00ff00;", "width: 5em;").
68
+ #
69
+ # Sass has both of these,
70
+ # as well as one additional element: nested rules.
71
+ #
72
+ # === Rules and Selectors
73
+ #
74
+ # However, some of the syntax is a little different.
75
+ # The syntax for selectors is the same,
76
+ # but instead of using brackets to delineate the attributes that belong to a particular rule,
77
+ # Sass uses two spaces of indentation.
78
+ # For example:
79
+ #
80
+ # #main p
81
+ # <attribute>
82
+ # <attribute>
83
+ # ...
84
+ #
85
+ # Like CSS, you can stretch rules over multiple lines.
86
+ # However, unlike CSS, you can only do this if each line but the last
87
+ # ends with a comma.
88
+ # For example:
89
+ #
90
+ # .users #userTab,
91
+ # .posts #postsTab
92
+ # <attributes>
93
+ #
94
+ # === Attributes
95
+ #
96
+ # There are two different ways to write CSS attrbibutes.
97
+ # The first is very similar to the how you're used to writing them:
98
+ # with a colon between the name and the value.
99
+ # However, Sass attributes don't have semicolons at the end;
100
+ # each attribute is on its own line, so they aren't necessary.
101
+ # For example:
102
+ #
103
+ # #main p
104
+ # color: #00ff00
105
+ # width: 97%
106
+ #
107
+ # is compiled to:
108
+ #
109
+ # #main p {
110
+ # color: #00ff00;
111
+ # width: 97% }
112
+ #
113
+ # The second syntax for attributes is slightly different.
114
+ # The colon is at the beginning of the attribute,
115
+ # rather than between the name and the value,
116
+ # so it's easier to tell what elements are attributes just by glancing at them.
117
+ # For example:
118
+ #
119
+ # #main p
120
+ # :color #00ff00
121
+ # :width 97%
122
+ #
123
+ # is compiled to:
124
+ #
125
+ # #main p {
126
+ # color: #00ff00;
127
+ # width: 97% }
128
+ #
129
+ # By default, either attribute syntax may be used.
130
+ # If you want to force one or the other,
131
+ # see the <tt>:attribute_syntax</tt> option below.
132
+ #
133
+ # === Nested Rules
134
+ #
135
+ # Rules can also be nested within each other.
136
+ # This signifies that the inner rule's selector is a child of the outer selector.
137
+ # For example:
138
+ #
139
+ # #main p
140
+ # :color #00ff00
141
+ # :width 97%
142
+ #
143
+ # .redbox
144
+ # :background-color #ff0000
145
+ # :color #000000
146
+ #
147
+ # is compiled to:
148
+ #
149
+ # #main p {
150
+ # color: #00ff00;
151
+ # width: 97%; }
152
+ # #main p .redbox {
153
+ # background-color: #ff0000;
154
+ # color: #000000; }
155
+ #
156
+ # This makes insanely complicated CSS layouts with lots of nested selectors very simple:
157
+ #
158
+ # #main
159
+ # :width 97%
160
+ #
161
+ # p, div
162
+ # :font-size 2em
163
+ # a
164
+ # :font-weight bold
165
+ #
166
+ # pre
167
+ # :font-size 3em
168
+ #
169
+ # is compiled to:
170
+ #
171
+ # #main {
172
+ # width: 97%; }
173
+ # #main p, #main div {
174
+ # font-size: 2em; }
175
+ # #main p a, #main div a {
176
+ # font-weight: bold; }
177
+ # #main pre {
178
+ # font-size: 3em; }
179
+ #
180
+ # === Referencing Parent Rules
181
+ #
182
+ # In addition to the default behavior of inserting the parent selector
183
+ # as a CSS parent of the current selector
184
+ # (e.g. above, "#main" is the parent of "p"),
185
+ # you can have more fine-grained control over what's done with the parent selector
186
+ # by using the ampersand character "&" in your selectors.
187
+ #
188
+ # The ampersand is automatically replaced by the parent selector,
189
+ # instead of having it prepended.
190
+ # This allows you to cleanly create pseudo-attributes:
191
+ #
192
+ # a
193
+ # :font-weight bold
194
+ # :text-decoration none
195
+ # &:hover
196
+ # :text-decoration underline
197
+ # &:visited
198
+ # :font-weight normal
199
+ #
200
+ # Which would become:
201
+ #
202
+ # a {
203
+ # font-weight: bold;
204
+ # text-decoration: none; }
205
+ # a:hover {
206
+ # text-decoration: underline; }
207
+ # a:visited {
208
+ # font-weight: normal; }
209
+ #
210
+ # It also allows you to add selectors at the base of the hierarchy,
211
+ # which can be useuful for targeting certain styles to certain browsers:
212
+ #
213
+ # #main
214
+ # :width 90%
215
+ # #sidebar
216
+ # :float left
217
+ # :margin-left 20%
218
+ # .ie6 &
219
+ # :margin-left 40%
220
+ #
221
+ # Which would become:
222
+ #
223
+ # #main {
224
+ # width: 90%; }
225
+ # #main #sidebar {
226
+ # float: left;
227
+ # margin-left: 20%; }
228
+ # .ie6 #main #sidebar {
229
+ # margin-left: 40%; }
230
+ #
231
+ # === Attribute Namespaces
232
+ #
233
+ # CSS has quite a few attributes that are in "namespaces;"
234
+ # for instance, "font-family," "font-size," and "font-weight"
235
+ # are all in the "font" namespace.
236
+ # In CSS, if you want to set a bunch of attributes in the same namespace,
237
+ # you have to type it out each time.
238
+ # Sass offers a shortcut for this:
239
+ # just write the namespace one,
240
+ # then indent each of the sub-attributes within it.
241
+ # For example:
242
+ #
243
+ # .funky
244
+ # :font
245
+ # :family fantasy
246
+ # :size 30em
247
+ # :weight bold
248
+ #
249
+ # is compiled to:
250
+ #
251
+ # .funky {
252
+ # font-family: fantasy;
253
+ # font-size: 30em;
254
+ # font-weight: bold; }
255
+ #
256
+ # == Constants
257
+ #
258
+ # Sass has support for setting document-wide constants.
259
+ # They're set using an exclamation mark followed by the name,
260
+ # an equals sign, and the value.
261
+ # An attribute can then be set to the value of a constant
262
+ # by following it with another equals sign.
263
+ # For example:
264
+ #
265
+ # !main_color = #00ff00
266
+ #
267
+ # #main
268
+ # :color = !main_color
269
+ # :p
270
+ # :background-color = !main_color
271
+ # :color #000000
272
+ #
273
+ # is compiled to:
274
+ #
275
+ # #main {
276
+ # color: #00ff00; }
277
+ # #main p {
278
+ # background-color: #00ff00;
279
+ # color: #000000; }
280
+ #
281
+ # === Arithmetic
282
+ #
283
+ # You can even do basic arithmetic with constants.
284
+ # Sass recognizes numbers, colors,
285
+ # lengths (numbers with units),
286
+ # and strings (everything that's not one of the above),
287
+ # and various operators that work on various values.
288
+ # All the normal arithmetic operators
289
+ # (+, -, *, /, %, and parentheses for grouping)
290
+ # are defined as usual
291
+ # for numbers, colors, and lengths.
292
+ # The "+" operator is also defined for Strings
293
+ # as the concatenation operator.
294
+ # For example:
295
+ #
296
+ # !main_width = 10
297
+ # !unit1 = em
298
+ # !unit2 = px
299
+ # !bg_color = #a5f39e
300
+ #
301
+ # #main
302
+ # :background-color = !bg_color
303
+ # p
304
+ # :background-color = !bg_color + #202020
305
+ # :width = !main_width + !unit1
306
+ # img.thumb
307
+ # :width = (!main_width + 15) + !unit2
308
+ #
309
+ # is compiled to:
310
+ #
311
+ # #main {
312
+ # background-color: #a5f39e; }
313
+ # #main p {
314
+ # background-color: #c5ffbe;
315
+ # width: 10em; }
316
+ # #main img.thumb {
317
+ # width: 25em; }
318
+ #
319
+ # === Colors
320
+ #
321
+ # Colors may be written as three- or six-digit hex numbers prefixed
322
+ # by a pound sign (#), or as HTML4 color names. For example,
323
+ # "#ff0", "#ffff00" and "yellow" all refer to the same color.
324
+ #
325
+ # Not only can arithmetic be done between colors and other colors,
326
+ # but it can be done between colors and normal numbers.
327
+ # In this case, the operation is done piecewise one each of the
328
+ # Red, Green, and Blue components of the color.
329
+ # For example:
330
+ #
331
+ # !main_color = #a5f39e
332
+ #
333
+ # #main
334
+ # :background-color = !main_color
335
+ # p
336
+ # :background-color = !main_color + 32
337
+ #
338
+ # is compiled to:
339
+ #
340
+ # #main {
341
+ # background-color: #a5f39e; }
342
+ # #main p {
343
+ # background-color: #c5ffbe; }
344
+ #
345
+ # === Strings
346
+ #
347
+ # Strings are the type that's used by default
348
+ # when an element in a bit of constant arithmetic isn't recognized
349
+ # as another type of constant.
350
+ # However, they can also be created explicitly be wrapping a section of code with quotation marks.
351
+ # Inside the quotation marks,
352
+ # a backslash can be used to
353
+ # escape quotation marks that you want to appear in the CSS.
354
+ # For example:
355
+ #
356
+ # !content = "Hello, \"Hubert\" Bean."
357
+ #
358
+ # #main
359
+ # :content = "string(" + !content + ")"
360
+ #
361
+ # is compiled to:
362
+ #
363
+ # #main {
364
+ # content: string(Hello, "Hubert" Bean.) }
365
+ #
366
+ # === Optional Assignment
367
+ #
368
+ # You can assign Sass constants if they aren't already assigned
369
+ # using the ||= assignment operator.
370
+ # This means that if the constant has already been assigned to,
371
+ # it won't be re-assigned,
372
+ # but if it doesn't have a value yet,
373
+ # it will be given one.
374
+ # For example:
375
+ #
376
+ # !content = "First content"
377
+ # !content ||= "Second content?"
378
+ #
379
+ # #main
380
+ # content = content
381
+ #
382
+ # is compiled to:
383
+ #
384
+ # #main {
385
+ # content: First content; }
386
+ #
387
+ # However,
388
+ #
389
+ # !content ||= "Second content?"
390
+ #
391
+ # #main
392
+ # content = content
393
+ #
394
+ # is compiled to:
395
+ #
396
+ # #main {
397
+ # content: Second content?; }
398
+ #
399
+ # === Default Concatenation
400
+ #
401
+ # All those plusses and quotes for concatenating strings
402
+ # can get pretty messy, though.
403
+ # Most of the time, if you want to concatenate stuff,
404
+ # you just want individual values with spaces in between them.
405
+ # Thus, in Sass, when two values are next to each other without an operator,
406
+ # they're simply joined with a space.
407
+ # For example:
408
+ #
409
+ # !font_family = "sans-serif"
410
+ # !main_font_size = 1em
411
+ #
412
+ # #main
413
+ # :font
414
+ # :family = !font_family
415
+ # :size = !main_font_size
416
+ # h6
417
+ # :font = italic "small-caps" bold (!main_font_size + 0.1em) !font_family
418
+ #
419
+ # is compiled to:
420
+ #
421
+ # #main {
422
+ # font-family: sans-serif;
423
+ # font-size: 1em; }
424
+ # #main h6 {
425
+ # font: italic small-caps bold 1.1em sans-serif; }
426
+ #
427
+ # == Directives
428
+ #
429
+ # Directives allow the author to directly issue instructions to the Sass compiler.
430
+ # They're prefixed with an at sign, "<tt>@</tt>",
431
+ # followed by the name of the directive,
432
+ # a space, and any arguments to it -
433
+ # just like CSS directives.
434
+ # For example:
435
+ #
436
+ # @import red.sass
437
+ #
438
+ # === Import
439
+ #
440
+ # Currently, the only directive is the "import" directive.
441
+ # It works in a very similar way to the CSS import directive,
442
+ # and sometimes compiles to a literal CSS "@import".
443
+ #
444
+ # Sass can import either other Sass files or plain CSS files.
445
+ # If it imports a Sass file,
446
+ # not only are the rules from that file included,
447
+ # but all constants in that file are made available in the current file.
448
+ #
449
+ # Sass looks for other Sass files in the working directory,
450
+ # and the Sass file directory under Rails or Merb.
451
+ # Additional search directories may be specified
452
+ # using the :load_paths option (see below).
453
+ #
454
+ # Sass can also import plain CSS files.
455
+ # In this case, it doesn't literally include the content of the files;
456
+ # rather, it uses the built-in CSS "@import" directive to tell the client program
457
+ # to import the files.
458
+ #
459
+ # The import directive can take either a full filename
460
+ # or a filename without an extension.
461
+ # If an extension isn't provided,
462
+ # Sass will try to find a Sass file with the given basename in the load paths,
463
+ # and, failing that, will assume a relevant CSS file will be available.
464
+ #
465
+ # For example,
466
+ #
467
+ # @import foo.sass
468
+ #
469
+ # would compile to
470
+ #
471
+ # .foo
472
+ # :color #f00
473
+ #
474
+ # whereas
475
+ #
476
+ # @import foo.css
477
+ #
478
+ # would compile to
479
+ #
480
+ # @import foo.css
481
+ #
482
+ # Finally,
483
+ #
484
+ # @import foo
485
+ #
486
+ # might compile to either,
487
+ # depending on whether a file called "foo.sass" existed.
488
+ #
489
+ # === @font-face, @media, etc.
490
+ #
491
+ # Sass behaves as you'd expect for normal CSS @-directives.
492
+ # For example:
493
+ #
494
+ # @font-face
495
+ # font-family: "Bitstream Vera Sans"
496
+ # src: url(http://foo.bar/bvs")
497
+ #
498
+ # compiles to:
499
+ #
500
+ # @font-face {
501
+ # font-family: "Bitstream Vera Sans";
502
+ # src: url(http://foo.bar/bvs"); }
503
+ #
504
+ # and
505
+ #
506
+ # @media print
507
+ # #sidebar
508
+ # display: none
509
+ #
510
+ # #main
511
+ # background-color: white
512
+ #
513
+ # compiles to:
514
+ #
515
+ # @media print {
516
+ # #sidebar {
517
+ # display: none; }
518
+ #
519
+ # #main {
520
+ # background-color: white; }
521
+ # }
522
+ #
523
+ # == Comments
524
+ #
525
+ # === Silent Comments
526
+ #
527
+ # It's simple to add "silent" comments,
528
+ # which don't output anything to the CSS document,
529
+ # to a Sass document.
530
+ # Simply use the familiar C-style notation for a one-line comment, "//",
531
+ # at the normal indentation level and all text following it won't be output.
532
+ # For example:
533
+ #
534
+ # // A very awesome rule.
535
+ # #awesome.rule
536
+ # // An equally awesome attribute.
537
+ # :awesomeness very
538
+ #
539
+ # becomes
540
+ #
541
+ # #awesome.rule {
542
+ # awesomeness: very; }
543
+ #
544
+ # You can also nest text beneath a comment to comment out a whole block.
545
+ # For example:
546
+ #
547
+ # // A very awesome rule
548
+ # #awesome.rule
549
+ # // Don't use these attributes
550
+ # color: green
551
+ # font-size: 10em
552
+ # color: red
553
+ #
554
+ # becomes
555
+ #
556
+ # #awesome.rule {
557
+ # color: red; }
558
+ #
559
+ # === Loud Comments
560
+ #
561
+ # "Loud" comments are just as easy as silent ones.
562
+ # These comments output to the document as CSS comments,
563
+ # and thus use the same opening sequence: "/*".
564
+ # For example:
565
+ #
566
+ # /* A very awesome rule.
567
+ # #awesome.rule
568
+ # /* An equally awesome attribute.
569
+ # :awesomeness very
570
+ #
571
+ # becomes
572
+ #
573
+ # /* A very awesome rule. */
574
+ # #awesome.rule {
575
+ # /* An equally awesome attribute. */
576
+ # awesomeness: very; }
577
+ #
578
+ # You can also nest content beneath loud comments. For example:
579
+ #
580
+ # #pbj
581
+ # /* This rule describes
582
+ # the styling of the element
583
+ # that represents
584
+ # a peanut butter and jelly sandwich.
585
+ # :background-image url(/images/pbj.png)
586
+ # :color red
587
+ #
588
+ # becomes
589
+ #
590
+ # #pbj {
591
+ # /* This rule describes
592
+ # * the styling of the element
593
+ # * that represents
594
+ # * a peanut butter and jelly sandwich. */
595
+ # background-image: url(/images/pbj.png);
596
+ # color: red; }
597
+ #
598
+ # == Mixins
599
+ #
600
+ # Mixins enable you to define groups of CSS attributes and
601
+ # then include them inline in any number of selectors
602
+ # throughout the document.
603
+ #
604
+ # === Defining a Mixin
605
+ #
606
+ # To define a mixin you use a slightly modified form of selector syntax.
607
+ # For example the 'large-text' mixin is defined as follows:
608
+ #
609
+ # =large-text
610
+ # :font
611
+ # :family Arial
612
+ # :size 20px
613
+ # :weight bold
614
+ # :color #ff0000
615
+ #
616
+ # The initial '=' marks this as a mixin rather than a standard selector.
617
+ # The CSS rules that follow won't be included until the mixin is referenced later on.
618
+ # Anything you can put into a standard selector,
619
+ # you can put into a mixin definition. e.g.
620
+ #
621
+ # =clearfix
622
+ # display: inline-block
623
+ # &:after
624
+ # content: "."
625
+ # display: block
626
+ # height: 0
627
+ # clear: both
628
+ # visibility: hidden
629
+ # * html &
630
+ # height: 1px
631
+ #
632
+ #
633
+ # === Mixing it in
634
+ #
635
+ # Inlining a defined mixin is simple,
636
+ # just prepend a '+' symbol to the name of a mixin defined earlier in the document.
637
+ # So to inline the 'large-text' defined earlier,
638
+ # we include the statment '+large-text' in our selector definition thus:
639
+ #
640
+ # .page-title
641
+ # +large-text
642
+ # :padding 4px
643
+ # :margin
644
+ # :top 10px
645
+ #
646
+ #
647
+ # This will produce the following CSS output:
648
+ #
649
+ # .page-title {
650
+ # font-family: Arial;
651
+ # font-size: 20px;
652
+ # font-weight: bold;
653
+ # color: #ff0000;
654
+ # padding: 4px;
655
+ # margin-top: 10px;
656
+ # }
657
+ #
658
+ # Any number of mixins may be defined and there is no limit on
659
+ # the number that can be included in a particular selector.
660
+ #
661
+ # Mixin definitions can also include references to other mixins defined earlier in the file.
662
+ # E.g.
663
+ #
664
+ # =highlighted-background
665
+ # background:
666
+ # color: #fc0
667
+ # =header-text
668
+ # font:
669
+ # size: 20px
670
+ #
671
+ # =compound
672
+ # +highlighted-background
673
+ # +header-text
674
+ #
675
+ #
676
+ # == Output Style
677
+ #
678
+ # Although the default CSS style that Sass outputs is very nice,
679
+ # and reflects the structure of the document in a similar way that Sass does,
680
+ # sometimes it's good to have other formats available.
681
+ #
682
+ # Sass allows you to choose between three different output styles
683
+ # by setting the <tt>:style</tt> option.
684
+ # In Rails, this is done by setting <tt>Sass::Plugin.options[:style]</tt>;
685
+ # outside Rails, it's done by passing an options hash with </tt>:style</tt> set.
686
+ #
687
+ # === <tt>:nested</tt>
688
+ #
689
+ # Nested style is the default Sass style,
690
+ # because it reflects the structure of the document
691
+ # in much the same way Sass does.
692
+ # Each attribute has its own line,
693
+ # but the indentation isn't constant.
694
+ # Each rule is indented based on how deeply it's nested.
695
+ # For example:
696
+ #
697
+ # #main {
698
+ # color: #fff;
699
+ # background-color: #000; }
700
+ # #main p {
701
+ # width: 10em; }
702
+ #
703
+ # .huge {
704
+ # font-size: 10em;
705
+ # font-weight: bold;
706
+ # text-decoration: underline; }
707
+ #
708
+ # Nested style is very useful when looking at large CSS files
709
+ # for the same reason Sass is useful for making them:
710
+ # it allows you to very easily grasp the structure of the file
711
+ # without actually reading anything.
712
+ #
713
+ # === <tt>:expanded</tt>
714
+ #
715
+ # Expanded is the typical human-made CSS style,
716
+ # with each attribute and rule taking up one line.
717
+ # Attributes are indented within the rules,
718
+ # but the rules aren't indented in any special way.
719
+ # For example:
720
+ #
721
+ # #main {
722
+ # color: #fff;
723
+ # background-color: #000;
724
+ # }
725
+ # #main p {
726
+ # width: 10em;
727
+ # }
728
+ #
729
+ # .huge {
730
+ # font-size: 10em;
731
+ # font-weight: bold;
732
+ # text-decoration: underline;
733
+ # }
734
+ #
735
+ # === <tt>:compact</tt>
736
+ #
737
+ # Compact style, as the name would imply,
738
+ # takes up less space than Nested or Expanded.
739
+ # However, it's also harder to read.
740
+ # Each CSS rule takes up only one line,
741
+ # with every attribute defined on that line.
742
+ # Nested rules are placed next to each other with no newline,
743
+ # while groups of rules have newlines between them.
744
+ # For example:
745
+ #
746
+ # #main { color: #fff; background-color: #000; }
747
+ # #main p { width: 10em; }
748
+ #
749
+ # .huge { font-size: 10em; font-weight: bold; text-decoration: underline; }
750
+ #
751
+ # === <tt>:compressed</tt>
752
+ #
753
+ # Compressed style takes up the minimum amount of space possible,
754
+ # having no whitespace except that necessary to separate selectors
755
+ # and a newline at the end of the file.
756
+ # It's not meant to be human-readable.
757
+ # For example:
758
+ #
759
+ # #main{color:#fff;background-color:#000}#main p{width:10em}.huge{font-size:10em;font-weight:bold;text-decoration:underline}
760
+ #
761
+ # == Sass Options
762
+ #
763
+ # Options can be set by setting the hash <tt>Sass::Plugin.options</tt>
764
+ # from <tt>environment.rb</tt> in Rails,
765
+ # or by passing an options hash to Sass::Engine.
766
+ # Available options are:
767
+ #
768
+ # [<tt>:style</tt>] Sets the style of the CSS output.
769
+ # See the section on Output Style, above.
770
+ #
771
+ # [<tt>:attribute_syntax</tt>] Forces the document to use one syntax for attributes.
772
+ # If the correct syntax isn't used, an error is thrown.
773
+ # <tt>:normal</tt> forces the use of a colon
774
+ # before the attribute name.
775
+ # For example: <tt>:color #0f3</tt>
776
+ # or <tt>:width = !main_width</tt>.
777
+ # <tt>:alternate</tt> forces the use of a colon or equals sign
778
+ # after the attribute name.
779
+ # For example: <tt>color: #0f3</tt>
780
+ # or <tt>width = !main_width</tt>.
781
+ # By default, either syntax is valid.
782
+ #
783
+ # [<tt>:never_update</tt>] Whether the CSS files should never be updated,
784
+ # even if the template file changes.
785
+ # Setting this to true may give small performance gains.
786
+ # It always defaults to false.
787
+ # Only has meaning within Ruby on Rails or Merb.
788
+ #
789
+ # [<tt>:always_update</tt>] Whether the CSS files should be updated every
790
+ # time a controller is accessed,
791
+ # as opposed to only when the template has been modified.
792
+ # Defaults to false.
793
+ # Only has meaning within Ruby on Rails or Merb.
794
+ #
795
+ # [<tt>:always_check</tt>] Whether a Sass template should be checked for updates every
796
+ # time a controller is accessed,
797
+ # as opposed to only when the Rails server starts.
798
+ # If a Sass template has been updated,
799
+ # it will be recompiled and will overwrite the corresponding CSS file.
800
+ # Defaults to false in production mode, true otherwise.
801
+ # Only has meaning within Ruby on Rails or Merb.
802
+ #
803
+ # [<tt>:full_exception</tt>] Whether an error in the Sass code
804
+ # should cause Sass to provide a detailed description.
805
+ # If set to true, the specific error will be displayed
806
+ # along with a line number and source snippet.
807
+ # Otherwise, a simple uninformative error message will be displayed.
808
+ # Defaults to false in production mode, true otherwise.
809
+ # Only has meaning within Ruby on Rails or Merb.
810
+ #
811
+ # [<tt>:template_location</tt>] The directory where Sass templates should be read from.
812
+ # Defaults to <tt>RAILS_ROOT + "/public/stylesheets/sass"</tt>
813
+ # or <tt>MERB_ROOT + "/public/stylesheets/sass"</tt>.
814
+ # Only has meaning within Ruby on Rails or Merb.
815
+ #
816
+ # [<tt>:css_location</tt>] The directory where CSS output should be written to.
817
+ # Defaults to <tt>RAILS_ROOT + "/public/stylesheets"</tt>
818
+ # or <tt>MERB_ROOT + "/public/stylesheets"</tt>.
819
+ # Only has meaning within Ruby on Rails or Merb.
820
+ #
821
+ # [<tt>:filename</tt>] The filename of the file being rendered.
822
+ # This is used solely for reporting errors,
823
+ # and is automatically set when using Rails or Merb.
824
+ #
825
+ # [<tt>:load_paths</tt>] An array of filesystem paths which should be searched
826
+ # for Sass templates imported with the "@import" directive.
827
+ # This defaults to the working directory and, in Rails or Merb,
828
+ # whatever <tt>:template_location</tt> is.
829
+ #
830
+ module Sass; end
831
+
832
+ require 'sass/engine'
833
+ require 'sass/plugin' if defined?(Merb::Plugins)