redcar 0.3.1dev → 0.3.2dev

Sign up to get free protection for your applications and to get access to all the features.
Files changed (316) hide show
  1. data/CHANGES +34 -1
  2. data/README.md +2 -1
  3. data/ROADMAP.md +13 -45
  4. data/Rakefile +15 -14
  5. data/bin/redcar +4 -1
  6. data/lib/plugin_manager/README.md +61 -0
  7. data/lib/plugin_manager/Rakefile +55 -0
  8. data/lib/plugin_manager/bin/plugin_manager +4 -0
  9. data/lib/plugin_manager/lib/plugin_manager.rb +107 -0
  10. data/lib/plugin_manager/lib/plugin_manager/definition_builder.rb +37 -0
  11. data/lib/plugin_manager/lib/plugin_manager/plugin.rb +9 -0
  12. data/lib/plugin_manager/lib/plugin_manager/plugin_definition.rb +50 -0
  13. data/lib/plugin_manager/plugin_manager.gemspec +33 -0
  14. data/lib/plugin_manager/spec/fixtures/error_in_definition/core/plugin.rb +2 -0
  15. data/lib/plugin_manager/spec/fixtures/error_in_plugin/core/core.rb +4 -0
  16. data/lib/plugin_manager/spec/fixtures/error_in_plugin/core/plugin.rb +7 -0
  17. data/lib/plugin_manager/spec/fixtures/example/core/core.rb +20 -0
  18. data/lib/plugin_manager/spec/fixtures/example/core/plugin.rb +7 -0
  19. data/lib/plugin_manager/spec/fixtures/example/debug/debug.rb +6 -0
  20. data/lib/plugin_manager/spec/fixtures/example/debug/plugin.rb +8 -0
  21. data/lib/plugin_manager/spec/fixtures/example/extras/extras.rb +6 -0
  22. data/lib/plugin_manager/spec/fixtures/example/extras/plugin.rb +8 -0
  23. data/lib/plugin_manager/spec/fixtures/two_versions1/core/core.rb +20 -0
  24. data/lib/plugin_manager/spec/fixtures/two_versions1/core/plugin.rb +7 -0
  25. data/lib/plugin_manager/spec/fixtures/two_versions1/core2/core.rb +20 -0
  26. data/lib/plugin_manager/spec/fixtures/two_versions1/core2/plugin.rb +7 -0
  27. data/lib/plugin_manager/spec/fixtures/two_versions2/core/core.rb +20 -0
  28. data/lib/plugin_manager/spec/fixtures/two_versions2/core/plugin.rb +7 -0
  29. data/lib/plugin_manager/spec/fixtures/two_versions2/core2/core.rb +20 -0
  30. data/lib/plugin_manager/spec/fixtures/two_versions2/core2/plugin.rb +8 -0
  31. data/lib/plugin_manager/spec/fixtures/unmet_dependencies1/core/core.rb +10 -0
  32. data/lib/plugin_manager/spec/fixtures/unmet_dependencies1/core/plugin.rb +7 -0
  33. data/lib/plugin_manager/spec/fixtures/unmet_dependencies1/debug/debug.rb +6 -0
  34. data/lib/plugin_manager/spec/fixtures/unmet_dependencies1/debug/plugin.rb +8 -0
  35. data/lib/plugin_manager/spec/fixtures/unmet_dependencies2/core/core.rb +10 -0
  36. data/lib/plugin_manager/spec/fixtures/unmet_dependencies2/core/plugin.rb +7 -0
  37. data/lib/plugin_manager/spec/fixtures/unmet_dependencies2/debug/debug.rb +6 -0
  38. data/lib/plugin_manager/spec/fixtures/unmet_dependencies2/debug/plugin.rb +8 -0
  39. data/lib/plugin_manager/spec/plugin_manager_spec.rb +208 -0
  40. data/lib/plugin_manager/spec/spec_helper.rb +3 -0
  41. data/lib/redcar.rb +8 -3
  42. data/lib/redcar/boot.rb +59 -56
  43. data/lib/redcar/installer.rb +1 -1
  44. data/lib/redcar/instance_exec.rb +25 -0
  45. data/lib/redcar/runner.rb +5 -1
  46. data/lib/redcar/usage.rb +5 -1
  47. data/plugins/application/icons/close.png +0 -0
  48. data/plugins/application/lib/application.rb +61 -28
  49. data/plugins/application/lib/application/clipboard.rb +71 -0
  50. data/plugins/application/lib/application/dialog.rb +63 -0
  51. data/plugins/application/lib/application/menu.rb +32 -1
  52. data/plugins/application/lib/application/menu/builder.rb +10 -4
  53. data/plugins/application/lib/application/menu/item.rb +16 -3
  54. data/plugins/application/lib/application/notebook.rb +5 -0
  55. data/plugins/application/lib/application/speedbar.rb +73 -0
  56. data/plugins/application/lib/application/window.rb +25 -0
  57. data/plugins/application/plugin.rb +8 -0
  58. data/plugins/application/spec/application/clipboard_spec.rb +36 -0
  59. data/plugins/application/spec/application/menu_spec.rb +73 -1
  60. data/plugins/application/spec/application/speedbar_spec.rb +46 -0
  61. data/plugins/application/spec/spec_helper.rb +1 -1
  62. data/plugins/application_swt/lib/application_swt.rb +18 -11
  63. data/plugins/application_swt/lib/application_swt/clipboard.rb +42 -0
  64. data/plugins/application_swt/lib/application_swt/dialog_adapter.rb +68 -0
  65. data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +1 -1
  66. data/plugins/application_swt/lib/application_swt/html_tab.rb +32 -0
  67. data/plugins/application_swt/lib/application_swt/menu.rb +57 -21
  68. data/plugins/application_swt/lib/application_swt/menu/binding_translator.rb +39 -2
  69. data/plugins/application_swt/lib/application_swt/notebook.rb +5 -0
  70. data/plugins/application_swt/lib/application_swt/speedbar.rb +187 -0
  71. data/plugins/application_swt/lib/application_swt/swt_wrapper.rb +24 -1
  72. data/plugins/application_swt/lib/application_swt/window.rb +33 -3
  73. data/plugins/application_swt/plugin.rb +8 -0
  74. data/plugins/application_swt/spec/spec_helper.rb +1 -1
  75. data/plugins/auto_completer/features/auto_complete.feature +65 -0
  76. data/plugins/auto_completer/features/step_definitions/auto_complete_steps.rb +4 -0
  77. data/plugins/auto_completer/features/support/env.rb +4 -0
  78. data/plugins/auto_completer/lib/auto_completer.rb +99 -0
  79. data/plugins/auto_completer/lib/auto_completer/document_controller.rb +52 -0
  80. data/plugins/auto_completer/lib/auto_completer/word_iterator.rb +48 -0
  81. data/plugins/auto_completer/lib/auto_completer/word_list.rb +40 -0
  82. data/plugins/auto_completer/plugin.rb +10 -0
  83. data/plugins/auto_indenter/lib/auto_indenter.rb +1 -1
  84. data/plugins/auto_indenter/lib/auto_indenter/document_controller.rb +1 -1
  85. data/plugins/auto_indenter/plugin.rb +8 -0
  86. data/plugins/core/lib/core.rb +6 -30
  87. data/plugins/core/lib/core/gui.rb +7 -2
  88. data/plugins/core/lib/core/logger.rb +7 -4
  89. data/plugins/core/lib/core/plugin/storage.rb +15 -5
  90. data/plugins/core/plugin.rb +7 -0
  91. data/plugins/core/spec/core/storage_spec.rb +0 -9
  92. data/plugins/edit_view/features/cut_and_paste.feature +45 -0
  93. data/plugins/edit_view/features/step_definitions/editing_steps.rb +22 -0
  94. data/plugins/edit_view/features/step_definitions/key_steps.rb +1 -1
  95. data/plugins/edit_view/features/step_definitions/notebook_steps.rb +1 -1
  96. data/plugins/edit_view/features/step_definitions/tab_steps.rb +2 -0
  97. data/plugins/edit_view/features/step_definitions/window_steps.rb +1 -1
  98. data/plugins/edit_view/features/support/env.rb +2 -2
  99. data/plugins/edit_view/lib/edit_view.rb +24 -13
  100. data/plugins/edit_view/lib/edit_view/document.rb +233 -15
  101. data/plugins/edit_view/lib/edit_view/edit_tab.rb +2 -2
  102. data/plugins/edit_view/plugin.rb +9 -0
  103. data/plugins/edit_view/spec/spec_helper.rb +1 -1
  104. data/plugins/edit_view_swt/lib/edit_view_swt.rb +37 -8
  105. data/plugins/edit_view_swt/lib/edit_view_swt/document.rb +59 -24
  106. data/plugins/edit_view_swt/lib/edit_view_swt/word_movement.rb +66 -0
  107. data/plugins/edit_view_swt/plugin.rb +9 -0
  108. data/plugins/edit_view_swt/spec/edit_view_swt/word_movement_spec.rb +29 -0
  109. data/plugins/edit_view_swt/spec/spec_helper.rb +6 -0
  110. data/plugins/html_view/assets/blueprint/ie.css +35 -0
  111. data/plugins/html_view/assets/blueprint/print.css +29 -0
  112. data/plugins/html_view/assets/blueprint/screen.css +257 -0
  113. data/plugins/html_view/assets/blueprint/src/forms.css +65 -0
  114. data/plugins/html_view/assets/blueprint/src/grid.css +281 -0
  115. data/plugins/html_view/assets/blueprint/src/grid.png +0 -0
  116. data/plugins/html_view/assets/blueprint/src/ie.css +76 -0
  117. data/plugins/html_view/assets/blueprint/src/print.css +85 -0
  118. data/plugins/html_view/assets/blueprint/src/reset.css +38 -0
  119. data/plugins/html_view/assets/blueprint/src/typography.css +106 -0
  120. data/plugins/html_view/assets/jquery-1.4.min.js +151 -0
  121. data/plugins/html_view/assets/redcar.css +12 -0
  122. data/plugins/html_view/lib/html_controller.rb +5 -0
  123. data/plugins/html_view/lib/html_view.rb +47 -0
  124. data/plugins/html_view/lib/html_view/html_tab.rb +16 -0
  125. data/plugins/html_view/plugin.rb +12 -0
  126. data/plugins/my_plugin/lib/my_plugin.rb +55 -0
  127. data/plugins/my_plugin/plugin.rb +8 -0
  128. data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +62 -0
  129. data/plugins/plugin_manager_ui/plugin.rb +12 -0
  130. data/plugins/plugin_manager_ui/views/index.html.erb +31 -0
  131. data/plugins/project/lib/project.rb +27 -13
  132. data/plugins/project/lib/project/find_file_dialog.rb +25 -19
  133. data/plugins/project/plugin.rb +8 -0
  134. data/plugins/project/spec/spec_helper.rb +1 -1
  135. data/plugins/redcar/plugin.rb +13 -0
  136. data/plugins/redcar/redcar.rb +249 -8
  137. data/plugins/repl/lib/repl.rb +22 -14
  138. data/plugins/repl/plugin.rb +8 -0
  139. data/plugins/repl/spec/spec_helper.rb +1 -1
  140. data/plugins/tree/plugin.rb +9 -0
  141. data/plugins/tree/spec/spec_helper.rb +1 -1
  142. data/plugins/tree_view_swt/plugin.rb +9 -0
  143. data/textmate/Bundles/Apache.tmbundle/Syntaxes/Apache.plist +544 -0
  144. data/textmate/Bundles/Apache.tmbundle/Syntaxes/mod_perl.tmLanguage +120 -0
  145. data/textmate/Bundles/Blogging.tmbundle/Syntaxes/Blog___HTML__.plist +88 -0
  146. data/textmate/Bundles/Blogging.tmbundle/Syntaxes/Blog___Markdown__.plist +89 -0
  147. data/textmate/Bundles/Blogging.tmbundle/Syntaxes/Blog___Text__.plist +74 -0
  148. data/textmate/Bundles/Blogging.tmbundle/Syntaxes/Blog___Textile__.plist +74 -0
  149. data/textmate/Bundles/Bundle Development.tmbundle/Syntaxes/LanguageGrammar.tmLanguage +1829 -0
  150. data/textmate/Bundles/C Sharp.tmbundle/Syntaxes/Build.tmLanguage +142 -0
  151. data/textmate/Bundles/C Sharp.tmbundle/Syntaxes/C__.tmLanguage +524 -0
  152. data/textmate/Bundles/C++ Qt.tmbundle/Syntaxes/Qt_C____.tmLanguage +62 -0
  153. data/textmate/Bundles/C++ Qt.tmbundle/Syntaxes/qmake_Project.tmLanguage +308 -0
  154. data/textmate/Bundles/C.tmbundle/Syntaxes/C.plist +90 -48
  155. data/textmate/Bundles/Clojure.tmbundle/Syntaxes/Clojure.tmLanguage +427 -0
  156. data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/Cucumber_Plain_Text_Feature.tmLanguage +106 -13
  157. data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/Cucumber_Steps.tmLanguage +177 -2
  158. data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/plaintext_template.erb +109 -17
  159. data/textmate/Bundles/D.tmbundle/Syntaxes/D.tmLanguage +908 -0
  160. data/textmate/Bundles/Diff.tmbundle/Syntaxes/Diff.plist +229 -0
  161. data/textmate/Bundles/DokuWiki.tmbundle/Syntaxes/DokuWiki.tmLanguage +649 -0
  162. data/textmate/Bundles/F-Script.tmbundle/Syntaxes/F__Script.plist +219 -0
  163. data/textmate/Bundles/Haskell.tmbundle/Syntaxes/Haskell.plist +646 -0
  164. data/textmate/Bundles/Haskell.tmbundle/Syntaxes/Literate_Haskell.plist +90 -0
  165. data/textmate/Bundles/Io.tmbundle/Syntaxes/Io.plist +225 -0
  166. data/textmate/Bundles/JSON.tmbundle/Syntaxes/JSON.tmLanguage +285 -0
  167. data/textmate/Bundles/JavaScript Prototype & Script_aculo_us.tmbundle/Syntaxes/JavaScript____Prototype.tmLanguage +193 -0
  168. data/textmate/Bundles/JavaScript Prototype & Script_aculo_us.tmbundle/Syntaxes/JavaScript____Prototype_Bracketed.tmLanguage +394 -0
  169. data/textmate/Bundles/JavaScript jQuery.tmbundle/Syntaxes/jQuery___JavaScript__.tmLanguage +440 -0
  170. data/textmate/Bundles/JavaScript.tmbundle/Syntaxes/JavaScript.plist +712 -0
  171. data/textmate/Bundles/Latex.tmbundle/Syntaxes/Bibtex.plist +406 -0
  172. data/textmate/Bundles/Latex.tmbundle/Syntaxes/LaTeX.plist +1601 -0
  173. data/textmate/Bundles/Latex.tmbundle/Syntaxes/LaTeX_Beamer.plist +106 -0
  174. data/textmate/Bundles/Latex.tmbundle/Syntaxes/LaTeX_Log.plist +141 -0
  175. data/textmate/Bundles/Latex.tmbundle/Syntaxes/LaTeX_Memoir.tmLanguage +165 -0
  176. data/textmate/Bundles/Latex.tmbundle/Syntaxes/TeX.plist +246 -0
  177. data/textmate/Bundles/Latex.tmbundle/Syntaxes/TeX_Math.plist +132 -0
  178. data/textmate/Bundles/Lisp.tmbundle/Syntaxes/Lisp.plist +160 -0
  179. data/textmate/Bundles/Makefile.tmbundle/Syntaxes/Makefile.plist +103 -0
  180. data/textmate/Bundles/Markdown.tmbundle/Syntaxes/Markdown.plist +1192 -0
  181. data/textmate/Bundles/Markdown.tmbundle/Syntaxes/MultiMarkdown.tmLanguage +80 -0
  182. data/textmate/Bundles/PHP.tmbundle/Syntaxes/PHP.plist +3481 -0
  183. data/textmate/Bundles/Perl HTML-Template.tmbundle/Syntaxes/Perl_HTML__Template.tmLanguage +217 -0
  184. data/textmate/Bundles/Perl Template Toolkit.tmbundle/Syntaxes/HTML___Template_Toolkit__.tmLanguage +339 -0
  185. data/textmate/Bundles/Postscript.tmbundle/Syntaxes/Postscript.tmLanguage +321 -0
  186. data/textmate/Bundles/Processing.tmbundle/Syntaxes/Processing.plist +296 -0
  187. data/textmate/Bundles/Property List.tmbundle/Syntaxes/Property_List.tmLanguage +1650 -0
  188. data/textmate/Bundles/Python Django Templates.tmbundle/Syntaxes/HTML___Django__.tmLanguage +104 -0
  189. data/textmate/Bundles/Python Django.tmbundle/Syntaxes/Python_Django.tmLanguage +57 -0
  190. data/textmate/Bundles/Python.tmbundle/Syntaxes/Python.tmLanguage +3016 -0
  191. data/textmate/Bundles/Python.tmbundle/Syntaxes/Regular_Expressions___Python__.tmLanguage +299 -0
  192. data/textmate/Bundles/Rez.tmbundle/Syntaxes/Rez.plist +219 -0
  193. data/textmate/Bundles/Ruby Haml.tmbundle/Syntaxes/Ruby_Haml.tmLanguage +403 -0
  194. data/textmate/Bundles/Ruby RSpec.tmbundle/Syntaxes/RSpec.tmLanguage +142 -0
  195. data/textmate/Bundles/Ruby.tmbundle/Syntaxes/Ruby.plist +139 -49
  196. data/textmate/Bundles/SQL.tmbundle/Syntaxes/SQL.plist +705 -0
  197. data/textmate/Bundles/SSH-Config.tmbundle/Syntaxes/SSH__Config.tmLanguage +88 -0
  198. data/textmate/Bundles/Scala.tmbundle/Syntaxes/Scala.tmLanguage +609 -0
  199. data/textmate/Bundles/Scala.tmbundle/Syntaxes/Scala_Properties.tmLanguage +54 -0
  200. data/textmate/Bundles/ShellScript.tmbundle/Syntaxes/Shell__Unix__Generic.plist +1855 -0
  201. data/textmate/Bundles/Tabular.tmbundle/Syntaxes/CSV.tmLanguage +178 -0
  202. data/textmate/Bundles/Tabular.tmbundle/Syntaxes/TSV.tmLanguage +135 -0
  203. data/textmate/Bundles/TextMate.tmbundle/Syntaxes/Regular_Expressions___Oniguruma__.tmLanguage +295 -0
  204. data/textmate/Bundles/TextMate.tmbundle/Syntaxes/Release_Notes.tmLanguage +126 -0
  205. data/textmate/Bundles/Textile.tmbundle/Syntaxes/Textile.plist +490 -0
  206. data/textmate/Bundles/Thrift.tmbundle/Syntaxes/Thrift.tmLanguage +1024 -0
  207. data/textmate/Bundles/XML.tmbundle/Syntaxes/XML.plist +576 -0
  208. data/textmate/Bundles/XML.tmbundle/Syntaxes/XSL.plist +157 -0
  209. data/textmate/Bundles/YAML.tmbundle/Syntaxes/YAML.plist +466 -0
  210. data/textmate/Themes/Django.tmTheme +436 -0
  211. metadata +371 -325
  212. data/config/default.yaml +0 -15
  213. data/lib/freebase2/README.txt +0 -47
  214. data/lib/freebase2/bin/default.yaml +0 -15
  215. data/lib/freebase2/bin/install.rb +0 -42
  216. data/lib/freebase2/bin/run.rb +0 -48
  217. data/lib/freebase2/lib/freebase/configuration.rb +0 -535
  218. data/lib/freebase2/lib/freebase/core.rb +0 -197
  219. data/lib/freebase2/lib/freebase/databus.rb +0 -1128
  220. data/lib/freebase2/lib/freebase/freebase.rb +0 -60
  221. data/lib/freebase2/lib/freebase/logger.rb +0 -117
  222. data/lib/freebase2/lib/freebase/plugin.rb +0 -384
  223. data/lib/freebase2/lib/freebase/properties.rb +0 -130
  224. data/lib/freebase2/lib/freebase/readers.rb +0 -328
  225. data/lib/freebase2/notes +0 -61
  226. data/lib/freebase2/plugins/raa_webrick/httpd.rb +0 -125
  227. data/lib/freebase2/plugins/raa_webrick/plugin.yaml +0 -7
  228. data/lib/freebase2/plugins/raa_webrick/web_root/test.html +0 -5
  229. data/lib/freebase2/plugins/raa_webrick/webserver.yaml +0 -6
  230. data/lib/freebase2/plugins/raa_xmlrpc4r/plugin.xml +0 -8
  231. data/lib/freebase2/plugins/raa_xmlrpc4r/rpcd.rb +0 -54
  232. data/lib/freebase2/regress/README +0 -1
  233. data/lib/little_plugger/History.txt +0 -20
  234. data/lib/little_plugger/Rakefile +0 -34
  235. data/lib/little_plugger/lib/little-plugger.rb +0 -323
  236. data/lib/little_plugger/spec/little-plugger_spec.rb +0 -26
  237. data/lib/little_plugger/spec/spec_helper.rb +0 -16
  238. data/lib/logging/History.txt +0 -240
  239. data/lib/logging/Rakefile +0 -37
  240. data/lib/logging/data/bad_logging_1.rb +0 -13
  241. data/lib/logging/data/bad_logging_2.rb +0 -21
  242. data/lib/logging/data/logging.rb +0 -42
  243. data/lib/logging/data/logging.yaml +0 -63
  244. data/lib/logging/data/simple_logging.rb +0 -13
  245. data/lib/logging/examples/appenders.rb +0 -47
  246. data/lib/logging/examples/classes.rb +0 -41
  247. data/lib/logging/examples/consolidation.rb +0 -83
  248. data/lib/logging/examples/formatting.rb +0 -51
  249. data/lib/logging/examples/hierarchies.rb +0 -73
  250. data/lib/logging/examples/layouts.rb +0 -48
  251. data/lib/logging/examples/loggers.rb +0 -29
  252. data/lib/logging/examples/names.rb +0 -43
  253. data/lib/logging/examples/simple.rb +0 -17
  254. data/lib/logging/lib/logging.rb +0 -501
  255. data/lib/logging/lib/logging/appender.rb +0 -251
  256. data/lib/logging/lib/logging/appenders.rb +0 -131
  257. data/lib/logging/lib/logging/appenders/buffering.rb +0 -168
  258. data/lib/logging/lib/logging/appenders/console.rb +0 -60
  259. data/lib/logging/lib/logging/appenders/email.rb +0 -75
  260. data/lib/logging/lib/logging/appenders/file.rb +0 -58
  261. data/lib/logging/lib/logging/appenders/growl.rb +0 -197
  262. data/lib/logging/lib/logging/appenders/io.rb +0 -69
  263. data/lib/logging/lib/logging/appenders/rolling_file.rb +0 -293
  264. data/lib/logging/lib/logging/appenders/string_io.rb +0 -68
  265. data/lib/logging/lib/logging/appenders/syslog.rb +0 -194
  266. data/lib/logging/lib/logging/config/configurator.rb +0 -188
  267. data/lib/logging/lib/logging/config/yaml_configurator.rb +0 -191
  268. data/lib/logging/lib/logging/layout.rb +0 -117
  269. data/lib/logging/lib/logging/layouts.rb +0 -47
  270. data/lib/logging/lib/logging/layouts/basic.rb +0 -32
  271. data/lib/logging/lib/logging/layouts/parseable.rb +0 -211
  272. data/lib/logging/lib/logging/layouts/pattern.rb +0 -311
  273. data/lib/logging/lib/logging/log_event.rb +0 -45
  274. data/lib/logging/lib/logging/logger.rb +0 -503
  275. data/lib/logging/lib/logging/repository.rb +0 -232
  276. data/lib/logging/lib/logging/root_logger.rb +0 -61
  277. data/lib/logging/lib/logging/stats.rb +0 -278
  278. data/lib/logging/lib/logging/utils.rb +0 -153
  279. data/lib/logging/lib/spec/logging_helper.rb +0 -34
  280. data/lib/logging/test/appenders/test_buffered_io.rb +0 -176
  281. data/lib/logging/test/appenders/test_console.rb +0 -66
  282. data/lib/logging/test/appenders/test_email.rb +0 -170
  283. data/lib/logging/test/appenders/test_file.rb +0 -95
  284. data/lib/logging/test/appenders/test_growl.rb +0 -127
  285. data/lib/logging/test/appenders/test_io.rb +0 -129
  286. data/lib/logging/test/appenders/test_rolling_file.rb +0 -200
  287. data/lib/logging/test/appenders/test_syslog.rb +0 -194
  288. data/lib/logging/test/benchmark.rb +0 -86
  289. data/lib/logging/test/config/test_configurator.rb +0 -70
  290. data/lib/logging/test/config/test_yaml_configurator.rb +0 -40
  291. data/lib/logging/test/layouts/test_basic.rb +0 -42
  292. data/lib/logging/test/layouts/test_json.rb +0 -112
  293. data/lib/logging/test/layouts/test_pattern.rb +0 -198
  294. data/lib/logging/test/layouts/test_yaml.rb +0 -121
  295. data/lib/logging/test/setup.rb +0 -44
  296. data/lib/logging/test/test_appender.rb +0 -152
  297. data/lib/logging/test/test_consolidate.rb +0 -46
  298. data/lib/logging/test/test_layout.rb +0 -110
  299. data/lib/logging/test/test_log_event.rb +0 -80
  300. data/lib/logging/test/test_logger.rb +0 -699
  301. data/lib/logging/test/test_logging.rb +0 -267
  302. data/lib/logging/test/test_repository.rb +0 -158
  303. data/lib/logging/test/test_root_logger.rb +0 -81
  304. data/lib/logging/test/test_stats.rb +0 -274
  305. data/lib/logging/test/test_utils.rb +0 -116
  306. data/plugins/application/plugin.yaml +0 -11
  307. data/plugins/application_swt/plugin.yaml +0 -11
  308. data/plugins/auto_indenter/plugin.yaml +0 -12
  309. data/plugins/core/plugin.yaml +0 -7
  310. data/plugins/edit_view/plugin.yaml +0 -14
  311. data/plugins/edit_view_swt/plugin.yaml +0 -14
  312. data/plugins/project/plugin.yaml +0 -12
  313. data/plugins/redcar/plugin.yaml +0 -18
  314. data/plugins/repl/plugin.yaml +0 -12
  315. data/plugins/tree/plugin.yaml +0 -14
  316. data/plugins/tree_view_swt/plugin.yaml +0 -14
@@ -0,0 +1,8 @@
1
+
2
+ Plugin.define do
3
+ name "my_plugin"
4
+ version "1.0"
5
+ file "lib", "my_plugin"
6
+ object "Redcar::MyPlugin"
7
+ dependencies "redcar", ">0"
8
+ end
@@ -0,0 +1,62 @@
1
+
2
+ require 'erb'
3
+
4
+ module Redcar
5
+ class PluginManagerUi
6
+ class << self
7
+ attr_accessor :last_reloaded
8
+ end
9
+
10
+ class ReloadLastReloadedCommand < Redcar::Command
11
+ key :osx => "Cmd+Shift+R", :linux => "Ctrl+Shift+R", :windows => "Ctrl+Shift+R"
12
+
13
+ def execute
14
+ if plugin = PluginManagerUi.last_reloaded
15
+ plugin.load
16
+ end
17
+ end
18
+ end
19
+
20
+ class OpenCommand < Redcar::Command
21
+ class Controller
22
+ def title
23
+ "Plugins"
24
+ end
25
+
26
+ def index
27
+ rhtml = ERB.new(File.read(File.join(File.dirname(__FILE__), "..", "views", "index.html.erb")))
28
+ rhtml.result(binding)
29
+ end
30
+
31
+ def reload_plugin(name)
32
+ plugin = Redcar.plugin_manager.loaded_plugins.detect {|pl| pl.name == name }
33
+ plugin.load
34
+ PluginManagerUi.last_reloaded = plugin
35
+ end
36
+
37
+ private
38
+
39
+ def plugin_table(plugins)
40
+ str = "<table>\n"
41
+ highlight = true
42
+ plugins.each do |plugin|
43
+ name = plugin.is_a?(PluginManager::PluginDefinition) ? plugin.name : plugin
44
+ str << "<tr class=\"#{highlight ? "grey" : ""}\">"
45
+ str << "<td class=\"plugin\"><span class=\"plugin-name\">" + name + "</span></td>"
46
+ str << "<td class=\"links\"><a href=\"#\">Reload</a>" + "</td>"
47
+ str << "</tr>"
48
+ highlight = !highlight
49
+ end
50
+ str << "</table>"
51
+ end
52
+ end
53
+
54
+ def execute
55
+ controller = Controller.new
56
+ tab = win.new_tab(HtmlTab)
57
+ tab.html_view.controller = controller
58
+ tab.focus
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,12 @@
1
+
2
+ Plugin.define do
3
+ name "Plugin Manager UI"
4
+ version "0.3.2"
5
+
6
+ object "Redcar::PluginManagerUi"
7
+ file "lib", "plugin_manager_ui"
8
+
9
+ dependencies "core", ">0",
10
+ "HTML View", ">=0.3.2"
11
+
12
+ end
@@ -0,0 +1,31 @@
1
+ <br />
2
+ <br />
3
+ <div class="container">
4
+ <div class="span-8">
5
+ <% jquery_path = File.expand_path(File.join(Redcar.root, %w(plugins html_view assets jquery-1.4.min.js))) %>
6
+ <script type="text/javascript" src="file://<%= jquery_path %>"></script>
7
+ <% blueprint_dir = File.expand_path(File.join(Redcar.root, %w(plugins html_view assets blueprint))) %>
8
+ <% redcar_css = File.expand_path(File.join(Redcar.root, %w(plugins html_view assets redcar.css))) %>
9
+ <link rel="stylesheet" href="file://<%= blueprint_dir %>/screen.css" type="text/css" media="screen, projection">
10
+ <link rel="stylesheet" href="file://<%= blueprint_dir %>/print.css" type="text/css" media="print">
11
+ <link rel="stylesheet" href="file://<%= redcar_css %>" type="text/css" media="screen">
12
+
13
+ <h3>Loaded Plugins</h3>
14
+ <%= plugin_table(Redcar.plugin_manager.loaded_plugins) %>
15
+
16
+ <h3>Unloaded Plugins</h3>
17
+ <%= plugin_table(Redcar.plugin_manager.unloaded_plugins) %>
18
+
19
+ <h3>Unreadable definitions</h3>
20
+ <%= plugin_table(Redcar.plugin_manager.unreadable_definitions) %>
21
+
22
+ <h3>Plugins with Errors</h3>
23
+ <%= plugin_table(Redcar.plugin_manager.plugins_with_errors) %>
24
+
25
+ <script language="javascript">
26
+ $("a").click(function() {
27
+ Controller.reloadPlugin($(this).parent().parent().find(".plugin-name").text());
28
+ });
29
+ </script>
30
+ </div>
31
+ </div>
@@ -7,23 +7,30 @@ require "project/dir_controller"
7
7
 
8
8
  module Redcar
9
9
  class Project
10
- def self.load
10
+
11
+ def self.storage
12
+ @storage ||= Plugin::Storage.new('project_plugin')
11
13
  end
12
14
 
13
- def self.start
14
- @open_project_sensitivity =
15
- Sensitivity.new(:open_project, Redcar.app, false, [:focussed_window]) do
16
- if win = Redcar.app.focussed_window
17
- win.treebook.trees.detect {|t| t.tree_mirror.is_a?(DirMirror) }
15
+ def self.sensitivities
16
+ [ @open_project_sensitivity =
17
+ Sensitivity.new(:open_project, Redcar.app, false, [:focussed_window]) do
18
+ if win = Redcar.app.focussed_window
19
+ win.treebook.trees.detect {|t| t.tree_mirror.is_a?(DirMirror) }
20
+ end
18
21
  end
19
- end
22
+ ]
20
23
  end
21
24
 
22
25
  class << self
23
26
  attr_reader :open_project_sensitivity
24
27
  end
25
28
 
26
- def self.window_trees
29
+ def self.filter_path
30
+ Project.storage['last_dir'] || File.expand_path(Dir.pwd)
31
+ end
32
+
33
+ def self.window_trees
27
34
  @window_trees ||= {}
28
35
  end
29
36
 
@@ -95,7 +102,10 @@ module Redcar
95
102
 
96
103
  def get_path
97
104
  @path || begin
98
- path = Application::Dialog.open_file(win, :filter_path => File.expand_path("~"))
105
+ if path = Application::Dialog.open_file(win, :filter_path => Project.filter_path)
106
+ Project.storage['last_dir'] = File.dirname(File.expand_path(path))
107
+ path
108
+ end
99
109
  end
100
110
  end
101
111
  end
@@ -137,10 +147,12 @@ module Redcar
137
147
  end
138
148
 
139
149
  private
140
-
141
150
  def get_path
142
151
  @path || begin
143
- path = Application::Dialog.save_file(win, :filter_path => File.expand_path("~"))
152
+ if path = Application::Dialog.save_file(win, :filter_path => Project.filter_path)
153
+ Project.storage['last_dir'] = File.dirname(File.expand_path(path))
154
+ path
155
+ end
144
156
  end
145
157
  end
146
158
  end
@@ -150,6 +162,7 @@ module Redcar
150
162
  :linux => "Ctrl+Shift+O",
151
163
  :windows => "Ctrl+Shift+O"
152
164
 
165
+
153
166
  def initialize(path=nil)
154
167
  @path = path
155
168
  end
@@ -166,8 +179,9 @@ module Redcar
166
179
 
167
180
  def get_path
168
181
  @path || begin
169
- if path = Application::Dialog.open_directory(win, :filter_path => File.expand_path("~"))
170
- File.expand_path(path)
182
+ if path = Application::Dialog.open_directory(win, :filter_path => Project.filter_path)
183
+ Project.storage['last_dir'] = File.dirname(File.expand_path(path))
184
+ path
171
185
  end
172
186
  end
173
187
  end
@@ -49,29 +49,35 @@ module Redcar
49
49
  score_match_pairs = []
50
50
  cutoff = 10000000
51
51
 
52
- results = files(directories).each do |fn|
53
- unless File.directory?(fn)
54
- bit = fn.split("/")
55
- if m = bit.last.match(re)
56
- cs = []
57
- diffs = 0
58
- m.captures.each_with_index do |_, i|
59
- cs << m.begin(i + 1)
60
- if i > 0
61
- diffs += cs[i] - cs[i-1]
52
+ results = files(directories).each do |fn|
53
+ begin
54
+ unless File.directory?(fn)
55
+ bit = fn.split("/")
56
+ if m = bit.last.match(re)
57
+ cs = []
58
+ diffs = 0
59
+ m.captures.each_with_index do |_, i|
60
+ cs << m.begin(i + 1)
61
+ if i > 0
62
+ diffs += cs[i] - cs[i-1]
63
+ end
62
64
  end
63
- end
64
- # lower score is better
65
- score = (cs[0] + diffs)*100 + bit.last.length
66
- if score < cutoff
67
- score_match_pairs << [score, fn]
68
- score_match_pairs.sort!
69
- if score_match_pairs.length == MAX_ENTRIES
70
- cutoff = score_match_pairs.last.first
71
- score_match_pairs.pop
65
+ # lower score is better
66
+ score = (cs[0] + diffs)*100 + bit.last.length
67
+ if score < cutoff
68
+ score_match_pairs << [score, fn]
69
+ score_match_pairs.sort!
70
+ if score_match_pairs.length == MAX_ENTRIES
71
+ cutoff = score_match_pairs.last.first
72
+ score_match_pairs.pop
73
+ end
72
74
  end
73
75
  end
74
76
  end
77
+ rescue Errno::ENOENT
78
+ # File.directory? can throw no such file or directory even if File.exist?
79
+ # has returned true. For example this happens on some awful textmate filenames
80
+ # unicode in them.
75
81
  end
76
82
  end
77
83
  score_match_pairs.map {|a| a.last }
@@ -0,0 +1,8 @@
1
+
2
+ Plugin.define do
3
+ name "project"
4
+ version "1.0"
5
+ file "lib", "project"
6
+ object "Redcar::Project"
7
+ dependencies "edit_view", ">0"
8
+ end
@@ -2,4 +2,4 @@ $:.push File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
2
2
 
3
3
  require 'redcar'
4
4
  Redcar.boot
5
- Redcar.require_files
5
+ Redcar.load
@@ -0,0 +1,13 @@
1
+
2
+ Plugin.define do
3
+ name "redcar"
4
+ version "1.0"
5
+ file "redcar"
6
+ object "Redcar::Top"
7
+ dependencies "core", ">0",
8
+ "application", ">0",
9
+ "project", ">0",
10
+ "Auto Completer", ">0",
11
+ "HTML View", ">=0.3.2",
12
+ "Plugin Manager UI", ">=0.3.2"
13
+ end
@@ -225,7 +225,7 @@ module Redcar
225
225
  else
226
226
  end_selection = doc.offset_at_line(last_line_ix + 1)
227
227
  end
228
- doc.set_selection_range(start_selection, end_selection)
228
+ doc.set_selection_range(start_selection..end_selection)
229
229
  else
230
230
  indent_line(doc, doc.cursor_line)
231
231
  end
@@ -267,16 +267,228 @@ module Redcar
267
267
  class StripWhitespaceCommand < Redcar::EditTabCommand
268
268
 
269
269
  def execute
270
- 0.upto(doc.line_count - 1) do |line_ix|
271
- doc.replace_line(line_ix) {|line| line.strip }
270
+ doc.text = doc.to_s.gsub(/\s+$/, "")
271
+ end
272
+ end
273
+
274
+ class SelectAllCommand < Redcar::EditTabCommand
275
+ key :osx => "Cmd+A",
276
+ :linux => "Ctrl+Shift+A",
277
+ :windows => "Ctrl+Shift+A"
278
+
279
+ def execute
280
+ doc.set_selection_range(0..(doc.length))
281
+ end
282
+ end
283
+
284
+ class SelectLineCommand < Redcar::EditTabCommand
285
+ key :osx => "Cmd+Shift+L",
286
+ :linux => "Ctrl+Shift+L",
287
+ :windows => "Ctrl+Shift+L"
288
+
289
+ def execute
290
+ doc.set_selection_range(
291
+ doc.cursor_line_start_offset..doc.cursor_line_end_offset)
292
+ end
293
+ end
294
+
295
+ class CutCommand < Redcar::EditTabCommand
296
+ key :osx => "Cmd+X",
297
+ :linux => "Ctrl+X",
298
+ :windows => "Ctrl+X"
299
+
300
+ def execute
301
+ if doc.selection?
302
+ text = doc.selection_ranges.map do |range|
303
+ doc.get_range(range.begin, range.count)
304
+ end
305
+ p text
306
+ Redcar.app.clipboard << text
307
+ diff = 0
308
+ doc.selection_ranges.each do |range|
309
+ doc.delete(range.begin - diff, range.count)
310
+ diff += range.count
311
+ end
312
+ else
313
+ Redcar.app.clipboard << doc.get_line(doc.cursor_line)
314
+ doc.delete(doc.cursor_line_start_offset,
315
+ doc.cursor_line_end_offset - doc.cursor_line_start_offset)
272
316
  end
273
317
  end
274
318
  end
275
319
 
276
- def self.start
277
- Redcar.gui = ApplicationSWT.gui
278
- Redcar.app.controller = ApplicationSWT.new(Redcar.app)
279
- builder = Menu::Builder.new do
320
+ class CopyCommand < Redcar::EditTabCommand
321
+ key :osx => "Cmd+C",
322
+ :linux => "Ctrl+C",
323
+ :windows => "Ctrl+C"
324
+
325
+ def execute
326
+ if doc.selection?
327
+ text = doc.selection_ranges.map do |range|
328
+ doc.get_range(range.begin, range.count)
329
+ end
330
+ Redcar.app.clipboard << text
331
+ else
332
+ Redcar.app.clipboard << doc.get_line(doc.cursor_line)
333
+ end
334
+ end
335
+ end
336
+
337
+ class PasteCommand < Redcar::EditTabCommand
338
+ sensitize :clipboard_not_empty
339
+
340
+ key :osx => "Cmd+V",
341
+ :linux => "Ctrl+V",
342
+ :windows => "Ctrl+V"
343
+
344
+ def execute
345
+ start_offset = doc.selection_ranges.first.begin
346
+ start_line = doc.line_at_offset(start_offset)
347
+ line_offset = start_offset - doc.offset_at_line(start_line)
348
+ cursor_line = doc.cursor_line
349
+ cursor_line_offset = doc.cursor_line_offset
350
+ diff = 0
351
+ doc.selection_ranges.each do |range|
352
+ doc.delete(range.begin - diff, range.count)
353
+ diff += range.count
354
+ end
355
+ texts = Redcar.app.clipboard.last.dup
356
+ texts.each_with_index do |text, i|
357
+ line_ix = start_line + i
358
+ if line_ix == doc.line_count
359
+ doc.insert(doc.length, "\n" + " "*line_offset)
360
+ else
361
+ line = doc.get_line(line_ix)
362
+ if line.length - 1 < line_offset
363
+ doc.insert(
364
+ doc.offset_at_inner_end_of_line(line_ix),
365
+ " "*(line_offset - line.length + 1)
366
+ )
367
+ end
368
+ end
369
+ doc.insert(
370
+ doc.offset_at_line(line_ix) + line_offset,
371
+ text
372
+ )
373
+ end
374
+ new_offset = doc.offset_at_line(cursor_line) + cursor_line_offset + Redcar.app.clipboard.last.first.length
375
+ doc.cursor_offset = new_offset
376
+ end
377
+ end
378
+
379
+ class DialogExample < Redcar::Command
380
+ def execute
381
+ builder = Menu::Builder.new do
382
+ item("Foo") { p :foo }
383
+ item("Bar") { p :bar }
384
+ separator
385
+ sub_menu "Baz" do
386
+ item("Qux") { p :qx}
387
+ item("Quux") { p :quux }
388
+ item("Corge") { p :corge }
389
+ end
390
+ end
391
+ win.popup_menu(builder.menu)
392
+ end
393
+ end
394
+
395
+ class GotoLineCommand < Redcar::EditTabCommand
396
+ key :osx => "Cmd+L",
397
+ :linux => "Ctrl+L",
398
+ :windows => "Ctrl+L"
399
+
400
+ class Speedbar < Redcar::Speedbar
401
+ label "Goto line:"
402
+ textbox :line
403
+ button :go, "Return" do
404
+ new_line_ix = @speedbar.line.to_i - 1
405
+ if new_line_ix < doc.line_count and new_line_ix >= 0
406
+ doc.cursor_offset = doc.offset_at_line(new_line_ix)
407
+ doc.scroll_to_line(new_line_ix)
408
+ win.close_speedbar
409
+ end
410
+ end
411
+ end
412
+
413
+ def execute
414
+ @speedbar = GotoLineCommand::Speedbar.new(self)
415
+ win.open_speedbar(@speedbar)
416
+ end
417
+ end
418
+
419
+ class SearchForwardCommand < Redcar::EditTabCommand
420
+ key :osx => "Cmd+F", :linux => "Ctrl+F", :windows => "Ctrl+F"
421
+
422
+ class Speedbar < Redcar::Speedbar
423
+ label "Regex"
424
+ textbox :query
425
+ button :search, "Return" do
426
+ FindNextRegex.new(Regexp.new(@speedbar.query), false).run
427
+ end
428
+ end
429
+
430
+ def execute
431
+ @speedbar = SearchForwardCommand::Speedbar.new(self)
432
+ win.open_speedbar(@speedbar)
433
+ end
434
+ end
435
+
436
+ class FindNextRegex < Redcar::EditTabCommand
437
+ def initialize(re, wrap=nil)
438
+ @re = re
439
+ @wrap = wrap
440
+ end
441
+
442
+ def to_s
443
+ "<#{self.class}: @re:#{@re.inspect} wrap:#{!!@wrap}>"
444
+ end
445
+
446
+ def execute
447
+ # first search the remainder of the current line
448
+ curr_line = doc.get_line(doc.cursor_line)
449
+ cursor_line_offset = doc.cursor_offset - doc.offset_at_line(doc.cursor_line)
450
+ curr_line = curr_line[cursor_line_offset..-1]
451
+ if curr_line =~ @re
452
+ line_start = doc.offset_at_line(doc.cursor_line)
453
+ startoff = line_start + $`.length + cursor_line_offset
454
+ endoff = startoff + $&.length
455
+ doc.set_selection_range(startoff..endoff)
456
+ else
457
+ # next search the rest of the lines
458
+ line_num = doc.cursor_line + 1
459
+ curr_line = doc.get_line(line_num)
460
+ until line_num == doc.line_count - 1 or
461
+ found = (curr_line.to_s =~ @re)
462
+ line_num += 1
463
+ curr_line = doc.get_line(line_num)
464
+ end
465
+ if found
466
+ line_start = doc.offset_at_line(line_num)
467
+ startoff = line_start + $`.length
468
+ endoff = startoff + $&.length
469
+ doc.set_selection_range(startoff..endoff)
470
+ doc.scroll_to_line(line_num)
471
+ end
472
+ if !doc.get_line(line_num) and @wrap
473
+ doc.cursor_offset = 0
474
+ execute
475
+ end
476
+ end
477
+ end
478
+ end
479
+
480
+ class ToggleBlockSelectionCommand < Redcar::EditTabCommand
481
+ key :osx => "Cmd+B",
482
+ :windows => "Ctrl+B",
483
+ :linux => "Ctrl+B"
484
+
485
+ def execute
486
+ doc.block_selection_mode = !doc.block_selection_mode?
487
+ end
488
+ end
489
+
490
+ def self.menus
491
+ Menu::Builder.build do
280
492
  sub_menu "File" do
281
493
  item "New", NewCommand
282
494
  item "New Notebook", NewNotebookCommand
@@ -296,6 +508,10 @@ module Redcar
296
508
  item "Undo", UndoCommand
297
509
  item "Redo", RedoCommand
298
510
  separator
511
+ item "Cut", CutCommand
512
+ item "Copy", CopyCommand
513
+ item "Paste", PasteCommand
514
+ separator
299
515
  item "Home", MoveHomeCommand
300
516
  item "End", MoveEndCommand
301
517
  separator
@@ -303,6 +519,16 @@ module Redcar
303
519
  item "Decrease Indent", DecreaseIndentCommand
304
520
  separator
305
521
  item "Strip Whitespace", StripWhitespaceCommand
522
+ separator
523
+ item "Goto Line", GotoLineCommand
524
+ item "Regex Search", SearchForwardCommand
525
+ separator
526
+ sub_menu "Select" do
527
+ item "All", SelectAllCommand
528
+ item "Line", SelectLineCommand
529
+ end
530
+ item "Toggle Block Selection", ToggleBlockSelectionCommand
531
+ item "Auto Complete", AutoCompleter::AutoCompleteCommand
306
532
  end
307
533
  sub_menu "Project" do
308
534
  item "Find File", Project::FindFileCommand
@@ -313,6 +539,7 @@ module Redcar
313
539
  item "List Tabs", ListTabsCommand
314
540
  item "Print Scope Tree", PrintScopeTreeCommand
315
541
  item "Refresh Directory", Project::RefreshDirectoryCommand
542
+ item "Dialog Tester", DialogExample
316
543
  end
317
544
  sub_menu "View" do
318
545
  item "Rotate Notebooks", RotateNotebooksCommand
@@ -323,13 +550,27 @@ module Redcar
323
550
  item "Next Tab", SwitchTabUpCommand
324
551
  end
325
552
  sub_menu "Plugins" do
553
+ item "Plugin Manager", PluginManagerUi::OpenCommand
554
+ item "Reload Again", PluginManagerUi::ReloadLastReloadedCommand
555
+ separator
326
556
  end
327
557
  sub_menu "Help" do
328
558
  item "Website", PrintHistoryCommand
329
559
  end
330
560
  end
561
+ end
562
+
563
+ def self.start
564
+ Application.start
565
+ ApplicationSWT.start
566
+ AutoIndenter.start
567
+ EditViewSWT.start
568
+ AutoCompleter.start
569
+ Redcar.gui = ApplicationSWT.gui
570
+ Redcar.app.controller = ApplicationSWT.new(Redcar.app)
331
571
 
332
- Redcar.app.menu = builder.menu
572
+ Redcar.app.load_menus
573
+ Redcar.app.load_sensitivities
333
574
  Redcar.app.new_window
334
575
  end
335
576
  end