picolena 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (390) hide show
  1. data/History.txt +11 -4
  2. data/Manifest.txt +1 -0
  3. data/README.txt +2 -2
  4. data/bin/picolena +1 -1
  5. data/config/hoe.rb +10 -10
  6. data/lib/picolena/USAGE +1 -1
  7. data/lib/picolena/config/basic.rb +11 -11
  8. data/lib/picolena/picolena_generator.rb +15 -14
  9. data/lib/picolena/templates/app/controllers/application.rb +5 -5
  10. data/lib/picolena/templates/app/controllers/documents_controller.rb +17 -9
  11. data/lib/picolena/templates/app/helpers/documents_helper.rb +15 -14
  12. data/lib/picolena/templates/app/models/document.rb +28 -37
  13. data/lib/picolena/templates/app/models/finder.rb +12 -37
  14. data/lib/picolena/templates/app/models/indexer.rb +58 -37
  15. data/lib/picolena/templates/app/models/plain_text_extractor.rb +16 -16
  16. data/lib/picolena/templates/app/models/query.rb +5 -5
  17. data/lib/picolena/templates/app/views/documents/show.html.haml +3 -3
  18. data/lib/picolena/templates/app/views/layouts/application.html.haml +2 -2
  19. data/lib/picolena/templates/config/environment.rb +1 -1
  20. data/lib/picolena/templates/config/initializers/002_load_indexed_dirs.rb +8 -8
  21. data/lib/picolena/templates/config/initializers/003_load_white_list_IPs.rb +8 -8
  22. data/lib/picolena/templates/config/initializers/005_load_custom_title_and_names_and_links.rb +5 -5
  23. data/lib/picolena/templates/config/initializers/006_load_icons.rb +9 -7
  24. data/lib/picolena/templates/lang/ui/es.yml +1 -1
  25. data/lib/picolena/templates/lib/core_exts.rb +7 -7
  26. data/lib/picolena/templates/lib/plain_text_extractor_DSL.rb +10 -10
  27. data/lib/picolena/templates/lib/plain_text_extractors/ms.excel.rb +1 -1
  28. data/lib/picolena/templates/lib/plain_text_extractors/plain_text.rb +2 -2
  29. data/lib/picolena/templates/lib/tasks/index.rake +8 -3
  30. data/lib/picolena/templates/lib/tasks/install_dependencies.rake +2 -2
  31. data/lib/picolena/templates/lib/tasks/log.rake +1 -1
  32. data/lib/picolena/templates/public/.htaccess +3 -3
  33. data/lib/picolena/templates/public/images/flags/sv.png +0 -0
  34. data/lib/picolena/templates/public/stylesheets/style.css +2 -2
  35. data/lib/picolena/templates/script/spec_server +1 -1
  36. data/lib/picolena/templates/spec/controllers/application_controller_spec.rb +2 -2
  37. data/lib/picolena/templates/spec/controllers/documents_controller_spec.rb +17 -17
  38. data/lib/picolena/templates/spec/helpers/application_helper_spec.rb +2 -2
  39. data/lib/picolena/templates/spec/helpers/documents_helper_spec.rb +3 -3
  40. data/lib/picolena/templates/spec/models/basic_finder_spec.rb +14 -14
  41. data/lib/picolena/templates/spec/models/document_spec.rb +7 -15
  42. data/lib/picolena/templates/spec/models/finder_spec.rb +45 -38
  43. data/lib/picolena/templates/spec/models/host_indexing_system_spec.rb +5 -5
  44. data/lib/picolena/templates/spec/models/index_directories_spec.rb +2 -2
  45. data/lib/picolena/templates/spec/models/plain_text_extractor_spec.rb +6 -6
  46. data/lib/picolena/templates/spec/models/query_spec.rb +7 -7
  47. data/lib/picolena/templates/spec/rcov.opts +1 -1
  48. data/lib/picolena/templates/spec/test_dirs/indexed/basic/myfirstjavaprog.java +1 -1
  49. data/lib/picolena/templates/spec/test_dirs/indexed/basic/queens.for +1 -1
  50. data/lib/picolena/templates/spec/test_dirs/indexed/lang/hugo +74 -74
  51. data/lib/picolena/templates/spec/test_dirs/indexed/lang/lorca +56 -56
  52. data/lib/picolena/templates/spec/test_dirs/indexed/others/7.html +4 -4
  53. data/lib/picolena/templates/spec/test_dirs/indexed/others/ccmatrix1.cpp +6 -6
  54. data/lib/picolena/templates/spec/test_dirs/indexed/others/lemonde.htm +326 -326
  55. data/lib/picolena/templates/spec/test_dirs/indexed/others/nested/ReadMe.rtf +62 -62
  56. data/lib/picolena/templates/spec/test_dirs/indexed/others/xor.vee +0 -1
  57. data/lib/picolena/templates/spec/test_dirs/indexed/others/zafh.net.html +1 -1
  58. data/lib/picolena/version.rb +1 -1
  59. data/lib/rubigen_ext.rb +1 -1
  60. data/rails_plugins/globalite/CHANGELOG +1 -1
  61. data/rails_plugins/globalite/README +19 -19
  62. data/rails_plugins/globalite/lang/rails/de-DE.yml +6 -6
  63. data/rails_plugins/globalite/lang/rails/en-UK.yml +10 -10
  64. data/rails_plugins/globalite/lang/rails/en-US.yml +10 -10
  65. data/rails_plugins/globalite/lang/rails/es-ES.yml +11 -11
  66. data/rails_plugins/globalite/lang/rails/fr-FR.yml +10 -10
  67. data/rails_plugins/globalite/lang/rails/it.yml +10 -10
  68. data/rails_plugins/globalite/lang/rails/pt-BR.yml +6 -6
  69. data/rails_plugins/globalite/lang/rails/pt-PT.yml +6 -6
  70. data/rails_plugins/globalite/lib/globalite/l10n.rb +25 -25
  71. data/rails_plugins/globalite/lib/globalite/locale.rb +9 -9
  72. data/rails_plugins/globalite/lib/rails/core_ext.rb +4 -4
  73. data/rails_plugins/globalite/lib/rails/localization.rb +3 -3
  74. data/rails_plugins/globalite/lib/rails/localized_action_view.rb +17 -17
  75. data/rails_plugins/globalite/lib/rails/localized_active_record.rb +4 -4
  76. data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers/DateHelper.html +19 -19
  77. data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers/FormOptionsHelper.html +9 -9
  78. data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers/NumberHelper.html +8 -8
  79. data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers.html +5 -5
  80. data/rails_plugins/globalite/rdoc/classes/ActionView.html +5 -5
  81. data/rails_plugins/globalite/rdoc/classes/ActiveRecord/Errors.html +6 -6
  82. data/rails_plugins/globalite/rdoc/classes/ActiveRecord.html +5 -5
  83. data/rails_plugins/globalite/rdoc/classes/Array.html +6 -6
  84. data/rails_plugins/globalite/rdoc/classes/Date.html +8 -8
  85. data/rails_plugins/globalite/rdoc/classes/Globalite/L10n.html +49 -49
  86. data/rails_plugins/globalite/rdoc/classes/Globalite.html +6 -6
  87. data/rails_plugins/globalite/rdoc/classes/Kernel.html +6 -6
  88. data/rails_plugins/globalite/rdoc/classes/Locale.html +11 -11
  89. data/rails_plugins/globalite/rdoc/classes/Time.html +8 -8
  90. data/rails_plugins/globalite/rdoc/files/README.html +5 -5
  91. data/rails_plugins/globalite/rdoc/files/lib/globalite/l10n_rb.html +5 -5
  92. data/rails_plugins/globalite/rdoc/files/lib/globalite/locale_rb.html +5 -5
  93. data/rails_plugins/globalite/rdoc/files/lib/globalite_rb.html +5 -5
  94. data/rails_plugins/globalite/rdoc/files/lib/rails/core_ext_rb.html +5 -5
  95. data/rails_plugins/globalite/rdoc/files/lib/rails/localization_rb.html +5 -5
  96. data/rails_plugins/globalite/rdoc/files/lib/rails/localized_action_view_rb.html +5 -5
  97. data/rails_plugins/globalite/rdoc/files/lib/rails/localized_active_record_rb.html +5 -5
  98. data/rails_plugins/globalite/rdoc/fr_class_index.html +1 -1
  99. data/rails_plugins/globalite/rdoc/fr_file_index.html +1 -1
  100. data/rails_plugins/globalite/rdoc/fr_method_index.html +1 -1
  101. data/rails_plugins/globalite/rdoc/index.html +1 -1
  102. data/rails_plugins/globalite/spec/core_localization_spec.rb +18 -18
  103. data/rails_plugins/globalite/spec/l10n_spec.rb +25 -25
  104. data/rails_plugins/globalite/tasks/globalite_tasks.rake +6 -6
  105. data/rails_plugins/rspec/CHANGES +16 -16
  106. data/rails_plugins/rspec/README +2 -2
  107. data/rails_plugins/rspec/Rakefile +1 -1
  108. data/rails_plugins/rspec/UPGRADE +1 -1
  109. data/rails_plugins/rspec/autotest/discover.rb +1 -1
  110. data/rails_plugins/rspec/examples/pure/autogenerated_docstrings_example.rb +5 -5
  111. data/rails_plugins/rspec/examples/pure/before_and_after_example.rb +2 -2
  112. data/rails_plugins/rspec/examples/pure/behave_as_example.rb +5 -5
  113. data/rails_plugins/rspec/examples/pure/custom_expectation_matchers.rb +7 -7
  114. data/rails_plugins/rspec/examples/pure/file_accessor.rb +1 -1
  115. data/rails_plugins/rspec/examples/pure/file_accessor_spec.rb +2 -2
  116. data/rails_plugins/rspec/examples/pure/helper_method_example.rb +1 -1
  117. data/rails_plugins/rspec/examples/pure/legacy_spec.rb +2 -2
  118. data/rails_plugins/rspec/examples/pure/predicate_example.rb +2 -2
  119. data/rails_plugins/rspec/examples/pure/shared_example_group_example.rb +11 -11
  120. data/rails_plugins/rspec/examples/pure/shared_stack_examples.rb +4 -4
  121. data/rails_plugins/rspec/examples/pure/stack.rb +6 -6
  122. data/rails_plugins/rspec/examples/pure/stack_spec.rb +7 -7
  123. data/rails_plugins/rspec/examples/pure/stack_spec_with_nested_example_groups.rb +10 -10
  124. data/rails_plugins/rspec/examples/pure/stubbing_example.rb +4 -4
  125. data/rails_plugins/rspec/examples/stories/adder.rb +2 -2
  126. data/rails_plugins/rspec/examples/stories/addition +8 -8
  127. data/rails_plugins/rspec/examples/stories/calculator.rb +5 -5
  128. data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb +7 -7
  129. data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/examples/grid_behaviour.rb +13 -13
  130. data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/stories/create_a_cell.rb +5 -5
  131. data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/stories/kill_a_cell.rb +2 -2
  132. data/rails_plugins/rspec/examples/stories/game-of-life/life/game.rb +3 -3
  133. data/rails_plugins/rspec/examples/stories/game-of-life/life/grid.rb +10 -10
  134. data/rails_plugins/rspec/failing_examples/failing_autogenerated_docstrings_example.rb +5 -5
  135. data/rails_plugins/rspec/failing_examples/failure_in_setup.rb +3 -3
  136. data/rails_plugins/rspec/failing_examples/failure_in_teardown.rb +3 -3
  137. data/rails_plugins/rspec/failing_examples/mocking_example.rb +1 -1
  138. data/rails_plugins/rspec/failing_examples/raising_example.rb +11 -11
  139. data/rails_plugins/rspec/failing_examples/team_spec.rb +5 -5
  140. data/rails_plugins/rspec/lib/autotest/rspec.rb +5 -5
  141. data/rails_plugins/rspec/lib/spec/example/configuration.rb +4 -4
  142. data/rails_plugins/rspec/lib/spec/example/example_group_factory.rb +3 -3
  143. data/rails_plugins/rspec/lib/spec/example/example_group_methods.rb +1 -1
  144. data/rails_plugins/rspec/lib/spec/example/example_matcher.rb +2 -2
  145. data/rails_plugins/rspec/lib/spec/example/example_methods.rb +4 -4
  146. data/rails_plugins/rspec/lib/spec/example/pending.rb +1 -1
  147. data/rails_plugins/rspec/lib/spec/expectations/differs/default.rb +5 -5
  148. data/rails_plugins/rspec/lib/spec/expectations/errors.rb +1 -1
  149. data/rails_plugins/rspec/lib/spec/expectations/handler.rb +5 -5
  150. data/rails_plugins/rspec/lib/spec/expectations.rb +1 -1
  151. data/rails_plugins/rspec/lib/spec/extensions/main.rb +8 -8
  152. data/rails_plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb +2 -2
  153. data/rails_plugins/rspec/lib/spec/matchers/be.rb +18 -18
  154. data/rails_plugins/rspec/lib/spec/matchers/be_close.rb +4 -4
  155. data/rails_plugins/rspec/lib/spec/matchers/change.rb +20 -20
  156. data/rails_plugins/rspec/lib/spec/matchers/eql.rb +4 -4
  157. data/rails_plugins/rspec/lib/spec/matchers/equal.rb +4 -4
  158. data/rails_plugins/rspec/lib/spec/matchers/has.rb +8 -8
  159. data/rails_plugins/rspec/lib/spec/matchers/have.rb +9 -9
  160. data/rails_plugins/rspec/lib/spec/matchers/include.rb +7 -7
  161. data/rails_plugins/rspec/lib/spec/matchers/match.rb +6 -6
  162. data/rails_plugins/rspec/lib/spec/matchers/operator_matcher.rb +1 -1
  163. data/rails_plugins/rspec/lib/spec/matchers/raise_error.rb +6 -6
  164. data/rails_plugins/rspec/lib/spec/matchers/respond_to.rb +7 -7
  165. data/rails_plugins/rspec/lib/spec/matchers/satisfy.rb +4 -4
  166. data/rails_plugins/rspec/lib/spec/matchers/simple_matcher.rb +3 -3
  167. data/rails_plugins/rspec/lib/spec/matchers/throw_symbol.rb +8 -8
  168. data/rails_plugins/rspec/lib/spec/matchers.rb +2 -2
  169. data/rails_plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb +3 -3
  170. data/rails_plugins/rspec/lib/spec/mocks/argument_expectation.rb +32 -32
  171. data/rails_plugins/rspec/lib/spec/mocks/error_generator.rb +13 -13
  172. data/rails_plugins/rspec/lib/spec/mocks/errors.rb +1 -1
  173. data/rails_plugins/rspec/lib/spec/mocks/message_expectation.rb +38 -38
  174. data/rails_plugins/rspec/lib/spec/mocks/methods.rb +3 -3
  175. data/rails_plugins/rspec/lib/spec/mocks/mock.rb +5 -5
  176. data/rails_plugins/rspec/lib/spec/mocks/order_group.rb +5 -5
  177. data/rails_plugins/rspec/lib/spec/mocks/proxy.rb +4 -4
  178. data/rails_plugins/rspec/lib/spec/mocks/space.rb +3 -3
  179. data/rails_plugins/rspec/lib/spec/mocks/spec_methods.rb +1 -1
  180. data/rails_plugins/rspec/lib/spec/mocks.rb +13 -13
  181. data/rails_plugins/rspec/lib/spec/rake/spectask.rb +4 -4
  182. data/rails_plugins/rspec/lib/spec/rake/verify_rcov.rb +9 -9
  183. data/rails_plugins/rspec/lib/spec/runner/backtrace_tweaker.rb +2 -2
  184. data/rails_plugins/rspec/lib/spec/runner/formatter/base_formatter.rb +7 -7
  185. data/rails_plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb +13 -13
  186. data/rails_plugins/rspec/lib/spec/runner/formatter/failing_examples_formatter.rb +1 -1
  187. data/rails_plugins/rspec/lib/spec/runner/formatter/html_formatter.rb +8 -8
  188. data/rails_plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb +7 -7
  189. data/rails_plugins/rspec/lib/spec/runner/formatter/progress_bar_formatter.rb +2 -2
  190. data/rails_plugins/rspec/lib/spec/runner/formatter/snippet_extractor.rb +5 -5
  191. data/rails_plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb +4 -4
  192. data/rails_plugins/rspec/lib/spec/runner/formatter/story/html_formatter.rb +6 -6
  193. data/rails_plugins/rspec/lib/spec/runner/formatter/story/plain_text_formatter.rb +12 -12
  194. data/rails_plugins/rspec/lib/spec/runner/heckle_runner.rb +6 -6
  195. data/rails_plugins/rspec/lib/spec/runner/option_parser.rb +5 -5
  196. data/rails_plugins/rspec/lib/spec/runner/options.rb +8 -8
  197. data/rails_plugins/rspec/lib/spec/runner/reporter.rb +14 -14
  198. data/rails_plugins/rspec/lib/spec/runner.rb +41 -41
  199. data/rails_plugins/rspec/lib/spec/story/extensions/main.rb +6 -6
  200. data/rails_plugins/rspec/lib/spec/story/extensions/regexp.rb +1 -1
  201. data/rails_plugins/rspec/lib/spec/story/extensions/string.rb +1 -1
  202. data/rails_plugins/rspec/lib/spec/story/given_scenario.rb +1 -1
  203. data/rails_plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb +6 -6
  204. data/rails_plugins/rspec/lib/spec/story/runner/scenario_collector.rb +2 -2
  205. data/rails_plugins/rspec/lib/spec/story/runner/scenario_runner.rb +5 -5
  206. data/rails_plugins/rspec/lib/spec/story/runner/story_mediator.rb +20 -20
  207. data/rails_plugins/rspec/lib/spec/story/runner/story_parser.rb +29 -29
  208. data/rails_plugins/rspec/lib/spec/story/runner/story_runner.rb +8 -8
  209. data/rails_plugins/rspec/lib/spec/story/runner.rb +7 -7
  210. data/rails_plugins/rspec/lib/spec/story/scenario.rb +1 -1
  211. data/rails_plugins/rspec/lib/spec/story/step.rb +5 -5
  212. data/rails_plugins/rspec/lib/spec/story/step_group.rb +12 -12
  213. data/rails_plugins/rspec/lib/spec/story/step_mother.rb +6 -6
  214. data/rails_plugins/rspec/lib/spec/story/story.rb +5 -5
  215. data/rails_plugins/rspec/lib/spec/story/world.rb +16 -16
  216. data/rails_plugins/rspec/lib/spec/translator.rb +21 -21
  217. data/rails_plugins/rspec/lib/spec/version.rb +2 -2
  218. data/rails_plugins/rspec/lib/spec.rb +1 -1
  219. data/rails_plugins/rspec/pre_commit/lib/pre_commit/pre_commit.rb +1 -1
  220. data/rails_plugins/rspec/pre_commit/lib/pre_commit/rspec.rb +6 -6
  221. data/rails_plugins/rspec/pre_commit/lib/pre_commit/rspec_on_rails.rb +6 -6
  222. data/rails_plugins/rspec/pre_commit/spec/pre_commit/pre_commit_spec.rb +1 -1
  223. data/rails_plugins/rspec/pre_commit/spec/pre_commit/rspec_on_rails_spec.rb +1 -1
  224. data/rails_plugins/rspec/report.html +3 -3
  225. data/rails_plugins/rspec/spec/autotest/discover_spec.rb +2 -2
  226. data/rails_plugins/rspec/spec/autotest/rspec_spec.rb +30 -30
  227. data/rails_plugins/rspec/spec/autotest_matchers.rb +7 -7
  228. data/rails_plugins/rspec/spec/spec/example/configuration_spec.rb +5 -5
  229. data/rails_plugins/rspec/spec/spec/example/example_group_factory_spec.rb +5 -5
  230. data/rails_plugins/rspec/spec/spec/example/example_group_methods_spec.rb +3 -3
  231. data/rails_plugins/rspec/spec/spec/example/example_group_spec.rb +2 -2
  232. data/rails_plugins/rspec/spec/spec/example/example_matcher_spec.rb +10 -10
  233. data/rails_plugins/rspec/spec/spec/example/example_runner_spec.rb +29 -29
  234. data/rails_plugins/rspec/spec/spec/example/example_spec.rb +6 -6
  235. data/rails_plugins/rspec/spec/spec/example/nested_example_group_spec.rb +2 -2
  236. data/rails_plugins/rspec/spec/spec/example/pending_module_spec.rb +3 -3
  237. data/rails_plugins/rspec/spec/spec/example/predicate_matcher_spec.rb +1 -1
  238. data/rails_plugins/rspec/spec/spec/example/shared_example_group_spec.rb +4 -4
  239. data/rails_plugins/rspec/spec/spec/expectations/extensions/object_spec.rb +12 -12
  240. data/rails_plugins/rspec/spec/spec/expectations/fail_with_spec.rb +8 -8
  241. data/rails_plugins/rspec/spec/spec/extensions/main_spec.rb +6 -6
  242. data/rails_plugins/rspec/spec/spec/interop/test/unit/spec_spec.rb +2 -2
  243. data/rails_plugins/rspec/spec/spec/interop/test/unit/test_unit_spec_helper.rb +2 -2
  244. data/rails_plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb +2 -2
  245. data/rails_plugins/rspec/spec/spec/matchers/be_spec.rb +5 -5
  246. data/rails_plugins/rspec/spec/spec/matchers/change_spec.rb +14 -14
  247. data/rails_plugins/rspec/spec/spec/matchers/description_generation_spec.rb +25 -25
  248. data/rails_plugins/rspec/spec/spec/matchers/exist_spec.rb +5 -5
  249. data/rails_plugins/rspec/spec/spec/matchers/handler_spec.rb +16 -16
  250. data/rails_plugins/rspec/spec/spec/matchers/have_spec.rb +13 -13
  251. data/rails_plugins/rspec/spec/spec/matchers/match_spec.rb +1 -1
  252. data/rails_plugins/rspec/spec/spec/matchers/matcher_methods_spec.rb +1 -1
  253. data/rails_plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb +17 -17
  254. data/rails_plugins/rspec/spec/spec/matchers/raise_error_spec.rb +20 -20
  255. data/rails_plugins/rspec/spec/spec/matchers/respond_to_spec.rb +10 -10
  256. data/rails_plugins/rspec/spec/spec/matchers/simple_matcher_spec.rb +3 -3
  257. data/rails_plugins/rspec/spec/spec/matchers/throw_symbol_spec.rb +2 -2
  258. data/rails_plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb +2 -2
  259. data/rails_plugins/rspec/spec/spec/mocks/bug_report_10263.rb +3 -3
  260. data/rails_plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb +4 -4
  261. data/rails_plugins/rspec/spec/spec/mocks/bug_report_15719_spec.rb +1 -1
  262. data/rails_plugins/rspec/spec/spec/mocks/bug_report_7611_spec.rb +1 -1
  263. data/rails_plugins/rspec/spec/spec/mocks/bug_report_8302_spec.rb +1 -1
  264. data/rails_plugins/rspec/spec/spec/mocks/failing_mock_argument_constraints_spec.rb +12 -12
  265. data/rails_plugins/rspec/spec/spec/mocks/mock_ordering_spec.rb +3 -3
  266. data/rails_plugins/rspec/spec/spec/mocks/mock_space_spec.rb +1 -1
  267. data/rails_plugins/rspec/spec/spec/mocks/mock_spec.rb +56 -56
  268. data/rails_plugins/rspec/spec/spec/mocks/multiple_return_value_spec.rb +3 -3
  269. data/rails_plugins/rspec/spec/spec/mocks/once_counts_spec.rb +1 -1
  270. data/rails_plugins/rspec/spec/spec/mocks/options_hash_spec.rb +1 -1
  271. data/rails_plugins/rspec/spec/spec/mocks/partial_mock_spec.rb +16 -16
  272. data/rails_plugins/rspec/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +10 -10
  273. data/rails_plugins/rspec/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +13 -13
  274. data/rails_plugins/rspec/spec/spec/mocks/stub_spec.rb +7 -7
  275. data/rails_plugins/rspec/spec/spec/mocks/twice_counts_spec.rb +6 -6
  276. data/rails_plugins/rspec/spec/spec/package/bin_spec_spec.rb +1 -1
  277. data/rails_plugins/rspec/spec/spec/runner/class_and_argument_parser_spec.rb +2 -2
  278. data/rails_plugins/rspec/spec/spec/runner/command_line_spec.rb +1 -1
  279. data/rails_plugins/rspec/spec/spec/runner/drb_command_line_spec.rb +2 -2
  280. data/rails_plugins/rspec/spec/spec/runner/execution_context_spec.rb +2 -2
  281. data/rails_plugins/rspec/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +2 -2
  282. data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html +1 -1
  283. data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +2 -2
  284. data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html +1 -1
  285. data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +1 -1
  286. data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html +3 -3
  287. data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatter_spec.rb +1 -1
  288. data/rails_plugins/rspec/spec/spec/runner/formatter/profile_formatter_spec.rb +9 -9
  289. data/rails_plugins/rspec/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +4 -4
  290. data/rails_plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +1 -1
  291. data/rails_plugins/rspec/spec/spec/runner/formatter/story/html_formatter_spec.rb +5 -5
  292. data/rails_plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.4.html +13 -13
  293. data/rails_plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +2 -2
  294. data/rails_plugins/rspec/spec/spec/runner/heckle_runner_spec.rb +1 -1
  295. data/rails_plugins/rspec/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +3 -3
  296. data/rails_plugins/rspec/spec/spec/runner/option_parser_spec.rb +9 -9
  297. data/rails_plugins/rspec/spec/spec/runner/options_spec.rb +13 -13
  298. data/rails_plugins/rspec/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +1 -1
  299. data/rails_plugins/rspec/spec/spec/spec_classes.rb +8 -8
  300. data/rails_plugins/rspec/spec/spec/story/builders.rb +7 -7
  301. data/rails_plugins/rspec/spec/spec/story/extensions/main_spec.rb +6 -6
  302. data/rails_plugins/rspec/spec/spec/story/given_scenario_spec.rb +3 -3
  303. data/rails_plugins/rspec/spec/spec/story/runner/plain_text_story_runner_spec.rb +12 -12
  304. data/rails_plugins/rspec/spec/spec/story/runner/scenario_collector_spec.rb +2 -2
  305. data/rails_plugins/rspec/spec/spec/story/runner/scenario_runner_spec.rb +21 -21
  306. data/rails_plugins/rspec/spec/spec/story/runner/story_mediator_spec.rb +22 -22
  307. data/rails_plugins/rspec/spec/spec/story/runner/story_parser_spec.rb +55 -55
  308. data/rails_plugins/rspec/spec/spec/story/runner/story_runner_spec.rb +44 -44
  309. data/rails_plugins/rspec/spec/spec/story/runner_spec.rb +18 -18
  310. data/rails_plugins/rspec/spec/spec/story/scenario_spec.rb +2 -2
  311. data/rails_plugins/rspec/spec/spec/story/step_group_spec.rb +20 -20
  312. data/rails_plugins/rspec/spec/spec/story/step_mother_spec.rb +14 -14
  313. data/rails_plugins/rspec/spec/spec/story/step_spec.rb +33 -33
  314. data/rails_plugins/rspec/spec/spec/story/story_spec.rb +12 -12
  315. data/rails_plugins/rspec/spec/spec/translator_spec.rb +12 -12
  316. data/rails_plugins/rspec/spec/spec_helper.rb +5 -5
  317. data/rails_plugins/rspec/stories/resources/helpers/story_helper.rb +1 -1
  318. data/rails_plugins/rspec/stories/resources/steps/running_rspec.rb +4 -4
  319. data/rails_plugins/rspec/stories/resources/test/spec_and_test_together.rb +2 -2
  320. data/rails_plugins/rspec/stories/resources/test/test_case_with_should_methods.rb +1 -1
  321. data/rails_plugins/rspec/story_server/prototype/javascripts/builder.js +14 -14
  322. data/rails_plugins/rspec/story_server/prototype/javascripts/controls.js +61 -61
  323. data/rails_plugins/rspec/story_server/prototype/javascripts/dragdrop.js +144 -144
  324. data/rails_plugins/rspec/story_server/prototype/javascripts/effects.js +127 -127
  325. data/rails_plugins/rspec/story_server/prototype/javascripts/rspec.js +15 -15
  326. data/rails_plugins/rspec/story_server/prototype/javascripts/scriptaculous.js +7 -7
  327. data/rails_plugins/rspec/story_server/prototype/javascripts/slider.js +37 -37
  328. data/rails_plugins/rspec/story_server/prototype/javascripts/sound.js +4 -4
  329. data/rails_plugins/rspec/story_server/prototype/javascripts/unittest.js +66 -66
  330. data/rails_plugins/rspec/story_server/prototype/stories.html +9 -9
  331. data/rails_plugins/rspec_on_rails/MIT-LICENSE +11 -11
  332. data/rails_plugins/rspec_on_rails/generators/rspec/templates/rcov.opts +1 -1
  333. data/rails_plugins/rspec_on_rails/generators/rspec/templates/script/spec_server +1 -1
  334. data/rails_plugins/rspec_on_rails/generators/rspec_controller/USAGE +1 -1
  335. data/rails_plugins/rspec_on_rails/generators/rspec_controller/templates/helper_spec.rb +2 -2
  336. data/rails_plugins/rspec_on_rails/generators/rspec_controller/templates/view_spec.rb +1 -1
  337. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/rspec_scaffold_generator.rb +12 -12
  338. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/controller_spec.rb +35 -35
  339. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/edit_erb_spec.rb +2 -2
  340. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/helper_spec.rb +2 -2
  341. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/index_erb_spec.rb +1 -1
  342. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/new_erb_spec.rb +2 -2
  343. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/routing_spec.rb +11 -11
  344. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb +1 -1
  345. data/rails_plugins/rspec_on_rails/lib/autotest/rails_rspec.rb +3 -3
  346. data/rails_plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb +4 -4
  347. data/rails_plugins/rspec_on_rails/lib/spec/rails/example/rails_example_group.rb +1 -1
  348. data/rails_plugins/rspec_on_rails/lib/spec/rails/example/render_observer.rb +4 -4
  349. data/rails_plugins/rspec_on_rails/lib/spec/rails/example/view_example_group.rb +1 -1
  350. data/rails_plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/base.rb +1 -1
  351. data/rails_plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb +1 -1
  352. data/rails_plugins/rspec_on_rails/lib/spec/rails/matchers/assert_select.rb +10 -10
  353. data/rails_plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb +6 -6
  354. data/rails_plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb +7 -7
  355. data/rails_plugins/rspec_on_rails/lib/spec/rails/story_adapter.rb +1 -1
  356. data/rails_plugins/rspec_on_rails/lib/spec/rails.rb +8 -8
  357. data/rails_plugins/rspec_on_rails/spec/rails/autotest/mappings_spec.rb +6 -6
  358. data/rails_plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb +1 -1
  359. data/rails_plugins/rspec_on_rails/spec/rails/example/controller_spec_spec.rb +22 -22
  360. data/rails_plugins/rspec_on_rails/spec/rails/example/helper_spec_spec.rb +1 -1
  361. data/rails_plugins/rspec_on_rails/spec/rails/example/ivar_proxy_spec.rb +3 -3
  362. data/rails_plugins/rspec_on_rails/spec/rails/example/shared_behaviour_spec.rb +2 -2
  363. data/rails_plugins/rspec_on_rails/spec/rails/example/view_spec_spec.rb +8 -8
  364. data/rails_plugins/rspec_on_rails/spec/rails/extensions/action_view_base_spec.rb +7 -7
  365. data/rails_plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb +1 -1
  366. data/rails_plugins/rspec_on_rails/spec/rails/matchers/assert_select_spec.rb +37 -37
  367. data/rails_plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb +1 -1
  368. data/rails_plugins/rspec_on_rails/spec/rails/matchers/have_text_spec.rb +4 -4
  369. data/rails_plugins/rspec_on_rails/spec/rails/matchers/redirect_to_spec.rb +26 -26
  370. data/rails_plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb +18 -18
  371. data/rails_plugins/rspec_on_rails/spec/rails/mocks/mock_model_spec.rb +2 -2
  372. data/rails_plugins/rspec_on_rails/spec/spec_helper.rb +1 -1
  373. data/rails_plugins/rspec_on_rails/spec_resources/controllers/controller_spec_controller.rb +9 -9
  374. data/rails_plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb +7 -7
  375. data/rails_plugins/rspec_on_rails/spec_resources/controllers/render_spec_controller.rb +5 -5
  376. data/rails_plugins/rspec_on_rails/spec_resources/controllers/rjs_spec_controller.rb +10 -10
  377. data/rails_plugins/rspec_on_rails/spec_resources/helpers/explicit_helper.rb +1 -1
  378. data/rails_plugins/rspec_on_rails/stories/transactions_should_rollback.rb +1 -1
  379. data/rails_plugins/rspec_on_rails/tasks/rspec.rake +4 -4
  380. data/script/txt2html +1 -1
  381. data/setup.rb +4 -4
  382. data/tasks/hack.rake +3 -3
  383. data/website/index.html +2 -2
  384. data/website/index.txt +1 -1
  385. data/website/index_devjavu +3 -3
  386. data/website/javascripts/rounded_corners_lite.inc.js +1 -1
  387. data/website/stylesheets/screen.css +2 -2
  388. data.tar.gz.sig +0 -0
  389. metadata +2 -1
  390. metadata.gz.sig +2 -1
data/History.txt CHANGED
@@ -1,11 +1,19 @@
1
- == 0.1.5 2008-04-
1
+ == 0.1.6 2008-04-25
2
+
3
+ * 1 minor enhancement:
4
+ * replaced index key by Document#probably_unique_id
5
+
6
+ * bug fixes:
7
+ * Added forgotten public/images/flags to generator file.
8
+
9
+ == 0.1.5 2008-04-25
2
10
 
3
11
  * 1 major enhancement:
4
12
  * yet another Indexer & Index rewrite
5
13
 
6
14
  * 1 minor enhancement:
7
15
  * flags to indicate found language
8
-
16
+
9
17
  * bug fixes:
10
18
  * No more (or just less?) index lock errors
11
19
 
@@ -25,14 +33,13 @@
25
33
  * new DSL syntax
26
34
  * multi-threaded Indexer
27
35
 
28
-
29
36
  == 0.1.1 2008-04-12
30
37
 
31
38
  * 1 major enhancement:
32
39
  * cache à la Google
33
40
 
34
41
  * minor enhancements:
35
- * easier configuration. Every picolena specific conf files in config/custom
42
+ * easier configuration. Every picolena specific conf files in config/custom
36
43
  * lots of refactoring
37
44
 
38
45
  * bug fixes
data/Manifest.txt CHANGED
@@ -89,6 +89,7 @@ lib/picolena/templates/public/images/flags/pl.png
89
89
  lib/picolena/templates/public/images/flags/pt-br.png
90
90
  lib/picolena/templates/public/images/flags/pt-pt.png
91
91
  lib/picolena/templates/public/images/flags/readme.txt
92
+ lib/picolena/templates/public/images/flags/sv.png
92
93
  lib/picolena/templates/public/images/icons/cad.png
93
94
  lib/picolena/templates/public/images/icons/code.png
94
95
  lib/picolena/templates/public/images/icons/doc.png
data/README.txt CHANGED
@@ -8,7 +8,7 @@
8
8
  Picolena is a lightweight ferret-powered documents search engine written in Ruby on rails:
9
9
 
10
10
  1. Just let Ferret index any directory you want.
11
- 2. Enter queries on your browser to get corresponding documents in a few milliseconds.
11
+ 2. Enter queries on your browser to get corresponding documents in a few milliseconds.
12
12
 
13
13
  == FEATURES:
14
14
 
@@ -33,7 +33,7 @@ web-server just like you would with any Rails application.
33
33
  picolena ~/shared_documents /media/literature
34
34
  cd picolena
35
35
  ruby script/server
36
-
36
+
37
37
  This would create the picolena file structure, index every file inside ~/shared_documents and /media/literature, and launch a web-server available at http://localhost:3000
38
38
 
39
39
  == REQUIREMENTS:
data/bin/picolena CHANGED
@@ -14,7 +14,7 @@ end
14
14
  action= ARGV.include?("--spec-only") ? "testing" : "installing"
15
15
 
16
16
  require 'rubigen/scripts/generate'
17
- source = RubiGen::PathSource.new(:application,
17
+ source = RubiGen::PathSource.new(:application,
18
18
  File.join(File.dirname(__FILE__), "../lib"))
19
19
  RubiGen::Base.reset_sources
20
20
  RubiGen::Base.append_sources source
data/config/hoe.rb CHANGED
@@ -28,21 +28,21 @@ Run 'rubyforge setup' to prepare your env for access to Rubyforge
28
28
  end
29
29
 
30
30
 
31
- REV = nil
32
- # UNCOMMENT IF REQUIRED:
31
+ REV = nil
32
+ # UNCOMMENT IF REQUIRED:
33
33
  # REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
34
34
  VERS = Picolena::VERSION::STRING + (REV ? ".#{REV}" : "")
35
35
  RDOC_OPTS = ['--quiet', '--title', 'picolena documentation',
36
36
  "--opname", "index.html",
37
- "--line-numbers",
37
+ "--line-numbers",
38
38
  "--main", "README",
39
39
  "--inline-source"]
40
40
 
41
41
  class Hoe
42
- def extra_deps
43
- @extra_deps.reject! { |x| Array(x).first == 'hoe' }
42
+ def extra_deps
43
+ @extra_deps.reject! { |x| Array(x).first == 'hoe' }
44
44
  @extra_deps
45
- end
45
+ end
46
46
  end
47
47
 
48
48
  # Generate all the Rake tasks
@@ -54,10 +54,10 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
54
54
  p.url = HOMEPATH
55
55
  p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
56
56
  p.test_globs = ["spec/picolena_spec.rb"]
57
-
57
+
58
58
  files_to_clean = File.readlines(File.join(File.dirname(__FILE__),'files_to_clean')).collect{|line| line.chomp}
59
59
  p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store']+files_to_clean #An array of file patterns to delete on clean.
60
-
60
+
61
61
  # == Optional
62
62
  p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
63
63
  p.extra_deps = [ ['rails', '>= 2.0.2'],
@@ -70,9 +70,9 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
70
70
  ['paginator', '>= 1.1.0'],
71
71
  ['rspec', '>= 1.1.3']
72
72
  ]
73
-
73
+
74
74
  #p.spec_extras = {} # A hash of extra values to set in the gemspec.
75
-
75
+
76
76
  p.rdoc_pattern = /txt$/
77
77
  end
78
78
 
data/lib/picolena/USAGE CHANGED
@@ -9,7 +9,7 @@ Example:
9
9
  picolena ~/shared_documents /media/literature
10
10
  cd picolena
11
11
  ruby script/server
12
-
12
+
13
13
  This would create the picolena file structure, index every file
14
14
  inside ~/shared_documents and /media/literature, and launch a
15
15
  web-server available at http://localhost:3000
@@ -2,16 +2,16 @@ module Picolena
2
2
  # Specify indexes path.
3
3
  # Storage should be sufficient in order to store all indexed data.
4
4
  IndexesSavePath=File.join(RAILS_ROOT, 'tmp/ferret_indexes/')
5
-
6
-
5
+
6
+
7
7
  # Which language should be used?
8
8
  # English (:en), German (:de), French (:fr) and Spanish (:es) are currently supported
9
9
  # English is chosen by default.
10
10
  # If you'd like to use another language, you can find templates in #{RAILS_ROOT}/lang/ui,
11
11
  # then add your own language in this directory, and modify this line:
12
12
  Globalite.language = :en
13
-
14
-
13
+
14
+
15
15
  # Is more than one language used in indexed documents?
16
16
  # Picolena can try to recognise the language used, and save it in the index.
17
17
  # It is then possible to look for documents according to their language.
@@ -19,15 +19,15 @@ module Picolena
19
19
  # If every document is written in the same language, turning UseLanguageRecognition to false
20
20
  # will speed up the indexing process
21
21
  UseLanguageRecognition = true
22
-
22
+
23
23
  # Specify which locale should be used by Ferret
24
24
  Ferret.locale = "en_US.UTF-8"
25
-
26
-
25
+
26
+
27
27
  # Results per page
28
28
  ResultsPerPage = 10
29
-
30
-
29
+
30
+
31
31
  # Length of "probably unique id" 's
32
32
  # Those id's are used to characterize every document, thus allowing tiny URLs in Controllers
33
33
  # HashLength = 10
@@ -37,8 +37,8 @@ module Picolena
37
37
  # The more documents you have, the bigger HashLength should be in order to avoid collisions.
38
38
  # It would not be wise (and specs won't pass) to specify HashLength smaller than 10.
39
39
  HashLength = 10
40
-
41
-
40
+
41
+
42
42
  # Specify the default Levenshtein distance when using FuzzyQuery
43
43
  # see http://ferret.davebalmain.com/api/classes/Ferret/QueryParser.html for more information.
44
44
  Ferret::Search::FuzzyQuery.default_min_similarity=0.6
@@ -3,14 +3,14 @@ require 'fileutils'
3
3
  require 'pathname'
4
4
 
5
5
  class PicolenaGenerator < RubiGen::Base #:nodoc:
6
-
6
+
7
7
  DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
8
8
  Config::CONFIG['ruby_install_name'])
9
-
9
+
10
10
  default_options :destination => 'picolena'
11
-
11
+
12
12
  attr_reader :name
13
-
13
+
14
14
  def initialize(runtime_args, runtime_options = {})
15
15
  super
16
16
  usage if args.empty? and !options[:spec_only]
@@ -20,17 +20,17 @@ class PicolenaGenerator < RubiGen::Base #:nodoc:
20
20
  abs_dir=Pathname.new(relative_path).realpath.to_s
21
21
  "\"#{abs_dir}\" : \"#{abs_dir}\""
22
22
  }.join("\n ")
23
-
23
+
24
24
  extract_options
25
25
  end
26
26
 
27
27
  def manifest
28
28
  script_options = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] }
29
-
29
+
30
30
  record do |m|
31
31
  #Create base dir
32
32
  m.directory ''
33
-
33
+
34
34
  # Picolena file structure, without any plugin.
35
35
  BASEDIRS.each { |path|
36
36
  # Ensure appropriate folder exists
@@ -38,7 +38,7 @@ class PicolenaGenerator < RubiGen::Base #:nodoc:
38
38
  # Copy every file included in BASEDIRS
39
39
  m.folder path, path
40
40
  }
41
-
41
+
42
42
  # Moved plugins away so they don't get parsed by rdoc/ri.
43
43
  RAILS_PLUGINS.each{ |path|
44
44
  plugin_source = '../../../rails_plugins/'+path
@@ -56,7 +56,7 @@ class PicolenaGenerator < RubiGen::Base #:nodoc:
56
56
  %w( about breakpointer console destroy generate performance/benchmarker performance/profiler performance/request process/reaper process/spawner process/inspector runner server plugin spec spec_server).each do |file|
57
57
  m.file "script/#{file}", "script/#{file}", script_options
58
58
  end
59
-
59
+
60
60
  # Picolena configuration files
61
61
  m.file '../config/white_list_ip.yml', 'config/custom/white_list_ip.yml'
62
62
  m.file '../config/basic.rb', 'config/custom/picolena.rb'
@@ -69,10 +69,10 @@ class PicolenaGenerator < RubiGen::Base #:nodoc:
69
69
  m.file '../../../README.txt', 'README'
70
70
  m.file '../../../README.txt', 'doc/README_FOR_APP'
71
71
  m.file 'Rakefile', 'Rakefile'
72
-
72
+
73
73
  unless options[:no_index]
74
74
  # Indexing documents for development environment
75
- m.rake 'index:create'
75
+ m.rake 'index:create'
76
76
  # Mirroring Ferret development index instead of indexing documents again for production.
77
77
  m.mirror 'tmp/ferret_indexes/development', 'tmp/ferret_indexes/production'
78
78
  end
@@ -109,10 +109,10 @@ EOS
109
109
  opts.on(nil, "--spec-only", "Test picolena framework without installing it."){
110
110
  options[:spec_only]=true
111
111
  options[:no_index]=true
112
- options[:destination]=File.join(Dir::tmpdir,"picolena_test_#{Time.now.to_i}")
112
+ options[:destination]=File.join(Dir::tmpdir,"picolena_test_#{Time.now.to_i}")
113
113
  }
114
114
  end
115
-
115
+
116
116
  def extract_options
117
117
  # for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
118
118
  # Templates can access these value via the attr_reader-generated methods, but not the
@@ -143,6 +143,7 @@ EOS
143
143
  public/help
144
144
  public/images
145
145
  public/images/icons
146
+ public/images/flags
146
147
  public/javascripts
147
148
  public/stylesheets
148
149
  spec
@@ -169,7 +170,7 @@ EOS
169
170
  tmp/sessions
170
171
  tmp/sockets
171
172
  )
172
-
173
+
173
174
  RAILS_PLUGINS=%w(
174
175
  globalite
175
176
  globalite/data
@@ -3,23 +3,23 @@
3
3
  # The request is sent to DocumentsController only if the IP is included in the white list.
4
4
  # Otherwise, it returns "Access denied" 403.
5
5
 
6
- class ApplicationController < ActionController::Base
6
+ class ApplicationController < ActionController::Base
7
7
  session :disabled => true
8
8
  before_filter :should_only_be_available_for_white_list_IPs, :except=> :access_denied
9
-
9
+
10
10
  # Returns 403 status in case of an unknown remote IP address
11
11
  def access_denied
12
12
  render :text=>"Access denied", :status => 403
13
13
  end
14
-
14
+
15
15
  # Redirects to documents_url in case route hasn't been recognised
16
16
  def unknown_request
17
17
  flash[:warning]="Unknown URL"
18
18
  redirect_to documents_url
19
19
  end
20
-
20
+
21
21
  private
22
-
22
+
23
23
  # Tries to match remote IP address with the white list defined in config/custom/white_list_ip.yml
24
24
  # Redirects to :access_denied if the remote IP is not white listed.
25
25
  def should_only_be_available_for_white_list_IPs
@@ -6,17 +6,18 @@
6
6
  # - displays document content
7
7
  # - displays cached content.
8
8
 
9
- class DocumentsController < ApplicationController
9
+ class DocumentsController < ApplicationController
10
+ before_filter :ensure_index_is_created, :except=> :index
10
11
  before_filter :check_if_valid_link, :only=> [:download, :content, :cached]
11
-
12
+
12
13
  # Actually doesn't check anything at all. Just a redirect to show_document(query)
13
14
  #
14
15
  # FIXME: remove this useless action, and go directly from submit button to GET :action => show
15
16
  def check_query
16
17
  redirect_to :action=>'show', :id=>params[:query]
17
18
  end
18
-
19
-
19
+
20
+
20
21
  # Show the matching documents for a given query
21
22
  def show
22
23
  start=Time.now
@@ -31,14 +32,14 @@ class DocumentsController < ApplicationController
31
32
  @total_hits=finder.total_hits
32
33
  @time_needed=Time.now-start
33
34
  end
34
-
35
-
35
+
36
+
36
37
  # Download the file whose probably_unique_id is given.
37
38
  # If the checksum is incorrect, redirect to documents_url via no_valid_link
38
39
  def download
39
40
  send_file @document.complete_path
40
41
  end
41
-
42
+
42
43
  # Returns the content of the document identified by probably_unique_id, as it is *now*.
43
44
  def content
44
45
  end
@@ -47,9 +48,9 @@ class DocumentsController < ApplicationController
47
48
  # similar to Google cache.
48
49
  def cached
49
50
  end
50
-
51
+
51
52
  private
52
-
53
+
53
54
  # Returns corresponding document for any given "probably unique id"
54
55
  # Redirects to no_valid_link if:
55
56
  # there are more than one matching document (hash collision)
@@ -59,6 +60,13 @@ class DocumentsController < ApplicationController
59
60
  @document=Document.find_by_unique_id(@probably_unique_id) rescue no_valid_link
60
61
  end
61
62
 
63
+ def ensure_index_is_created
64
+ Indexer.ensure_index_existence
65
+ while Indexer.do_not_disturb_while_indexing do
66
+ sleep 1
67
+ end
68
+ end
69
+
62
70
  # Flashes a warning and redirects to documents_url.
63
71
  def no_valid_link
64
72
  flash[:warning]="no valid link"
@@ -3,7 +3,7 @@ module DocumentsHelper
3
3
  def nothing_found?
4
4
  @matching_documents.nil? or @matching_documents.entries.empty?
5
5
  end
6
-
6
+
7
7
  # Very basic pagination.
8
8
  # Provides liks to Next, Prev and FirstPage when needed.
9
9
  def should_paginate(page,query)
@@ -11,7 +11,7 @@ module DocumentsHelper
11
11
  (link_to("&larr;", :action => :show, :id => query, :page => page.prev.number) if page.prev?),
12
12
  (link_to("&rarr;", :action => :show, :id => query, :page => page.next.number) if page.next?)].compact.join(" | ")
13
13
  end
14
-
14
+
15
15
  # Returns a localized sentence like "Results 1-10 of 12 for Zimbabwe (0.472s)" or
16
16
  # "Résultats 1-2 parmi 2 pour whatever (0.012s)"
17
17
  def describe_results(page, total_hits, dt, query)
@@ -24,45 +24,46 @@ module DocumentsHelper
24
24
  show_time_needed(dt)
25
25
  ].join(' ')
26
26
  end
27
-
27
+
28
28
  # Returns the time needed to treat the query and launch the search, with a ms precision : (0.472s)
29
29
  def show_time_needed(dt)
30
30
  content_tag(:small,'('<<number_with_precision(dt,3)<<'s)')
31
31
  end
32
-
32
+
33
33
  # When possible, highlights content of the document that matches the query.
34
34
  def highlight_matching_content(document)
35
35
  content_tag(:ul,document.matching_content.collect{|sentence|
36
36
  content_tag(:li,h(sentence).gsub(/&lt;&lt;(.*?)&gt;&gt;/,'<strong>\1</strong>').gsub(/\v|\f/,''))
37
37
  }) if document.matching_content
38
38
  end
39
-
39
+
40
40
  def language_icon_for(document)
41
- (lang=document.language) && image_tag("flags/#{lang}.png")
41
+ lang=document.language
42
+ link_to(image_tag("flags/#{lang}.png"), document_url('lang:'<<lang)) unless lang.blank?
42
43
  end
43
-
44
+
44
45
  # Returns icon and filename for any given document.
45
46
  def icon_and_filename_for(document)
46
- [icon_for(document.extname),document.filename].join("&nbsp;")
47
+ [icon_for(document.ext_as_sym),document.filename].join("&nbsp;")
47
48
  end
48
-
49
+
49
50
  # Returns the location (if avaible) of the filetype icon.
50
- def icon_for(filetype)
51
- icon_symbol=FiletypeToIconSymbol[filetype.downcase.sub(/^\./,'')]
51
+ def icon_for(ext)
52
+ icon_symbol=Picolena::FiletypeToIconSymbol[ext]
52
53
  image_tag("icons/#{icon_symbol}.png") if icon_symbol
53
54
  end
54
-
55
+
55
56
  # Returns a link to a backup search engine that could maybe find more results for the same query.
56
57
  def link_to_backup_search_engine(query)
57
58
  link_to :backup_search_engine_name.l, :backup_search_engine_url.l<<query
58
59
  end
59
-
60
+
60
61
  # For any indexed document, returns a link to its containing directory.
61
62
  def link_to_containing_directory(document)
62
63
  link_name=image_tag('icons/remote_folder.png')<<'&nbsp;'<<content_tag(:small,document.alias_path)
63
64
  link_to link_name, document.alias_path, :target=>'_blank'
64
65
  end
65
-
66
+
66
67
  # For any indexed document, returns a link to show its content.
67
68
  def link_to_plain_text_content(document)
68
69
  link_name=image_tag('icons/plain_text_small.png')<<'&nbsp;'<<content_tag(:small,:text_content.l)
@@ -1,36 +1,33 @@
1
1
  # Document class retrieves information from filesystem and the index for any given document.
2
2
  class Document
3
3
  attr_reader :complete_path
4
- attr_writer :index_id
5
- attr_accessor :user, :score, :matching_content
6
-
4
+ attr_accessor :score, :matching_content
5
+
7
6
  def initialize(path)
8
7
  #To ensure @complete_path is an absolute direction.
9
8
  @complete_path=File.expand_path(path)
10
9
  validate_existence_of_file
11
10
  validate_in_indexed_directory
12
11
  end
13
-
12
+
14
13
  #Delegating properties to File::method_name(complete_path)
15
- [:dirname, :basename, :extname, :size?, :file?, :read, :ext_as_sym].each{|method_name|
14
+ [:dirname, :basename, :extname, :ext_as_sym, :file?, :ext_as_sym].each{|method_name|
16
15
  define_method(method_name){File.send(method_name,complete_path)}
17
16
  }
18
- alias_method :size, :size?
19
17
  alias_method :filename, :basename
20
- alias_method :to_s, :basename
21
-
18
+
22
19
  # Returns filename without extension
23
20
  # "buildings.odt" => "buildings"
24
21
  def basename
25
22
  filename.chomp(extname)
26
23
  end
27
-
24
+
28
25
  # End users should not always know where documents are stored internally.
29
26
  # An alias path can be specified in config/indexed_directories.yml
30
- #
27
+ #
31
28
  # For example, with:
32
29
  # "/media/wiki_dump/" : "http://www.mycompany.com/wiki/"
33
- #
30
+ #
34
31
  # The documents
35
32
  # "/media/wiki_dump/organigram.odp"
36
33
  # will be displayed as being:
@@ -40,7 +37,7 @@ class Document
40
37
  alias_dir=Picolena::IndexedDirectories[original_dir]
41
38
  dirname.sub(original_dir,alias_dir)
42
39
  end
43
-
40
+
44
41
  # Returns an id for this document.
45
42
  # This id will be used in Controllers in order to get tiny urls.
46
43
  # Since it's a base26 hash of the absolute filename, it can only be "probably unique".
@@ -48,46 +45,41 @@ class Document
48
45
  def probably_unique_id
49
46
  @probably_unique_id||=complete_path.base26_hash
50
47
  end
51
-
48
+
52
49
  # Returns true iff some PlainTextExtractor has been defined to convert it to plain text.
53
50
  # Document.new("presentation.pdf").supported? => true
54
51
  # Document.new("presentation.some_weird_extension").supported? => false
55
52
  def supported?
56
53
  PlainTextExtractor.supported_extensions.include?(self.ext_as_sym)
57
54
  end
58
-
55
+
59
56
  # Retrieves content as it is *now*.
60
57
  def content
61
58
  PlainTextExtractor.extract_content_from(complete_path)
62
59
  end
63
-
60
+
64
61
  # Cache à la Google.
65
62
  # Returns content as it was at the time it was indexed.
66
63
  def cached
67
64
  from_index[:content]
68
65
  end
69
-
66
+
70
67
  # FIXME: Not just date anymore.
71
68
  # Returns the last modification date before the document got indexed.
72
69
  # Useful to know how old a document is, and to which version the cache corresponds.
73
70
  def date
74
71
  from_index[:modified].sub(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/,'\1-\2-\3 \4:\5:\6')
75
72
  end
76
-
73
+
77
74
  def mtime
78
75
  from_index[:modified].to_i
79
76
  end
80
-
77
+
81
78
  # Returns language.
82
79
  def language
83
80
  from_index[:language]
84
81
  end
85
-
86
- # Returns the id with which the document is indexed.
87
- def index_id
88
- @index_id ||= Finder.term_search(:complete_path, complete_path).doc
89
- end
90
-
82
+
91
83
  # Fields that are shared between every document.
92
84
  def self.default_fields_for(complete_path)
93
85
  {
@@ -97,36 +89,35 @@ class Document
97
89
  :basename => File.basename(complete_path, File.extname(complete_path)).gsub(/_/,' '),
98
90
  :filetype => File.extname(complete_path),
99
91
  :modified => File.mtime(complete_path).strftime("%Y%m%d%H%M%S")
100
- }
92
+ }
101
93
  end
102
-
94
+
103
95
  private
104
-
96
+
105
97
  # Retrieves the document from the index.
106
98
  # Useful to get meta-info about it.
107
99
  def from_index
108
- Indexer.index[index_id]
100
+ Indexer.index[probably_unique_id]
109
101
  end
110
-
111
- def self.find_by_unique_id(some_id)
112
- doc_id=Finder.term_search(:probably_unique_id, some_id).doc
113
- new(Indexer.index[doc_id][:complete_path])
102
+
103
+ def self.find_by_unique_id(probably_unique_id)
104
+ new(Indexer.index[probably_unique_id][:complete_path])
114
105
  end
115
-
106
+
116
107
  def in_indexed_directory?
117
108
  !indexed_directory.nil?
118
109
  end
119
-
110
+
120
111
  def indexed_directory
121
112
  Picolena::IndexedDirectories.keys.find{|indexed_dir|
122
113
  dirname.starts_with?(indexed_dir)
123
- }
114
+ }
124
115
  end
125
-
116
+
126
117
  def validate_existence_of_file
127
118
  raise Errno::ENOENT, @complete_path unless file?
128
119
  end
129
-
120
+
130
121
  def validate_in_indexed_directory
131
122
  raise ArgumentError, "required document is not in indexed directory" unless in_indexed_directory?
132
123
  end