brakeman 4.4.0 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of brakeman might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGES.md +17 -0
- data/bundle/load.rb +7 -8
- data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/History.rdoc +8 -0
- data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/Manifest.txt +0 -0
- data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/README.rdoc +0 -0
- data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/lib/ruby2ruby.rb +34 -36
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/History.rdoc +47 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/Manifest.txt +5 -4
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/README.rdoc +0 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/compare/normalize.rb +29 -2
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/debugging.md +18 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/rp_extensions.rb +0 -7
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/rp_stringscanner.rb +0 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby20_parser.rb +6874 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby20_parser.y +284 -201
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby21_parser.rb +6952 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby21_parser.y +281 -197
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby22_parser.rb +6983 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib/ruby_parser.yy → ruby_parser-3.13.0/lib/ruby22_parser.y} +280 -306
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby23_parser.rb +6982 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby23_parser.y +282 -203
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby24_parser.rb +6982 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby24_parser.y +282 -203
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby25_parser.rb +6981 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby25_parser.y +282 -203
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby26_parser.rb +6999 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby26_parser.y +2469 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rb +116 -118
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rex +10 -8
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rex.rb +8 -8
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_parser.rb +5 -7
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby_parser.yy +2571 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby_parser_extras.rb +1360 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/tools/munge.rb +216 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/tools/ripper.rb +23 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/History.rdoc +6 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/Manifest.txt +19 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/README.rdoc +54 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy.rb +5 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby18_parser.rb +7 -6
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby18_parser.y +5 -4
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby19_parser.rb +7 -6
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby19_parser.y +5 -4
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rb +1412 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex +179 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex.rb +323 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb +30 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby_parser_extras.rb +43 -33
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/CHANGES.md +5 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/Gemfile +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/LICENSE.txt +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/README.md +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/bundle_install_all_ruby_versions.sh +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/deep.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/libyaml_checker.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/load.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/parse/date.rb +2 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/parse/hexadecimal.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/parse/sexagesimal.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/psych_handler.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/psych_resolver.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/resolver.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/safe_to_ruby_visitor.rb +0 -0
- data/bundle/ruby/2.5.0/gems/safe_yaml-1.0.5/lib/safe_yaml/store.rb +39 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/syck_hack.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/syck_node_monkeypatch.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/syck_resolver.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_boolean.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_date.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_float.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_integer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_nil.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_symbol.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/transformation_map.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/version.rb +1 -1
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/run_specs_all_ruby_versions.sh +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/safe_yaml.gemspec +0 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/History.rdoc +8 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/Manifest.txt +0 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/README.rdoc +0 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/composite_sexp_processor.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/pt_testcase.rb +2 -2
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/sexp.rb +4 -4
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/sexp_processor.rb +1 -1
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/strict_sexp.rb +3 -3
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/unique.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/CHANGES +6 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/EXPRESSIONS.md +1 -1
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/Gemfile +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/LICENSE +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/README.md +1 -1
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/engine.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/engine.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/parser.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/template.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/trimming.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/exceptions.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filter.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/code_merger.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/control_flow.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/dynamic_inliner.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/encoding.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/eraser.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/escapable.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/multi_flattener.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/remove_bom.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/static_analyzer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/static_merger.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/string_splitter.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/validator.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generator.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/array.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/array_buffer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/erb.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/rails_output_buffer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/string_buffer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/grammar.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_merger.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_remover.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_sorter.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/dispatcher.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/fast.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/filter.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/pretty.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/safe.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/map.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/dispatcher.rb +2 -1
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/engine_dsl.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/grammar_dsl.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/options.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/template.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/parser.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/static_analyzer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates/rails.rb +2 -2
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates/tilt.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/utils.rb +0 -0
- data/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/version.rb +3 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/temple.gemspec +0 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/CHANGELOG.md +4 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/MIT-LICENSE.txt +1 -1
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/README.md +10 -10
- data/bundle/ruby/2.5.0/gems/unicode-display_width-1.5.0/data/display_width.marshal.gz +0 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/constants.rb +2 -2
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/index.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/no_string_ext.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/string_ext.rb +0 -0
- data/lib/brakeman/checks/base_check.rb +16 -0
- data/lib/brakeman/checks/check_content_tag.rb +12 -0
- data/lib/brakeman/checks/check_cross_site_scripting.rb +6 -6
- data/lib/brakeman/checks/check_evaluation.rb +0 -1
- data/lib/brakeman/checks/check_execute.rb +18 -0
- data/lib/brakeman/checks/check_send.rb +0 -1
- data/lib/brakeman/checks/check_session_manipulation.rb +0 -1
- data/lib/brakeman/checks/check_sql.rb +12 -3
- data/lib/brakeman/file_parser.rb +8 -4
- data/lib/brakeman/parsers/haml_embedded.rb +44 -0
- data/lib/brakeman/parsers/slim_embedded.rb +44 -0
- data/lib/brakeman/parsers/template_parser.rb +2 -4
- data/lib/brakeman/processors/alias_processor.rb +23 -1
- data/lib/brakeman/processors/lib/call_conversion_helper.rb +4 -0
- data/lib/brakeman/processors/slim_template_processor.rb +16 -0
- data/lib/brakeman/processors/template_alias_processor.rb +2 -2
- data/lib/brakeman/scanner.rb +11 -10
- data/lib/brakeman/tracker.rb +5 -1
- data/lib/brakeman/tracker/config.rb +32 -7
- data/lib/brakeman/util.rb +17 -0
- data/lib/brakeman/version.rb +1 -1
- metadata +157 -320
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby20_parser.rb +0 -6687
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby21_parser.rb +0 -6767
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby22_parser.rb +0 -6803
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby22_parser.y +0 -2376
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby23_parser.rb +0 -6818
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby24_parser.rb +0 -6818
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby25_parser.rb +0 -6818
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/CODE_OF_CONDUCT.md +0 -10
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/CONTRIBUTING.md +0 -148
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/MIT-LICENSE +0 -20
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/README.md +0 -227
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/REVISION +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION_DATE +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION_NAME +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/extra/sass-spec-ref.sh +0 -32
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/extra/update_watch.rb +0 -13
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/init.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass.rb +0 -109
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores.rb +0 -15
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/base.rb +0 -88
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/chain.rb +0 -34
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/filesystem.rb +0 -60
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/memory.rb +0 -46
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/null.rb +0 -25
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/callbacks.rb +0 -67
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/css.rb +0 -408
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/deprecation.rb +0 -55
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/engine.rb +0 -1226
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/environment.rb +0 -215
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/error.rb +0 -198
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec.rb +0 -9
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/base.rb +0 -199
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/sass_convert.rb +0 -283
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/sass_scss.rb +0 -440
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/features.rb +0 -47
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers.rb +0 -23
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/base.rb +0 -182
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/deprecated_path.rb +0 -51
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/filesystem.rb +0 -219
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger.rb +0 -17
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/base.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/delayed.rb +0 -50
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/log_level.rb +0 -45
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/media.rb +0 -210
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin.rb +0 -134
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/compiler.rb +0 -582
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/configuration.rb +0 -134
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/generic.rb +0 -15
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/merb.rb +0 -48
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/rack.rb +0 -60
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/rails.rb +0 -47
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/staleness_checker.rb +0 -199
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/railtie.rb +0 -10
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/repl.rb +0 -57
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/root.rb +0 -7
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script.rb +0 -66
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_lexer.rb +0 -33
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_parser.rb +0 -33
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_variable_warning.rb +0 -52
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/functions.rb +0 -2693
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/lexer.rb +0 -464
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/parser.rb +0 -832
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree.rb +0 -16
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/funcall.rb +0 -313
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/interpolation.rb +0 -223
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/list_literal.rb +0 -104
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/literal.rb +0 -49
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/map_literal.rb +0 -64
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/node.rb +0 -127
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/operation.rb +0 -156
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/selector.rb +0 -26
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/string_interpolation.rb +0 -125
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/unary_operation.rb +0 -69
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/variable.rb +0 -57
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value.rb +0 -11
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/arg_list.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/base.rb +0 -241
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/bool.rb +0 -35
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/color.rb +0 -698
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/helpers.rb +0 -272
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/list.rb +0 -113
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/map.rb +0 -70
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/null.rb +0 -44
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/number.rb +0 -563
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/string.rb +0 -138
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss.rb +0 -14
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/css_parser.rb +0 -56
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/parser.rb +0 -1254
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/rx.rb +0 -140
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/static_parser.rb +0 -373
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector.rb +0 -323
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/abstract_sequence.rb +0 -111
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/comma_sequence.rb +0 -191
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/pseudo.rb +0 -266
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/sequence.rb +0 -636
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/simple.rb +0 -117
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/simple_sequence.rb +0 -344
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/shared.rb +0 -76
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/map.rb +0 -213
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/position.rb +0 -39
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/range.rb +0 -41
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/stack.rb +0 -120
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/supports.rb +0 -225
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/at_root_node.rb +0 -83
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/charset_node.rb +0 -22
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/comment_node.rb +0 -82
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/content_node.rb +0 -9
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/css_import_node.rb +0 -68
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/debug_node.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/directive_node.rb +0 -59
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/each_node.rb +0 -24
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/error_node.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/extend_node.rb +0 -43
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/for_node.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/function_node.rb +0 -44
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/if_node.rb +0 -52
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/import_node.rb +0 -75
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/keyframe_rule_node.rb +0 -15
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/media_node.rb +0 -48
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/mixin_def_node.rb +0 -38
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/mixin_node.rb +0 -52
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/node.rb +0 -240
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/prop_node.rb +0 -170
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/return_node.rb +0 -19
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/root_node.rb +0 -44
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/rule_node.rb +0 -155
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/supports_node.rb +0 -38
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/trace_node.rb +0 -33
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/variable_node.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb +0 -72
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/check_nesting.rb +0 -173
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/convert.rb +0 -351
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/cssize.rb +0 -373
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/deep_copy.rb +0 -107
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/extend.rb +0 -70
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb +0 -564
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/set_options.rb +0 -139
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/to_css.rb +0 -409
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/warn_node.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/while_node.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util.rb +0 -1375
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/cross_platform_random.rb +0 -19
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/multibyte_string_scanner.rb +0 -155
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/normalized_map.rb +0 -129
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/ordered_hash.rb +0 -192
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/subset_map.rb +0 -109
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/test.rb +0 -9
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/version.rb +0 -124
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/rails/init.rb +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/CHANGELOG.md +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/CONTRIBUTING.md +0 -38
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Gemfile +0 -20
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Guardfile +0 -8
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/LICENSE +0 -20
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/README.md +0 -349
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Rakefile +0 -5
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Vagrantfile +0 -96
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb +0 -54
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapter.rb +0 -327
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/bsd.rb +0 -75
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/darwin.rb +0 -48
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/linux.rb +0 -81
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/polling.rb +0 -58
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/windows.rb +0 -91
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/directory_record.rb +0 -406
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/listener.rb +0 -323
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/turnstile.rb +0 -32
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/version.rb +0 -3
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/listen.gemspec +0 -28
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapter_spec.rb +0 -149
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/bsd_spec.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -37
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -47
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -30
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/directory_record_spec.rb +0 -1250
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/listener_spec.rb +0 -258
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen_spec.rb +0 -67
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/spec_helper.rb +0 -25
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/adapter_helper.rb +0 -666
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/directory_record_helper.rb +0 -57
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/fixtures_helper.rb +0 -29
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/listeners_helper.rb +0 -179
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/platform_helper.rb +0 -15
- data/bundle/ruby/2.5.0/gems/temple-0.8.0/lib/temple/version.rb +0 -3
- data/bundle/ruby/2.5.0/gems/unicode-display_width-1.4.1/data/display_width.marshal.gz +0 -0
@@ -1,109 +0,0 @@
|
|
1
|
-
require 'set'
|
2
|
-
|
3
|
-
module Sass
|
4
|
-
module Util
|
5
|
-
# A map from sets to values.
|
6
|
-
# A value is \{#\[]= set} by providing a set (the "set-set") and a value,
|
7
|
-
# which is then recorded as corresponding to that set.
|
8
|
-
# Values are \{#\[] accessed} by providing a set (the "get-set")
|
9
|
-
# and returning all values that correspond to set-sets
|
10
|
-
# that are subsets of the get-set.
|
11
|
-
#
|
12
|
-
# SubsetMap preserves the order of values as they're inserted.
|
13
|
-
#
|
14
|
-
# @example
|
15
|
-
# ssm = SubsetMap.new
|
16
|
-
# ssm[Set[1, 2]] = "Foo"
|
17
|
-
# ssm[Set[2, 3]] = "Bar"
|
18
|
-
# ssm[Set[1, 2, 3]] = "Baz"
|
19
|
-
#
|
20
|
-
# ssm[Set[1, 2, 3]] #=> ["Foo", "Bar", "Baz"]
|
21
|
-
class SubsetMap
|
22
|
-
# Creates a new, empty SubsetMap.
|
23
|
-
def initialize
|
24
|
-
@hash = {}
|
25
|
-
@vals = []
|
26
|
-
end
|
27
|
-
|
28
|
-
# Whether or not this SubsetMap has any key-value pairs.
|
29
|
-
#
|
30
|
-
# @return [Boolean]
|
31
|
-
def empty?
|
32
|
-
@hash.empty?
|
33
|
-
end
|
34
|
-
|
35
|
-
# Associates a value with a set.
|
36
|
-
# When `set` or any of its supersets is accessed,
|
37
|
-
# `value` will be among the values returned.
|
38
|
-
#
|
39
|
-
# Note that if the same `set` is passed to this method multiple times,
|
40
|
-
# all given `value`s will be associated with that `set`.
|
41
|
-
#
|
42
|
-
# This runs in `O(n)` time, where `n` is the size of `set`.
|
43
|
-
#
|
44
|
-
# @param set [#to_set] The set to use as the map key. May not be empty.
|
45
|
-
# @param value [Object] The value to associate with `set`.
|
46
|
-
# @raise [ArgumentError] If `set` is empty.
|
47
|
-
def []=(set, value)
|
48
|
-
raise ArgumentError.new("SubsetMap keys may not be empty.") if set.empty?
|
49
|
-
|
50
|
-
index = @vals.size
|
51
|
-
@vals << value
|
52
|
-
set.each do |k|
|
53
|
-
@hash[k] ||= []
|
54
|
-
@hash[k] << [set, set.to_set, index]
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
# Returns all values associated with subsets of `set`.
|
59
|
-
#
|
60
|
-
# In the worst case, this runs in `O(m*max(n, log m))` time,
|
61
|
-
# where `n` is the size of `set`
|
62
|
-
# and `m` is the number of associations in the map.
|
63
|
-
# However, unless many keys in the map overlap with `set`,
|
64
|
-
# `m` will typically be much smaller.
|
65
|
-
#
|
66
|
-
# @param set [Set] The set to use as the map key.
|
67
|
-
# @return [Array<(Object, #to_set)>] An array of pairs,
|
68
|
-
# where the first value is the value associated with a subset of `set`,
|
69
|
-
# and the second value is that subset of `set`
|
70
|
-
# (or whatever `#to_set` object was used to set the value)
|
71
|
-
# This array is in insertion order.
|
72
|
-
# @see #[]
|
73
|
-
def get(set)
|
74
|
-
res = set.map do |k|
|
75
|
-
subsets = @hash[k]
|
76
|
-
next unless subsets
|
77
|
-
subsets.map do |subenum, subset, index|
|
78
|
-
next unless subset.subset?(set)
|
79
|
-
[index, subenum]
|
80
|
-
end
|
81
|
-
end.flatten(1)
|
82
|
-
res.compact!
|
83
|
-
res.uniq!
|
84
|
-
res.sort!
|
85
|
-
res.map! {|i, s| [@vals[i], s]}
|
86
|
-
res
|
87
|
-
end
|
88
|
-
|
89
|
-
# Same as \{#get}, but doesn't return the subsets of the argument
|
90
|
-
# for which values were found.
|
91
|
-
#
|
92
|
-
# @param set [Set] The set to use as the map key.
|
93
|
-
# @return [Array] The array of all values
|
94
|
-
# associated with subsets of `set`, in insertion order.
|
95
|
-
# @see #get
|
96
|
-
def [](set)
|
97
|
-
get(set).map {|v, _| v}
|
98
|
-
end
|
99
|
-
|
100
|
-
# Iterates over each value in the subset map. Ignores keys completely. If
|
101
|
-
# multiple keys have the same value, this will return them multiple times.
|
102
|
-
#
|
103
|
-
# @yield [Object] Each value in the map.
|
104
|
-
def each_value
|
105
|
-
@vals.each {|v| yield v}
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
@@ -1,124 +0,0 @@
|
|
1
|
-
require 'date'
|
2
|
-
require 'sass/util'
|
3
|
-
|
4
|
-
module Sass
|
5
|
-
# Handles Sass version-reporting.
|
6
|
-
# Sass not only reports the standard three version numbers,
|
7
|
-
# but its Git revision hash as well,
|
8
|
-
# if it was installed from Git.
|
9
|
-
module Version
|
10
|
-
# Returns a hash representing the version of Sass.
|
11
|
-
# The `:major`, `:minor`, and `:teeny` keys have their respective numbers as Integers.
|
12
|
-
# The `:name` key has the name of the version.
|
13
|
-
# The `:string` key contains a human-readable string representation of the version.
|
14
|
-
# The `:number` key is the major, minor, and teeny keys separated by periods.
|
15
|
-
# The `:date` key, which is not guaranteed to be defined, is the `DateTime`
|
16
|
-
# at which this release was cut.
|
17
|
-
# If Sass is checked out from Git, the `:rev` key will have the revision hash.
|
18
|
-
# For example:
|
19
|
-
#
|
20
|
-
# {
|
21
|
-
# :string => "2.1.0.9616393",
|
22
|
-
# :rev => "9616393b8924ef36639c7e82aa88a51a24d16949",
|
23
|
-
# :number => "2.1.0",
|
24
|
-
# :date => DateTime.parse("Apr 30 13:52:01 2009 -0700"),
|
25
|
-
# :major => 2, :minor => 1, :teeny => 0
|
26
|
-
# }
|
27
|
-
#
|
28
|
-
# If a prerelease version of Sass is being used,
|
29
|
-
# the `:string` and `:number` fields will reflect the full version
|
30
|
-
# (e.g. `"2.2.beta.1"`), and the `:teeny` field will be `-1`.
|
31
|
-
# A `:prerelease` key will contain the name of the prerelease (e.g. `"beta"`),
|
32
|
-
# and a `:prerelease_number` key will contain the rerelease number.
|
33
|
-
# For example:
|
34
|
-
#
|
35
|
-
# {
|
36
|
-
# :string => "3.0.beta.1",
|
37
|
-
# :number => "3.0.beta.1",
|
38
|
-
# :date => DateTime.parse("Mar 31 00:38:04 2010 -0700"),
|
39
|
-
# :major => 3, :minor => 0, :teeny => -1,
|
40
|
-
# :prerelease => "beta",
|
41
|
-
# :prerelease_number => 1
|
42
|
-
# }
|
43
|
-
#
|
44
|
-
# @return [{Symbol => String/Integer}] The version hash
|
45
|
-
# @comment
|
46
|
-
# rubocop:disable ClassVars
|
47
|
-
def version
|
48
|
-
return @@version if defined?(@@version)
|
49
|
-
|
50
|
-
numbers = File.read(Sass::Util.scope('VERSION')).strip.split('.').
|
51
|
-
map {|n| n =~ /^[0-9]+$/ ? n.to_i : n}
|
52
|
-
name = File.read(Sass::Util.scope('VERSION_NAME')).strip
|
53
|
-
@@version = {
|
54
|
-
:major => numbers[0],
|
55
|
-
:minor => numbers[1],
|
56
|
-
:teeny => numbers[2],
|
57
|
-
:name => name
|
58
|
-
}
|
59
|
-
|
60
|
-
if (date = version_date)
|
61
|
-
@@version[:date] = date
|
62
|
-
end
|
63
|
-
|
64
|
-
if numbers[3].is_a?(String)
|
65
|
-
@@version[:teeny] = -1
|
66
|
-
@@version[:prerelease] = numbers[3]
|
67
|
-
@@version[:prerelease_number] = numbers[4]
|
68
|
-
end
|
69
|
-
|
70
|
-
@@version[:number] = numbers.join('.')
|
71
|
-
@@version[:string] = @@version[:number].dup
|
72
|
-
|
73
|
-
if (rev = revision_number)
|
74
|
-
@@version[:rev] = rev
|
75
|
-
unless rev[0] == ?(
|
76
|
-
@@version[:string] << "." << rev[0...7]
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
@@version[:string] << " (#{name})"
|
81
|
-
@@version
|
82
|
-
end
|
83
|
-
# rubocop:enable ClassVars
|
84
|
-
|
85
|
-
private
|
86
|
-
|
87
|
-
def revision_number
|
88
|
-
if File.exist?(Sass::Util.scope('REVISION'))
|
89
|
-
rev = File.read(Sass::Util.scope('REVISION')).strip
|
90
|
-
return rev unless rev =~ /^([a-f0-9]+|\(.*\))$/ || rev == '(unknown)'
|
91
|
-
end
|
92
|
-
|
93
|
-
return unless File.exist?(Sass::Util.scope('.git/HEAD'))
|
94
|
-
rev = File.read(Sass::Util.scope('.git/HEAD')).strip
|
95
|
-
return rev unless rev =~ /^ref: (.*)$/
|
96
|
-
|
97
|
-
ref_name = $1
|
98
|
-
ref_file = Sass::Util.scope(".git/#{ref_name}")
|
99
|
-
info_file = Sass::Util.scope(".git/info/refs")
|
100
|
-
return File.read(ref_file).strip if File.exist?(ref_file)
|
101
|
-
return unless File.exist?(info_file)
|
102
|
-
File.open(info_file) do |f|
|
103
|
-
f.each do |l|
|
104
|
-
sha, ref = l.strip.split("\t", 2)
|
105
|
-
next unless ref == ref_name
|
106
|
-
return sha
|
107
|
-
end
|
108
|
-
end
|
109
|
-
nil
|
110
|
-
end
|
111
|
-
|
112
|
-
def version_date
|
113
|
-
return unless File.exist?(Sass::Util.scope('VERSION_DATE'))
|
114
|
-
DateTime.parse(File.read(Sass::Util.scope('VERSION_DATE')).strip)
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
extend Sass::Version
|
119
|
-
|
120
|
-
# A string representing the version of Sass.
|
121
|
-
# A more fine-grained representation is available from Sass.version.
|
122
|
-
# @api public
|
123
|
-
VERSION = version[:string] unless defined?(Sass::VERSION)
|
124
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
Kernel.load File.join(File.dirname(__FILE__), '..', 'init.rb')
|
@@ -1 +0,0 @@
|
|
1
|
-
# Moved to [Github releases](https://github.com/guard/listen/releases) page.
|
@@ -1,38 +0,0 @@
|
|
1
|
-
Contribute to Listen
|
2
|
-
===================
|
3
|
-
|
4
|
-
File an issue
|
5
|
-
-------------
|
6
|
-
|
7
|
-
You can report bugs and feature requests to [GitHub Issues](https://github.com/guard/listen/issues).
|
8
|
-
|
9
|
-
**Please don't ask question in the issue tracker**, instead ask them in our
|
10
|
-
[Google group](http://groups.google.com/group/guard-dev) or on `#guard` (irc.freenode.net).
|
11
|
-
|
12
|
-
Try to figure out where the issue belongs to: Is it an issue with Listen itself or with Guard?
|
13
|
-
|
14
|
-
When you file a bug, please try to follow these simple rules if applicable:
|
15
|
-
|
16
|
-
* Make sure you run Listen with `bundle exec` first.
|
17
|
-
* Add your `Guardfile` (if used) and `Gemfile` to the issue.
|
18
|
-
* Make sure that the issue is reproducible with your description.
|
19
|
-
|
20
|
-
**It's most likely that your bug gets resolved faster if you provide as much information as possible!**
|
21
|
-
|
22
|
-
Development
|
23
|
-
-----------
|
24
|
-
|
25
|
-
* Documentation hosted at [RubyDoc](http://rubydoc.info/github/guard/listen/master/frames).
|
26
|
-
* Source hosted at [GitHub](https://github.com/guard/listen).
|
27
|
-
|
28
|
-
Pull requests are very welcome! Please try to follow these simple rules if applicable:
|
29
|
-
|
30
|
-
* Please create a topic branch for every separate change you make.
|
31
|
-
* Make sure your patches are well tested. All specs run with `rake spec` must pass.
|
32
|
-
* Update the [Yard](http://yardoc.org/) documentation.
|
33
|
-
* Update the [README](https://github.com/guard/listen/blob/master/README.md).
|
34
|
-
* Update the [CHANGELOG](https://github.com/guard/listen/blob/master/CHANGELOG.md) for noteworthy changes.
|
35
|
-
* Please **do not change** the version number.
|
36
|
-
|
37
|
-
For questions please join us in our [Google group](http://groups.google.com/group/guard-dev) or on
|
38
|
-
`#guard` (irc.freenode.net).
|
@@ -1,20 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
gem 'rake'
|
6
|
-
|
7
|
-
require 'rbconfig'
|
8
|
-
gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
|
9
|
-
|
10
|
-
group :development do
|
11
|
-
gem 'guard-rspec'
|
12
|
-
gem 'yard'
|
13
|
-
gem 'redcarpet'
|
14
|
-
gem 'pimpmychangelog'
|
15
|
-
end
|
16
|
-
|
17
|
-
group :test do
|
18
|
-
gem 'rspec'
|
19
|
-
gem 'coveralls', :require => false
|
20
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
guard :rspec, :all_on_start => false, :all_after_pass => false do
|
2
|
-
watch(%r{^spec/.+_spec\.rb$})
|
3
|
-
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
4
|
-
watch('spec/support/adapter_helper.rb') { "spec/listen/adapters" }
|
5
|
-
watch('spec/support/listener_helper.rb') { "spec/listen/listener_spec.rb" }
|
6
|
-
watch('spec/support/fixtures_helper.rb') { "spec" }
|
7
|
-
watch('spec/spec_helper.rb') { "spec" }
|
8
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2013 Thibaud Guillaume-Gentil
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,349 +0,0 @@
|
|
1
|
-
# Listen [![Gem Version](https://badge.fury.io/rb/listen.png)](http://badge.fury.io/rb/listen) [![Build Status](https://secure.travis-ci.org/guard/listen.png?branch=master)](http://travis-ci.org/guard/listen) [![Dependency Status](https://gemnasium.com/guard/listen.png)](https://gemnasium.com/guard/listen) [![Code Climate](https://codeclimate.com/github/guard/listen.png)](https://codeclimate.com/github/guard/listen) [![Coverage Status](https://coveralls.io/repos/guard/listen/badge.png?branch=master)](https://coveralls.io/r/guard/listen)
|
2
|
-
|
3
|
-
The Listen gem listens to file modifications and notifies you about the changes.
|
4
|
-
|
5
|
-
## Features
|
6
|
-
|
7
|
-
* Works everywhere!
|
8
|
-
* Supports watching multiple directories from a single listener.
|
9
|
-
* OS-specific adapters for Mac OS X 10.6+, Linux, *BSD and Windows.
|
10
|
-
* Automatic fallback to polling if OS-specific adapter doesn't work.
|
11
|
-
* Detects file modification, addition and removal.
|
12
|
-
* File content checksum comparison for modifications made under the same second.
|
13
|
-
* Allows supplying regexp-patterns to ignore and filter paths for better results.
|
14
|
-
* Tested on all Ruby environments via [Travis CI](https://travis-ci.org/guard/listen).
|
15
|
-
|
16
|
-
## Pending features
|
17
|
-
|
18
|
-
Still not implemented, pull requests are welcome.
|
19
|
-
|
20
|
-
* Symlinks support. [#25](https://github.com/guard/listen/issues/25)
|
21
|
-
* Signal handling. [#105](https://github.com/guard/listen/issues/105)
|
22
|
-
* Non-recursive directory scanning. [#111](https://github.com/guard/listen/issues/111)
|
23
|
-
|
24
|
-
## Install
|
25
|
-
|
26
|
-
### Using Bundler
|
27
|
-
|
28
|
-
The simplest way to install Listen is to use Bundler.
|
29
|
-
|
30
|
-
Add Listen to your Gemfile:
|
31
|
-
|
32
|
-
```ruby
|
33
|
-
group :development do
|
34
|
-
gem 'listen'
|
35
|
-
end
|
36
|
-
```
|
37
|
-
|
38
|
-
and install it by running Bundler:
|
39
|
-
|
40
|
-
```bash
|
41
|
-
$ bundle
|
42
|
-
```
|
43
|
-
|
44
|
-
### Install the gem with RubyGems
|
45
|
-
|
46
|
-
```bash
|
47
|
-
$ gem install listen
|
48
|
-
```
|
49
|
-
|
50
|
-
### On Windows
|
51
|
-
|
52
|
-
If your are on Windows and using Ruby MRI >= 1.9.2 you can try to use the [`wdm`](https://github.com/Maher4Ever/wdm) instead of polling.
|
53
|
-
Please add the following to your Gemfile:
|
54
|
-
|
55
|
-
```ruby
|
56
|
-
require 'rbconfig'
|
57
|
-
gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
|
58
|
-
```
|
59
|
-
|
60
|
-
## Usage
|
61
|
-
|
62
|
-
There are **two ways** to use Listen:
|
63
|
-
|
64
|
-
1. Block API: Call `Listen.to`/`Listen.to!` with either a single directory or multiple directories, then define the `change` callback in a block.
|
65
|
-
2. "Object" API: Create a `listener` object and use it in a chainable way.
|
66
|
-
|
67
|
-
### Block API
|
68
|
-
|
69
|
-
``` ruby
|
70
|
-
# Listen to a single directory.
|
71
|
-
Listen.to('dir/path/to/listen', :filter => /\.rb$/, :ignore => %r{ignored/path/}) do |modified, added, removed|
|
72
|
-
# ...
|
73
|
-
end
|
74
|
-
|
75
|
-
# Listen to multiple directories.
|
76
|
-
Listen.to('dir/to/awesome_app', 'dir/to/other_app', :filter => /\.rb$/, :latency => 0.1) do |modified, added, removed|
|
77
|
-
# ...
|
78
|
-
end
|
79
|
-
```
|
80
|
-
|
81
|
-
### "Object" API
|
82
|
-
|
83
|
-
``` ruby
|
84
|
-
listener = Listen.to('dir/path/to/listen')
|
85
|
-
listener = listener.ignore(%r{^ignored/path/})
|
86
|
-
listener = listener.filter(/\.rb$/)
|
87
|
-
listener = listener.latency(0.5)
|
88
|
-
listener = listener.force_polling(true)
|
89
|
-
listener = listener.polling_fallback_message(false)
|
90
|
-
listener = listener.force_adapter(Listen::Adapters::Linux)
|
91
|
-
listener = listener.change(&callback)
|
92
|
-
listener.start
|
93
|
-
```
|
94
|
-
|
95
|
-
**Note**: All the "Object" API methods except `start`/`start!` return the listener
|
96
|
-
and are thus chainable:
|
97
|
-
|
98
|
-
``` ruby
|
99
|
-
Listen.to('dir/path/to/listen')
|
100
|
-
.ignore(%r{^ignored/path/})
|
101
|
-
.filter(/\.rb$/)
|
102
|
-
.latency(0.5)
|
103
|
-
.force_polling(true)
|
104
|
-
.polling_fallback_message('custom message')
|
105
|
-
.change(&callback)
|
106
|
-
.start
|
107
|
-
```
|
108
|
-
|
109
|
-
### Pause/Unpause
|
110
|
-
|
111
|
-
Listener can also easily be paused/unpaused:
|
112
|
-
|
113
|
-
``` ruby
|
114
|
-
listener = Listen.to('dir/path/to/listen')
|
115
|
-
listener.start # non-blocking mode
|
116
|
-
listener.pause # stop listening to changes
|
117
|
-
listener.paused? # => true
|
118
|
-
listener.unpause # start listening to changes again
|
119
|
-
listener.stop # stop completely the listener
|
120
|
-
```
|
121
|
-
|
122
|
-
## Changes callback
|
123
|
-
|
124
|
-
Changes to the listened-to directories gets reported back to the user in a callback.
|
125
|
-
The registered callback gets invoked, when there are changes, with **three** parameters:
|
126
|
-
`modified_paths`, `added_paths` and `removed_paths` in that particular order.
|
127
|
-
|
128
|
-
You can register a callback in two ways. The first way is by passing a block when calling
|
129
|
-
the `Listen.to`/`Listen.to!` method or when initializing a listener object:
|
130
|
-
|
131
|
-
```ruby
|
132
|
-
Listen.to('path/to/app') do |modified, added, removed|
|
133
|
-
# This block will be called when there are changes.
|
134
|
-
end
|
135
|
-
|
136
|
-
# or ...
|
137
|
-
|
138
|
-
listener = Listen::Listener.new('path/to/app') do |modified, added, removed|
|
139
|
-
# This block will be called when there are changes.
|
140
|
-
end
|
141
|
-
|
142
|
-
```
|
143
|
-
|
144
|
-
The second way to register a callback is by calling the `#change` method on a
|
145
|
-
listener passing it a block:
|
146
|
-
|
147
|
-
```ruby
|
148
|
-
# Create a callback
|
149
|
-
callback = Proc.new do |modified, added, removed|
|
150
|
-
# This proc will be called when there are changes.
|
151
|
-
end
|
152
|
-
|
153
|
-
listener = Listen.to('dir')
|
154
|
-
listener.change(&callback) # convert the callback to a block and register it
|
155
|
-
|
156
|
-
listener.start
|
157
|
-
```
|
158
|
-
|
159
|
-
### Paths in callbacks
|
160
|
-
|
161
|
-
Listeners invoke callbacks passing them absolute paths by default:
|
162
|
-
|
163
|
-
```ruby
|
164
|
-
# Assume someone changes the 'style.css' file in '/home/user/app/css' after creating
|
165
|
-
# the listener.
|
166
|
-
Listen.to('/home/user/app/css') do |modified, added, removed|
|
167
|
-
modified.inspect # => ['/home/user/app/css/style.css']
|
168
|
-
end
|
169
|
-
```
|
170
|
-
|
171
|
-
#### Relative paths in callbacks
|
172
|
-
|
173
|
-
When creating a listener for a **single** path (more specifically a `Listen::Listener` instance),
|
174
|
-
you can pass `:relative_paths => true` as an option to get relative paths in
|
175
|
-
your callback:
|
176
|
-
|
177
|
-
```ruby
|
178
|
-
# Assume someone changes the 'style.css' file in '/home/user/app/css' after creating
|
179
|
-
# the listener.
|
180
|
-
Listen.to('/home/user/app/css', :relative_paths => true) do |modified, added, removed|
|
181
|
-
modified.inspect # => ['style.css']
|
182
|
-
end
|
183
|
-
```
|
184
|
-
|
185
|
-
Passing the `:relative_paths => true` option won't work when listening to multiple
|
186
|
-
directories:
|
187
|
-
|
188
|
-
```ruby
|
189
|
-
# Assume someone changes the 'style.css' file in '/home/user/app/css' after creating
|
190
|
-
# the listener.
|
191
|
-
Listen.to('/home/user/app/css', '/home/user/app/js', :relative_paths => true) do |modified, added, removed|
|
192
|
-
modified.inspect # => ['/home/user/app/css/style.css']
|
193
|
-
end
|
194
|
-
```
|
195
|
-
|
196
|
-
## Options
|
197
|
-
|
198
|
-
All the following options can be set through the `Listen.to`/`Listen.to!` params
|
199
|
-
or via ["Object" API](#object-api) methods:
|
200
|
-
|
201
|
-
```ruby
|
202
|
-
:ignore => %r{app/CMake/}, /\.pid$/ # Ignore a list of paths (root directory or sub-dir)
|
203
|
-
# default: See DEFAULT_IGNORED_DIRECTORIES and DEFAULT_IGNORED_EXTENSIONS in Listen::DirectoryRecord
|
204
|
-
|
205
|
-
:filter => /\.rb$/, /\.coffee$/ # Filter files to listen to via a regexps list.
|
206
|
-
# default: none
|
207
|
-
|
208
|
-
:latency => 0.5 # Set the delay (**in seconds**) between checking for changes
|
209
|
-
# default: 0.25 sec (1.0 sec for polling)
|
210
|
-
|
211
|
-
:force_adapter => Listen::Adapters::Linux # Force the use of a particular adapter class
|
212
|
-
# default: none
|
213
|
-
|
214
|
-
:force_polling => true # Force the use of the polling adapter
|
215
|
-
# default: none
|
216
|
-
|
217
|
-
:polling_fallback_message => 'custom message' # Set a custom polling fallback message (or disable it with false)
|
218
|
-
# default: "Listen will be polling for changes. Learn more at https://github.com/guard/listen#polling-fallback."
|
219
|
-
|
220
|
-
:relative_paths => true # Enable the use of relative paths in the callback.
|
221
|
-
# default: false
|
222
|
-
```
|
223
|
-
|
224
|
-
### Note on the patterns for ignoring and filtering paths
|
225
|
-
|
226
|
-
Just like the unix convention of beginning absolute paths with the
|
227
|
-
directory-separator (forward slash `/` in unix) and with no prefix for relative paths,
|
228
|
-
Listen doesn't prefix relative paths (to the watched directory) with a directory-separator.
|
229
|
-
|
230
|
-
Therefore make sure _NOT_ to prefix your regexp-patterns for filtering or ignoring paths
|
231
|
-
with a directory-separator, otherwise they won't work as expected.
|
232
|
-
|
233
|
-
As an example: to ignore the `build` directory in a C-project, use `%r{build/}`
|
234
|
-
and not `%r{/build/}`.
|
235
|
-
|
236
|
-
Use `#filter!` and `#ignore!` methods to overwrites default patterns.
|
237
|
-
|
238
|
-
## Blocking listening to changes
|
239
|
-
|
240
|
-
Calling `Listen.to` with a block doesn't block the current thread. If you want
|
241
|
-
to block the current thread instead until the listener is stopped (which needs
|
242
|
-
to be done from another thread), you can use `Listen.to!`.
|
243
|
-
|
244
|
-
Similarly, if you're using the "Object" API, you can use `#start!` instead of `#start` to block the
|
245
|
-
current thread until the listener is stopped.
|
246
|
-
|
247
|
-
Here is an example of using a listener in the blocking mode:
|
248
|
-
|
249
|
-
```ruby
|
250
|
-
Listen.to!('dir/path/to/listen') # block execution
|
251
|
-
|
252
|
-
# Code here will not run until the listener is stopped
|
253
|
-
|
254
|
-
```
|
255
|
-
|
256
|
-
Here is an example of using a listener started with the "Object" API in blocking mode:
|
257
|
-
|
258
|
-
```ruby
|
259
|
-
listener = Listen.to('dir/path/to/listen')
|
260
|
-
listener.start! # block execution
|
261
|
-
|
262
|
-
# Code here will not run until the listener is stopped
|
263
|
-
|
264
|
-
```
|
265
|
-
|
266
|
-
**Note**: Using the `Listen.to!` helper-method with or without a callback-block
|
267
|
-
will always start the listener right away and block execution of the current thread.
|
268
|
-
|
269
|
-
## Listen adapters
|
270
|
-
|
271
|
-
The Listen gem has a set of adapters to notify it when there are changes.
|
272
|
-
There are 4 OS-specific adapters to support Mac, Linux, *BSD and Windows.
|
273
|
-
These adapters are fast as they use some system-calls to implement the notifying function.
|
274
|
-
|
275
|
-
There is also a polling adapter which is a cross-platform adapter and it will
|
276
|
-
work on any system. This adapter is unfortunately slower than the rest of the adapters.
|
277
|
-
|
278
|
-
The Listen gem will choose the best and working adapter for your machine automatically. If you
|
279
|
-
want to force the use of the polling adapter, either use the `:force_polling` option
|
280
|
-
while initializing the listener or call the `#force_polling` method on your listener
|
281
|
-
before starting it.
|
282
|
-
|
283
|
-
It is also possible to force the use of a particular adapter, by using the `:force_adapter`
|
284
|
-
option. This option skips the usual adapter choosing mechanism and uses the given
|
285
|
-
adapter class instead. The adapter choosing mechanism requires write permission
|
286
|
-
to your watched directories and will needlessly load code, which isn't always desirable.
|
287
|
-
|
288
|
-
## Polling fallback
|
289
|
-
|
290
|
-
When a OS-specific adapter doesn't work the Listen gem automatically falls back to the polling adapter.
|
291
|
-
Here are some things you could try to avoid the polling fallback:
|
292
|
-
|
293
|
-
* [Update your Dropbox client](http://www.dropbox.com/downloading) (if used).
|
294
|
-
* Increase latency. (Please [open an issue](https://github.com/guard/listen/issues/new)
|
295
|
-
if you think that default is too low.)
|
296
|
-
* Move or rename the listened folder.
|
297
|
-
* Update/reboot your OS.
|
298
|
-
|
299
|
-
If your application keeps using the polling-adapter and you can't figure out why, feel free to [open an issue](https://github.com/guard/listen/issues/new) (and be sure to [give all the details](https://github.com/guard/listen/blob/master/CONTRIBUTING.md)).
|
300
|
-
|
301
|
-
## Development [![Dependency Status](https://gemnasium.com/guard/listen.png?branch=master)](https://gemnasium.com/guard/listen)
|
302
|
-
|
303
|
-
* Documentation hosted at [RubyDoc](http://rubydoc.info/github/guard/listen/master/frames).
|
304
|
-
* Source hosted at [GitHub](https://github.com/guard/listen).
|
305
|
-
|
306
|
-
Pull requests are very welcome! Please try to follow these simple rules if applicable:
|
307
|
-
|
308
|
-
* Please create a topic branch for every separate change you make.
|
309
|
-
* Make sure your patches are well tested. All specs must pass on [Travis CI](https://travis-ci.org/guard/listen).
|
310
|
-
* Update the [Yard](http://yardoc.org/) documentation.
|
311
|
-
* Update the [README](https://github.com/guard/listen/blob/master/README.md).
|
312
|
-
* Update the [CHANGELOG](https://github.com/guard/listen/blob/master/CHANGELOG.md) for noteworthy changes (don't forget to run `bundle exec pimpmychangelog` and watch the magic happen)!
|
313
|
-
* Please **do not change** the version number.
|
314
|
-
|
315
|
-
For questions please join us in our [Google group](http://groups.google.com/group/guard-dev) or on
|
316
|
-
`#guard` (irc.freenode.net).
|
317
|
-
|
318
|
-
## Acknowledgments
|
319
|
-
|
320
|
-
* [Michael Kessler (netzpirat)][] for having written the [initial specs](https://github.com/guard/listen/commit/1e457b13b1bb8a25d2240428ce5ed488bafbed1f).
|
321
|
-
* [Travis Tilley (ttilley)][] for this awesome work on [fssm][] & [rb-fsevent][].
|
322
|
-
* [Nathan Weizenbaum (nex3)][] for [rb-inotify][], a thorough inotify wrapper.
|
323
|
-
* [Mathieu Arnold (mat813)][] for [rb-kqueue][], a simple kqueue wrapper.
|
324
|
-
* [stereobooster][] for [rb-fchange][], windows support wouldn't exist without him.
|
325
|
-
* [Yehuda Katz (wycats)][] for [vigilo][], that has been a great source of inspiration.
|
326
|
-
|
327
|
-
## Authors
|
328
|
-
|
329
|
-
* [Thibaud Guillaume-Gentil][] ([@thibaudgg](http://twitter.com/thibaudgg))
|
330
|
-
* [Maher Sallam][] ([@mahersalam](http://twitter.com/mahersalam))
|
331
|
-
|
332
|
-
## Contributors
|
333
|
-
|
334
|
-
[https://github.com/guard/listen/contributors](https://github.com/guard/listen/contributors)
|
335
|
-
|
336
|
-
[Thibaud Guillaume-Gentil]: https://github.com/thibaudgg
|
337
|
-
[Maher Sallam]: https://github.com/Maher4Ever
|
338
|
-
[Michael Kessler (netzpirat)]: https://github.com/netzpirat
|
339
|
-
[Travis Tilley (ttilley)]: https://github.com/ttilley
|
340
|
-
[fssm]: https://github.com/ttilley/fssm
|
341
|
-
[rb-fsevent]: https://github.com/thibaudgg/rb-fsevent
|
342
|
-
[Mathieu Arnold (mat813)]: https://github.com/mat813
|
343
|
-
[Nathan Weizenbaum (nex3)]: https://github.com/nex3
|
344
|
-
[rb-inotify]: https://github.com/nex3/rb-inotify
|
345
|
-
[stereobooster]: https://github.com/stereobooster
|
346
|
-
[rb-fchange]: https://github.com/stereobooster/rb-fchange
|
347
|
-
[rb-kqueue]: https://github.com/mat813/rb-kqueue
|
348
|
-
[Yehuda Katz (wycats)]: https://github.com/wycats
|
349
|
-
[vigilo]: https://github.com/wycats/vigilo
|