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,84 @@
|
|
1
|
+
module Listen
|
2
|
+
module Adapters
|
3
|
+
|
4
|
+
# Adapter implementation for Mac OS X `FSEvents`.
|
5
|
+
#
|
6
|
+
class Darwin < Adapter
|
7
|
+
|
8
|
+
LAST_SEPARATOR_REGEX = /\/$/
|
9
|
+
|
10
|
+
# Initializes the Adapter. See {Listen::Adapter#initialize} for more info.
|
11
|
+
#
|
12
|
+
def initialize(directories, options = {}, &callback)
|
13
|
+
super
|
14
|
+
@worker = init_worker
|
15
|
+
end
|
16
|
+
|
17
|
+
# Starts the adapter.
|
18
|
+
#
|
19
|
+
# @param [Boolean] blocking whether or not to block the current thread after starting
|
20
|
+
#
|
21
|
+
def start(blocking = true)
|
22
|
+
@mutex.synchronize do
|
23
|
+
return if @stop == false
|
24
|
+
super
|
25
|
+
end
|
26
|
+
|
27
|
+
@worker_thread = Thread.new { @worker.run }
|
28
|
+
@poll_thread = Thread.new { poll_changed_dirs }
|
29
|
+
|
30
|
+
# The FSEvent worker needs sometime to startup. Turnstiles can't
|
31
|
+
# be used to wait for it as it runs in a loop.
|
32
|
+
# TODO: Find a better way to block until the worker starts.
|
33
|
+
sleep @latency
|
34
|
+
@poll_thread.join if blocking
|
35
|
+
end
|
36
|
+
|
37
|
+
# Stops the adapter.
|
38
|
+
#
|
39
|
+
def stop
|
40
|
+
@mutex.synchronize do
|
41
|
+
return if @stop == true
|
42
|
+
super
|
43
|
+
end
|
44
|
+
|
45
|
+
@worker.stop
|
46
|
+
Thread.kill(@worker_thread) if @worker_thread
|
47
|
+
@poll_thread.join
|
48
|
+
end
|
49
|
+
|
50
|
+
# Checks if the adapter is usable on the current OS.
|
51
|
+
#
|
52
|
+
# @return [Boolean] whether usable or not
|
53
|
+
#
|
54
|
+
def self.usable?
|
55
|
+
return false unless RbConfig::CONFIG['target_os'] =~ /darwin(1.+)?$/i
|
56
|
+
|
57
|
+
require 'rb-fsevent'
|
58
|
+
true
|
59
|
+
rescue LoadError
|
60
|
+
false
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
# Initializes a FSEvent worker and adds a watcher for
|
66
|
+
# each directory passed to the adapter.
|
67
|
+
#
|
68
|
+
# @return [FSEvent] initialized worker
|
69
|
+
#
|
70
|
+
def init_worker
|
71
|
+
FSEvent.new.tap do |worker|
|
72
|
+
worker.watch(@directories.dup, :latency => @latency) do |changes|
|
73
|
+
next if @paused
|
74
|
+
@mutex.synchronize do
|
75
|
+
changes.each { |path| @changed_dirs << path.sub(LAST_SEPARATOR_REGEX, '') }
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
module Listen
|
2
|
+
module Adapters
|
3
|
+
|
4
|
+
# Listener implementation for Linux `inotify`.
|
5
|
+
#
|
6
|
+
class Linux < Adapter
|
7
|
+
|
8
|
+
# Watched inotify events
|
9
|
+
#
|
10
|
+
# @see http://www.tin.org/bin/man.cgi?section=7&topic=inotify
|
11
|
+
# @see https://github.com/nex3/rb-inotify/blob/master/lib/rb-inotify/notifier.rb#L99-L177
|
12
|
+
#
|
13
|
+
EVENTS = %w[recursive attrib close modify move create delete delete_self move_self]
|
14
|
+
|
15
|
+
# The message to show when the limit of inotify watchers is not enough
|
16
|
+
#
|
17
|
+
INOTIFY_LIMIT_MESSAGE = <<-EOS.gsub(/^\s*/, '')
|
18
|
+
Listen error: unable to monitor directories for changes.
|
19
|
+
|
20
|
+
Please head to https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers
|
21
|
+
for information on how to solve this issue.
|
22
|
+
EOS
|
23
|
+
|
24
|
+
# Initializes the Adapter. See {Listen::Adapter#initialize} for more info.
|
25
|
+
#
|
26
|
+
def initialize(directories, options = {}, &callback)
|
27
|
+
super
|
28
|
+
@worker = init_worker
|
29
|
+
rescue Errno::ENOSPC
|
30
|
+
abort(INOTIFY_LIMIT_MESSAGE)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Starts the adapter.
|
34
|
+
#
|
35
|
+
# @param [Boolean] blocking whether or not to block the current thread after starting
|
36
|
+
#
|
37
|
+
def start(blocking = true)
|
38
|
+
@mutex.synchronize do
|
39
|
+
return if @stop == false
|
40
|
+
super
|
41
|
+
end
|
42
|
+
|
43
|
+
@worker_thread = Thread.new { @worker.run }
|
44
|
+
@poll_thread = Thread.new { poll_changed_dirs }
|
45
|
+
@poll_thread.join if blocking
|
46
|
+
end
|
47
|
+
|
48
|
+
# Stops the adapter.
|
49
|
+
#
|
50
|
+
def stop
|
51
|
+
@mutex.synchronize do
|
52
|
+
return if @stop == true
|
53
|
+
super
|
54
|
+
end
|
55
|
+
|
56
|
+
@worker.stop
|
57
|
+
Thread.kill(@worker_thread) if @worker_thread
|
58
|
+
@poll_thread.join
|
59
|
+
end
|
60
|
+
|
61
|
+
# Check if the adapter is usable on the current OS.
|
62
|
+
#
|
63
|
+
# @return [Boolean] whether usable or not
|
64
|
+
#
|
65
|
+
def self.usable?
|
66
|
+
return false unless RbConfig::CONFIG['target_os'] =~ /linux/i
|
67
|
+
|
68
|
+
require 'rb-inotify'
|
69
|
+
true
|
70
|
+
rescue LoadError
|
71
|
+
false
|
72
|
+
end
|
73
|
+
|
74
|
+
private
|
75
|
+
|
76
|
+
# Initializes a INotify worker and adds a watcher for
|
77
|
+
# each directory passed to the adapter.
|
78
|
+
#
|
79
|
+
# @return [INotify::Notifier] initialized worker
|
80
|
+
#
|
81
|
+
def init_worker
|
82
|
+
worker = INotify::Notifier.new
|
83
|
+
@directories.each do |directory|
|
84
|
+
worker.watch(directory, *EVENTS.map(&:to_sym)) do |event|
|
85
|
+
if @paused || (
|
86
|
+
# Event on root directory
|
87
|
+
event.name == ""
|
88
|
+
) || (
|
89
|
+
# INotify reports changes to files inside directories as events
|
90
|
+
# on the directories themselves too.
|
91
|
+
#
|
92
|
+
# @see http://linux.die.net/man/7/inotify
|
93
|
+
event.flags.include?(:isdir) and event.flags & [:close, :modify] != []
|
94
|
+
)
|
95
|
+
# Skip all of these!
|
96
|
+
next
|
97
|
+
end
|
98
|
+
|
99
|
+
@mutex.synchronize do
|
100
|
+
@changed_dirs << File.dirname(event.absolute_name)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
worker
|
105
|
+
end
|
106
|
+
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Listen
|
2
|
+
module Adapters
|
3
|
+
|
4
|
+
# The default delay between checking for changes.
|
5
|
+
DEFAULT_POLLING_LATENCY = 1.0
|
6
|
+
|
7
|
+
# Polling Adapter that works cross-platform and
|
8
|
+
# has no dependencies. This is the adapter that
|
9
|
+
# uses the most CPU processing power and has higher
|
10
|
+
# file IO that the other implementations.
|
11
|
+
#
|
12
|
+
class Polling < Adapter
|
13
|
+
|
14
|
+
# Initialize the Adapter. See {Listen::Adapter#initialize} for more info.
|
15
|
+
#
|
16
|
+
def initialize(directories, options = {}, &callback)
|
17
|
+
@latency ||= DEFAULT_POLLING_LATENCY
|
18
|
+
super
|
19
|
+
end
|
20
|
+
|
21
|
+
# Start the adapter.
|
22
|
+
#
|
23
|
+
# @param [Boolean] blocking whether or not to block the current thread after starting
|
24
|
+
#
|
25
|
+
def start(blocking = true)
|
26
|
+
@mutex.synchronize do
|
27
|
+
return if @stop == false
|
28
|
+
super
|
29
|
+
end
|
30
|
+
|
31
|
+
@poll_thread = Thread.new { poll }
|
32
|
+
@poll_thread.join if blocking
|
33
|
+
end
|
34
|
+
|
35
|
+
# Stop the adapter.
|
36
|
+
#
|
37
|
+
def stop
|
38
|
+
@mutex.synchronize do
|
39
|
+
return if @stop == true
|
40
|
+
super
|
41
|
+
end
|
42
|
+
|
43
|
+
@poll_thread.join
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
# Poll listener directory for file system changes.
|
49
|
+
#
|
50
|
+
def poll
|
51
|
+
until @stop
|
52
|
+
sleep(0.1) && next if @paused
|
53
|
+
|
54
|
+
start = Time.now.to_f
|
55
|
+
@callback.call(@directories.dup, :recursive => true)
|
56
|
+
@turnstile.signal
|
57
|
+
nap_time = @latency - (Time.now.to_f - start)
|
58
|
+
sleep(nap_time) if nap_time > 0
|
59
|
+
end
|
60
|
+
rescue Interrupt
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'set'
|
2
|
+
|
3
|
+
module Listen
|
4
|
+
module Adapters
|
5
|
+
|
6
|
+
# Adapter implementation for Windows `fchange`.
|
7
|
+
#
|
8
|
+
class Windows < Adapter
|
9
|
+
|
10
|
+
# Initializes the Adapter. See {Listen::Adapter#initialize} for more info.
|
11
|
+
#
|
12
|
+
def initialize(directories, options = {}, &callback)
|
13
|
+
super
|
14
|
+
@worker = init_worker
|
15
|
+
end
|
16
|
+
|
17
|
+
# Starts the adapter.
|
18
|
+
#
|
19
|
+
# @param [Boolean] blocking whether or not to block the current thread after starting
|
20
|
+
#
|
21
|
+
def start(blocking = true)
|
22
|
+
@mutex.synchronize do
|
23
|
+
return if @stop == false
|
24
|
+
super
|
25
|
+
end
|
26
|
+
|
27
|
+
@worker_thread = Thread.new { @worker.run }
|
28
|
+
@poll_thread = Thread.new { poll_changed_dirs(true) }
|
29
|
+
@poll_thread.join if blocking
|
30
|
+
end
|
31
|
+
|
32
|
+
# Stops the adapter.
|
33
|
+
#
|
34
|
+
def stop
|
35
|
+
@mutex.synchronize do
|
36
|
+
return if @stop == true
|
37
|
+
super
|
38
|
+
end
|
39
|
+
|
40
|
+
@worker.stop
|
41
|
+
Thread.kill(@worker_thread) if @worker_thread
|
42
|
+
@poll_thread.join
|
43
|
+
end
|
44
|
+
|
45
|
+
# Checks if the adapter is usable on the current OS.
|
46
|
+
#
|
47
|
+
# @return [Boolean] whether usable or not
|
48
|
+
#
|
49
|
+
def self.usable?
|
50
|
+
return false unless RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
|
51
|
+
|
52
|
+
require 'rb-fchange'
|
53
|
+
true
|
54
|
+
rescue LoadError
|
55
|
+
false
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
# Initializes a FChange worker and adds a watcher for
|
61
|
+
# each directory passed to the adapter.
|
62
|
+
#
|
63
|
+
# @return [FChange::Notifier] initialized worker
|
64
|
+
#
|
65
|
+
def init_worker
|
66
|
+
FChange::Notifier.new.tap do |worker|
|
67
|
+
@directories.each do |directory|
|
68
|
+
worker.watch(directory, :all_events, :recursive) do |event|
|
69
|
+
next if @paused
|
70
|
+
@mutex.synchronize do
|
71
|
+
@changed_dirs << File.expand_path(event.watcher.path)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,317 @@
|
|
1
|
+
require 'set'
|
2
|
+
require 'find'
|
3
|
+
require 'digest/sha1'
|
4
|
+
|
5
|
+
module Listen
|
6
|
+
|
7
|
+
# The directory record stores information about
|
8
|
+
# a directory and keeps track of changes to
|
9
|
+
# the structure of its childs.
|
10
|
+
#
|
11
|
+
class DirectoryRecord
|
12
|
+
attr_reader :directory, :paths, :sha1_checksums
|
13
|
+
|
14
|
+
DEFAULT_IGNORED_DIRECTORIES = %w[.rbx .bundle .git .svn log tmp vendor]
|
15
|
+
|
16
|
+
DEFAULT_IGNORED_EXTENSIONS = %w[.DS_Store]
|
17
|
+
|
18
|
+
# Defines the used precision based on the type of mtime returned by the
|
19
|
+
# system (whether its in milliseconds or just seconds)
|
20
|
+
#
|
21
|
+
HIGH_PRECISION_SUPPORTED = File.mtime(__FILE__).to_f.to_s[-2..-1] != '.0'
|
22
|
+
|
23
|
+
# Data structure used to save meta data about a path
|
24
|
+
#
|
25
|
+
MetaData = Struct.new(:type, :mtime)
|
26
|
+
|
27
|
+
# Class methods
|
28
|
+
#
|
29
|
+
class << self
|
30
|
+
|
31
|
+
# Creates the ignoring patterns from the default ignored
|
32
|
+
# directories and extensions. It memoizes the generated patterns
|
33
|
+
# to avoid unnecessary computation.
|
34
|
+
#
|
35
|
+
def generate_default_ignoring_patterns
|
36
|
+
@@default_ignoring_patterns ||= Array.new.tap do |default_patterns|
|
37
|
+
# Add directories
|
38
|
+
ignored_directories = DEFAULT_IGNORED_DIRECTORIES.map { |d| Regexp.escape(d) }
|
39
|
+
default_patterns << %r{^(?:#{ignored_directories.join('|')})/}
|
40
|
+
|
41
|
+
# Add extensions
|
42
|
+
ignored_extensions = DEFAULT_IGNORED_EXTENSIONS.map { |e| Regexp.escape(e) }
|
43
|
+
default_patterns << %r{(?:#{ignored_extensions.join('|')})$}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Initializes a directory record.
|
49
|
+
#
|
50
|
+
# @option [String] directory the directory to keep track of
|
51
|
+
#
|
52
|
+
def initialize(directory)
|
53
|
+
raise ArgumentError, "The path '#{directory}' is not a directory!" unless File.directory?(directory)
|
54
|
+
|
55
|
+
@directory = directory
|
56
|
+
@ignoring_patterns = Set.new
|
57
|
+
@filtering_patterns = Set.new
|
58
|
+
@sha1_checksums = Hash.new
|
59
|
+
|
60
|
+
@ignoring_patterns.merge(DirectoryRecord.generate_default_ignoring_patterns)
|
61
|
+
end
|
62
|
+
|
63
|
+
# Returns the ignoring patterns in the record
|
64
|
+
#
|
65
|
+
# @return [Array<Regexp>] the ignoring patterns
|
66
|
+
#
|
67
|
+
def ignoring_patterns
|
68
|
+
@ignoring_patterns.to_a
|
69
|
+
end
|
70
|
+
|
71
|
+
# Returns the filtering patterns used in the record to know
|
72
|
+
# which paths should be stored.
|
73
|
+
#
|
74
|
+
# @return [Array<Regexp>] the filtering patterns
|
75
|
+
#
|
76
|
+
def filtering_patterns
|
77
|
+
@filtering_patterns.to_a
|
78
|
+
end
|
79
|
+
|
80
|
+
# Adds ignoring patterns to the record.
|
81
|
+
#
|
82
|
+
# @example Ignore some paths
|
83
|
+
# ignore %r{^ignored/path/}, /man/
|
84
|
+
#
|
85
|
+
# @param [Regexp] regexp a pattern for ignoring paths
|
86
|
+
#
|
87
|
+
def ignore(*regexps)
|
88
|
+
@ignoring_patterns.merge(regexps)
|
89
|
+
end
|
90
|
+
|
91
|
+
# Adds filtering patterns to the listener.
|
92
|
+
#
|
93
|
+
# @example Filter some files
|
94
|
+
# ignore /\.txt$/, /.*\.zip/
|
95
|
+
#
|
96
|
+
# @param [Regexp] regexp a pattern for filtering paths
|
97
|
+
#
|
98
|
+
def filter(*regexps)
|
99
|
+
@filtering_patterns.merge(regexps)
|
100
|
+
end
|
101
|
+
|
102
|
+
# Returns whether a path should be ignored or not.
|
103
|
+
#
|
104
|
+
# @param [String] path the path to test.
|
105
|
+
#
|
106
|
+
# @return [Boolean]
|
107
|
+
#
|
108
|
+
def ignored?(path)
|
109
|
+
path = relative_to_base(path)
|
110
|
+
@ignoring_patterns.any? { |pattern| pattern =~ path }
|
111
|
+
end
|
112
|
+
|
113
|
+
# Returns whether a path should be filtered or not.
|
114
|
+
#
|
115
|
+
# @param [String] path the path to test.
|
116
|
+
#
|
117
|
+
# @return [Boolean]
|
118
|
+
#
|
119
|
+
def filtered?(path)
|
120
|
+
# When no filtering patterns are set, ALL files are stored.
|
121
|
+
return true if @filtering_patterns.empty?
|
122
|
+
|
123
|
+
path = relative_to_base(path)
|
124
|
+
@filtering_patterns.any? { |pattern| pattern =~ path }
|
125
|
+
end
|
126
|
+
|
127
|
+
# Finds the paths that should be stored and adds them
|
128
|
+
# to the paths' hash.
|
129
|
+
#
|
130
|
+
def build
|
131
|
+
@paths = Hash.new { |h, k| h[k] = Hash.new }
|
132
|
+
important_paths { |path| insert_path(path) }
|
133
|
+
end
|
134
|
+
|
135
|
+
# Detects changes in the passed directories, updates
|
136
|
+
# the record with the new changes and returns the changes
|
137
|
+
#
|
138
|
+
# @param [Array] directories the list of directories scan for changes
|
139
|
+
# @param [Hash] options
|
140
|
+
# @option options [Boolean] recursive scan all sub-directories recursively
|
141
|
+
# @option options [Boolean] relative_paths whether or not to use relative paths for changes
|
142
|
+
#
|
143
|
+
# @return [Hash<Array>] the changes
|
144
|
+
#
|
145
|
+
def fetch_changes(directories, options = {})
|
146
|
+
@changes = { :modified => [], :added => [], :removed => [] }
|
147
|
+
directories = directories.sort_by { |el| el.length }.reverse # diff sub-dir first
|
148
|
+
|
149
|
+
directories.each do |directory|
|
150
|
+
next unless directory[@directory] # Path is or inside directory
|
151
|
+
detect_modifications_and_removals(directory, options)
|
152
|
+
detect_additions(directory, options)
|
153
|
+
end
|
154
|
+
|
155
|
+
@changes
|
156
|
+
end
|
157
|
+
|
158
|
+
# Converts an absolute path to a path that's relative to the base directory.
|
159
|
+
#
|
160
|
+
# @param [String] path the path to convert
|
161
|
+
#
|
162
|
+
# @return [String] the relative path
|
163
|
+
#
|
164
|
+
def relative_to_base(path)
|
165
|
+
return nil unless path[@directory]
|
166
|
+
path.sub(%r{^#{@directory}#{File::SEPARATOR}?}, '')
|
167
|
+
end
|
168
|
+
|
169
|
+
private
|
170
|
+
|
171
|
+
# Detects modifications and removals recursively in a directory.
|
172
|
+
#
|
173
|
+
# @note Modifications detection begins by checking the modification time (mtime)
|
174
|
+
# of files and then by checking content changes (using SHA1-checksum)
|
175
|
+
# when the mtime of files is not changed.
|
176
|
+
#
|
177
|
+
# @param [String] directory the path to analyze
|
178
|
+
# @param [Hash] options
|
179
|
+
# @option options [Boolean] recursive scan all sub-directories recursively
|
180
|
+
# @option options [Boolean] relative_paths whether or not to use relative paths for changes
|
181
|
+
#
|
182
|
+
def detect_modifications_and_removals(directory, options = {})
|
183
|
+
@paths[directory].each do |basename, meta_data|
|
184
|
+
path = File.join(directory, basename)
|
185
|
+
|
186
|
+
case meta_data.type
|
187
|
+
when 'Dir'
|
188
|
+
if File.directory?(path)
|
189
|
+
detect_modifications_and_removals(path, options) if options[:recursive]
|
190
|
+
else
|
191
|
+
detect_modifications_and_removals(path, { :recursive => true }.merge(options))
|
192
|
+
@paths[directory].delete(basename)
|
193
|
+
@paths.delete("#{directory}/#{basename}")
|
194
|
+
end
|
195
|
+
when 'File'
|
196
|
+
if File.exist?(path)
|
197
|
+
new_mtime = mtime_of(path)
|
198
|
+
|
199
|
+
# First check if we are in the same second (to update checksums)
|
200
|
+
# before checking the time difference
|
201
|
+
if (meta_data.mtime.to_i == new_mtime.to_i && content_modified?(path)) || meta_data.mtime < new_mtime
|
202
|
+
# Update the meta data of the files
|
203
|
+
meta_data.mtime = new_mtime
|
204
|
+
@paths[directory][basename] = meta_data
|
205
|
+
|
206
|
+
@changes[:modified] << (options[:relative_paths] ? relative_to_base(path) : path)
|
207
|
+
end
|
208
|
+
else
|
209
|
+
@paths[directory].delete(basename)
|
210
|
+
@sha1_checksums.delete(path)
|
211
|
+
@changes[:removed] << (options[:relative_paths] ? relative_to_base(path) : path)
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
# Detects additions in a directory.
|
218
|
+
#
|
219
|
+
# @param [String] directory the path to analyze
|
220
|
+
# @param [Hash] options
|
221
|
+
# @option options [Boolean] recursive scan all sub-directories recursively
|
222
|
+
# @option options [Boolean] relative_paths whether or not to use relative paths for changes
|
223
|
+
#
|
224
|
+
def detect_additions(directory, options = {})
|
225
|
+
# Don't process removed directories
|
226
|
+
return unless File.exist?(directory)
|
227
|
+
|
228
|
+
Find.find(directory) do |path|
|
229
|
+
next if path == @directory
|
230
|
+
|
231
|
+
if File.directory?(path)
|
232
|
+
# Add a trailing slash to directories when checking if a directory is
|
233
|
+
# ignored to optimize finding them as Find.find doesn't.
|
234
|
+
if ignored?(path + File::SEPARATOR) || (directory != path && (!options[:recursive] && existing_path?(path)))
|
235
|
+
Find.prune # Don't look any further into this directory.
|
236
|
+
else
|
237
|
+
insert_path(path)
|
238
|
+
end
|
239
|
+
elsif !ignored?(path) && filtered?(path) && !existing_path?(path)
|
240
|
+
if File.file?(path)
|
241
|
+
@changes[:added] << (options[:relative_paths] ? relative_to_base(path) : path)
|
242
|
+
end
|
243
|
+
insert_path(path)
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
# Returns whether or not a file's content has been modified by
|
249
|
+
# comparing the SHA1-checksum to a stored one.
|
250
|
+
#
|
251
|
+
# @param [String] path the file path
|
252
|
+
#
|
253
|
+
def content_modified?(path)
|
254
|
+
sha1_checksum = Digest::SHA1.file(path).to_s
|
255
|
+
return false if @sha1_checksums[path] == sha1_checksum
|
256
|
+
|
257
|
+
had_no_checksum = @sha1_checksums[path].nil?
|
258
|
+
@sha1_checksums[path] = sha1_checksum
|
259
|
+
|
260
|
+
had_no_checksum ? false : true
|
261
|
+
end
|
262
|
+
|
263
|
+
# Traverses the base directory looking for paths that should
|
264
|
+
# be stored; thus paths that are filters or not ignored.
|
265
|
+
#
|
266
|
+
# @yield [path] an important path
|
267
|
+
#
|
268
|
+
def important_paths
|
269
|
+
Find.find(@directory) do |path|
|
270
|
+
next if path == @directory
|
271
|
+
|
272
|
+
if File.directory?(path)
|
273
|
+
# Add a trailing slash to directories when checking if a directory is
|
274
|
+
# ignored to optimize finding them as Find.find doesn't.
|
275
|
+
if ignored?(path + File::SEPARATOR)
|
276
|
+
Find.prune # Don't look any further into this directory.
|
277
|
+
else
|
278
|
+
yield(path)
|
279
|
+
end
|
280
|
+
elsif !ignored?(path) && filtered?(path)
|
281
|
+
yield(path)
|
282
|
+
end
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
286
|
+
# Inserts a path with its type (Dir or File) in paths hash.
|
287
|
+
#
|
288
|
+
# @param [String] path the path to insert in @paths.
|
289
|
+
#
|
290
|
+
def insert_path(path)
|
291
|
+
meta_data = MetaData.new
|
292
|
+
meta_data.type = File.directory?(path) ? 'Dir' : 'File'
|
293
|
+
meta_data.mtime = mtime_of(path) unless meta_data.type == 'Dir' # mtimes of dirs are not used yet
|
294
|
+
@paths[File.dirname(path)][File.basename(path)] = meta_data
|
295
|
+
end
|
296
|
+
|
297
|
+
# Returns whether or not a path exists in the paths hash.
|
298
|
+
#
|
299
|
+
# @param [String] path the path to check
|
300
|
+
#
|
301
|
+
# @return [Boolean]
|
302
|
+
#
|
303
|
+
def existing_path?(path)
|
304
|
+
@paths[File.dirname(path)][File.basename(path)] != nil
|
305
|
+
end
|
306
|
+
|
307
|
+
# Returns the modification time of a file based on the precision defined by the system
|
308
|
+
#
|
309
|
+
# @param [String] file the file for which the mtime must be returned
|
310
|
+
#
|
311
|
+
# @return [Fixnum, Float] the mtime of the file
|
312
|
+
#
|
313
|
+
def mtime_of(file)
|
314
|
+
File.mtime(file).send(HIGH_PRECISION_SUPPORTED ? :to_f : :to_i)
|
315
|
+
end
|
316
|
+
end
|
317
|
+
end
|