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
@@ -1,45 +0,0 @@
1
-
2
- module Logging
3
-
4
- # This class defines a logging event.
5
- #
6
- LogEvent = Struct.new( :logger, :level, :data, :time, :file, :line, :method ) {
7
- # :stopdoc:
8
-
9
- # Regular expression used to parse out caller information
10
- #
11
- # * $1 == filename
12
- # * $2 == line number
13
- # * $3 == method name (might be nil)
14
- CALLER_RGXP = %r/([\.\/\(\)\w]+):(\d+)(?::in `(\w+)')?/o
15
- CALLER_INDEX = 2
16
- #CALLER_INDEX = RUBY_PLATFORM[%r/^java/i] ? 1 : 2
17
- # :startdoc:
18
-
19
- # call-seq:
20
- # LogEvent.new( logger, level, [data], trace )
21
- #
22
- # Creates a new log event with the given _logger_ name, numeric _level_,
23
- # array of _data_ from the user to be logged, and boolean _trace_ flag.
24
- # If the _trace_ flag is set to +true+ then Kernel::caller will be
25
- # invoked to get the execution trace of the logging method.
26
- #
27
- def initialize( logger, level, data, trace )
28
- f = l = m = ''
29
-
30
- if trace
31
- stack = Kernel.caller[CALLER_INDEX]
32
- return if stack.nil?
33
-
34
- match = CALLER_RGXP.match(stack)
35
- f = match[1]
36
- l = Integer(match[2])
37
- m = match[3] unless match[3].nil?
38
- end
39
-
40
- super(logger, level, data, Time.now, f, l, m)
41
- end
42
- }
43
- end # module Logging
44
-
45
- # EOF
@@ -1,503 +0,0 @@
1
-
2
- module Logging
3
-
4
- # The +Logger+ class is the primary interface to the +Logging+ framework.
5
- # It provides the logging methods that will be called from user methods,
6
- # and it generates logging events that are sent to the appenders (the
7
- # appenders take care of sending the log events to the logging
8
- # destinations -- files, sockets, etc).
9
- #
10
- # +Logger+ instances are obtained from the +Repository+ and should
11
- # not be directly created by users.
12
- #
13
- # Example:
14
- #
15
- # log = Logging.logger['my logger']
16
- # log.add_appenders( Logging.appenders.stdout ) # append to STDOUT
17
- # log.level = :info # log 'info' and above
18
- #
19
- # log.info 'starting foo operation'
20
- # ...
21
- # log.info 'finishing foo operation'
22
- # ...
23
- # log.fatal 'unknown exception', exception
24
- #
25
- class Logger
26
-
27
- @mutex = Mutex.new # :nodoc:
28
-
29
- class << self
30
-
31
- # call-seq:
32
- # Logger.root
33
- #
34
- # Returns the root logger.
35
- #
36
- def root
37
- ::Logging::Repository.instance[:root]
38
- end
39
-
40
- # :stopdoc:
41
-
42
- # Overrides the new method such that only one Logger will be created
43
- # for any given logger name.
44
- #
45
- def new( *args )
46
- return super if args.empty?
47
-
48
- repo = ::Logging::Repository.instance
49
- name = repo.to_key(args.shift)
50
-
51
- @mutex.synchronize do
52
- logger = repo[name]
53
- if logger.nil?
54
-
55
- master = repo.master_for(name)
56
- if master
57
- if repo.has_logger?(master)
58
- logger = repo[master]
59
- else
60
- logger = super(master)
61
- repo[master] = logger
62
- repo.children(master).each {|c| c.__send__(:parent=, logger)}
63
- end
64
- repo[name] = logger
65
- else
66
- logger = super(name)
67
- repo[name] = logger
68
- repo.children(name).each {|c| c.__send__(:parent=, logger)}
69
- end
70
- end
71
- logger
72
- end
73
- end
74
- alias :[] :new
75
-
76
- # This is where the actual logging methods are defined. Two methods
77
- # are created for each log level. The first is a query method used to
78
- # determine if that perticular logging level is enabled. The second is
79
- # the actual logging method that accepts a list of objects to be
80
- # logged or a block. If a block is given, then the object returned
81
- # from the block will be logged.
82
- #
83
- # Example
84
- #
85
- # log = Logging::Logger['my logger']
86
- # log.level = :warn
87
- #
88
- # log.info? # => false
89
- # log.warn? # => true
90
- # log.warn 'this is your last warning'
91
- # log.fatal 'I die!', exception
92
- #
93
- # log.debug do
94
- # # expensive method to construct log message
95
- # msg
96
- # end
97
- #
98
- def define_log_methods( logger )
99
- ::Logging::LEVELS.each do |name,num|
100
- code = "undef :#{name} if method_defined? :#{name}\n"
101
- code << "undef :#{name}? if method_defined? :#{name}?\n"
102
-
103
- if logger.level > num
104
- code << <<-CODE
105
- def #{name}?( ) false end
106
- def #{name}( data = nil ) false end
107
- CODE
108
- else
109
- code << <<-CODE
110
- def #{name}?( ) true end
111
- def #{name}( data = nil )
112
- data = yield if block_given?
113
- log_event(::Logging::LogEvent.new(@name, #{num}, data, @trace))
114
- true
115
- end
116
- CODE
117
- end
118
-
119
- logger._meta_eval(code, __FILE__, __LINE__)
120
- end
121
- logger
122
- end
123
- # :startdoc:
124
-
125
- end # class << self
126
-
127
- attr_reader :name, :parent, :additive, :trace
128
-
129
- # call-seq:
130
- # Logger.new( name )
131
- # Logger[name]
132
- #
133
- # Returns the logger identified by _name_.
134
- #
135
- # When _name_ is a +String+ or a +Symbol+ it will be used "as is" to
136
- # retrieve the logger. When _name_ is a +Class+ the class name will be
137
- # used to retrieve the logger. When _name_ is an object the name of the
138
- # object's class will be used to retrieve the logger.
139
- #
140
- # Example:
141
- #
142
- # obj = MyClass.new
143
- #
144
- # log1 = Logger.new(obj)
145
- # log2 = Logger.new(MyClass)
146
- # log3 = Logger['MyClass']
147
- #
148
- # log1.object_id == log2.object_id # => true
149
- # log2.object_id == log3.object_id # => true
150
- #
151
- def initialize( name )
152
- case name
153
- when String
154
- raise(ArgumentError, "logger must have a name") if name.empty?
155
- else raise(ArgumentError, "logger name must be a String") end
156
-
157
- repo = ::Logging::Repository.instance
158
- _setup(name, :parent => repo.parent(name))
159
- end
160
-
161
- # call-seq:
162
- # log <=> other
163
- #
164
- # Compares this logger by name to another logger. The normal return codes
165
- # for +String+ objects apply.
166
- #
167
- def <=>( other )
168
- case other
169
- when self; 0
170
- when ::Logging::RootLogger; 1
171
- when ::Logging::Logger; @name <=> other.name
172
- else raise ArgumentError, 'expecting a Logger instance' end
173
- end
174
-
175
- # call-seq:
176
- # log << "message"
177
- #
178
- # Log the given message without any formatting and without performing any
179
- # level checks. The message is logged to all appenders. The message is
180
- # passed up the logger tree if this logger's additivity is +true+.
181
- #
182
- def <<( msg )
183
- @appenders.each {|a| a << msg}
184
- @parent << msg if @additive
185
- end
186
-
187
- # call-seq:
188
- # add( severity, message = nil ) {block}
189
- #
190
- # Log a message if the given severity is high enough. This is the generic
191
- # logging method. Users will be more inclined to use #debug, #info, #warn,
192
- # #error, and #fatal.
193
- #
194
- # <b>Message format</b>: +message+ can be any object, but it has to be
195
- # converted to a String in order to log it. The Logging::format_as
196
- # method is used to determine how objects chould be converted to
197
- # strings. Generally, +inspect+ is used.
198
- #
199
- # A special case is an +Exception+ object, which will be printed in
200
- # detail, including message, class, and backtrace.
201
- #
202
- # If a _message_ is not given, then the return value from the block is
203
- # used as the message to log. This is useful when creating the actual
204
- # message is an expensive operation. This allows the logger to check the
205
- # severity against the configured level before actually constructing the
206
- # message.
207
- #
208
- # This method returns +true+ if the message was logged, and +false+ is
209
- # returned if the message was not logged.
210
- #
211
- def add( lvl, data = nil )
212
- lvl = Integer(lvl)
213
- return false if lvl < level
214
-
215
- data = yield if block_given?
216
- log_event(::Logging::LogEvent.new(@name, lvl, data, @trace))
217
- true
218
- end
219
-
220
- # call-seq:
221
- # additive = true
222
- #
223
- # Sets the additivity of the logger. Acceptable values are +true+,
224
- # 'true', +false+, 'false', or +nil+. In this case +nil+ does not
225
- # change the additivity
226
- #
227
- def additive=( val )
228
- @additive = case val
229
- when true, 'true'; true
230
- when false, 'false'; false
231
- when nil; @additive
232
- else raise ArgumentError, 'expecting a boolean' end
233
- end
234
-
235
- # call-seq:
236
- # trace = true
237
- #
238
- # Sets the tracing of the logger. Acceptable values are +true+,
239
- # 'true', +false+, 'false', or +nil+. In this case +nil+ does not
240
- # change the tracing.
241
- #
242
- def trace=( val )
243
- @trace = case val
244
- when true, 'true'; true
245
- when false, 'false'; false
246
- when nil; @trace
247
- else raise ArgumentError, 'expecting a boolean' end
248
- end
249
-
250
- # call-seq:
251
- # level => integer
252
- #
253
- # Returns an integer which is the defined log level for this logger.
254
- #
255
- def level
256
- return @level unless @level.nil?
257
- @parent.level
258
- end
259
-
260
- # call-seq:
261
- # level = :all
262
- #
263
- # Set the level for this logger. The level can be either a +String+, a
264
- # +Symbol+, or a +Fixnum+. An +ArgumentError+ is raised if this is not
265
- # the case.
266
- #
267
- # There are two special levels -- "all" and "off". The former will
268
- # enable log messages from this logger. The latter will disable all log
269
- # messages from this logger.
270
- #
271
- # Setting the logger level to +nil+ will cause the parent's logger level
272
- # to be used.
273
- #
274
- # Example:
275
- #
276
- # log.level = :debug
277
- # log.level = "INFO"
278
- # log.level = 4
279
- # log.level = 'off'
280
- # log.level = :all
281
- #
282
- # These prodcue an +ArgumentError+
283
- #
284
- # log.level = Object
285
- # log.level = -1
286
- # log.level = 1_000_000_000_000
287
- #
288
- def level=( level )
289
- @level =
290
- if level.nil? then level
291
- else
292
- lvl = case level
293
- when String, Symbol; ::Logging::level_num(level)
294
- when Fixnum; level
295
- else
296
- raise ArgumentError,
297
- "level must be a String, Symbol, or Integer"
298
- end
299
- if lvl.nil? or lvl < 0 or lvl > ::Logging::LEVELS.length
300
- raise ArgumentError, "unknown level was given '#{level}'"
301
- end
302
- lvl
303
- end
304
-
305
- define_log_methods(true)
306
- self.level
307
- end
308
-
309
- # call-seq:
310
- # appenders = app
311
- #
312
- # Clears the current list of appenders and replaces them with _app_,
313
- # where _app_ can be either a single appender or an array of appenders.
314
- #
315
- def appenders=( args )
316
- @appenders.clear
317
- add_appenders(*args) unless args.nil?
318
- end
319
-
320
- # call-seq:
321
- # add_appenders( appenders )
322
- #
323
- # Add the given _appenders_ to the list of appenders, where _appenders_
324
- # can be either a single appender or an array of appenders.
325
- #
326
- def add_appenders( *args )
327
- args.flatten.each do |arg|
328
- o = arg.kind_of?(::Logging::Appender) ? arg : ::Logging::Appenders[arg.to_s]
329
- raise ArgumentError, "unknown appender #{arg.inspect}" if o.nil?
330
- @appenders << o unless @appenders.include?(o)
331
- end
332
- self
333
- end
334
-
335
- # call-seq:
336
- # remove_appenders( appenders )
337
- #
338
- # Remove the given _appenders_ from the list of appenders. The appenders
339
- # to remove can be identified either by name using a +String+ or by
340
- # passing the appender instance. _appenders_ can be a single appender or
341
- # an array of appenders.
342
- #
343
- def remove_appenders( *args )
344
- args.flatten.each do |arg|
345
- @appenders.delete_if do |a|
346
- case arg
347
- when String; arg == a.name
348
- when ::Logging::Appender; arg.object_id == a.object_id
349
- else
350
- raise ArgumentError, "#{arg.inspect} is not a 'Logging::Appender'"
351
- end
352
- end
353
- end
354
- self
355
- end
356
-
357
- # call-seq:
358
- # clear_appenders
359
- #
360
- # Remove all appenders from this logger.
361
- #
362
- def clear_appenders( ) @appenders.clear end
363
-
364
- # call-seq:
365
- # inspect => string
366
- #
367
- # Returns a string representation of the logger.
368
- #
369
- def inspect
370
- "<%s:0x%x name=\"%s\">" % [self.class.name, self.object_id, self.name]
371
- end
372
-
373
-
374
- protected
375
-
376
- # call-seq:
377
- # parent = ParentLogger
378
- #
379
- # Set the parent logger for this logger. This method will be invoked by
380
- # the +Repository+ class when a parent or child is added to the
381
- # hierarchy.
382
- #
383
- def parent=( parent ) @parent = parent end
384
-
385
- # call-seq:
386
- # log_event( event )
387
- #
388
- # Send the given _event_ to the appenders for logging, and pass the
389
- # _event_ up to the parent if additive mode is enabled. The log level has
390
- # already been checked before this method is called.
391
- #
392
- def log_event( event )
393
- @appenders.each {|a| a.append(event)}
394
- @parent.log_event(event) if @additive
395
- end
396
-
397
- # call-seq:
398
- # define_log_methods( force = false )
399
- #
400
- # Define the logging methods for this logger based on the configured log
401
- # level. If the level is nil, then we will ask our parent for it's level
402
- # and define log levels accordingly. The force flag will skip this
403
- # check.
404
- #
405
- # Recursively call this method on all our children loggers.
406
- #
407
- def define_log_methods( force = false )
408
- return if @level and !force
409
-
410
- ::Logging::Logger.define_log_methods(self)
411
- ::Logging::Repository.instance.children(name).each do |c|
412
- c.define_log_methods
413
- end
414
- self
415
- end
416
-
417
- # :stopdoc:
418
- public
419
-
420
- # call-seq:
421
- # _meta_eval( code )
422
- #
423
- # Evaluates the given string of _code_ if the singleton class of this
424
- # Logger object.
425
- #
426
- def _meta_eval( code, file = nil, line = nil )
427
- meta = class << self; self end
428
- meta.class_eval code, file, line
429
- end
430
-
431
- # call-seq:
432
- # _setup( name, opts = {} )
433
- #
434
- # Configures internal variables for the logger. This method can be used
435
- # to avoid storing the logger in the repository.
436
- #
437
- def _setup( name, opts = {} )
438
- @name = name
439
- @parent = opts.getopt(:parent)
440
- @appenders = opts.getopt(:appenders, [])
441
- @additive = opts.getopt(:additive, true)
442
- @trace = opts.getopt(:trace, false)
443
- @level = opts.getopt(:level)
444
- ::Logging::Logger.define_log_methods(self)
445
- end
446
-
447
- # call-seq:
448
- # _dump_configuration( io = STDOUT, indent = 0 )
449
- #
450
- # An internal method that is used to dump this logger's configuration to
451
- # the given _io_ stream. The configuration includes the logger's name,
452
- # level, additivity, and trace settings. The configured appenders are
453
- # also printed to the _io_ stream.
454
- #
455
- def _dump_configuration( io = STDOUT, indent = 0 )
456
- str, spacer, base = '', ' ', 50
457
- indent_str = indent == 0 ? '' : ' ' * indent
458
-
459
- str << indent_str
460
- str << self.name.reduce(base - indent)
461
- if (str.length + spacer.length) < base
462
- str << spacer
463
- str << '.' * (base - str.length)
464
- end
465
- io.write(str.ljust(base))
466
- io.write(spacer)
467
-
468
- level_str = @level.nil? ? '' : '*'
469
- level_str << if level < ::Logging::LEVELS.length
470
- ::Logging.levelify(::Logging::LNAMES[level])
471
- else
472
- 'off'
473
- end
474
- level_len = ::Logging::MAX_LEVEL_LENGTH + 1
475
-
476
- io.write("%#{level_len}s" % level_str)
477
- io.write(spacer)
478
-
479
- if self.respond_to?(:additive)
480
- io.write(additive ? '+A' : '-A')
481
- else
482
- io.write(' ')
483
- end
484
-
485
- io.write(spacer)
486
- io.write(trace ? '+T' : '-T')
487
- io.write("\n")
488
-
489
- @appenders.each do |appender|
490
- io.write(indent_str)
491
- io.write('- ')
492
- io.write(appender.inspect)
493
- io.write("\n")
494
- end
495
-
496
- return io
497
- end
498
- # :startdoc:
499
-
500
- end # class Logger
501
- end # module Logging
502
-
503
- # EOF