classiccms 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/classiccms/application.rb +2 -3
- data/lib/classiccms/cli.rb +6 -0
- data/lib/classiccms/scaffold/Gemfile +4 -0
- data/lib/classiccms/{mongoid.yml → scaffold/config/mongoid.yml} +3 -4
- data/lib/classiccms/scaffold/spec/models/article_spec.rb +8 -0
- data/lib/classiccms/scaffold/spec/spec_helper.rb +24 -0
- data/lib/classiccms/version.rb +1 -1
- data/spec/cli_spec.rb +8 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/build/v8/libv8.a +0 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/build/v8/libv8preparser.a +0 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-debug.h +395 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-preparser.h +117 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-profiler.h +505 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-testing.h +104 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8.h +4124 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8stdint.h +53 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/version.rb +6 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8.rb +15 -0
- data/vendor/bundle/gems/sass-3.1.19/.yardopts +11 -0
- data/vendor/bundle/gems/sass-3.1.19/CONTRIBUTING +3 -0
- data/vendor/bundle/gems/sass-3.1.19/MIT-LICENSE +20 -0
- data/vendor/bundle/gems/sass-3.1.19/README.md +200 -0
- data/vendor/bundle/gems/sass-3.1.19/REVISION +1 -0
- data/vendor/bundle/gems/sass-3.1.19/Rakefile +339 -0
- data/vendor/bundle/gems/sass-3.1.19/VERSION +1 -0
- data/vendor/bundle/gems/sass-3.1.19/VERSION_NAME +1 -0
- data/vendor/bundle/gems/sass-3.1.19/bin/sass +8 -0
- data/vendor/bundle/gems/sass-3.1.19/bin/sass-convert +7 -0
- data/vendor/bundle/gems/sass-3.1.19/bin/scss +8 -0
- data/vendor/bundle/gems/sass-3.1.19/extra/update_watch.rb +13 -0
- data/vendor/bundle/gems/sass-3.1.19/init.rb +18 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/base.rb +86 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/chain.rb +33 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/filesystem.rb +61 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/memory.rb +47 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/null.rb +25 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores.rb +15 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/callbacks.rb +66 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/css.rb +390 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/engine.rb +880 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/environment.rb +180 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/error.rb +201 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/exec.rb +682 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/importers/base.rb +139 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/importers/filesystem.rb +149 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/importers.rb +22 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/less.rb +382 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/logger/base.rb +32 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/logger/log_level.rb +49 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/logger.rb +15 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/compiler.rb +384 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/configuration.rb +123 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/generic.rb +15 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/merb.rb +48 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/rack.rb +60 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/rails.rb +47 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/staleness_checker.rb +183 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin.rb +132 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/railtie.rb +9 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/repl.rb +57 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/root.rb +7 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/bool.rb +18 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/color.rb +475 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/css_lexer.rb +29 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/css_parser.rb +31 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/funcall.rb +175 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/functions.rb +1381 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/interpolation.rb +79 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/lexer.rb +337 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/list.rb +84 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/literal.rb +230 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/node.rb +99 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/number.rb +452 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/operation.rb +107 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/parser.rb +474 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/string.rb +51 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/string_interpolation.rb +103 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/unary_operation.rb +64 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/variable.rb +58 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script.rb +39 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/css_parser.rb +46 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/parser.rb +1055 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/rx.rb +137 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/sass_parser.rb +11 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/script_lexer.rb +15 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/script_parser.rb +25 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/static_parser.rb +40 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss.rb +17 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/abstract_sequence.rb +71 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/comma_sequence.rb +86 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/sequence.rb +296 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/simple.rb +119 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/simple_sequence.rb +154 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector.rb +373 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/shared.rb +76 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/charset_node.rb +22 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/comment_node.rb +90 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/debug_node.rb +18 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/directive_node.rb +28 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/each_node.rb +24 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/extend_node.rb +29 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/for_node.rb +36 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/function_node.rb +27 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/if_node.rb +52 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/import_node.rb +68 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/media_node.rb +32 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/mixin_def_node.rb +27 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/mixin_node.rb +32 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/node.rb +188 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/prop_node.rb +148 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/return_node.rb +18 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/root_node.rb +28 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/rule_node.rb +127 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/variable_node.rb +30 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/base.rb +75 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/check_nesting.rb +127 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/convert.rb +262 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/cssize.rb +206 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/deep_copy.rb +87 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/extend.rb +42 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/perform.rb +357 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/set_options.rb +97 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/to_css.rb +219 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/warn_node.rb +18 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/while_node.rb +18 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/util/multibyte_string_scanner.rb +134 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/util/subset_map.rb +101 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/util.rb +800 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/version.rb +112 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass.rb +73 -0
- data/vendor/bundle/gems/sass-3.1.19/rails/init.rb +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/Gemfile +4 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/cache_test.rb +89 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/callbacks_test.rb +61 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/conversion_test.rb +1245 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/css2sass_test.rb +397 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/data/hsl-rgb.txt +319 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/engine_test.rb +2730 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/extend_test.rb +1663 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/fixtures/test_staleness_check_across_importers.css +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/fixtures/test_staleness_check_across_importers.scss +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/functions_test.rb +1047 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/importer_test.rb +192 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/less_conversion_test.rb +653 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/logger_test.rb +58 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/mock_importer.rb +49 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/more_results/more1.css +9 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/more_results/more1_with_line_comments.css +26 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/more_results/more_import.css +29 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/more_templates/_more_partial.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/more_templates/more1.sass +23 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/more_templates/more_import.sass +11 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/plugin_test.rb +496 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/alt.css +4 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/basic.css +9 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/compact.css +5 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/complex.css +86 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/compressed.css +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/expanded.css +19 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/if.css +3 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import.css +31 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import_charset.css +5 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import_charset_1_8.css +5 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import_charset_ibm866.css +5 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/line_numbers.css +49 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/mixins.css +95 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/multiline.css +24 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/nested.css +22 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/options.css +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/parent_ref.css +13 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/script.css +16 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/scss_import.css +31 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/scss_importee.css +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/subdir/subdir.css +3 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/units.css +11 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/warn.css +0 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/warn_imported.css +0 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/script_conversion_test.rb +285 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/script_test.rb +519 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/css_test.rb +975 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/rx_test.rb +156 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/scss_test.rb +1308 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/test_helper.rb +37 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_double_import_loop2.sass +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_imported_charset_ibm866.sass +4 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_imported_charset_utf8.sass +4 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_partial.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/alt.sass +16 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/basic.sass +23 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork1.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork2.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork3.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork4.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork5.sass +3 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/compact.sass +17 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/complex.sass +305 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/compressed.sass +15 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/double_import_loop1.sass +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/expanded.sass +17 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/if.sass +11 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import.sass +12 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import_charset.sass +9 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import_charset_1_8.sass +6 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import_charset_ibm866.sass +11 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/importee.less +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/importee.sass +19 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/line_numbers.sass +13 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/mixin_bork.sass +5 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/mixins.sass +76 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/multiline.sass +20 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested.sass +25 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork1.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork2.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork3.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork4.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork5.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_import.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_mixin_bork.sass +6 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/options.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/parent_ref.sass +25 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/script.sass +101 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/scss_import.scss +11 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/scss_importee.scss +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/single_import_loop.sass +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/subdir/subdir.sass +6 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/units.sass +11 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/warn.sass +3 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/warn_imported.sass +4 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/test_helper.rb +8 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/util/multibyte_string_scanner_test.rb +147 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/util/subset_map_test.rb +91 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/util_test.rb +282 -0
- data/vendor/bundle/gems/sass-3.1.19/test/test_helper.rb +70 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/CHANGELOG.md +90 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Gemfile +35 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Guardfile +8 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/LICENSE +20 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/README.md +312 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Rakefile +47 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Vagrantfile +96 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapter.rb +167 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/darwin.rb +84 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/linux.rb +110 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/polling.rb +66 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/windows.rb +81 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/directory_record.rb +317 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/listener.rb +203 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/multi_listener.rb +121 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/turnstile.rb +28 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/version.rb +3 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen.rb +38 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/listen.gemspec +26 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapter_spec.rb +142 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/darwin_spec.rb +31 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/linux_spec.rb +41 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/polling_spec.rb +68 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/windows_spec.rb +24 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/directory_record_spec.rb +1034 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/listener_spec.rb +155 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/multi_listener_spec.rb +156 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/turnstile_spec.rb +56 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen_spec.rb +73 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/spec_helper.rb +16 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/adapter_helper.rb +716 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/directory_record_helper.rb +55 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/fixtures_helper.rb +29 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/listeners_helper.rb +144 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/platform_helper.rb +11 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/.gitignore +13 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/.gitmodules +3 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/.travis.yml +9 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/.yardopts +1 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/Changelog.md +196 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/Gemfile +1 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/README.md +167 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/Rakefile +23 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/bin/therubyracer +11 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/Makefile +213 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/extconf.rb +26 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/gem_make.out +156 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/rr.cpp +189 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/rr.h +41 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8.cpp +48 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_array.cpp +48 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_array.h +8 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_callbacks.cpp +81 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_callbacks.h +8 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_context.cpp +92 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_context.h +6 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_date.cpp +34 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_date.h +6 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_debug.cpp +17 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_debug.h +6 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_exception.cpp +133 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_exception.h +11 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_external.cpp +70 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_external.h +8 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_function.cpp +69 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_function.h +11 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_handle.cpp +186 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_handle.h +48 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_locker.cpp +139 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_locker.h +6 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_message.cpp +67 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_message.h +10 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_object.cpp +122 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_object.h +10 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_script.cpp +36 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_script.h +8 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_string.cpp +52 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_string.h +9 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_template.cpp +344 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_template.h +8 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_try_catch.cpp +70 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_try_catch.h +5 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_v8.cpp +35 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_v8.h +6 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_value.cpp +175 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_value.h +10 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_weakref.cpp +61 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_weakref.h +29 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/access.rb +87 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/array.rb +17 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/c/locker.rb +18 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/cli.rb +133 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/context.rb +111 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/error.rb +130 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/function.rb +44 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/object.rb +69 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/caller.rb +37 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/constructor.rb +98 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/function.rb +63 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/interceptors.rb +152 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/proxies.rb +151 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/templates.rb +73 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal.rb +86 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/stack.rb +66 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/tap.rb +9 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/version.rb +3 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8.rb +23 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/array_spec.rb +15 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/cxt_spec.rb +57 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/ext_spec_helper.rb +27 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/func_spec.rb +64 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/object_spec.rb +10 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/string_spec.rb +11 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/try_catch_spec.rb +60 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/.gitignore +1 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/README.txt +8 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/jsapi_spec.rb +922 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/loadme.js +1 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs_helper.rb +3 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/spec_helper.rb +9 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/v8/error_spec.rb +131 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/v8/portal/proxies_spec.rb +106 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/specmem/handle_memspec.rb +41 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/specmem/object_memspec.rb +14 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/specmem/proxies_memspec.rb +49 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/specmem/spec_helper.rb +24 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/specthread/spec_helper.rb +2 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/specthread/threading_spec.rb +13 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/thefrontside.png +0 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/therubyracer.gemspec +29 -0
- data/vendor/bundle/specifications/libv8-3.3.10.4-x86_64-darwin-11.gemspec +33 -0
- data/vendor/bundle/specifications/sass-3.1.19.gemspec +35 -0
- metadata +365 -3
@@ -0,0 +1,60 @@
|
|
1
|
+
module Sass
|
2
|
+
module Plugin
|
3
|
+
# Rack middleware for compiling Sass code.
|
4
|
+
#
|
5
|
+
# ## Activate
|
6
|
+
#
|
7
|
+
# require 'sass/plugin/rack'
|
8
|
+
# use Sass::Plugin::Rack
|
9
|
+
#
|
10
|
+
# ## Customize
|
11
|
+
#
|
12
|
+
# Sass::Plugin.options.merge(
|
13
|
+
# :cache_location => './tmp/sass-cache',
|
14
|
+
# :never_update => environment != :production,
|
15
|
+
# :full_exception => environment != :production)
|
16
|
+
#
|
17
|
+
# {file:SASS_REFERENCE.md#options See the Reference for more options}.
|
18
|
+
#
|
19
|
+
# ## Use
|
20
|
+
#
|
21
|
+
# Put your Sass files in `public/stylesheets/sass`.
|
22
|
+
# Your CSS will be generated in `public/stylesheets`,
|
23
|
+
# and regenerated every request if necessary.
|
24
|
+
# The locations and frequency {file:SASS_REFERENCE.md#options can be customized}.
|
25
|
+
# That's all there is to it!
|
26
|
+
class Rack
|
27
|
+
# The delay, in seconds, between update checks.
|
28
|
+
# Useful when many resources are requested for a single page.
|
29
|
+
# `nil` means no delay at all.
|
30
|
+
#
|
31
|
+
# @return [Float]
|
32
|
+
attr_accessor :dwell
|
33
|
+
|
34
|
+
# Initialize the middleware.
|
35
|
+
#
|
36
|
+
# @param app [#call] The Rack application
|
37
|
+
# @param dwell [Float] See \{#dwell}
|
38
|
+
def initialize(app, dwell = 1.0)
|
39
|
+
@app = app
|
40
|
+
@dwell = dwell
|
41
|
+
@check_after = Time.now.to_f
|
42
|
+
end
|
43
|
+
|
44
|
+
# Process a request, checking the Sass stylesheets for changes
|
45
|
+
# and updating them if necessary.
|
46
|
+
#
|
47
|
+
# @param env The Rack request environment
|
48
|
+
# @return [(#to_i, {String => String}, Object)] The Rack response
|
49
|
+
def call(env)
|
50
|
+
if @dwell.nil? || Time.now.to_f > @check_after
|
51
|
+
Sass::Plugin.check_for_updates
|
52
|
+
@check_after = Time.now.to_f + @dwell if @dwell
|
53
|
+
end
|
54
|
+
@app.call(env)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
require 'sass/plugin'
|
@@ -0,0 +1,47 @@
|
|
1
|
+
unless defined?(Sass::RAILS_LOADED)
|
2
|
+
Sass::RAILS_LOADED = true
|
3
|
+
|
4
|
+
module Sass::Plugin::Configuration
|
5
|
+
# Different default options in a rails envirionment.
|
6
|
+
def default_options
|
7
|
+
return @default_options if @default_options
|
8
|
+
opts = {
|
9
|
+
:quiet => Sass::Util.rails_env != "production",
|
10
|
+
:full_exception => Sass::Util.rails_env != "production",
|
11
|
+
:cache_location => Sass::Util.rails_root + '/tmp/sass-cache'
|
12
|
+
}
|
13
|
+
|
14
|
+
opts.merge!(
|
15
|
+
:always_update => false,
|
16
|
+
:template_location => Sass::Util.rails_root + '/public/stylesheets/sass',
|
17
|
+
:css_location => Sass::Util.rails_root + '/public/stylesheets',
|
18
|
+
:always_check => Sass::Util.rails_env == "development")
|
19
|
+
|
20
|
+
@default_options = opts.freeze
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
Sass::Plugin.options.reverse_merge!(Sass::Plugin.default_options)
|
25
|
+
|
26
|
+
# Rails 3.1 loads and handles Sass all on its own
|
27
|
+
if defined?(ActionController::Metal)
|
28
|
+
# 3.1 > Rails >= 3.0
|
29
|
+
require 'sass/plugin/rack'
|
30
|
+
Rails.configuration.middleware.use(Sass::Plugin::Rack)
|
31
|
+
elsif defined?(ActionController::Dispatcher) &&
|
32
|
+
defined?(ActionController::Dispatcher.middleware)
|
33
|
+
# Rails >= 2.3
|
34
|
+
require 'sass/plugin/rack'
|
35
|
+
ActionController::Dispatcher.middleware.use(Sass::Plugin::Rack)
|
36
|
+
else
|
37
|
+
module ActionController
|
38
|
+
class Base
|
39
|
+
alias_method :sass_old_process, :process
|
40
|
+
def process(*args)
|
41
|
+
Sass::Plugin.check_for_updates
|
42
|
+
sass_old_process(*args)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,183 @@
|
|
1
|
+
module Sass
|
2
|
+
module Plugin
|
3
|
+
# The class handles `.s[ca]ss` file staleness checks via their mtime timestamps.
|
4
|
+
#
|
5
|
+
# To speed things up two level of caches are employed:
|
6
|
+
#
|
7
|
+
# * A class-level dependency cache which stores @import paths for each file.
|
8
|
+
# This is a long-lived cache that is reused by every StalenessChecker instance.
|
9
|
+
# * Three short-lived instance-level caches, one for file mtimes,
|
10
|
+
# one for whether a file is stale during this particular run.
|
11
|
+
# and one for the parse tree for a file.
|
12
|
+
# These are only used by a single StalenessChecker instance.
|
13
|
+
#
|
14
|
+
# Usage:
|
15
|
+
#
|
16
|
+
# * For a one-off staleness check of a single `.s[ca]ss` file,
|
17
|
+
# the class-level {stylesheet_needs_update?} method
|
18
|
+
# should be used.
|
19
|
+
# * For a series of staleness checks (e.g. checking all files for staleness)
|
20
|
+
# a StalenessChecker instance should be created,
|
21
|
+
# and the instance-level \{#stylesheet\_needs\_update?} method should be used.
|
22
|
+
# the caches should make the whole process significantly faster.
|
23
|
+
# *WARNING*: It is important not to retain the instance for too long,
|
24
|
+
# as its instance-level caches are never explicitly expired.
|
25
|
+
class StalenessChecker
|
26
|
+
@dependencies_cache = {}
|
27
|
+
|
28
|
+
class << self
|
29
|
+
# TODO: attach this to a compiler instance.
|
30
|
+
# @private
|
31
|
+
attr_accessor :dependencies_cache
|
32
|
+
end
|
33
|
+
|
34
|
+
# Creates a new StalenessChecker
|
35
|
+
# for checking the staleness of several stylesheets at once.
|
36
|
+
#
|
37
|
+
# @param options [{Symbol => Object}]
|
38
|
+
# See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
|
39
|
+
def initialize(options)
|
40
|
+
@dependencies = self.class.dependencies_cache
|
41
|
+
|
42
|
+
# URIs that are being actively checked for staleness. Protects against
|
43
|
+
# import loops.
|
44
|
+
@actively_checking = Set.new
|
45
|
+
|
46
|
+
# Entries in the following instance-level caches are never explicitly expired.
|
47
|
+
# Instead they are supposed to automaticaly go out of scope when a series of staleness checks
|
48
|
+
# (this instance of StalenessChecker was created for) is finished.
|
49
|
+
@mtimes, @dependencies_stale, @parse_trees = {}, {}, {}
|
50
|
+
@options = Sass::Engine.normalize_options(options)
|
51
|
+
end
|
52
|
+
|
53
|
+
# Returns whether or not a given CSS file is out of date
|
54
|
+
# and needs to be regenerated.
|
55
|
+
#
|
56
|
+
# @param css_file [String] The location of the CSS file to check.
|
57
|
+
# @param template_file [String] The location of the Sass or SCSS template
|
58
|
+
# that is compiled to `css_file`.
|
59
|
+
# @return [Boolean] Whether the stylesheet needs to be updated.
|
60
|
+
def stylesheet_needs_update?(css_file, template_file, importer = nil)
|
61
|
+
template_file = File.expand_path(template_file)
|
62
|
+
begin
|
63
|
+
css_mtime = File.mtime(css_file)
|
64
|
+
rescue Errno::ENOENT
|
65
|
+
return true
|
66
|
+
end
|
67
|
+
stylesheet_modified_since?(template_file, css_mtime, importer)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Returns whether a Sass or SCSS stylesheet has been modified since a given time.
|
71
|
+
#
|
72
|
+
# @param template_file [String] The location of the Sass or SCSS template.
|
73
|
+
# @param mtime [Fixnum] The modification time to check against.
|
74
|
+
# @param importer [Sass::Importers::Base] The importer used to locate the stylesheet.
|
75
|
+
# Defaults to the filesystem importer.
|
76
|
+
# @return [Boolean] Whether the stylesheet has been modified.
|
77
|
+
def stylesheet_modified_since?(template_file, mtime, importer = nil)
|
78
|
+
importer ||= @options[:filesystem_importer].new(".")
|
79
|
+
dependency_updated?(mtime).call(template_file, importer)
|
80
|
+
end
|
81
|
+
|
82
|
+
# Returns whether or not a given CSS file is out of date
|
83
|
+
# and needs to be regenerated.
|
84
|
+
#
|
85
|
+
# The distinction between this method and the instance-level \{#stylesheet\_needs\_update?}
|
86
|
+
# is that the instance method preserves mtime and stale-dependency caches,
|
87
|
+
# so it's better to use when checking multiple stylesheets at once.
|
88
|
+
#
|
89
|
+
# @param css_file [String] The location of the CSS file to check.
|
90
|
+
# @param template_file [String] The location of the Sass or SCSS template
|
91
|
+
# that is compiled to `css_file`.
|
92
|
+
# @return [Boolean] Whether the stylesheet needs to be updated.
|
93
|
+
def self.stylesheet_needs_update?(css_file, template_file, importer = nil)
|
94
|
+
new(Plugin.engine_options).stylesheet_needs_update?(css_file, template_file, importer)
|
95
|
+
end
|
96
|
+
|
97
|
+
# Returns whether a Sass or SCSS stylesheet has been modified since a given time.
|
98
|
+
#
|
99
|
+
# The distinction between this method and the instance-level \{#stylesheet\_modified\_since?}
|
100
|
+
# is that the instance method preserves mtime and stale-dependency caches,
|
101
|
+
# so it's better to use when checking multiple stylesheets at once.
|
102
|
+
#
|
103
|
+
# @param template_file [String] The location of the Sass or SCSS template.
|
104
|
+
# @param mtime [Fixnum] The modification time to check against.
|
105
|
+
# @param importer [Sass::Importers::Base] The importer used to locate the stylesheet.
|
106
|
+
# Defaults to the filesystem importer.
|
107
|
+
# @return [Boolean] Whether the stylesheet has been modified.
|
108
|
+
def self.stylesheet_modified_since?(template_file, mtime, importer = nil)
|
109
|
+
new(Plugin.engine_options).stylesheet_modified_since?(template_file, mtime, importer)
|
110
|
+
end
|
111
|
+
|
112
|
+
private
|
113
|
+
|
114
|
+
def dependencies_stale?(uri, importer, css_mtime)
|
115
|
+
timestamps = @dependencies_stale[[uri, importer]] ||= {}
|
116
|
+
timestamps.each_pair do |checked_css_mtime, is_stale|
|
117
|
+
if checked_css_mtime <= css_mtime && !is_stale
|
118
|
+
return false
|
119
|
+
elsif checked_css_mtime > css_mtime && is_stale
|
120
|
+
return true
|
121
|
+
end
|
122
|
+
end
|
123
|
+
timestamps[css_mtime] = dependencies(uri, importer).any?(&dependency_updated?(css_mtime))
|
124
|
+
rescue Sass::SyntaxError
|
125
|
+
# If there's an error finding dependencies, default to recompiling.
|
126
|
+
true
|
127
|
+
end
|
128
|
+
|
129
|
+
def mtime(uri, importer)
|
130
|
+
@mtimes[[uri, importer]] ||=
|
131
|
+
begin
|
132
|
+
mtime = importer.mtime(uri, @options)
|
133
|
+
if mtime.nil?
|
134
|
+
@dependencies.delete([uri, importer])
|
135
|
+
nil
|
136
|
+
else
|
137
|
+
mtime
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
def dependencies(uri, importer)
|
143
|
+
stored_mtime, dependencies = @dependencies[[uri, importer]]
|
144
|
+
|
145
|
+
if !stored_mtime || stored_mtime < mtime(uri, importer)
|
146
|
+
dependencies = compute_dependencies(uri, importer)
|
147
|
+
@dependencies[[uri, importer]] = [mtime(uri, importer), dependencies]
|
148
|
+
end
|
149
|
+
|
150
|
+
dependencies
|
151
|
+
end
|
152
|
+
|
153
|
+
def dependency_updated?(css_mtime)
|
154
|
+
Proc.new do |uri, importer|
|
155
|
+
next true if @actively_checking.include?(uri)
|
156
|
+
begin
|
157
|
+
@actively_checking << uri
|
158
|
+
sass_mtime = mtime(uri, importer)
|
159
|
+
!sass_mtime ||
|
160
|
+
sass_mtime > css_mtime ||
|
161
|
+
dependencies_stale?(uri, importer, css_mtime)
|
162
|
+
ensure
|
163
|
+
@actively_checking.delete uri
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
def compute_dependencies(uri, importer)
|
169
|
+
tree(uri, importer).grep(Tree::ImportNode) do |n|
|
170
|
+
next if n.css_import?
|
171
|
+
file = n.imported_file
|
172
|
+
key = [file.options[:filename], file.options[:importer]]
|
173
|
+
@parse_trees[key] = file.to_tree
|
174
|
+
key
|
175
|
+
end.compact
|
176
|
+
end
|
177
|
+
|
178
|
+
def tree(uri, importer)
|
179
|
+
@parse_trees[[uri, importer]] ||= importer.find(uri, @options).to_tree
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
require 'sass'
|
4
|
+
require 'sass/plugin/compiler'
|
5
|
+
|
6
|
+
module Sass
|
7
|
+
# This module provides a single interface to the compilation of Sass/SCSS files
|
8
|
+
# for an application. It provides global options and checks whether CSS files
|
9
|
+
# need to be updated.
|
10
|
+
#
|
11
|
+
# This module is used as the primary interface with Sass
|
12
|
+
# when it's used as a plugin for various frameworks.
|
13
|
+
# All Rack-enabled frameworks are supported out of the box.
|
14
|
+
# The plugin is {file:SASS_REFERENCE.md#rails_merb_plugin automatically activated for Rails and Merb}.
|
15
|
+
# Other frameworks must enable it explicitly; see {Sass::Plugin::Rack}.
|
16
|
+
#
|
17
|
+
# This module has a large set of callbacks available
|
18
|
+
# to allow users to run code (such as logging) when certain things happen.
|
19
|
+
# All callback methods are of the form `on_#{name}`,
|
20
|
+
# and they all take a block that's called when the given action occurs.
|
21
|
+
#
|
22
|
+
# Note that this class proxies almost all methods to its {Sass::Plugin::Compiler} instance.
|
23
|
+
# See \{#compiler}.
|
24
|
+
#
|
25
|
+
# @example Using a callback
|
26
|
+
# Sass::Plugin.on_updating_stylesheet do |template, css|
|
27
|
+
# puts "Compiling #{template} to #{css}"
|
28
|
+
# end
|
29
|
+
# Sass::Plugin.update_stylesheets
|
30
|
+
# #=> Compiling app/sass/screen.scss to public/stylesheets/screen.css
|
31
|
+
# #=> Compiling app/sass/print.scss to public/stylesheets/print.css
|
32
|
+
# #=> Compiling app/sass/ie.scss to public/stylesheets/ie.css
|
33
|
+
# @see Sass::Plugin::Compiler
|
34
|
+
module Plugin
|
35
|
+
include Sass::Util
|
36
|
+
extend self
|
37
|
+
|
38
|
+
@checked_for_updates = false
|
39
|
+
|
40
|
+
# Whether or not Sass has **ever** checked if the stylesheets need to be updated
|
41
|
+
# (in this Ruby instance).
|
42
|
+
#
|
43
|
+
# @return [Boolean]
|
44
|
+
attr_accessor :checked_for_updates
|
45
|
+
|
46
|
+
# Same as \{#update\_stylesheets}, but respects \{#checked\_for\_updates}
|
47
|
+
# and the {file:SASS_REFERENCE.md#always_update-option `:always_update`}
|
48
|
+
# and {file:SASS_REFERENCE.md#always_check-option `:always_check`} options.
|
49
|
+
#
|
50
|
+
# @see #update_stylesheets
|
51
|
+
def check_for_updates
|
52
|
+
return unless !Sass::Plugin.checked_for_updates ||
|
53
|
+
Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
|
54
|
+
update_stylesheets
|
55
|
+
end
|
56
|
+
|
57
|
+
# Returns the singleton compiler instance.
|
58
|
+
# This compiler has been pre-configured according
|
59
|
+
# to the plugin configuration.
|
60
|
+
#
|
61
|
+
# @return [Sass::Plugin::Compiler]
|
62
|
+
def compiler
|
63
|
+
@compiler ||= Compiler.new
|
64
|
+
end
|
65
|
+
|
66
|
+
# Updates out-of-date stylesheets.
|
67
|
+
#
|
68
|
+
# Checks each Sass/SCSS file in {file:SASS_REFERENCE.md#template_location-option `:template_location`}
|
69
|
+
# to see if it's been modified more recently than the corresponding CSS file
|
70
|
+
# in {file:SASS_REFERENCE.md#css_location-option `:css_location`}.
|
71
|
+
# If it has, it updates the CSS file.
|
72
|
+
#
|
73
|
+
# @param individual_files [Array<(String, String)>]
|
74
|
+
# A list of files to check for updates
|
75
|
+
# **in addition to those specified by the
|
76
|
+
# {file:SASS_REFERENCE.md#template_location-option `:template_location` option}.**
|
77
|
+
# The first string in each pair is the location of the Sass/SCSS file,
|
78
|
+
# the second is the location of the CSS file that it should be compiled to.
|
79
|
+
def update_stylesheets(individual_files = [])
|
80
|
+
return if options[:never_update]
|
81
|
+
compiler.update_stylesheets(individual_files)
|
82
|
+
end
|
83
|
+
|
84
|
+
# Updates all stylesheets, even those that aren't out-of-date.
|
85
|
+
# Ignores the cache.
|
86
|
+
#
|
87
|
+
# @param individual_files [Array<(String, String)>]
|
88
|
+
# A list of files to check for updates
|
89
|
+
# **in addition to those specified by the
|
90
|
+
# {file:SASS_REFERENCE.md#template_location-option `:template_location` option}.**
|
91
|
+
# The first string in each pair is the location of the Sass/SCSS file,
|
92
|
+
# the second is the location of the CSS file that it should be compiled to.
|
93
|
+
# @see #update_stylesheets
|
94
|
+
def force_update_stylesheets(individual_files = [])
|
95
|
+
Compiler.new(options.dup.merge(
|
96
|
+
:never_update => false,
|
97
|
+
:always_update => true,
|
98
|
+
:cache => false)).update_stylesheets(individual_files)
|
99
|
+
end
|
100
|
+
|
101
|
+
# All other method invocations are proxied to the \{#compiler}.
|
102
|
+
#
|
103
|
+
# @see #compiler
|
104
|
+
# @see Sass::Plugin::Compiler
|
105
|
+
def method_missing(method, *args, &block)
|
106
|
+
if compiler.respond_to?(method)
|
107
|
+
compiler.send(method, *args, &block)
|
108
|
+
else
|
109
|
+
super
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
# For parity with method_missing
|
114
|
+
def respond_to?(method)
|
115
|
+
super || compiler.respond_to?(method)
|
116
|
+
end
|
117
|
+
|
118
|
+
# There's a small speedup by not using method missing for frequently delegated methods.
|
119
|
+
def options
|
120
|
+
compiler.options
|
121
|
+
end
|
122
|
+
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
if defined?(ActionController)
|
127
|
+
require 'sass/plugin/rails'
|
128
|
+
elsif defined?(Merb::Plugins)
|
129
|
+
require 'sass/plugin/merb'
|
130
|
+
else
|
131
|
+
require 'sass/plugin/generic'
|
132
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Rails 3.0.0.beta.2+, < 3.1
|
2
|
+
if defined?(ActiveSupport) && Sass::Util.has?(:public_method, ActiveSupport, :on_load) &&
|
3
|
+
!Sass::Util.ap_geq?('3.1.0.beta')
|
4
|
+
require 'sass/plugin/configuration'
|
5
|
+
ActiveSupport.on_load(:before_configuration) do
|
6
|
+
require 'sass'
|
7
|
+
require 'sass/plugin'
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'readline'
|
2
|
+
|
3
|
+
module Sass
|
4
|
+
# Runs a SassScript read-eval-print loop.
|
5
|
+
# It presents a prompt on the terminal,
|
6
|
+
# reads in SassScript expressions,
|
7
|
+
# evaluates them,
|
8
|
+
# and prints the result.
|
9
|
+
class Repl
|
10
|
+
# @param options [{Symbol => Object}] An options hash.
|
11
|
+
def initialize(options = {})
|
12
|
+
@options = options
|
13
|
+
end
|
14
|
+
|
15
|
+
# Starts the read-eval-print loop.
|
16
|
+
def run
|
17
|
+
environment = Environment.new
|
18
|
+
@line = 0
|
19
|
+
loop do
|
20
|
+
@line += 1
|
21
|
+
unless text = Readline.readline('>> ')
|
22
|
+
puts
|
23
|
+
return
|
24
|
+
end
|
25
|
+
|
26
|
+
Readline::HISTORY << text
|
27
|
+
parse_input(environment, text)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def parse_input(environment, text)
|
34
|
+
case text
|
35
|
+
when Script::MATCH
|
36
|
+
name = $1
|
37
|
+
guarded = !!$3
|
38
|
+
val = Script::Parser.parse($2, @line, text.size - ($3 || '').size - $2.size)
|
39
|
+
|
40
|
+
unless guarded && environment.var(name)
|
41
|
+
environment.set_var(name, val.perform(environment))
|
42
|
+
end
|
43
|
+
|
44
|
+
p environment.var(name)
|
45
|
+
else
|
46
|
+
p Script::Parser.parse(text, @line, 0).perform(environment)
|
47
|
+
end
|
48
|
+
rescue Sass::SyntaxError => e
|
49
|
+
puts "SyntaxError: #{e.message}"
|
50
|
+
if @options[:trace]
|
51
|
+
e.backtrace.each do |e|
|
52
|
+
puts "\tfrom #{e}"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'sass/script/literal'
|
2
|
+
|
3
|
+
module Sass::Script
|
4
|
+
# A SassScript object representing a boolean (true or false) value.
|
5
|
+
class Bool < Literal
|
6
|
+
# The Ruby value of the boolean.
|
7
|
+
#
|
8
|
+
# @return [Boolean]
|
9
|
+
attr_reader :value
|
10
|
+
alias_method :to_bool, :value
|
11
|
+
|
12
|
+
# @return [String] "true" or "false"
|
13
|
+
def to_s(opts = {})
|
14
|
+
@value.to_s
|
15
|
+
end
|
16
|
+
alias_method :to_sass, :to_s
|
17
|
+
end
|
18
|
+
end
|