motiro 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (309) hide show
  1. data/LICENSE +280 -0
  2. data/README +28 -0
  3. data/README.en +175 -0
  4. data/README.pt-br +175 -0
  5. data/Rakefile +10 -0
  6. data/app/controllers/account_controller.rb +62 -0
  7. data/app/controllers/application.rb +72 -0
  8. data/app/controllers/edition_controller.rb +13 -0
  9. data/app/controllers/javascript_controller.rb +21 -0
  10. data/app/controllers/report_controller.rb +79 -0
  11. data/app/controllers/root_controller.rb +7 -0
  12. data/app/controllers/wiki_controller.rb +102 -0
  13. data/app/core/cache_reporter.rb +53 -0
  14. data/app/core/cache_reporter_fetcher.rb +33 -0
  15. data/app/core/chief_editor.rb +69 -0
  16. data/app/core/reporter.rb +105 -0
  17. data/app/core/reporter_driver.rb +36 -0
  18. data/app/core/reporter_fetcher.rb +39 -0
  19. data/app/core/settings.rb +43 -0
  20. data/app/core/version.rb +1 -0
  21. data/app/core/wiki_page_not_found.rb +33 -0
  22. data/app/core/wiki_reporter.rb +83 -0
  23. data/app/helpers/account_helper.rb +2 -0
  24. data/app/helpers/application_helper.rb +68 -0
  25. data/app/helpers/default_page_provider.rb +28 -0
  26. data/app/helpers/report_helper.rb +2 -0
  27. data/app/helpers/root_helper.rb +2 -0
  28. data/app/helpers/wiki_helper.rb +3 -0
  29. data/app/models/change.rb +96 -0
  30. data/app/models/diff_table_builder.rb +285 -0
  31. data/app/models/event.rb +18 -0
  32. data/app/models/headline.rb +109 -0
  33. data/app/models/page.rb +114 -0
  34. data/app/models/page_sweeper.rb +26 -0
  35. data/app/models/user.rb +85 -0
  36. data/app/ports/chdir_runner.rb +36 -0
  37. data/app/ports/reporter_loader.rb +9 -0
  38. data/app/ports/runner.rb +64 -0
  39. data/app/reporters/darcs_connection.rb +54 -0
  40. data/app/reporters/darcs_reporter.rb +104 -0
  41. data/app/reporters/darcs_settings.rb +9 -0
  42. data/app/reporters/darcs_temp_repo.rb +40 -0
  43. data/app/reporters/events_reporter.rb +28 -0
  44. data/app/reporters/features_reporter.rb +24 -0
  45. data/app/reporters/subversion_reporter.rb +203 -0
  46. data/app/reporters/svn_connection.rb +62 -0
  47. data/app/reporters/svn_settings.rb +40 -0
  48. data/app/views/account/_authorization.rhtml +54 -0
  49. data/app/views/account/_availability.rhtml +5 -0
  50. data/app/views/account/availability.rhtml +1 -0
  51. data/app/views/account/login.rhtml +22 -0
  52. data/app/views/account/logout.rhtml +10 -0
  53. data/app/views/javascript/motiro.rjs +132 -0
  54. data/app/views/javascript/niftycube.rjs +300 -0
  55. data/app/views/layouts/_bottom.rhtml +5 -0
  56. data/app/views/layouts/_header.rhtml +7 -0
  57. data/app/views/layouts/_top.rhtml +25 -0
  58. data/app/views/layouts/application.rhtml +3 -0
  59. data/app/views/layouts/scaffold.rhtml +13 -0
  60. data/app/views/layouts/wiki_edit.rhtml +26 -0
  61. data/app/views/report/list.rhtml +32 -0
  62. data/app/views/report/older.rhtml +26 -0
  63. data/app/views/report/rss.rxml +29 -0
  64. data/app/views/report/show.rhtml +20 -0
  65. data/app/views/root/index.rhtml +33 -0
  66. data/app/views/wiki/_editbar.rhtml +26 -0
  67. data/app/views/wiki/_properties_edit.rhtml +5 -0
  68. data/app/views/wiki/_properties_show.rhtml +5 -0
  69. data/app/views/wiki/edit.rhtml +56 -0
  70. data/app/views/wiki/properties_edit.rhtml +1 -0
  71. data/app/views/wiki/show.rhtml +9 -0
  72. data/bin/motiro +44 -0
  73. data/config/boot.rb +19 -0
  74. data/config/database.yml +14 -0
  75. data/config/environment.rb +64 -0
  76. data/config/environments/development.rb +20 -0
  77. data/config/environments/production.rb +19 -0
  78. data/config/environments/test.rb +19 -0
  79. data/config/motiro.yml +43 -0
  80. data/config/routes.rb +79 -0
  81. data/db/migrate/005_globalize_migration.rb +11363 -0
  82. data/db/migrate/006_remove_headline_title.rb +14 -0
  83. data/db/migrate/007_stretch_rid.rb +11 -0
  84. data/db/migrate/008_add_page_editors.rb +12 -0
  85. data/db/migrate/009_add_page_original_author.rb +12 -0
  86. data/db/migrate/010_remove_empty_string_defaults_from_pages.rb +17 -0
  87. data/db/migrate/011_add_title_and_kind_to_pages.rb +13 -0
  88. data/db/migrate/012_page_modification_info.rb +13 -0
  89. data/db/migrate/013_nullify_initial_page_attributes.rb +21 -0
  90. data/db/migrate/014_events_are_wiki_pages.rb +13 -0
  91. data/db/migrate/015_migrate_previous_event_data.rb +23 -0
  92. data/db/migrate/1_initial_structure.rb +36 -0
  93. data/db/migrate/2_add_authentication.rb +12 -0
  94. data/db/migrate/3_drop_articles.rb +26 -0
  95. data/db/migrate/4_add_page_editing.rb +14 -0
  96. data/db/motirodb.sqlite.initial +0 -0
  97. data/db/schema_version +1 -0
  98. data/db/translation/pt-BR.rb +76 -0
  99. data/doc/README_FOR_APP +2 -0
  100. data/installer/rails_installer_defaults.yml +5 -0
  101. data/lib/import_translations.rb +154 -0
  102. data/lib/login_system.rb +89 -0
  103. data/lib/relative_time.rb +48 -0
  104. data/lib/string_extensions.rb +10 -0
  105. data/lib/stub_hash.rb +22 -0
  106. data/lib/tasks/packaging.rake +93 -0
  107. data/lib/tasks/testing.rake +32 -0
  108. data/lib/tick_daemon.rb +41 -0
  109. data/lib/translator.rb +67 -0
  110. data/lib/wiki_renderer.rb +42 -0
  111. data/lib/wiki_url_generator.rb +29 -0
  112. data/log/.keepdir +0 -0
  113. data/public/404.html +8 -0
  114. data/public/500.html +8 -0
  115. data/public/dispatch.cgi +10 -0
  116. data/public/dispatch.fcgi +24 -0
  117. data/public/dispatch.rb +10 -0
  118. data/public/favicon.ico +0 -0
  119. data/public/images/calendar.png +0 -0
  120. data/public/images/rss.png +0 -0
  121. data/public/javascripts/controls.js +750 -0
  122. data/public/javascripts/dragdrop.js +584 -0
  123. data/public/javascripts/effects.js +854 -0
  124. data/public/javascripts/prototype.js +1785 -0
  125. data/public/robots.txt +1 -0
  126. data/public/stylesheets/motiro.css +269 -0
  127. data/public/stylesheets/niftyCorners.css +35 -0
  128. data/public/stylesheets/scaffold.css +74 -0
  129. data/script/about +3 -0
  130. data/script/breakpointer +3 -0
  131. data/script/console +3 -0
  132. data/script/destroy +3 -0
  133. data/script/generate +3 -0
  134. data/script/performance/benchmarker +3 -0
  135. data/script/performance/profiler +3 -0
  136. data/script/plugin +3 -0
  137. data/script/process/reaper +3 -0
  138. data/script/process/spawner +3 -0
  139. data/script/process/spinner +3 -0
  140. data/script/runner +3 -0
  141. data/script/server +3 -0
  142. data/script/ticker +29 -0
  143. data/test/acceptance/account_test.rb +186 -0
  144. data/test/acceptance/darcs_test.rb +62 -0
  145. data/test/acceptance/events_test.rb +47 -0
  146. data/test/acceptance/main_page_test.rb +92 -0
  147. data/test/acceptance/subversion_test.rb +319 -0
  148. data/test/acceptance/ts_all_suites.rb +27 -0
  149. data/test/acceptance/wiki_test.rb +202 -0
  150. data/test/contract/darcs_test.rb +51 -0
  151. data/test/contract/remote_darcs_test.rb +61 -0
  152. data/test/contract/svn_test.rb +53 -0
  153. data/test/fixtures/changes.yml +25 -0
  154. data/test/fixtures/headlines.yml +45 -0
  155. data/test/fixtures/pages.yml +98 -0
  156. data/test/fixtures/users.yml +31 -0
  157. data/test/functional/account_controller_test.rb +96 -0
  158. data/test/functional/report_controller_test.rb +113 -0
  159. data/test/functional/report_features_test.rb +38 -0
  160. data/test/functional/report_subversion_test.rb +79 -0
  161. data/test/functional/root_controller_test.rb +127 -0
  162. data/test/functional/wiki_controller_test.rb +280 -0
  163. data/test/lib/acceptance_test_case.rb +43 -0
  164. data/test/lib/configuration.rb +53 -0
  165. data/test/lib/darcs_excerpts.rb +181 -0
  166. data/test/lib/darcs_repo.rb +77 -0
  167. data/test/lib/live_mode_test.rb +51 -0
  168. data/test/lib/local_svn.rb +157 -0
  169. data/test/lib/netutils.rb +42 -0
  170. data/test/lib/platform_thread.rb +62 -0
  171. data/test/lib/repoutils.rb +23 -0
  172. data/test/lib/selenium_extensions.rb +32 -0
  173. data/test/lib/stubio.rb +37 -0
  174. data/test/lib/svn_excerpts.rb +288 -0
  175. data/test/lib/test_configuration.rb +14 -0
  176. data/test/lib/webserver.rb +71 -0
  177. data/test/meta/configuration_test.rb +72 -0
  178. data/test/meta/darcs_repo_test.rb +118 -0
  179. data/test/meta/local_svn_test.rb +125 -0
  180. data/test/meta/platform_thread_test.rb +46 -0
  181. data/test/meta/stubio_test.rb +44 -0
  182. data/test/mocks/headline.rb +34 -0
  183. data/test/mocks/svn_reporter.rb +29 -0
  184. data/test/stubs/svn_settings.rb +19 -0
  185. data/test/stubs/url_generator.rb +24 -0
  186. data/test/test_helper.rb +36 -0
  187. data/test/unit/cache_reporter_fetcher_test.rb +46 -0
  188. data/test/unit/cache_reporter_test.rb +97 -0
  189. data/test/unit/caching_test.rb +78 -0
  190. data/test/unit/change_test.rb +152 -0
  191. data/test/unit/chdir_runner_test.rb +77 -0
  192. data/test/unit/chief_editor_test.rb +234 -0
  193. data/test/unit/darcs_connection_test.rb +109 -0
  194. data/test/unit/darcs_reporter_test.rb +146 -0
  195. data/test/unit/darcs_settings_test.rb +37 -0
  196. data/test/unit/darcs_temp_repo_test.rb +51 -0
  197. data/test/unit/default_page_provider_test.rb +46 -0
  198. data/test/unit/diff_table_builder_test.rb +602 -0
  199. data/test/unit/headline_test.rb +259 -0
  200. data/test/unit/page_test.rb +145 -0
  201. data/test/unit/relative_time_test.rb +56 -0
  202. data/test/unit/reporter_driver_test.rb +85 -0
  203. data/test/unit/reporter_fetcher_test.rb +31 -0
  204. data/test/unit/reporter_test.rb +81 -0
  205. data/test/unit/runner_test.rb +93 -0
  206. data/test/unit/settings_test.rb +55 -0
  207. data/test/unit/string_extensions_test.rb +10 -0
  208. data/test/unit/svn_connection_test.rb +183 -0
  209. data/test/unit/svn_reporter_interaction_test.rb +38 -0
  210. data/test/unit/svn_reporter_test.rb +286 -0
  211. data/test/unit/svn_settings_test.rb +86 -0
  212. data/test/unit/translator_test.rb +96 -0
  213. data/test/unit/user_test.rb +125 -0
  214. data/test/unit/wiki_renderer_test.rb +87 -0
  215. data/test/unit/wiki_reporter_test.rb +94 -0
  216. data/test/unit/wiki_url_generator_test.rb +31 -0
  217. data/vendor/motiro-installer.rb +159 -0
  218. data/vendor/plugins/globalize/LICENSE +9 -0
  219. data/vendor/plugins/globalize/README +49 -0
  220. data/vendor/plugins/globalize/data/country_data.csv +240 -0
  221. data/vendor/plugins/globalize/data/language_data.csv +188 -0
  222. data/vendor/plugins/globalize/data/translation_data.csv +3421 -0
  223. data/vendor/plugins/globalize/generators/globalize/USAGE +10 -0
  224. data/vendor/plugins/globalize/generators/globalize/globalize_generator.rb +42 -0
  225. data/vendor/plugins/globalize/generators/globalize/templates/migration.rb.gz +0 -0
  226. data/vendor/plugins/globalize/generators/globalize/templates/tiny_migration.rb.gz +0 -0
  227. data/vendor/plugins/globalize/init.rb +30 -0
  228. data/vendor/plugins/globalize/lib/globalize/localization/core_ext.rb +170 -0
  229. data/vendor/plugins/globalize/lib/globalize/localization/core_ext_hooks.rb +33 -0
  230. data/vendor/plugins/globalize/lib/globalize/localization/db_translate.rb +494 -0
  231. data/vendor/plugins/globalize/lib/globalize/localization/db_view_translator.rb +152 -0
  232. data/vendor/plugins/globalize/lib/globalize/localization/locale.rb +173 -0
  233. data/vendor/plugins/globalize/lib/globalize/localization/rfc_3066.rb +40 -0
  234. data/vendor/plugins/globalize/lib/globalize/models/country.rb +24 -0
  235. data/vendor/plugins/globalize/lib/globalize/models/currency.rb +188 -0
  236. data/vendor/plugins/globalize/lib/globalize/models/language.rb +84 -0
  237. data/vendor/plugins/globalize/lib/globalize/models/model_translation.rb +4 -0
  238. data/vendor/plugins/globalize/lib/globalize/models/translation.rb +9 -0
  239. data/vendor/plugins/globalize/lib/globalize/models/view_translation.rb +14 -0
  240. data/vendor/plugins/globalize/lib/globalize/rails/action_mailer.rb +125 -0
  241. data/vendor/plugins/globalize/lib/globalize/rails/action_view.rb +79 -0
  242. data/vendor/plugins/globalize/lib/globalize/rails/active_record.rb +129 -0
  243. data/vendor/plugins/globalize/lib/globalize/rails/active_record_helper.rb +33 -0
  244. data/vendor/plugins/globalize/populators/pop_dates.rb +81 -0
  245. data/vendor/plugins/globalize/populators/pop_migration.rb +18 -0
  246. data/vendor/plugins/globalize/populators/pop_pluralization.rb +26 -0
  247. data/vendor/plugins/globalize/populators/pop_seps.rb +32 -0
  248. data/vendor/plugins/globalize/tasks/data.rake +130 -0
  249. data/vendor/plugins/globalize/test/action_mailer_test/globalize_mailer/test.en-US.plain.text.rhtml +1 -0
  250. data/vendor/plugins/globalize/test/action_mailer_test/globalize_mailer/test.en.plain.text.rhtml +1 -0
  251. data/vendor/plugins/globalize/test/action_mailer_test/globalize_mailer/test.he.plain.text.rhtml +1 -0
  252. data/vendor/plugins/globalize/test/action_mailer_test/globalize_mailer/test.plain.text.rhtml +1 -0
  253. data/vendor/plugins/globalize/test/action_mailer_test.rb +54 -0
  254. data/vendor/plugins/globalize/test/config/database.yml.default +16 -0
  255. data/vendor/plugins/globalize/test/config/database.yml.example +22 -0
  256. data/vendor/plugins/globalize/test/core_ext_test.rb +61 -0
  257. data/vendor/plugins/globalize/test/currency_test.rb +141 -0
  258. data/vendor/plugins/globalize/test/date_helper_test.rb +634 -0
  259. data/vendor/plugins/globalize/test/db/schema.rb +90 -0
  260. data/vendor/plugins/globalize/test/db_translation_test.rb +374 -0
  261. data/vendor/plugins/globalize/test/fixtures/globalize_categories.yml +7 -0
  262. data/vendor/plugins/globalize/test/fixtures/globalize_categories_products.yml +7 -0
  263. data/vendor/plugins/globalize/test/fixtures/globalize_countries.yml +41 -0
  264. data/vendor/plugins/globalize/test/fixtures/globalize_languages.yml +64 -0
  265. data/vendor/plugins/globalize/test/fixtures/globalize_manufacturers.yml +5 -0
  266. data/vendor/plugins/globalize/test/fixtures/globalize_products.yml +29 -0
  267. data/vendor/plugins/globalize/test/fixtures/globalize_simples.yml +5 -0
  268. data/vendor/plugins/globalize/test/fixtures/globalize_translations.yml +354 -0
  269. data/vendor/plugins/globalize/test/locale_test.rb +27 -0
  270. data/vendor/plugins/globalize/test/mime_responds_test.rb +358 -0
  271. data/vendor/plugins/globalize/test/model_test.rb +17 -0
  272. data/vendor/plugins/globalize/test/standard_data_test_helper.rb +33 -0
  273. data/vendor/plugins/globalize/test/test_helper.rb +19 -0
  274. data/vendor/plugins/globalize/test/test_standard_data.rb +54 -0
  275. data/vendor/plugins/globalize/test/validation_test.rb +29 -0
  276. data/vendor/plugins/globalize/test/view_picking_test.rb +49 -0
  277. data/vendor/plugins/globalize/test/view_translation_test.rb +237 -0
  278. data/vendor/plugins/globalize/test/views/layouts/standard.rhtml +1 -0
  279. data/vendor/plugins/globalize/test/views/respond_to/all_types_with_layout.rhtml +1 -0
  280. data/vendor/plugins/globalize/test/views/respond_to/all_types_with_layout.rjs +1 -0
  281. data/vendor/plugins/globalize/test/views/respond_to/using_defaults.en.rhtml +1 -0
  282. data/vendor/plugins/globalize/test/views/respond_to/using_defaults.en.rjs +1 -0
  283. data/vendor/plugins/globalize/test/views/respond_to/using_defaults.en.rxml +1 -0
  284. data/vendor/plugins/globalize/test/views/respond_to/using_defaults.fr.rhtml +1 -0
  285. data/vendor/plugins/globalize/test/views/respond_to/using_defaults.fr.rjs +1 -0
  286. data/vendor/plugins/globalize/test/views/respond_to/using_defaults.fr.rxml +1 -0
  287. data/vendor/plugins/globalize/test/views/respond_to/using_defaults.rhtml +1 -0
  288. data/vendor/plugins/globalize/test/views/respond_to/using_defaults.rjs +1 -0
  289. data/vendor/plugins/globalize/test/views/respond_to/using_defaults.rxml +1 -0
  290. data/vendor/plugins/globalize/test/views/respond_to/using_defaults_with_type_list.en.rhtml +1 -0
  291. data/vendor/plugins/globalize/test/views/respond_to/using_defaults_with_type_list.en.rjs +1 -0
  292. data/vendor/plugins/globalize/test/views/respond_to/using_defaults_with_type_list.en.rxml +1 -0
  293. data/vendor/plugins/globalize/test/views/respond_to/using_defaults_with_type_list.fr.rhtml +1 -0
  294. data/vendor/plugins/globalize/test/views/respond_to/using_defaults_with_type_list.fr.rjs +1 -0
  295. data/vendor/plugins/globalize/test/views/respond_to/using_defaults_with_type_list.fr.rxml +1 -0
  296. data/vendor/plugins/globalize/test/views/respond_to/using_defaults_with_type_list.rhtml +1 -0
  297. data/vendor/plugins/globalize/test/views/respond_to/using_defaults_with_type_list.rjs +1 -0
  298. data/vendor/plugins/globalize/test/views/respond_to/using_defaults_with_type_list.rxml +1 -0
  299. data/vendor/plugins/globalize/test/views/test.he-IL.rhtml +1 -0
  300. data/vendor/plugins/globalize/test/views/test.rhtml +1 -0
  301. data/vendor/plugins/globalize/test/views/test2.he.rhtml +1 -0
  302. data/vendor/plugins/globalize/test/views/test2.rhtml +1 -0
  303. data/vendor/plugins/test_xml/MIT-LICENSE +20 -0
  304. data/vendor/plugins/test_xml/README +20 -0
  305. data/vendor/plugins/test_xml/Rakefile +22 -0
  306. data/vendor/plugins/test_xml/init.rb +7 -0
  307. data/vendor/plugins/test_xml/lib/xml_assertions.rb +22 -0
  308. data/vendor/plugins/test_xml/test/test_xml_test.rb +40 -0
  309. metadata +505 -0
@@ -0,0 +1,53 @@
1
+ require 'yaml'
2
+
3
+ class Configuration
4
+
5
+ FILE_NAME = File.expand_path(File.dirname(__FILE__) +
6
+ '/../../config/motiro.yml')
7
+
8
+ def initialize(repo_type='subversion')
9
+ @repo_type = repo_type
10
+ @original_contents = File.open(FILE_NAME).read
11
+ @confs = YAML.load @original_contents
12
+ @confs.delete 'subversion' if repo_type != 'subversion'
13
+ end
14
+
15
+ def update_interval=(new_interval)
16
+ reconfigure('update_interval', new_interval)
17
+ end
18
+
19
+ def repo=(new_url)
20
+ reconfigure("#{@repo_type}/repo", new_url)
21
+ end
22
+
23
+ def go_live
24
+ self.update_interval = 0
25
+ end
26
+
27
+ def go_cached
28
+ self.update_interval = 10
29
+ end
30
+
31
+ def revert
32
+ file = File.open(FILE_NAME, 'w')
33
+ file << @original_contents
34
+ file.close
35
+ end
36
+
37
+ private
38
+
39
+ def reconfigure(key, value)
40
+ dst_hash = @confs
41
+ keys = key.split('/')
42
+ last_key = keys.pop
43
+ keys.each do |k|
44
+ dst_hash = dst_hash[k] = {}
45
+ end
46
+
47
+ dst_hash[last_key] = value
48
+ file = File.open(FILE_NAME, 'w')
49
+ YAML.dump(@confs, file)
50
+ file.close
51
+ end
52
+
53
+ end
@@ -0,0 +1,181 @@
1
+ # Motiro - A project tracking tool
2
+ # Copyright (C) 2006-2007 Thiago Arrais
3
+ #
4
+ # This program is free software; you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation; either version 2 of the License, or
7
+ # any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
+
18
+ P1 = <<END
19
+ <changelog>
20
+ <patch author='thiago.arrais@gmail.com' date='20060717200939' local_date='Mon Jul 17 17:09:39 BRT 2006' inverted='False' hash='20060717200939-49d33-c04fbb63892ae64cd96d1ad8f1ad2dd0a6e8e7da.gz'>
21
+ <name>Some refactoring after the mess</name>
22
+ </patch>
23
+ </changelog>
24
+ END
25
+
26
+ P2 = <<END
27
+ <changelog>
28
+ <patch author='thiago.arrais@gmail.com' date='20060813140540' local_date='Sun Aug 13 11:05:40 BRT 2006' inverted='False' hash='20060813140540-49d33-a640b3999077a8be03d81825ad7d40108c827250.gz'>
29
+ <name>Cheking for ghc --make output</name>
30
+ <comment>
31
+ Still need testing on Windows. Much probably there are file system and/or
32
+ linebreaking issues.</comment>
33
+ </patch>
34
+ </changelog>
35
+ END
36
+
37
+ P3 = <<END
38
+ <changelog>
39
+ <patch author='thiago.arrais@gmail.com' date='20060822135332' local_date='Tue Aug 22 10:53:32 Hora oficial do Brasil 2006' inverted='False' hash='20060822135332-47d7b-f311f9b4f4f2d329d8de62efaa09c5d20cf08f8f.gz'>
40
+ <name> </name>
41
+ </patch>
42
+ </changelog>
43
+ END
44
+
45
+ P4 = <<END
46
+ <changelog>
47
+ <patch author='thiago.arrais@gmail.com' date='20060717200939' local_date='Mon Jul 17 17:09:39 BRT 2006' inverted='False' hash='20060717200939-49d33-c04fbb63892ae64cd96d1ad8f1ad2dd0a6e8e7da.gz'>
48
+ <name>Some refactoring after the mess</name>
49
+ </patch>
50
+ <patch author='thiago.arrais@gmail.com' date='20060813140540' local_date='Sun Aug 13 11:05:40 BRT 2006' inverted='False' hash='20060813140540-49d33-a640b3999077a8be03d81825ad7d40108c827250.gz'>
51
+ <name>Cheking for ghc --make output</name>
52
+ <comment>
53
+ Still need testing on Windows. Much probably there are file system and/or
54
+ linebreaking issues.</comment>
55
+ </patch>
56
+ </changelog>
57
+ END
58
+
59
+ P5 = <<END
60
+ <changelog>
61
+ <patch author='thiago.arrais@gmail.com' date='20061120200104' local_date='Mon Nov 20 17:01:04 BRT 2006' inverted='False' hash='20061120200104-49d33-41e1ddac59f9a3cfa80c59492a686ab69ee5cd92.gz'>
62
+ <name>Activated restore defaults button for preference page</name>
63
+ </patch>
64
+ </changelog>
65
+ END
66
+
67
+ P5DIFF = <<END
68
+ Mon Nov 20 17:01:04 BRT 2006 thiago.arrais@gmail.com
69
+ * Activated restore defaults button for preference page
70
+ diff -rN -u old-eclipsefp/net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/preferences/BuildConsolePP.java new-eclipsefp/net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/preferences/BuildConsolePP.java
71
+ --- old-eclipsefp/net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/preferences/BuildConsolePP.java 2006-12-12 09:38:40.000000000 -0300
72
+ +++ new-eclipsefp/net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/preferences/BuildConsolePP.java 2006-12-12 09:38:40.000000000 -0300
73
+ @@ -56,18 +56,36 @@
74
+ fChkCleanConsole = new Button(composite, SWT.CHECK);
75
+ fChkCleanConsole.setText("Always clear console before building");
76
+
77
+ + createListeners();
78
+ + fillValuesInControls();
79
+ + return composite;
80
+ + }
81
+ +
82
+ + private void createListeners() {
83
+ fChkCleanConsole.addSelectionListener(new SelectionListener() {
84
+
85
+ - public void widgetDefaultSelected(SelectionEvent e) {}
86
+ + public void widgetDefaultSelected(SelectionEvent e) {
87
+ + //ignore event
88
+ + }
89
+
90
+ public void widgetSelected(SelectionEvent e) {
91
+ fStore.setValue(CLEAR_BUILD_CONSOLE, fChkCleanConsole.getSelection());
92
+ }
93
+
94
+ });
95
+ -
96
+ + }
97
+ +
98
+ + private void fillValuesInControls() {
99
+ fChkCleanConsole.setSelection(fStore.getBoolean(CLEAR_BUILD_CONSOLE));
100
+ - return composite;
101
+ + }
102
+ +
103
+ +
104
+ + @Override
105
+ + protected void performDefaults() {
106
+ + super.performDefaults();
107
+ +
108
+ + fStore.setToDefault(CLEAR_BUILD_CONSOLE);
109
+ + fillValuesInControls();
110
+ }
111
+
112
+ @Override
113
+
114
+ END
115
+
116
+ P6 = <<END
117
+ <changelog>
118
+ <patch author='thiago.arrais@gmail.com' date='20061120181253' local_date='Mon Nov 20 15:12:53 BRT 2006' inverted='False' hash='20061120181253-49d33-fd91e402f9667bc07e0e329831afcbde49b4fae8.gz'>
119
+ <name>Started build console preference page with clean before build option</name>
120
+ </patch>
121
+ </changelog>
122
+ END
123
+
124
+ P6DIFF = <<END
125
+ Mon Nov 20 15:12:53 BRT 2006 thiago.arrais@gmail.com
126
+ * Started build console preference page with clean before build option
127
+ diff -rN -u old-eclipsefp/net.sf.eclipsefp.common.core/src/net/sf/eclipsefp/common/core/util/MultiplexedWriter.java new-eclipsefp/net.sf.eclipsefp.common.core/src/net/sf/eclipsefp/common/core/util/MultiplexedWriter.java
128
+ --- old-eclipsefp/net.sf.eclipsefp.common.core/src/net/sf/eclipsefp/common/core/util/MultiplexedWriter.java 2006-12-12 11:04:19.000000000 -0300
129
+ +++ new-eclipsefp/net.sf.eclipsefp.common.core/src/net/sf/eclipsefp/common/core/util/MultiplexedWriter.java 2006-12-12 11:04:19.000000000 -0300
130
+ @@ -1,3 +1,14 @@
131
+ +/*******************************************************************************
132
+ + * Copyright (c) 2005, 2006 Thiago Arrais and others.
133
+ + *
134
+ + * All rights reserved. This program and the accompanying materials
135
+ + * are made available under the terms of the Eclipse Public License v1.0
136
+ + * which accompanies this distribution, and is available at
137
+ + * http://www.eclipse.org/legal/epl-v10.html
138
+ + *
139
+ + * Contributors:
140
+ + * Thiago Arrais - Initial API and implementation
141
+ + *******************************************************************************/
142
+ package net.sf.eclipsefp.common.core.util;
143
+
144
+ import java.io.IOException;
145
+ @@ -51,4 +62,8 @@
146
+ }
147
+ }
148
+
149
+ + public void removeOutput(Writer out) {
150
+ + fOutputs.remove(out);
151
+ + }
152
+ +
153
+ }
154
+ diff -rN -u old-eclipsefp/net.sf.eclipsefp.common.core.test/src/net/sf/eclipsefp/common/core/test/util/MultiplexedWriterTest.java new-eclipsefp/net.sf.eclipsefp.common.core.test/src/net/sf/eclipsefp/common/core/test/util/MultiplexedWriterTest.java
155
+ --- old-eclipsefp/net.sf.eclipsefp.common.core.test/src/net/sf/eclipsefp/common/core/test/util/MultiplexedWriterTest.java 2006-12-12 11:04:19.000000000 -0300
156
+ +++ new-eclipsefp/net.sf.eclipsefp.common.core.test/src/net/sf/eclipsefp/common/core/test/util/MultiplexedWriterTest.java 2006-12-12 11:04:19.000000000 -0300
157
+ @@ -76,6 +76,17 @@
158
+ multiplexer.close();
159
+ assertTrue(out.closed);
160
+ }
161
+ +
162
+ + public void testDoNotMultiplexToRemovedOutput() throws IOException {
163
+ + final StringWriter output = new StringWriter();
164
+ + MultiplexedWriter multiplexer = new MultiplexedWriter();
165
+ +
166
+ + multiplexer.addOutput(output);
167
+ + multiplexer.removeOutput(output);
168
+ + multiplexer.write("This should not be outputed to the removed writer");
169
+ +
170
+ + assertEquals(0, output.toString().length());
171
+ + }
172
+
173
+ private void multiplexTo(Writer... outputs) throws InterruptedException, IOException {
174
+ Writer multiplexer = new MultiplexedWriter(outputs);
175
+
176
+ END
177
+
178
+ P_EMPTY = <<END
179
+ <changelog>
180
+ </changelog>
181
+ END
@@ -0,0 +1,77 @@
1
+ # Motiro - A project tracking tool
2
+ # Copyright (C) 2006-2007 Thiago Arrais
3
+ #
4
+ # This program is free software; you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation; either version 2 of the License, or
7
+ # any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
+
18
+ require 'fileutils'
19
+ require 'repoutils'
20
+ require 'webserver'
21
+
22
+ include FileUtils
23
+
24
+ class DarcsRepository
25
+
26
+ attr_reader :dir, :url, :author
27
+
28
+ def initialize(options=:http)
29
+ @url = @dir = find_root_dir('darcs')
30
+ if (:http == options)
31
+ @server = WebServer.create_http_server_on(self.dir)
32
+ @url = 'http://localhost:' + @server[:Port].to_s
33
+ end
34
+ @author = 'alceu.valenca@olinda.pe.br'
35
+ mkdir_p(self.dir)
36
+ run_on_repo { `darcs init` }
37
+ end
38
+
39
+ def add_file(name, contents)
40
+ file_path = "#{self.dir}/#{name}"
41
+
42
+ File.open(file_path, 'w') do |file|
43
+ file << contents
44
+ end
45
+
46
+ run_on_repo { `darcs add #{name}` }
47
+ end
48
+
49
+ def record(patch_text)
50
+ temp_file = TEMP_DIR + '/darcs-msg.motiro'
51
+ File.open(temp_file, 'w') do |file|
52
+ file << patch_text
53
+ end
54
+
55
+ run_on_repo { `darcs record -a --logfile="#{temp_file}" --author="#{self.author}" 2>&1` }
56
+ end
57
+
58
+ def destroy
59
+ @server.shutdown if !@server.nil?
60
+ rm_rf(self.dir)
61
+ end
62
+
63
+ private
64
+
65
+ def run_on_repo
66
+ previous = Dir.pwd
67
+ begin
68
+ Dir.chdir(self.dir)
69
+ yield
70
+ ensure
71
+ Dir.chdir(previous)
72
+ end
73
+ end
74
+
75
+ include RepoUtils
76
+
77
+ end
@@ -0,0 +1,51 @@
1
+ # Motiro - A project tracking tool
2
+ # Copyright (C) 2006-2007 Thiago Arrais
3
+ #
4
+ # This program is free software; you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation; either version 2 of the License, or
7
+ # any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
+
18
+ require 'configuration'
19
+ require 'local_svn'
20
+
21
+ module LiveModeTestCase
22
+
23
+ def setup
24
+ super
25
+ @repo = self.create_repository
26
+ @config = Configuration.new(self.repo_type)
27
+ @config.repo = @repo.url
28
+ @config.go_live
29
+ do_setup
30
+ end
31
+
32
+ def create_repository
33
+ LocalSubversionRepository.new
34
+ end
35
+
36
+ def repo_type
37
+ 'subversion'
38
+ end
39
+
40
+ def do_setup; end
41
+
42
+ def teardown
43
+ super
44
+ @repo.destroy
45
+ @config.revert
46
+ do_teardown
47
+ end
48
+
49
+ def do_teardown; end
50
+
51
+ end
@@ -0,0 +1,157 @@
1
+ require 'fileutils'
2
+ require 'netutils'
3
+ require 'repoutils'
4
+
5
+ include FileUtils
6
+
7
+ class LocalSubversionRepository
8
+
9
+ attr_reader :url
10
+ attr_reader :wc_dir
11
+ attr_reader :username
12
+
13
+ def initialize
14
+ @username = 'motiro'
15
+ @password = 'motiro-pass'
16
+
17
+ @root_dir = find_root_dir
18
+ repo_dir = create_repo(@root_dir)
19
+ authorize_anon_read(repo_dir, @username, @password)
20
+ @url = start_server(repo_dir)
21
+ @wc_dir = create_working_copy(@root_dir, @url)
22
+ @valid = true
23
+ end
24
+
25
+ def destroy
26
+ if @valid
27
+ @valid = false
28
+ kill_server
29
+ rm_rf(@root_dir)
30
+ end
31
+ end
32
+
33
+ def mkdir(dirname, comment=nil)
34
+ if comment.nil? then
35
+ svn_command("mkdir #{self.wc_dir}/#{dirname}")
36
+ else
37
+ svn_command("mkdir #{self.url}/#{dirname}", comment)
38
+ end
39
+ end
40
+
41
+ def add_file(filename, contents)
42
+ put_file(filename, contents)
43
+ end
44
+
45
+ def put_file(filename, contents)
46
+ absolute_file = "#{self.wc_dir}/#{filename}"
47
+ existed = FileTest.exists? absolute_file
48
+
49
+ file = File.open(absolute_file, 'w')
50
+ file << contents
51
+ file.close
52
+ if !existed
53
+ svn_command("add #{absolute_file}")
54
+ end
55
+ end
56
+
57
+ def commit(comment)
58
+ svn_command("commit #{self.wc_dir}", comment)
59
+ end
60
+
61
+ def copy(src, dest, comment)
62
+ svn_command("copy #{self.url}/#{src} #{self.url}/#{dest}", comment)
63
+ end
64
+
65
+ def move(src, dest, comment)
66
+ svn_command("move #{self.url}/#{src} #{self.url}/#{dest}", comment)
67
+ end
68
+
69
+ private
70
+
71
+ include RepoUtils
72
+
73
+ def svn_command(command, comment=nil)
74
+ line = "svn #{command}"
75
+ unless comment.nil?
76
+ line += " --username #{@username} --password #{@password} -m \"#{comment}\""
77
+ end
78
+ `#{line}`
79
+ end
80
+
81
+ def create_repo(root_dir)
82
+ repo_dir = "#{root_dir}/repo"
83
+
84
+ mkdir_p(repo_dir)
85
+
86
+ `svnadmin create #{repo_dir}`
87
+
88
+ return repo_dir
89
+ end
90
+
91
+ def create_working_copy(root_dir, repo_url)
92
+ wc_dir = find_free_dir_under(root_dir, 'wc')
93
+ svn_command("checkout #{repo_url} #{wc_dir}")
94
+ return wc_dir
95
+ end
96
+
97
+ def start_server(repo_dir)
98
+ port = NetUtils.find_available_port
99
+
100
+ @server_pid = start_process(
101
+ "svnserve -d --foreground --listen-port #{port} -r #{repo_dir}")
102
+
103
+ sleep 0.5 # give some time for the server to boot
104
+
105
+ return "svn://localhost:#{port}"
106
+ end
107
+
108
+ def kill_server
109
+ Process.kill('SIGKILL', @server_pid)
110
+ end
111
+
112
+ def authorize_anon_read(repo_dir, username, password)
113
+ svnserve_file = File.open(repo_dir + '/conf/svnserve.conf', 'w')
114
+ svnserve_file << "[general]\n" <<
115
+ "anon-access = read\n" <<
116
+ "auth-access = write\n" <<
117
+ "password-db = passwd\n"
118
+ svnserve_file.close
119
+
120
+ passwd_file = File.open(repo_dir + '/conf/passwd', 'w')
121
+ passwd_file << "[users]\n" <<
122
+ "#{username} = #{password}\n"
123
+ passwd_file.close
124
+ end
125
+
126
+ @@fork_ok = true
127
+
128
+ def start_process(cmd)
129
+ # function inspired by Kirk Haines' code, published on ruby-talk group
130
+ # original code available at
131
+ # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/211793
132
+ begin
133
+ raise NotImplementedError unless @@fork_ok
134
+ pid = fork do
135
+ exec(cmd)
136
+ end
137
+ rescue NotImplementedError
138
+ @@fork_ok = false
139
+ begin
140
+ require 'rubygems'
141
+ rescue Exception
142
+ end
143
+
144
+ begin
145
+ require 'win32/process'
146
+ rescue LoadError
147
+ raise "Please install win32-process.\n'gem install win32-process' or http://rubyforge.org/projects/win32utils"
148
+ end
149
+
150
+ pid = Process.create(:app_name => cmd).process_id
151
+
152
+ end
153
+
154
+ return pid
155
+ end
156
+
157
+ end
@@ -0,0 +1,42 @@
1
+ # Motiro - A project tracking tool
2
+ # Copyright (C) 2006-2007 Thiago Arrais
3
+ #
4
+ # This program is free software; you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation; either version 2 of the License, or
7
+ # any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
+
18
+ require 'socket'
19
+
20
+ # Utilities for local repositories
21
+ module NetUtils
22
+
23
+ def self.find_available_port
24
+ port = 36906
25
+ while(try_port(port))
26
+ port += 1
27
+ end
28
+
29
+ return port
30
+ end
31
+
32
+ def self.try_port(port)
33
+ begin
34
+ t = TCPSocket.new('localhost', port)
35
+ t.close
36
+ return true
37
+ rescue
38
+ return false
39
+ end
40
+ end
41
+
42
+ end
@@ -0,0 +1,62 @@
1
+ # Motiro - A project tracking tool
2
+ # Copyright (C) 2006-2007 Thiago Arrais
3
+ #
4
+ # This program is free software; you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation; either version 2 of the License, or
7
+ # any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
+
18
+ require 'rubygems'
19
+ require 'platform'
20
+
21
+ class PlatformThread
22
+
23
+ def initialize(platform=self, process=self)
24
+ @platform, @process = platform, process
25
+
26
+ if :win32 == platform.OS
27
+ @pid = process.fork_win32_process { yield }
28
+ else
29
+ @thread = process.new_thread { yield }
30
+ end
31
+ end
32
+
33
+ def kill
34
+ if :win32 == @platform.OS
35
+ @process.kill_win32_process(9, @pid)
36
+ else
37
+ @thread.kill
38
+ end
39
+ end
40
+
41
+ def OS
42
+ Platform::OS
43
+ end
44
+
45
+ def fork_win32_process
46
+ require 'win32/process'
47
+ Process.fork do
48
+ yield
49
+ end
50
+ end
51
+
52
+ def kill_win32_process(signal, pid)
53
+ require 'win32/process'
54
+ Process.kill(signal, pid)
55
+ end
56
+
57
+ def new_thread
58
+ Thread.new { yield }
59
+ end
60
+
61
+ end
62
+
@@ -0,0 +1,23 @@
1
+ TEMP_DIR = File.expand_path(File.dirname(__FILE__) + '/../../tmp') unless defined? TEMP_DIR
2
+
3
+ # Utilities for local repositories
4
+ module RepoUtils
5
+
6
+ def find_root_dir(prefix='svn')
7
+ find_free_dir_under(TEMP_DIR, prefix)
8
+ end
9
+
10
+ def find_free_dir_under(parent_dir, prefix)
11
+ contents = Dir.entries(parent_dir)
12
+ suffix = ''
13
+ if (contents.include?(prefix))
14
+ suffix = 1
15
+ while(contents.include?(prefix + suffix.to_s))
16
+ suffix += 1
17
+ end
18
+ end
19
+
20
+ parent_dir + '/' + prefix + suffix.to_s
21
+ end
22
+
23
+ end
@@ -0,0 +1,32 @@
1
+ # Motiro - A project tracking tool
2
+ # Copyright (C) 2006-2007 Thiago Arrais
3
+ #
4
+ # This program is free software; you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation; either version 2 of the License, or
7
+ # any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
+
18
+ module SeleniumExtensions
19
+
20
+ def wait_for_visible(elem_id)
21
+ wait_for_condition(visible(elem_id), 2000)
22
+ end
23
+
24
+ def wait_for_not_visible(elem_id)
25
+ wait_for_condition("! " + visible(elem_id), 2000)
26
+ end
27
+
28
+ def visible(elem_id)
29
+ "selenium.browserbot.getCurrentWindow().document.getElementById('#{elem_id}').style.display != 'none'"
30
+ end
31
+
32
+ end