picolena 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +11 -4
- data/Manifest.txt +1 -0
- data/README.txt +2 -2
- data/bin/picolena +1 -1
- data/config/hoe.rb +10 -10
- data/lib/picolena/USAGE +1 -1
- data/lib/picolena/config/basic.rb +11 -11
- data/lib/picolena/picolena_generator.rb +15 -14
- data/lib/picolena/templates/app/controllers/application.rb +5 -5
- data/lib/picolena/templates/app/controllers/documents_controller.rb +17 -9
- data/lib/picolena/templates/app/helpers/documents_helper.rb +15 -14
- data/lib/picolena/templates/app/models/document.rb +28 -37
- data/lib/picolena/templates/app/models/finder.rb +12 -37
- data/lib/picolena/templates/app/models/indexer.rb +58 -37
- data/lib/picolena/templates/app/models/plain_text_extractor.rb +16 -16
- data/lib/picolena/templates/app/models/query.rb +5 -5
- data/lib/picolena/templates/app/views/documents/show.html.haml +3 -3
- data/lib/picolena/templates/app/views/layouts/application.html.haml +2 -2
- data/lib/picolena/templates/config/environment.rb +1 -1
- data/lib/picolena/templates/config/initializers/002_load_indexed_dirs.rb +8 -8
- data/lib/picolena/templates/config/initializers/003_load_white_list_IPs.rb +8 -8
- data/lib/picolena/templates/config/initializers/005_load_custom_title_and_names_and_links.rb +5 -5
- data/lib/picolena/templates/config/initializers/006_load_icons.rb +9 -7
- data/lib/picolena/templates/lang/ui/es.yml +1 -1
- data/lib/picolena/templates/lib/core_exts.rb +7 -7
- data/lib/picolena/templates/lib/plain_text_extractor_DSL.rb +10 -10
- data/lib/picolena/templates/lib/plain_text_extractors/ms.excel.rb +1 -1
- data/lib/picolena/templates/lib/plain_text_extractors/plain_text.rb +2 -2
- data/lib/picolena/templates/lib/tasks/index.rake +8 -3
- data/lib/picolena/templates/lib/tasks/install_dependencies.rake +2 -2
- data/lib/picolena/templates/lib/tasks/log.rake +1 -1
- data/lib/picolena/templates/public/.htaccess +3 -3
- data/lib/picolena/templates/public/images/flags/sv.png +0 -0
- data/lib/picolena/templates/public/stylesheets/style.css +2 -2
- data/lib/picolena/templates/script/spec_server +1 -1
- data/lib/picolena/templates/spec/controllers/application_controller_spec.rb +2 -2
- data/lib/picolena/templates/spec/controllers/documents_controller_spec.rb +17 -17
- data/lib/picolena/templates/spec/helpers/application_helper_spec.rb +2 -2
- data/lib/picolena/templates/spec/helpers/documents_helper_spec.rb +3 -3
- data/lib/picolena/templates/spec/models/basic_finder_spec.rb +14 -14
- data/lib/picolena/templates/spec/models/document_spec.rb +7 -15
- data/lib/picolena/templates/spec/models/finder_spec.rb +45 -38
- data/lib/picolena/templates/spec/models/host_indexing_system_spec.rb +5 -5
- data/lib/picolena/templates/spec/models/index_directories_spec.rb +2 -2
- data/lib/picolena/templates/spec/models/plain_text_extractor_spec.rb +6 -6
- data/lib/picolena/templates/spec/models/query_spec.rb +7 -7
- data/lib/picolena/templates/spec/rcov.opts +1 -1
- data/lib/picolena/templates/spec/test_dirs/indexed/basic/myfirstjavaprog.java +1 -1
- data/lib/picolena/templates/spec/test_dirs/indexed/basic/queens.for +1 -1
- data/lib/picolena/templates/spec/test_dirs/indexed/lang/hugo +74 -74
- data/lib/picolena/templates/spec/test_dirs/indexed/lang/lorca +56 -56
- data/lib/picolena/templates/spec/test_dirs/indexed/others/7.html +4 -4
- data/lib/picolena/templates/spec/test_dirs/indexed/others/ccmatrix1.cpp +6 -6
- data/lib/picolena/templates/spec/test_dirs/indexed/others/lemonde.htm +326 -326
- data/lib/picolena/templates/spec/test_dirs/indexed/others/nested/ReadMe.rtf +62 -62
- data/lib/picolena/templates/spec/test_dirs/indexed/others/xor.vee +0 -1
- data/lib/picolena/templates/spec/test_dirs/indexed/others/zafh.net.html +1 -1
- data/lib/picolena/version.rb +1 -1
- data/lib/rubigen_ext.rb +1 -1
- data/rails_plugins/globalite/CHANGELOG +1 -1
- data/rails_plugins/globalite/README +19 -19
- data/rails_plugins/globalite/lang/rails/de-DE.yml +6 -6
- data/rails_plugins/globalite/lang/rails/en-UK.yml +10 -10
- data/rails_plugins/globalite/lang/rails/en-US.yml +10 -10
- data/rails_plugins/globalite/lang/rails/es-ES.yml +11 -11
- data/rails_plugins/globalite/lang/rails/fr-FR.yml +10 -10
- data/rails_plugins/globalite/lang/rails/it.yml +10 -10
- data/rails_plugins/globalite/lang/rails/pt-BR.yml +6 -6
- data/rails_plugins/globalite/lang/rails/pt-PT.yml +6 -6
- data/rails_plugins/globalite/lib/globalite/l10n.rb +25 -25
- data/rails_plugins/globalite/lib/globalite/locale.rb +9 -9
- data/rails_plugins/globalite/lib/rails/core_ext.rb +4 -4
- data/rails_plugins/globalite/lib/rails/localization.rb +3 -3
- data/rails_plugins/globalite/lib/rails/localized_action_view.rb +17 -17
- data/rails_plugins/globalite/lib/rails/localized_active_record.rb +4 -4
- data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers/DateHelper.html +19 -19
- data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers/FormOptionsHelper.html +9 -9
- data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers/NumberHelper.html +8 -8
- data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers.html +5 -5
- data/rails_plugins/globalite/rdoc/classes/ActionView.html +5 -5
- data/rails_plugins/globalite/rdoc/classes/ActiveRecord/Errors.html +6 -6
- data/rails_plugins/globalite/rdoc/classes/ActiveRecord.html +5 -5
- data/rails_plugins/globalite/rdoc/classes/Array.html +6 -6
- data/rails_plugins/globalite/rdoc/classes/Date.html +8 -8
- data/rails_plugins/globalite/rdoc/classes/Globalite/L10n.html +49 -49
- data/rails_plugins/globalite/rdoc/classes/Globalite.html +6 -6
- data/rails_plugins/globalite/rdoc/classes/Kernel.html +6 -6
- data/rails_plugins/globalite/rdoc/classes/Locale.html +11 -11
- data/rails_plugins/globalite/rdoc/classes/Time.html +8 -8
- data/rails_plugins/globalite/rdoc/files/README.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/globalite/l10n_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/globalite/locale_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/globalite_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/rails/core_ext_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/rails/localization_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/rails/localized_action_view_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/rails/localized_active_record_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/fr_class_index.html +1 -1
- data/rails_plugins/globalite/rdoc/fr_file_index.html +1 -1
- data/rails_plugins/globalite/rdoc/fr_method_index.html +1 -1
- data/rails_plugins/globalite/rdoc/index.html +1 -1
- data/rails_plugins/globalite/spec/core_localization_spec.rb +18 -18
- data/rails_plugins/globalite/spec/l10n_spec.rb +25 -25
- data/rails_plugins/globalite/tasks/globalite_tasks.rake +6 -6
- data/rails_plugins/rspec/CHANGES +16 -16
- data/rails_plugins/rspec/README +2 -2
- data/rails_plugins/rspec/Rakefile +1 -1
- data/rails_plugins/rspec/UPGRADE +1 -1
- data/rails_plugins/rspec/autotest/discover.rb +1 -1
- data/rails_plugins/rspec/examples/pure/autogenerated_docstrings_example.rb +5 -5
- data/rails_plugins/rspec/examples/pure/before_and_after_example.rb +2 -2
- data/rails_plugins/rspec/examples/pure/behave_as_example.rb +5 -5
- data/rails_plugins/rspec/examples/pure/custom_expectation_matchers.rb +7 -7
- data/rails_plugins/rspec/examples/pure/file_accessor.rb +1 -1
- data/rails_plugins/rspec/examples/pure/file_accessor_spec.rb +2 -2
- data/rails_plugins/rspec/examples/pure/helper_method_example.rb +1 -1
- data/rails_plugins/rspec/examples/pure/legacy_spec.rb +2 -2
- data/rails_plugins/rspec/examples/pure/predicate_example.rb +2 -2
- data/rails_plugins/rspec/examples/pure/shared_example_group_example.rb +11 -11
- data/rails_plugins/rspec/examples/pure/shared_stack_examples.rb +4 -4
- data/rails_plugins/rspec/examples/pure/stack.rb +6 -6
- data/rails_plugins/rspec/examples/pure/stack_spec.rb +7 -7
- data/rails_plugins/rspec/examples/pure/stack_spec_with_nested_example_groups.rb +10 -10
- data/rails_plugins/rspec/examples/pure/stubbing_example.rb +4 -4
- data/rails_plugins/rspec/examples/stories/adder.rb +2 -2
- data/rails_plugins/rspec/examples/stories/addition +8 -8
- data/rails_plugins/rspec/examples/stories/calculator.rb +5 -5
- data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb +7 -7
- data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/examples/grid_behaviour.rb +13 -13
- data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/stories/create_a_cell.rb +5 -5
- data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/stories/kill_a_cell.rb +2 -2
- data/rails_plugins/rspec/examples/stories/game-of-life/life/game.rb +3 -3
- data/rails_plugins/rspec/examples/stories/game-of-life/life/grid.rb +10 -10
- data/rails_plugins/rspec/failing_examples/failing_autogenerated_docstrings_example.rb +5 -5
- data/rails_plugins/rspec/failing_examples/failure_in_setup.rb +3 -3
- data/rails_plugins/rspec/failing_examples/failure_in_teardown.rb +3 -3
- data/rails_plugins/rspec/failing_examples/mocking_example.rb +1 -1
- data/rails_plugins/rspec/failing_examples/raising_example.rb +11 -11
- data/rails_plugins/rspec/failing_examples/team_spec.rb +5 -5
- data/rails_plugins/rspec/lib/autotest/rspec.rb +5 -5
- data/rails_plugins/rspec/lib/spec/example/configuration.rb +4 -4
- data/rails_plugins/rspec/lib/spec/example/example_group_factory.rb +3 -3
- data/rails_plugins/rspec/lib/spec/example/example_group_methods.rb +1 -1
- data/rails_plugins/rspec/lib/spec/example/example_matcher.rb +2 -2
- data/rails_plugins/rspec/lib/spec/example/example_methods.rb +4 -4
- data/rails_plugins/rspec/lib/spec/example/pending.rb +1 -1
- data/rails_plugins/rspec/lib/spec/expectations/differs/default.rb +5 -5
- data/rails_plugins/rspec/lib/spec/expectations/errors.rb +1 -1
- data/rails_plugins/rspec/lib/spec/expectations/handler.rb +5 -5
- data/rails_plugins/rspec/lib/spec/expectations.rb +1 -1
- data/rails_plugins/rspec/lib/spec/extensions/main.rb +8 -8
- data/rails_plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb +2 -2
- data/rails_plugins/rspec/lib/spec/matchers/be.rb +18 -18
- data/rails_plugins/rspec/lib/spec/matchers/be_close.rb +4 -4
- data/rails_plugins/rspec/lib/spec/matchers/change.rb +20 -20
- data/rails_plugins/rspec/lib/spec/matchers/eql.rb +4 -4
- data/rails_plugins/rspec/lib/spec/matchers/equal.rb +4 -4
- data/rails_plugins/rspec/lib/spec/matchers/has.rb +8 -8
- data/rails_plugins/rspec/lib/spec/matchers/have.rb +9 -9
- data/rails_plugins/rspec/lib/spec/matchers/include.rb +7 -7
- data/rails_plugins/rspec/lib/spec/matchers/match.rb +6 -6
- data/rails_plugins/rspec/lib/spec/matchers/operator_matcher.rb +1 -1
- data/rails_plugins/rspec/lib/spec/matchers/raise_error.rb +6 -6
- data/rails_plugins/rspec/lib/spec/matchers/respond_to.rb +7 -7
- data/rails_plugins/rspec/lib/spec/matchers/satisfy.rb +4 -4
- data/rails_plugins/rspec/lib/spec/matchers/simple_matcher.rb +3 -3
- data/rails_plugins/rspec/lib/spec/matchers/throw_symbol.rb +8 -8
- data/rails_plugins/rspec/lib/spec/matchers.rb +2 -2
- data/rails_plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb +3 -3
- data/rails_plugins/rspec/lib/spec/mocks/argument_expectation.rb +32 -32
- data/rails_plugins/rspec/lib/spec/mocks/error_generator.rb +13 -13
- data/rails_plugins/rspec/lib/spec/mocks/errors.rb +1 -1
- data/rails_plugins/rspec/lib/spec/mocks/message_expectation.rb +38 -38
- data/rails_plugins/rspec/lib/spec/mocks/methods.rb +3 -3
- data/rails_plugins/rspec/lib/spec/mocks/mock.rb +5 -5
- data/rails_plugins/rspec/lib/spec/mocks/order_group.rb +5 -5
- data/rails_plugins/rspec/lib/spec/mocks/proxy.rb +4 -4
- data/rails_plugins/rspec/lib/spec/mocks/space.rb +3 -3
- data/rails_plugins/rspec/lib/spec/mocks/spec_methods.rb +1 -1
- data/rails_plugins/rspec/lib/spec/mocks.rb +13 -13
- data/rails_plugins/rspec/lib/spec/rake/spectask.rb +4 -4
- data/rails_plugins/rspec/lib/spec/rake/verify_rcov.rb +9 -9
- data/rails_plugins/rspec/lib/spec/runner/backtrace_tweaker.rb +2 -2
- data/rails_plugins/rspec/lib/spec/runner/formatter/base_formatter.rb +7 -7
- data/rails_plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb +13 -13
- data/rails_plugins/rspec/lib/spec/runner/formatter/failing_examples_formatter.rb +1 -1
- data/rails_plugins/rspec/lib/spec/runner/formatter/html_formatter.rb +8 -8
- data/rails_plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb +7 -7
- data/rails_plugins/rspec/lib/spec/runner/formatter/progress_bar_formatter.rb +2 -2
- data/rails_plugins/rspec/lib/spec/runner/formatter/snippet_extractor.rb +5 -5
- data/rails_plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb +4 -4
- data/rails_plugins/rspec/lib/spec/runner/formatter/story/html_formatter.rb +6 -6
- data/rails_plugins/rspec/lib/spec/runner/formatter/story/plain_text_formatter.rb +12 -12
- data/rails_plugins/rspec/lib/spec/runner/heckle_runner.rb +6 -6
- data/rails_plugins/rspec/lib/spec/runner/option_parser.rb +5 -5
- data/rails_plugins/rspec/lib/spec/runner/options.rb +8 -8
- data/rails_plugins/rspec/lib/spec/runner/reporter.rb +14 -14
- data/rails_plugins/rspec/lib/spec/runner.rb +41 -41
- data/rails_plugins/rspec/lib/spec/story/extensions/main.rb +6 -6
- data/rails_plugins/rspec/lib/spec/story/extensions/regexp.rb +1 -1
- data/rails_plugins/rspec/lib/spec/story/extensions/string.rb +1 -1
- data/rails_plugins/rspec/lib/spec/story/given_scenario.rb +1 -1
- data/rails_plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb +6 -6
- data/rails_plugins/rspec/lib/spec/story/runner/scenario_collector.rb +2 -2
- data/rails_plugins/rspec/lib/spec/story/runner/scenario_runner.rb +5 -5
- data/rails_plugins/rspec/lib/spec/story/runner/story_mediator.rb +20 -20
- data/rails_plugins/rspec/lib/spec/story/runner/story_parser.rb +29 -29
- data/rails_plugins/rspec/lib/spec/story/runner/story_runner.rb +8 -8
- data/rails_plugins/rspec/lib/spec/story/runner.rb +7 -7
- data/rails_plugins/rspec/lib/spec/story/scenario.rb +1 -1
- data/rails_plugins/rspec/lib/spec/story/step.rb +5 -5
- data/rails_plugins/rspec/lib/spec/story/step_group.rb +12 -12
- data/rails_plugins/rspec/lib/spec/story/step_mother.rb +6 -6
- data/rails_plugins/rspec/lib/spec/story/story.rb +5 -5
- data/rails_plugins/rspec/lib/spec/story/world.rb +16 -16
- data/rails_plugins/rspec/lib/spec/translator.rb +21 -21
- data/rails_plugins/rspec/lib/spec/version.rb +2 -2
- data/rails_plugins/rspec/lib/spec.rb +1 -1
- data/rails_plugins/rspec/pre_commit/lib/pre_commit/pre_commit.rb +1 -1
- data/rails_plugins/rspec/pre_commit/lib/pre_commit/rspec.rb +6 -6
- data/rails_plugins/rspec/pre_commit/lib/pre_commit/rspec_on_rails.rb +6 -6
- data/rails_plugins/rspec/pre_commit/spec/pre_commit/pre_commit_spec.rb +1 -1
- data/rails_plugins/rspec/pre_commit/spec/pre_commit/rspec_on_rails_spec.rb +1 -1
- data/rails_plugins/rspec/report.html +3 -3
- data/rails_plugins/rspec/spec/autotest/discover_spec.rb +2 -2
- data/rails_plugins/rspec/spec/autotest/rspec_spec.rb +30 -30
- data/rails_plugins/rspec/spec/autotest_matchers.rb +7 -7
- data/rails_plugins/rspec/spec/spec/example/configuration_spec.rb +5 -5
- data/rails_plugins/rspec/spec/spec/example/example_group_factory_spec.rb +5 -5
- data/rails_plugins/rspec/spec/spec/example/example_group_methods_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/example/example_group_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/example/example_matcher_spec.rb +10 -10
- data/rails_plugins/rspec/spec/spec/example/example_runner_spec.rb +29 -29
- data/rails_plugins/rspec/spec/spec/example/example_spec.rb +6 -6
- data/rails_plugins/rspec/spec/spec/example/nested_example_group_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/example/pending_module_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/example/predicate_matcher_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/example/shared_example_group_spec.rb +4 -4
- data/rails_plugins/rspec/spec/spec/expectations/extensions/object_spec.rb +12 -12
- data/rails_plugins/rspec/spec/spec/expectations/fail_with_spec.rb +8 -8
- data/rails_plugins/rspec/spec/spec/extensions/main_spec.rb +6 -6
- data/rails_plugins/rspec/spec/spec/interop/test/unit/spec_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/interop/test/unit/test_unit_spec_helper.rb +2 -2
- data/rails_plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/matchers/be_spec.rb +5 -5
- data/rails_plugins/rspec/spec/spec/matchers/change_spec.rb +14 -14
- data/rails_plugins/rspec/spec/spec/matchers/description_generation_spec.rb +25 -25
- data/rails_plugins/rspec/spec/spec/matchers/exist_spec.rb +5 -5
- data/rails_plugins/rspec/spec/spec/matchers/handler_spec.rb +16 -16
- data/rails_plugins/rspec/spec/spec/matchers/have_spec.rb +13 -13
- data/rails_plugins/rspec/spec/spec/matchers/match_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/matchers/matcher_methods_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb +17 -17
- data/rails_plugins/rspec/spec/spec/matchers/raise_error_spec.rb +20 -20
- data/rails_plugins/rspec/spec/spec/matchers/respond_to_spec.rb +10 -10
- data/rails_plugins/rspec/spec/spec/matchers/simple_matcher_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/matchers/throw_symbol_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/mocks/bug_report_10263.rb +3 -3
- data/rails_plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb +4 -4
- data/rails_plugins/rspec/spec/spec/mocks/bug_report_15719_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/mocks/bug_report_7611_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/mocks/bug_report_8302_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/mocks/failing_mock_argument_constraints_spec.rb +12 -12
- data/rails_plugins/rspec/spec/spec/mocks/mock_ordering_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/mocks/mock_space_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/mocks/mock_spec.rb +56 -56
- data/rails_plugins/rspec/spec/spec/mocks/multiple_return_value_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/mocks/once_counts_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/mocks/options_hash_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/mocks/partial_mock_spec.rb +16 -16
- data/rails_plugins/rspec/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +10 -10
- data/rails_plugins/rspec/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +13 -13
- data/rails_plugins/rspec/spec/spec/mocks/stub_spec.rb +7 -7
- data/rails_plugins/rspec/spec/spec/mocks/twice_counts_spec.rb +6 -6
- data/rails_plugins/rspec/spec/spec/package/bin_spec_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/runner/class_and_argument_parser_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/runner/command_line_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/runner/drb_command_line_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/runner/execution_context_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html +1 -1
- data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +2 -2
- data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html +1 -1
- data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +1 -1
- data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html +3 -3
- data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatter_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/runner/formatter/profile_formatter_spec.rb +9 -9
- data/rails_plugins/rspec/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +4 -4
- data/rails_plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/runner/formatter/story/html_formatter_spec.rb +5 -5
- data/rails_plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.4.html +13 -13
- data/rails_plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +2 -2
- data/rails_plugins/rspec/spec/spec/runner/heckle_runner_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/runner/option_parser_spec.rb +9 -9
- data/rails_plugins/rspec/spec/spec/runner/options_spec.rb +13 -13
- data/rails_plugins/rspec/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/spec_classes.rb +8 -8
- data/rails_plugins/rspec/spec/spec/story/builders.rb +7 -7
- data/rails_plugins/rspec/spec/spec/story/extensions/main_spec.rb +6 -6
- data/rails_plugins/rspec/spec/spec/story/given_scenario_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/story/runner/plain_text_story_runner_spec.rb +12 -12
- data/rails_plugins/rspec/spec/spec/story/runner/scenario_collector_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/story/runner/scenario_runner_spec.rb +21 -21
- data/rails_plugins/rspec/spec/spec/story/runner/story_mediator_spec.rb +22 -22
- data/rails_plugins/rspec/spec/spec/story/runner/story_parser_spec.rb +55 -55
- data/rails_plugins/rspec/spec/spec/story/runner/story_runner_spec.rb +44 -44
- data/rails_plugins/rspec/spec/spec/story/runner_spec.rb +18 -18
- data/rails_plugins/rspec/spec/spec/story/scenario_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/story/step_group_spec.rb +20 -20
- data/rails_plugins/rspec/spec/spec/story/step_mother_spec.rb +14 -14
- data/rails_plugins/rspec/spec/spec/story/step_spec.rb +33 -33
- data/rails_plugins/rspec/spec/spec/story/story_spec.rb +12 -12
- data/rails_plugins/rspec/spec/spec/translator_spec.rb +12 -12
- data/rails_plugins/rspec/spec/spec_helper.rb +5 -5
- data/rails_plugins/rspec/stories/resources/helpers/story_helper.rb +1 -1
- data/rails_plugins/rspec/stories/resources/steps/running_rspec.rb +4 -4
- data/rails_plugins/rspec/stories/resources/test/spec_and_test_together.rb +2 -2
- data/rails_plugins/rspec/stories/resources/test/test_case_with_should_methods.rb +1 -1
- data/rails_plugins/rspec/story_server/prototype/javascripts/builder.js +14 -14
- data/rails_plugins/rspec/story_server/prototype/javascripts/controls.js +61 -61
- data/rails_plugins/rspec/story_server/prototype/javascripts/dragdrop.js +144 -144
- data/rails_plugins/rspec/story_server/prototype/javascripts/effects.js +127 -127
- data/rails_plugins/rspec/story_server/prototype/javascripts/rspec.js +15 -15
- data/rails_plugins/rspec/story_server/prototype/javascripts/scriptaculous.js +7 -7
- data/rails_plugins/rspec/story_server/prototype/javascripts/slider.js +37 -37
- data/rails_plugins/rspec/story_server/prototype/javascripts/sound.js +4 -4
- data/rails_plugins/rspec/story_server/prototype/javascripts/unittest.js +66 -66
- data/rails_plugins/rspec/story_server/prototype/stories.html +9 -9
- data/rails_plugins/rspec_on_rails/MIT-LICENSE +11 -11
- data/rails_plugins/rspec_on_rails/generators/rspec/templates/rcov.opts +1 -1
- data/rails_plugins/rspec_on_rails/generators/rspec/templates/script/spec_server +1 -1
- data/rails_plugins/rspec_on_rails/generators/rspec_controller/USAGE +1 -1
- data/rails_plugins/rspec_on_rails/generators/rspec_controller/templates/helper_spec.rb +2 -2
- data/rails_plugins/rspec_on_rails/generators/rspec_controller/templates/view_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/rspec_scaffold_generator.rb +12 -12
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/controller_spec.rb +35 -35
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/edit_erb_spec.rb +2 -2
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/helper_spec.rb +2 -2
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/index_erb_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/new_erb_spec.rb +2 -2
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/routing_spec.rb +11 -11
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/lib/autotest/rails_rspec.rb +3 -3
- data/rails_plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb +4 -4
- data/rails_plugins/rspec_on_rails/lib/spec/rails/example/rails_example_group.rb +1 -1
- data/rails_plugins/rspec_on_rails/lib/spec/rails/example/render_observer.rb +4 -4
- data/rails_plugins/rspec_on_rails/lib/spec/rails/example/view_example_group.rb +1 -1
- data/rails_plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/base.rb +1 -1
- data/rails_plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb +1 -1
- data/rails_plugins/rspec_on_rails/lib/spec/rails/matchers/assert_select.rb +10 -10
- data/rails_plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb +6 -6
- data/rails_plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb +7 -7
- data/rails_plugins/rspec_on_rails/lib/spec/rails/story_adapter.rb +1 -1
- data/rails_plugins/rspec_on_rails/lib/spec/rails.rb +8 -8
- data/rails_plugins/rspec_on_rails/spec/rails/autotest/mappings_spec.rb +6 -6
- data/rails_plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/spec/rails/example/controller_spec_spec.rb +22 -22
- data/rails_plugins/rspec_on_rails/spec/rails/example/helper_spec_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/spec/rails/example/ivar_proxy_spec.rb +3 -3
- data/rails_plugins/rspec_on_rails/spec/rails/example/shared_behaviour_spec.rb +2 -2
- data/rails_plugins/rspec_on_rails/spec/rails/example/view_spec_spec.rb +8 -8
- data/rails_plugins/rspec_on_rails/spec/rails/extensions/action_view_base_spec.rb +7 -7
- data/rails_plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/spec/rails/matchers/assert_select_spec.rb +37 -37
- data/rails_plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/spec/rails/matchers/have_text_spec.rb +4 -4
- data/rails_plugins/rspec_on_rails/spec/rails/matchers/redirect_to_spec.rb +26 -26
- data/rails_plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb +18 -18
- data/rails_plugins/rspec_on_rails/spec/rails/mocks/mock_model_spec.rb +2 -2
- data/rails_plugins/rspec_on_rails/spec/spec_helper.rb +1 -1
- data/rails_plugins/rspec_on_rails/spec_resources/controllers/controller_spec_controller.rb +9 -9
- data/rails_plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb +7 -7
- data/rails_plugins/rspec_on_rails/spec_resources/controllers/render_spec_controller.rb +5 -5
- data/rails_plugins/rspec_on_rails/spec_resources/controllers/rjs_spec_controller.rb +10 -10
- data/rails_plugins/rspec_on_rails/spec_resources/helpers/explicit_helper.rb +1 -1
- data/rails_plugins/rspec_on_rails/stories/transactions_should_rollback.rb +1 -1
- data/rails_plugins/rspec_on_rails/tasks/rspec.rake +4 -4
- data/script/txt2html +1 -1
- data/setup.rb +4 -4
- data/tasks/hack.rake +3 -3
- data/website/index.html +2 -2
- data/website/index.txt +1 -1
- data/website/index_devjavu +3 -3
- data/website/javascripts/rounded_corners_lite.inc.js +1 -1
- data/website/stylesheets/screen.css +2 -2
- data.tar.gz.sig +0 -0
- metadata +2 -1
- metadata.gz.sig +2 -1
@@ -1,10 +1,10 @@
|
|
1
1
|
desc 'Ferret index maintenance tasks'
|
2
|
-
namespace :index do
|
2
|
+
namespace :index do
|
3
3
|
desc 'Clear indexes'
|
4
4
|
task :clear => :environment do
|
5
5
|
Indexer.clear! :all
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
desc 'Create index'
|
9
9
|
task :create => :environment do
|
10
10
|
Indexer.index_every_directory(remove_first=true)
|
@@ -14,7 +14,12 @@ namespace :index do
|
|
14
14
|
task :update => :environment do
|
15
15
|
Indexer.index_every_directory
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
|
+
desc 'Returns the number of indexed documents'
|
19
|
+
task :size => :environment do
|
20
|
+
puts "#{Indexer.doc_count} documents are currently indexed in #{Picolena::IndexSavePath}"
|
21
|
+
end
|
22
|
+
|
18
23
|
# Search index with query "some query" :
|
19
24
|
# rake index:search query="some query"
|
20
25
|
desc 'Search index'
|
@@ -14,14 +14,14 @@ namespace :install_dependencies do
|
|
14
14
|
# odt2txt package not available on previous versions
|
15
15
|
desc 'Install required packages on Ubuntu'
|
16
16
|
task :on_ubuntu => :on_debian
|
17
|
-
|
17
|
+
|
18
18
|
desc 'Install required gems and programs on Windows'
|
19
19
|
task :on_windows_xp do
|
20
20
|
#NOTE: Long way to go before it runs on XP.
|
21
21
|
$stderr.puts "Implement me!"
|
22
22
|
end
|
23
23
|
|
24
|
-
desc 'Install required gems and packages on Mac Os'
|
24
|
+
desc 'Install required gems and packages on Mac Os'
|
25
25
|
task :on_mac_os do
|
26
26
|
$stderr.puts "Implement me!"
|
27
27
|
end
|
@@ -5,14 +5,14 @@ Options +FollowSymLinks +ExecCGI
|
|
5
5
|
|
6
6
|
# If you don't want Rails to look in certain directories,
|
7
7
|
# use the following rewrite rules so that Apache won't rewrite certain requests
|
8
|
-
#
|
8
|
+
#
|
9
9
|
# Example:
|
10
10
|
# RewriteCond %{REQUEST_URI} ^/notrails.*
|
11
11
|
# RewriteRule .* - [L]
|
12
12
|
|
13
13
|
# Redirect all requests not available on the filesystem to Rails
|
14
14
|
# By default the cgi dispatcher is used which is very slow
|
15
|
-
#
|
15
|
+
#
|
16
16
|
# For better performance replace the dispatcher with the fastcgi one
|
17
17
|
#
|
18
18
|
# Example:
|
@@ -33,7 +33,7 @@ RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
|
|
33
33
|
|
34
34
|
# In case Rails experiences terminal errors
|
35
35
|
# Instead of displaying this message you can supply a file here which will be rendered instead
|
36
|
-
#
|
36
|
+
#
|
37
37
|
# Example:
|
38
38
|
# ErrorDocument 500 /500.html
|
39
39
|
|
Binary file
|
@@ -96,14 +96,14 @@ h1, h2, h3, h4, h5, h6, p, form {
|
|
96
96
|
border-left-color:#696;
|
97
97
|
border-right-color:#363;
|
98
98
|
border-bottom-color:#363;}
|
99
|
-
|
99
|
+
|
100
100
|
#mainimg input.btn:hover{
|
101
101
|
color:#EE8907;}
|
102
102
|
|
103
103
|
#mainimg input.text_field{
|
104
104
|
border: 2px solid #88b000;
|
105
105
|
background: #fff;
|
106
|
-
margin-right: 5px;
|
106
|
+
margin-right: 5px;
|
107
107
|
}
|
108
108
|
|
109
109
|
#contentarea hr {
|
@@ -5,12 +5,12 @@ describe ApplicationController do
|
|
5
5
|
get 'access_denied'
|
6
6
|
response.headers["Status"].should == "403 Forbidden"
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
it "should render 'Access denied' text when denying access" do
|
10
10
|
get 'access_denied'
|
11
11
|
response.body.should == 'Access denied'
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
it "should flash a warning if given a wrong request" do
|
15
15
|
get 'unknown_request'
|
16
16
|
response.should be_redirect
|
@@ -2,11 +2,11 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
2
|
|
3
3
|
describe "DocumentsController called from unknown IP" do
|
4
4
|
controller_name "documents"
|
5
|
-
|
5
|
+
|
6
6
|
before(:all) do
|
7
7
|
@backup=Picolena::WhiteListIPs
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
it "should deny access" do
|
11
11
|
# Displays a warning otherwise
|
12
12
|
Picolena.send(:remove_const, :WhiteListIPs) && Picolena::WhiteListIPs=/Something that won't match/
|
@@ -23,75 +23,75 @@ describe "DocumentsController called from unknown IP" do
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
describe DocumentsController do
|
26
|
+
describe DocumentsController do
|
27
27
|
it "GET 'index' should be succesful" do
|
28
28
|
get 'index'
|
29
29
|
response.should be_success
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
it "POST 'check_query' should check query and redirect to show" do
|
33
33
|
post 'check_query', {:query => 'basic test'}
|
34
34
|
response.should be_redirect
|
35
|
-
response.should redirect_to(document_url('basic test'))
|
35
|
+
response.should redirect_to(document_url('basic test'))
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
it "POST 'check_query' should accept . and redirect to show" do
|
39
39
|
post 'check_query', {:query => 'basic.test'}
|
40
40
|
response.should be_redirect
|
41
41
|
response.should redirect_to(:action=>'show', :id=>'basic.test')
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
it "POST 'check_query' should accept ? and redirect to show" do
|
45
45
|
post 'check_query', {:query => '?ric'}
|
46
46
|
response.should be_redirect
|
47
|
-
response.should redirect_to(:action=>'show', :id=>'?ric')
|
47
|
+
response.should redirect_to(:action=>'show', :id=>'?ric')
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
it "POST 'check_query' should accept empty query but should redirect to index" do
|
51
51
|
post 'check_query', {:query => ''}
|
52
52
|
response.should be_redirect
|
53
53
|
response.should redirect_to(:action=>'index')
|
54
54
|
end
|
55
|
-
|
55
|
+
|
56
56
|
it "GET 'show' should find corresponding docs" do
|
57
57
|
get 'show', :id=>'forschung an fachhochschulen nachhaltige energietechnik'
|
58
58
|
response.should be_success
|
59
59
|
assigns[:matching_documents].any?{|doc| doc.filename=="zafh.net.html"}.should be_true
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
it "GET 'show' should accept * in queries" do
|
63
63
|
lambda{get 'show', :id=>'*ric'}.should_not raise_error
|
64
64
|
response.should be_success
|
65
65
|
assigns[:matching_documents].entries.should_not be_empty
|
66
66
|
assigns[:matching_documents].any?{|doc| doc.matching_content.join.starts_with?("<<Éric>> Mößer\n\n\f")}.should be_true
|
67
67
|
end
|
68
|
-
|
68
|
+
|
69
69
|
it "GET 'show' should accept ? in queries" do
|
70
70
|
lambda{get 'show', :id=>'?ric'}.should_not raise_error(ActionController::RoutingError)
|
71
71
|
response.should be_success
|
72
72
|
assigns[:matching_documents].entries.should_not be_empty
|
73
73
|
assigns[:matching_documents].any?{|doc| doc.filename=="basic.tex"}.should be_true
|
74
74
|
end
|
75
|
-
|
75
|
+
|
76
76
|
it "GET 'show' should accept . in queries" do
|
77
77
|
lambda{get 'show', :id=>'basic.pdf'}.should_not raise_error(ActionController::RoutingError)
|
78
78
|
response.should be_success
|
79
79
|
assigns[:matching_documents].entries.should_not be_empty
|
80
80
|
assigns[:matching_documents].any?{|doc| doc.matching_content.join.starts_with?("just another content test in a pdf file")}.should be_true
|
81
81
|
end
|
82
|
-
|
82
|
+
|
83
83
|
it "GET 'show' should accept combined queries" do
|
84
84
|
get 'show', :id=>'test filetype:pdf'
|
85
85
|
response.should be_success
|
86
86
|
assigns[:matching_documents].entries.should_not be_empty
|
87
87
|
end
|
88
|
-
|
88
|
+
|
89
89
|
it "GET 'show' should accept empty query but should redirect to index" do
|
90
90
|
lambda{get 'show', :id=>''}.should_not raise_error
|
91
91
|
response.should be_success
|
92
92
|
assigns[:matching_documents].entries.should be_empty
|
93
93
|
end
|
94
|
-
|
94
|
+
|
95
95
|
it "GET 'download' should be successful with correct ID" do
|
96
96
|
get 'show', :id=>'basic.pdf'
|
97
97
|
response.should be_success
|
@@ -101,7 +101,7 @@ describe DocumentsController do
|
|
101
101
|
assigns[:document].complete_path == d.complete_path
|
102
102
|
response.should be_success
|
103
103
|
end
|
104
|
-
|
104
|
+
|
105
105
|
it "GET 'download' should redirect if wrong id" do
|
106
106
|
probably_unique_id="Not a document".base26_hash
|
107
107
|
get 'download', :id=>probably_unique_id
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../spec_helper'
|
2
2
|
|
3
3
|
describe ApplicationHelper do
|
4
|
-
|
4
|
+
|
5
5
|
#Delete this example and add some real ones or delete this file
|
6
6
|
it "should include the ApplicationHelper" do
|
7
7
|
included_modules = self.metaclass.send :included_modules
|
8
8
|
included_modules.should include(ApplicationHelper)
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../spec_helper'
|
2
2
|
|
3
|
-
describe DocumentsHelper do
|
3
|
+
describe DocumentsHelper do
|
4
4
|
it "shouldn't raise if matching not in content field"
|
5
5
|
|
6
6
|
PlainTextExtractor.supported_extensions.each{|ext|
|
7
|
-
it "should have an icon for .#{ext} filetype" do
|
8
|
-
icon_for(ext
|
7
|
+
it "should have an icon for .#{ext} filetype" do
|
8
|
+
icon_for(ext).should_not be_nil
|
9
9
|
end
|
10
10
|
}
|
11
11
|
end
|
@@ -8,24 +8,24 @@ describe "Finder without index on disk" do
|
|
8
8
|
@new_index_path=File.join(Dir::tmpdir,'ferret_tst')
|
9
9
|
Picolena::IndexSavePath.replace(@new_index_path)
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
before(:each) do
|
13
13
|
Indexer.clear!
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
it "should create index" do
|
17
17
|
Picolena::IndexedDirectories.replace({'spec/test_dirs/indexed/just_one_doc'=>'//justonedoc/'})
|
18
18
|
lambda {@finder_with_new_index=Finder.new("test moi")}.should change(Indexer, :index_exists?).from(false).to(true)
|
19
19
|
File.exists?(File.join(@new_index_path,'_0.cfs')).should be_true
|
20
20
|
Indexer.index.size.should >0
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
it "should raise if index is still empty after trying to create it" do
|
24
24
|
Picolena::IndexedDirectories.replace({'spec/test_dirs/empty_folder'=>'//empty_folder/'})
|
25
25
|
lambda {Finder.new("doesn't matter anyway")}.should raise_error(IndexError, "no document found")
|
26
26
|
File.exists?(File.join(@new_index_path,'_0.cfs')).should be_false
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
after(:all) do
|
30
30
|
Picolena::IndexedDirectories.replace(@original_indexed_dirs)
|
31
31
|
Picolena::IndexSavePath.replace(@original_index_path)
|
@@ -45,11 +45,11 @@ fields={
|
|
45
45
|
:language => :language
|
46
46
|
}
|
47
47
|
|
48
|
-
describe "Basic Finder" do
|
48
|
+
describe "Basic Finder" do
|
49
49
|
before(:all) do
|
50
50
|
Indexer.index_every_directory(remove_first=true)
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
53
|
it "should accept one parameter as query, and 2 optionals for paginating" do
|
54
54
|
lambda {Finder.new}.should raise_error(ArgumentError, "wrong number of arguments (0 for 1)")
|
55
55
|
# show first page with 10 results per page
|
@@ -65,37 +65,37 @@ describe "Basic Finder" do
|
|
65
65
|
it "should return matching documents if executed successfully" do
|
66
66
|
finder_with_valid_query=Finder.new("district heating")
|
67
67
|
finder_with_valid_query.should respond_to(:matching_documents)
|
68
|
-
|
68
|
+
|
69
69
|
matching_documents=finder_with_valid_query.matching_documents
|
70
70
|
matching_documents.should_not be_empty
|
71
|
-
|
71
|
+
|
72
72
|
matching_documents_filenames=matching_documents.collect{|d| d.filename}
|
73
73
|
matching_documents_filenames.should include("Simulation of district heating systems for evaluation of real-time control strategies.pdf")
|
74
74
|
matching_documents_filenames.should include("Types of malfunction in DH substations.doc")
|
75
75
|
end
|
76
|
-
|
76
|
+
|
77
77
|
it "should know if it has been executed" do
|
78
78
|
@finder=Finder.new("some query")
|
79
79
|
lambda {@finder.execute!}.should change(@finder, :executed?).from(false).to(true)
|
80
80
|
end
|
81
|
-
|
81
|
+
|
82
82
|
it "should not warn anything if index is up to date"
|
83
|
-
|
83
|
+
|
84
84
|
it "should warn if index is not up to date"
|
85
|
-
|
85
|
+
|
86
86
|
fields.each_pair do |description,field_name|
|
87
87
|
it "should index #{description} as :#{field_name}" do
|
88
88
|
Indexer.index.field_infos[field_name].should be_an_instance_of(Ferret::Index::FieldInfo)
|
89
89
|
end
|
90
90
|
end
|
91
|
-
|
91
|
+
|
92
92
|
it "should know how much time was needed for execution" do
|
93
93
|
finder=Finder.new("yet another stupid query")
|
94
94
|
finder.executed?.should be_nil
|
95
95
|
finder.time_needed.should > 0
|
96
96
|
finder.executed?.should be_true
|
97
97
|
end
|
98
|
-
|
98
|
+
|
99
99
|
it "should not need more than 100ms to find documents" do
|
100
100
|
finder=Finder.new("district heating")
|
101
101
|
finder.execute!
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../spec_helper'
|
2
2
|
|
3
3
|
basic_pdf_attribute={
|
4
|
-
:size=>9380,
|
5
4
|
:dirname=>File.join(RAILS_ROOT, 'spec/test_dirs/indexed/basic'),
|
6
5
|
:basename=>'basic',
|
7
6
|
:complete_path=>File.join(RAILS_ROOT, '/spec/test_dirs/indexed/basic/basic.pdf'),
|
@@ -13,18 +12,18 @@ describe Document do
|
|
13
12
|
before(:each) do
|
14
13
|
@valid_random_doc=Document.find(:random) rescue Document.new("spec/test_dirs/indexed/basic/basic.pdf")
|
15
14
|
end
|
16
|
-
|
15
|
+
|
17
16
|
it "should be an existing file" do
|
18
17
|
lambda {Document.new("/patapouf.txt")}.should raise_error(Errno::ENOENT)
|
19
18
|
lambda {@valid_random_doc}.should_not raise_error
|
20
19
|
lambda {Document.new("spec/test_dirs/not_indexed/Rakefile")}.should_not raise_error(Errno::ENOENT)
|
21
20
|
end
|
22
|
-
|
21
|
+
|
23
22
|
it "should belong to an indexed directory" do
|
24
23
|
lambda {@valid_random_doc}.should_not raise_error
|
25
24
|
lambda {Document.new("spec/test_dirs/not_indexed/Rakefile")}.should raise_error(ArgumentError, "required document is not in indexed directory")
|
26
25
|
end
|
27
|
-
|
26
|
+
|
28
27
|
basic_pdf_attribute.each{|attribute,expected_value|
|
29
28
|
it "should know its #{attribute}" do
|
30
29
|
@valid_random_doc.should respond_to(attribute)
|
@@ -32,31 +31,24 @@ describe Document do
|
|
32
31
|
@basic_pdf.send(attribute).should == expected_value
|
33
32
|
end
|
34
33
|
}
|
35
|
-
|
36
|
-
it "should know which user it belongs to, if specified" do
|
37
|
-
@valid_random_doc.should respond_to(:user)
|
38
|
-
@valid_random_doc.user.should be_nil
|
39
|
-
@valid_random_doc.user="eric"
|
40
|
-
@valid_random_doc.user.should == "eric"
|
41
|
-
end
|
42
|
-
|
34
|
+
|
43
35
|
it "should know its content" do
|
44
36
|
another_doc=Document.new("spec/test_dirs/indexed/basic/plain.txt")
|
45
37
|
another_doc.content.should == "just a content test\nin a txt file"
|
46
38
|
end
|
47
|
-
|
39
|
+
|
48
40
|
it "should know its alias_path" do
|
49
41
|
@valid_random_doc.should respond_to(:alias_path)
|
50
42
|
@valid_random_doc.alias_path.starts_with?("http://picolena.devjavu.com/browser/trunk/lib/picolena/templates/spec/test_dirs/indexed").should be_true
|
51
43
|
end
|
52
|
-
|
44
|
+
|
53
45
|
it "should let finder specify its score" do
|
54
46
|
@valid_random_doc.should respond_to(:score)
|
55
47
|
@valid_random_doc.score.should be_nil
|
56
48
|
@valid_random_doc.score=25
|
57
49
|
@valid_random_doc.score.should == 25
|
58
50
|
end
|
59
|
-
|
51
|
+
|
60
52
|
it "should let finder specify its matching content" do
|
61
53
|
@valid_random_doc.should respond_to(:matching_content)
|
62
54
|
@valid_random_doc.matching_content.should be_nil
|
@@ -3,9 +3,20 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
|
3
3
|
def revert_changes!(file,content)
|
4
4
|
File.open(file,'w'){|might_have_been_modified|
|
5
5
|
might_have_been_modified.write content
|
6
|
-
}
|
6
|
+
}
|
7
7
|
end
|
8
8
|
|
9
|
+
|
10
|
+
def matching_document_for(query)
|
11
|
+
# Returns matching document for any given query only if
|
12
|
+
# exactly one document is found.
|
13
|
+
# Specs don't pass otherwise.
|
14
|
+
matching_documents=Finder.new(query).matching_documents
|
15
|
+
matching_documents.size.should == 1
|
16
|
+
matching_documents.first
|
17
|
+
end
|
18
|
+
|
19
|
+
|
9
20
|
describe Finder do
|
10
21
|
before(:all) do
|
11
22
|
# SVN doesn't like non-ascii filenames.
|
@@ -13,7 +24,7 @@ describe Finder do
|
|
13
24
|
|
14
25
|
# To be sure this file has the right content
|
15
26
|
revert_changes!("spec/test_dirs/indexed/others/placeholder.txt","Absorption and Adsorption cooling machines!!!")
|
16
|
-
|
27
|
+
|
17
28
|
once_upon_a_time=Time.local(1982,2,16,20,42)
|
18
29
|
a_bit_later=Time.local(1983,12,9,9)
|
19
30
|
nineties=Time.local(1990)
|
@@ -23,84 +34,80 @@ describe Finder do
|
|
23
34
|
File.utime(0, nineties, 'spec/test_dirs/indexed/others/placeholder.txt')
|
24
35
|
Indexer.index_every_directory(remove_first=true)
|
25
36
|
end
|
26
|
-
|
37
|
+
|
27
38
|
it "should find documents according to their basename when specified with basename:query" do
|
28
39
|
matching_documents_filename=Finder.new("basename:crossed").matching_documents.collect{|d| d.filename}
|
29
40
|
matching_documents_filename.should include("crossed.txt")
|
30
41
|
matching_documents_filename.should include("crossed.text")
|
31
42
|
end
|
32
|
-
|
43
|
+
|
33
44
|
it "should find documents according to their filename when specified with file:query or filename:query" do
|
34
45
|
Finder.new("filename:crossed.text").matching_documents.collect{|d| d.content}.should include("txt inside!")
|
35
46
|
Finder.new("file:crossed.txt").matching_documents.collect{|d| d.content}.should include("text inside!")
|
36
47
|
end
|
37
|
-
|
48
|
+
|
38
49
|
it "should find documents according to their extension when specified with filetype:query" do
|
39
50
|
Finder.new("filetype:odt").matching_documents.should_not be_empty
|
40
51
|
Finder.new("filetype:pdf").matching_documents.should_not be_empty
|
41
52
|
end
|
42
|
-
|
53
|
+
|
43
54
|
it "should find documents according to their filename/basename/filetype even when unspecified" do
|
44
55
|
Finder.new("crossed.text").matching_documents.should_not be_empty
|
45
56
|
Finder.new("html").matching_documents.collect{|d| d.filename}.should include("zafh.net.html")
|
46
57
|
Finder.new("crossed").total_hits.should >= 2
|
47
58
|
end
|
48
|
-
|
59
|
+
|
49
60
|
it "should give a boost to basename, filename and filetype in index" do
|
50
61
|
index=Indexer.index
|
51
62
|
index.field_infos[:basename].boost.should > 1.0
|
52
63
|
index.field_infos[:filename].boost.should > 1.0
|
53
64
|
index.field_infos[:filetype].boost.should > 1.0
|
54
65
|
end
|
55
|
-
|
66
|
+
|
56
67
|
it "should also index unreadable files with known mimetypes" do
|
57
68
|
Finder.new("unreadable.pdf").matching_documents.should_not be_empty
|
58
69
|
Finder.new("too_small.doc").matching_documents.should_not be_empty
|
59
70
|
end
|
60
|
-
|
71
|
+
|
61
72
|
it "should also index files with unknown mimetypes" do
|
62
|
-
|
63
|
-
|
64
|
-
Finder.new("unreadable.png").matching_document.size.should == 19696
|
65
|
-
#Support for xls has been added meanwhile. The test is still valid though.
|
66
|
-
Finder.new("table.xls").matching_document.size.should == 8704
|
73
|
+
matching_document_for("filetype:xyz").basename.should == "ghjopdfg"
|
74
|
+
matching_document_for("filetype:abc").filename.should == "asfg.abc"
|
67
75
|
end
|
68
|
-
|
76
|
+
|
69
77
|
it "should also index files with upper/mixed case extension" do
|
70
78
|
Finder.new("filetype:pdf").matching_documents.entries.find{|doc| doc.filename=="other_basic.PDF"}.should_not be_nil
|
71
79
|
Finder.new("filetype:doc").matching_documents.entries.find{|doc| doc.filename=="other_too_small.dOc"}.should_not be_nil
|
72
80
|
end
|
73
|
-
|
81
|
+
|
74
82
|
it "should also index content of files with upper/mixed case extension" do
|
75
83
|
Finder.new("'just another content test\nin a pdf file'").matching_documents.entries.find{|doc| doc.filename=="other_basic.PDF"}.should_not be_nil
|
76
84
|
end
|
77
|
-
|
85
|
+
|
78
86
|
it "should also accept utf8 queries" do
|
79
87
|
lambda{Finder.new("Éric Mößer")}.should_not raise_error
|
80
88
|
end
|
81
|
-
|
89
|
+
|
82
90
|
it "should find documents according to their utf8 content" do
|
83
|
-
|
84
|
-
|
85
|
-
|
91
|
+
matching_document_for("Éric Mößer ext:pdf").basename.should == "utf8"
|
92
|
+
matching_document_for("no me hace daño").filename.should == "utf8.txt"
|
93
|
+
matching_document_for("Éric Mößer filetype:pdf").filename.should == "utf8.pdf"
|
86
94
|
end
|
87
|
-
|
95
|
+
|
88
96
|
it "should find documents according to their utf8 filenames" do
|
89
|
-
|
97
|
+
matching_document_for("bäñüßé").content.should == "just to know if files are indexed with utf8 filenames"
|
90
98
|
end
|
91
|
-
|
99
|
+
|
92
100
|
it "should find documents according to their modification date" do
|
93
|
-
#FIXME: Specs don't pass in /tmp folder. They do pass in any other directory, though. Why???
|
94
101
|
Finder.new("date:<1982").matching_documents.should be_empty
|
95
|
-
|
96
|
-
|
97
|
-
|
102
|
+
matching_document_for("19831209*").basename.should == "office2003-word-template"
|
103
|
+
matching_document_for("date:<1983").filename.should == "basic.pdf"
|
104
|
+
matching_document_for("date:>=1989 AND date:<=1992").filename.should == "placeholder.txt"
|
98
105
|
end
|
99
106
|
|
100
107
|
it "should not concatenate cells from xls file" do
|
101
108
|
Finder.new("content:ABC").matching_documents.select{|doc| doc.extname==".xls"}.should be_empty
|
102
109
|
end
|
103
|
-
|
110
|
+
|
104
111
|
it "should not raise if an indexed document has been moved/deleted, but just ignore it" do
|
105
112
|
@basic_dir='spec/test_dirs/indexed/basic/'
|
106
113
|
@from=File.join(@basic_dir,'another_plain.text')
|
@@ -114,29 +121,29 @@ describe Finder do
|
|
114
121
|
File.rename(@to,@from) if File.exists?(@to)
|
115
122
|
end
|
116
123
|
end
|
117
|
-
|
124
|
+
|
118
125
|
it "should not index content of binary files"
|
119
|
-
|
126
|
+
|
120
127
|
# Ferret sometimes SEGFAULT crashed with '*.pdf' queries
|
121
128
|
it "should not crash while looking for *.pdf" do
|
122
129
|
@finder=Finder.new("some query")
|
123
130
|
lambda{@finder=Finder.new("*.pdf")}.should_not raise_error
|
124
131
|
@finder.matching_documents.should_not be_empty
|
125
132
|
end
|
126
|
-
|
133
|
+
|
127
134
|
it "should use ? as placeholder" do
|
128
|
-
|
135
|
+
matching_document_for("A?sorption machines").matching_content.should include("<<Absorption>> and <<Adsorption>> cooling <<machines>>!!!")
|
129
136
|
end
|
130
|
-
|
137
|
+
|
131
138
|
it "should use * as placeholder" do
|
132
|
-
results=
|
139
|
+
results=matching_document_for("A*ption machines").matching_content.should include("<<Absorption>> and <<Adsorption>> cooling <<machines>>!!!")
|
133
140
|
end
|
134
|
-
|
141
|
+
|
135
142
|
it "should not index those stupid Thumbs.db files" do
|
136
143
|
Finder.new("Thumbs.db").matching_documents.should be_empty
|
137
144
|
Finder.new("filetype:db").matching_documents.should_not be_empty
|
138
145
|
end
|
139
|
-
|
146
|
+
|
140
147
|
it "should keep content cached" do
|
141
148
|
filename = "spec/test_dirs/indexed/others/placeholder.txt"
|
142
149
|
content_before = "Absorption and Adsorption cooling machines!!!"
|
@@ -148,7 +155,7 @@ describe Finder do
|
|
148
155
|
some_doc.content.should_not == content_before
|
149
156
|
some_doc.cached.should == content_before
|
150
157
|
end
|
151
|
-
|
158
|
+
|
152
159
|
after(:all) do
|
153
160
|
revert_changes!("spec/test_dirs/indexed/others/placeholder.txt","Absorption and Adsorption cooling machines!!!")
|
154
161
|
end
|
@@ -6,19 +6,19 @@ describe "Host indexing system" do
|
|
6
6
|
IO.popen("which #{dependency}"){|i| i.read.should_not be_empty}
|
7
7
|
end
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
it "should have a language guesser installed" do
|
11
11
|
PlainTextExtractor.language_guesser.should_not be_nil
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
it "should know which IP addresses are allowed (config/custom/white_list_ip.yml)" do
|
15
15
|
File.should be_readable('config/custom/white_list_ip.yml')
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
it "should know which directories are to be indexed (config/custom/indexed_directories.yml)" do
|
19
19
|
File.should be_readable('config/custom/indexed_directories.yml')
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
it "should be able to calculate base26 hash from strings" do
|
23
23
|
"test_dirs/indexed/010/decrepito.pdf".base26_hash(5).should == "rails"
|
24
24
|
"test_dirs/indexed/migrations/000_restreins.rb".base26_hash(5).should == "ricou"
|
@@ -26,7 +26,7 @@ describe "Host indexing system" do
|
|
26
26
|
"test_dirs/indexed/1148/plots.odt".base26_hash(8).should == "picolehn"
|
27
27
|
"whatever.pdf".base26_hash(10).should == "bbuxhynait"
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
it "should not use too small a hash for Document#probably_unique_id" do
|
31
31
|
Picolena::HashLength.should_not < 10
|
32
32
|
end
|
@@ -4,11 +4,11 @@ describe "IndexedDirectories" do
|
|
4
4
|
it "should be defined" do
|
5
5
|
lambda {Picolena::IndexedDirectories}.should_not raise_error(NameError)
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
it "should not be empty" do
|
9
9
|
Picolena::IndexedDirectories.should_not be_empty
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
it "should only contain existing directories" do
|
13
13
|
Picolena::IndexedDirectories.keys.all?{|dir|
|
14
14
|
File.should be_directory(dir)
|