redcar 0.3.1dev → 0.3.2dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +34 -1
- data/README.md +2 -1
- data/ROADMAP.md +13 -45
- data/Rakefile +15 -14
- data/bin/redcar +4 -1
- data/lib/plugin_manager/README.md +61 -0
- data/lib/plugin_manager/Rakefile +55 -0
- data/lib/plugin_manager/bin/plugin_manager +4 -0
- data/lib/plugin_manager/lib/plugin_manager.rb +107 -0
- data/lib/plugin_manager/lib/plugin_manager/definition_builder.rb +37 -0
- data/lib/plugin_manager/lib/plugin_manager/plugin.rb +9 -0
- data/lib/plugin_manager/lib/plugin_manager/plugin_definition.rb +50 -0
- data/lib/plugin_manager/plugin_manager.gemspec +33 -0
- data/lib/plugin_manager/spec/fixtures/error_in_definition/core/plugin.rb +2 -0
- data/lib/plugin_manager/spec/fixtures/error_in_plugin/core/core.rb +4 -0
- data/lib/plugin_manager/spec/fixtures/error_in_plugin/core/plugin.rb +7 -0
- data/lib/plugin_manager/spec/fixtures/example/core/core.rb +20 -0
- data/lib/plugin_manager/spec/fixtures/example/core/plugin.rb +7 -0
- data/lib/plugin_manager/spec/fixtures/example/debug/debug.rb +6 -0
- data/lib/plugin_manager/spec/fixtures/example/debug/plugin.rb +8 -0
- data/lib/plugin_manager/spec/fixtures/example/extras/extras.rb +6 -0
- data/lib/plugin_manager/spec/fixtures/example/extras/plugin.rb +8 -0
- data/lib/plugin_manager/spec/fixtures/two_versions1/core/core.rb +20 -0
- data/lib/plugin_manager/spec/fixtures/two_versions1/core/plugin.rb +7 -0
- data/lib/plugin_manager/spec/fixtures/two_versions1/core2/core.rb +20 -0
- data/lib/plugin_manager/spec/fixtures/two_versions1/core2/plugin.rb +7 -0
- data/lib/plugin_manager/spec/fixtures/two_versions2/core/core.rb +20 -0
- data/lib/plugin_manager/spec/fixtures/two_versions2/core/plugin.rb +7 -0
- data/lib/plugin_manager/spec/fixtures/two_versions2/core2/core.rb +20 -0
- data/lib/plugin_manager/spec/fixtures/two_versions2/core2/plugin.rb +8 -0
- data/lib/plugin_manager/spec/fixtures/unmet_dependencies1/core/core.rb +10 -0
- data/lib/plugin_manager/spec/fixtures/unmet_dependencies1/core/plugin.rb +7 -0
- data/lib/plugin_manager/spec/fixtures/unmet_dependencies1/debug/debug.rb +6 -0
- data/lib/plugin_manager/spec/fixtures/unmet_dependencies1/debug/plugin.rb +8 -0
- data/lib/plugin_manager/spec/fixtures/unmet_dependencies2/core/core.rb +10 -0
- data/lib/plugin_manager/spec/fixtures/unmet_dependencies2/core/plugin.rb +7 -0
- data/lib/plugin_manager/spec/fixtures/unmet_dependencies2/debug/debug.rb +6 -0
- data/lib/plugin_manager/spec/fixtures/unmet_dependencies2/debug/plugin.rb +8 -0
- data/lib/plugin_manager/spec/plugin_manager_spec.rb +208 -0
- data/lib/plugin_manager/spec/spec_helper.rb +3 -0
- data/lib/redcar.rb +8 -3
- data/lib/redcar/boot.rb +59 -56
- data/lib/redcar/installer.rb +1 -1
- data/lib/redcar/instance_exec.rb +25 -0
- data/lib/redcar/runner.rb +5 -1
- data/lib/redcar/usage.rb +5 -1
- data/plugins/application/icons/close.png +0 -0
- data/plugins/application/lib/application.rb +61 -28
- data/plugins/application/lib/application/clipboard.rb +71 -0
- data/plugins/application/lib/application/dialog.rb +63 -0
- data/plugins/application/lib/application/menu.rb +32 -1
- data/plugins/application/lib/application/menu/builder.rb +10 -4
- data/plugins/application/lib/application/menu/item.rb +16 -3
- data/plugins/application/lib/application/notebook.rb +5 -0
- data/plugins/application/lib/application/speedbar.rb +73 -0
- data/plugins/application/lib/application/window.rb +25 -0
- data/plugins/application/plugin.rb +8 -0
- data/plugins/application/spec/application/clipboard_spec.rb +36 -0
- data/plugins/application/spec/application/menu_spec.rb +73 -1
- data/plugins/application/spec/application/speedbar_spec.rb +46 -0
- data/plugins/application/spec/spec_helper.rb +1 -1
- data/plugins/application_swt/lib/application_swt.rb +18 -11
- data/plugins/application_swt/lib/application_swt/clipboard.rb +42 -0
- data/plugins/application_swt/lib/application_swt/dialog_adapter.rb +68 -0
- data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +1 -1
- data/plugins/application_swt/lib/application_swt/html_tab.rb +32 -0
- data/plugins/application_swt/lib/application_swt/menu.rb +57 -21
- data/plugins/application_swt/lib/application_swt/menu/binding_translator.rb +39 -2
- data/plugins/application_swt/lib/application_swt/notebook.rb +5 -0
- data/plugins/application_swt/lib/application_swt/speedbar.rb +187 -0
- data/plugins/application_swt/lib/application_swt/swt_wrapper.rb +24 -1
- data/plugins/application_swt/lib/application_swt/window.rb +33 -3
- data/plugins/application_swt/plugin.rb +8 -0
- data/plugins/application_swt/spec/spec_helper.rb +1 -1
- data/plugins/auto_completer/features/auto_complete.feature +65 -0
- data/plugins/auto_completer/features/step_definitions/auto_complete_steps.rb +4 -0
- data/plugins/auto_completer/features/support/env.rb +4 -0
- data/plugins/auto_completer/lib/auto_completer.rb +99 -0
- data/plugins/auto_completer/lib/auto_completer/document_controller.rb +52 -0
- data/plugins/auto_completer/lib/auto_completer/word_iterator.rb +48 -0
- data/plugins/auto_completer/lib/auto_completer/word_list.rb +40 -0
- data/plugins/auto_completer/plugin.rb +10 -0
- data/plugins/auto_indenter/lib/auto_indenter.rb +1 -1
- data/plugins/auto_indenter/lib/auto_indenter/document_controller.rb +1 -1
- data/plugins/auto_indenter/plugin.rb +8 -0
- data/plugins/core/lib/core.rb +6 -30
- data/plugins/core/lib/core/gui.rb +7 -2
- data/plugins/core/lib/core/logger.rb +7 -4
- data/plugins/core/lib/core/plugin/storage.rb +15 -5
- data/plugins/core/plugin.rb +7 -0
- data/plugins/core/spec/core/storage_spec.rb +0 -9
- data/plugins/edit_view/features/cut_and_paste.feature +45 -0
- data/plugins/edit_view/features/step_definitions/editing_steps.rb +22 -0
- data/plugins/edit_view/features/step_definitions/key_steps.rb +1 -1
- data/plugins/edit_view/features/step_definitions/notebook_steps.rb +1 -1
- data/plugins/edit_view/features/step_definitions/tab_steps.rb +2 -0
- data/plugins/edit_view/features/step_definitions/window_steps.rb +1 -1
- data/plugins/edit_view/features/support/env.rb +2 -2
- data/plugins/edit_view/lib/edit_view.rb +24 -13
- data/plugins/edit_view/lib/edit_view/document.rb +233 -15
- data/plugins/edit_view/lib/edit_view/edit_tab.rb +2 -2
- data/plugins/edit_view/plugin.rb +9 -0
- data/plugins/edit_view/spec/spec_helper.rb +1 -1
- data/plugins/edit_view_swt/lib/edit_view_swt.rb +37 -8
- data/plugins/edit_view_swt/lib/edit_view_swt/document.rb +59 -24
- data/plugins/edit_view_swt/lib/edit_view_swt/word_movement.rb +66 -0
- data/plugins/edit_view_swt/plugin.rb +9 -0
- data/plugins/edit_view_swt/spec/edit_view_swt/word_movement_spec.rb +29 -0
- data/plugins/edit_view_swt/spec/spec_helper.rb +6 -0
- data/plugins/html_view/assets/blueprint/ie.css +35 -0
- data/plugins/html_view/assets/blueprint/print.css +29 -0
- data/plugins/html_view/assets/blueprint/screen.css +257 -0
- data/plugins/html_view/assets/blueprint/src/forms.css +65 -0
- data/plugins/html_view/assets/blueprint/src/grid.css +281 -0
- data/plugins/html_view/assets/blueprint/src/grid.png +0 -0
- data/plugins/html_view/assets/blueprint/src/ie.css +76 -0
- data/plugins/html_view/assets/blueprint/src/print.css +85 -0
- data/plugins/html_view/assets/blueprint/src/reset.css +38 -0
- data/plugins/html_view/assets/blueprint/src/typography.css +106 -0
- data/plugins/html_view/assets/jquery-1.4.min.js +151 -0
- data/plugins/html_view/assets/redcar.css +12 -0
- data/plugins/html_view/lib/html_controller.rb +5 -0
- data/plugins/html_view/lib/html_view.rb +47 -0
- data/plugins/html_view/lib/html_view/html_tab.rb +16 -0
- data/plugins/html_view/plugin.rb +12 -0
- data/plugins/my_plugin/lib/my_plugin.rb +55 -0
- data/plugins/my_plugin/plugin.rb +8 -0
- data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +62 -0
- data/plugins/plugin_manager_ui/plugin.rb +12 -0
- data/plugins/plugin_manager_ui/views/index.html.erb +31 -0
- data/plugins/project/lib/project.rb +27 -13
- data/plugins/project/lib/project/find_file_dialog.rb +25 -19
- data/plugins/project/plugin.rb +8 -0
- data/plugins/project/spec/spec_helper.rb +1 -1
- data/plugins/redcar/plugin.rb +13 -0
- data/plugins/redcar/redcar.rb +249 -8
- data/plugins/repl/lib/repl.rb +22 -14
- data/plugins/repl/plugin.rb +8 -0
- data/plugins/repl/spec/spec_helper.rb +1 -1
- data/plugins/tree/plugin.rb +9 -0
- data/plugins/tree/spec/spec_helper.rb +1 -1
- data/plugins/tree_view_swt/plugin.rb +9 -0
- data/textmate/Bundles/Apache.tmbundle/Syntaxes/Apache.plist +544 -0
- data/textmate/Bundles/Apache.tmbundle/Syntaxes/mod_perl.tmLanguage +120 -0
- data/textmate/Bundles/Blogging.tmbundle/Syntaxes/Blog___HTML__.plist +88 -0
- data/textmate/Bundles/Blogging.tmbundle/Syntaxes/Blog___Markdown__.plist +89 -0
- data/textmate/Bundles/Blogging.tmbundle/Syntaxes/Blog___Text__.plist +74 -0
- data/textmate/Bundles/Blogging.tmbundle/Syntaxes/Blog___Textile__.plist +74 -0
- data/textmate/Bundles/Bundle Development.tmbundle/Syntaxes/LanguageGrammar.tmLanguage +1829 -0
- data/textmate/Bundles/C Sharp.tmbundle/Syntaxes/Build.tmLanguage +142 -0
- data/textmate/Bundles/C Sharp.tmbundle/Syntaxes/C__.tmLanguage +524 -0
- data/textmate/Bundles/C++ Qt.tmbundle/Syntaxes/Qt_C____.tmLanguage +62 -0
- data/textmate/Bundles/C++ Qt.tmbundle/Syntaxes/qmake_Project.tmLanguage +308 -0
- data/textmate/Bundles/C.tmbundle/Syntaxes/C.plist +90 -48
- data/textmate/Bundles/Clojure.tmbundle/Syntaxes/Clojure.tmLanguage +427 -0
- data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/Cucumber_Plain_Text_Feature.tmLanguage +106 -13
- data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/Cucumber_Steps.tmLanguage +177 -2
- data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/plaintext_template.erb +109 -17
- data/textmate/Bundles/D.tmbundle/Syntaxes/D.tmLanguage +908 -0
- data/textmate/Bundles/Diff.tmbundle/Syntaxes/Diff.plist +229 -0
- data/textmate/Bundles/DokuWiki.tmbundle/Syntaxes/DokuWiki.tmLanguage +649 -0
- data/textmate/Bundles/F-Script.tmbundle/Syntaxes/F__Script.plist +219 -0
- data/textmate/Bundles/Haskell.tmbundle/Syntaxes/Haskell.plist +646 -0
- data/textmate/Bundles/Haskell.tmbundle/Syntaxes/Literate_Haskell.plist +90 -0
- data/textmate/Bundles/Io.tmbundle/Syntaxes/Io.plist +225 -0
- data/textmate/Bundles/JSON.tmbundle/Syntaxes/JSON.tmLanguage +285 -0
- data/textmate/Bundles/JavaScript Prototype & Script_aculo_us.tmbundle/Syntaxes/JavaScript____Prototype.tmLanguage +193 -0
- data/textmate/Bundles/JavaScript Prototype & Script_aculo_us.tmbundle/Syntaxes/JavaScript____Prototype_Bracketed.tmLanguage +394 -0
- data/textmate/Bundles/JavaScript jQuery.tmbundle/Syntaxes/jQuery___JavaScript__.tmLanguage +440 -0
- data/textmate/Bundles/JavaScript.tmbundle/Syntaxes/JavaScript.plist +712 -0
- data/textmate/Bundles/Latex.tmbundle/Syntaxes/Bibtex.plist +406 -0
- data/textmate/Bundles/Latex.tmbundle/Syntaxes/LaTeX.plist +1601 -0
- data/textmate/Bundles/Latex.tmbundle/Syntaxes/LaTeX_Beamer.plist +106 -0
- data/textmate/Bundles/Latex.tmbundle/Syntaxes/LaTeX_Log.plist +141 -0
- data/textmate/Bundles/Latex.tmbundle/Syntaxes/LaTeX_Memoir.tmLanguage +165 -0
- data/textmate/Bundles/Latex.tmbundle/Syntaxes/TeX.plist +246 -0
- data/textmate/Bundles/Latex.tmbundle/Syntaxes/TeX_Math.plist +132 -0
- data/textmate/Bundles/Lisp.tmbundle/Syntaxes/Lisp.plist +160 -0
- data/textmate/Bundles/Makefile.tmbundle/Syntaxes/Makefile.plist +103 -0
- data/textmate/Bundles/Markdown.tmbundle/Syntaxes/Markdown.plist +1192 -0
- data/textmate/Bundles/Markdown.tmbundle/Syntaxes/MultiMarkdown.tmLanguage +80 -0
- data/textmate/Bundles/PHP.tmbundle/Syntaxes/PHP.plist +3481 -0
- data/textmate/Bundles/Perl HTML-Template.tmbundle/Syntaxes/Perl_HTML__Template.tmLanguage +217 -0
- data/textmate/Bundles/Perl Template Toolkit.tmbundle/Syntaxes/HTML___Template_Toolkit__.tmLanguage +339 -0
- data/textmate/Bundles/Postscript.tmbundle/Syntaxes/Postscript.tmLanguage +321 -0
- data/textmate/Bundles/Processing.tmbundle/Syntaxes/Processing.plist +296 -0
- data/textmate/Bundles/Property List.tmbundle/Syntaxes/Property_List.tmLanguage +1650 -0
- data/textmate/Bundles/Python Django Templates.tmbundle/Syntaxes/HTML___Django__.tmLanguage +104 -0
- data/textmate/Bundles/Python Django.tmbundle/Syntaxes/Python_Django.tmLanguage +57 -0
- data/textmate/Bundles/Python.tmbundle/Syntaxes/Python.tmLanguage +3016 -0
- data/textmate/Bundles/Python.tmbundle/Syntaxes/Regular_Expressions___Python__.tmLanguage +299 -0
- data/textmate/Bundles/Rez.tmbundle/Syntaxes/Rez.plist +219 -0
- data/textmate/Bundles/Ruby Haml.tmbundle/Syntaxes/Ruby_Haml.tmLanguage +403 -0
- data/textmate/Bundles/Ruby RSpec.tmbundle/Syntaxes/RSpec.tmLanguage +142 -0
- data/textmate/Bundles/Ruby.tmbundle/Syntaxes/Ruby.plist +139 -49
- data/textmate/Bundles/SQL.tmbundle/Syntaxes/SQL.plist +705 -0
- data/textmate/Bundles/SSH-Config.tmbundle/Syntaxes/SSH__Config.tmLanguage +88 -0
- data/textmate/Bundles/Scala.tmbundle/Syntaxes/Scala.tmLanguage +609 -0
- data/textmate/Bundles/Scala.tmbundle/Syntaxes/Scala_Properties.tmLanguage +54 -0
- data/textmate/Bundles/ShellScript.tmbundle/Syntaxes/Shell__Unix__Generic.plist +1855 -0
- data/textmate/Bundles/Tabular.tmbundle/Syntaxes/CSV.tmLanguage +178 -0
- data/textmate/Bundles/Tabular.tmbundle/Syntaxes/TSV.tmLanguage +135 -0
- data/textmate/Bundles/TextMate.tmbundle/Syntaxes/Regular_Expressions___Oniguruma__.tmLanguage +295 -0
- data/textmate/Bundles/TextMate.tmbundle/Syntaxes/Release_Notes.tmLanguage +126 -0
- data/textmate/Bundles/Textile.tmbundle/Syntaxes/Textile.plist +490 -0
- data/textmate/Bundles/Thrift.tmbundle/Syntaxes/Thrift.tmLanguage +1024 -0
- data/textmate/Bundles/XML.tmbundle/Syntaxes/XML.plist +576 -0
- data/textmate/Bundles/XML.tmbundle/Syntaxes/XSL.plist +157 -0
- data/textmate/Bundles/YAML.tmbundle/Syntaxes/YAML.plist +466 -0
- data/textmate/Themes/Django.tmTheme +436 -0
- metadata +371 -325
- data/config/default.yaml +0 -15
- data/lib/freebase2/README.txt +0 -47
- data/lib/freebase2/bin/default.yaml +0 -15
- data/lib/freebase2/bin/install.rb +0 -42
- data/lib/freebase2/bin/run.rb +0 -48
- data/lib/freebase2/lib/freebase/configuration.rb +0 -535
- data/lib/freebase2/lib/freebase/core.rb +0 -197
- data/lib/freebase2/lib/freebase/databus.rb +0 -1128
- data/lib/freebase2/lib/freebase/freebase.rb +0 -60
- data/lib/freebase2/lib/freebase/logger.rb +0 -117
- data/lib/freebase2/lib/freebase/plugin.rb +0 -384
- data/lib/freebase2/lib/freebase/properties.rb +0 -130
- data/lib/freebase2/lib/freebase/readers.rb +0 -328
- data/lib/freebase2/notes +0 -61
- data/lib/freebase2/plugins/raa_webrick/httpd.rb +0 -125
- data/lib/freebase2/plugins/raa_webrick/plugin.yaml +0 -7
- data/lib/freebase2/plugins/raa_webrick/web_root/test.html +0 -5
- data/lib/freebase2/plugins/raa_webrick/webserver.yaml +0 -6
- data/lib/freebase2/plugins/raa_xmlrpc4r/plugin.xml +0 -8
- data/lib/freebase2/plugins/raa_xmlrpc4r/rpcd.rb +0 -54
- data/lib/freebase2/regress/README +0 -1
- data/lib/little_plugger/History.txt +0 -20
- data/lib/little_plugger/Rakefile +0 -34
- data/lib/little_plugger/lib/little-plugger.rb +0 -323
- data/lib/little_plugger/spec/little-plugger_spec.rb +0 -26
- data/lib/little_plugger/spec/spec_helper.rb +0 -16
- data/lib/logging/History.txt +0 -240
- data/lib/logging/Rakefile +0 -37
- data/lib/logging/data/bad_logging_1.rb +0 -13
- data/lib/logging/data/bad_logging_2.rb +0 -21
- data/lib/logging/data/logging.rb +0 -42
- data/lib/logging/data/logging.yaml +0 -63
- data/lib/logging/data/simple_logging.rb +0 -13
- data/lib/logging/examples/appenders.rb +0 -47
- data/lib/logging/examples/classes.rb +0 -41
- data/lib/logging/examples/consolidation.rb +0 -83
- data/lib/logging/examples/formatting.rb +0 -51
- data/lib/logging/examples/hierarchies.rb +0 -73
- data/lib/logging/examples/layouts.rb +0 -48
- data/lib/logging/examples/loggers.rb +0 -29
- data/lib/logging/examples/names.rb +0 -43
- data/lib/logging/examples/simple.rb +0 -17
- data/lib/logging/lib/logging.rb +0 -501
- data/lib/logging/lib/logging/appender.rb +0 -251
- data/lib/logging/lib/logging/appenders.rb +0 -131
- data/lib/logging/lib/logging/appenders/buffering.rb +0 -168
- data/lib/logging/lib/logging/appenders/console.rb +0 -60
- data/lib/logging/lib/logging/appenders/email.rb +0 -75
- data/lib/logging/lib/logging/appenders/file.rb +0 -58
- data/lib/logging/lib/logging/appenders/growl.rb +0 -197
- data/lib/logging/lib/logging/appenders/io.rb +0 -69
- data/lib/logging/lib/logging/appenders/rolling_file.rb +0 -293
- data/lib/logging/lib/logging/appenders/string_io.rb +0 -68
- data/lib/logging/lib/logging/appenders/syslog.rb +0 -194
- data/lib/logging/lib/logging/config/configurator.rb +0 -188
- data/lib/logging/lib/logging/config/yaml_configurator.rb +0 -191
- data/lib/logging/lib/logging/layout.rb +0 -117
- data/lib/logging/lib/logging/layouts.rb +0 -47
- data/lib/logging/lib/logging/layouts/basic.rb +0 -32
- data/lib/logging/lib/logging/layouts/parseable.rb +0 -211
- data/lib/logging/lib/logging/layouts/pattern.rb +0 -311
- data/lib/logging/lib/logging/log_event.rb +0 -45
- data/lib/logging/lib/logging/logger.rb +0 -503
- data/lib/logging/lib/logging/repository.rb +0 -232
- data/lib/logging/lib/logging/root_logger.rb +0 -61
- data/lib/logging/lib/logging/stats.rb +0 -278
- data/lib/logging/lib/logging/utils.rb +0 -153
- data/lib/logging/lib/spec/logging_helper.rb +0 -34
- data/lib/logging/test/appenders/test_buffered_io.rb +0 -176
- data/lib/logging/test/appenders/test_console.rb +0 -66
- data/lib/logging/test/appenders/test_email.rb +0 -170
- data/lib/logging/test/appenders/test_file.rb +0 -95
- data/lib/logging/test/appenders/test_growl.rb +0 -127
- data/lib/logging/test/appenders/test_io.rb +0 -129
- data/lib/logging/test/appenders/test_rolling_file.rb +0 -200
- data/lib/logging/test/appenders/test_syslog.rb +0 -194
- data/lib/logging/test/benchmark.rb +0 -86
- data/lib/logging/test/config/test_configurator.rb +0 -70
- data/lib/logging/test/config/test_yaml_configurator.rb +0 -40
- data/lib/logging/test/layouts/test_basic.rb +0 -42
- data/lib/logging/test/layouts/test_json.rb +0 -112
- data/lib/logging/test/layouts/test_pattern.rb +0 -198
- data/lib/logging/test/layouts/test_yaml.rb +0 -121
- data/lib/logging/test/setup.rb +0 -44
- data/lib/logging/test/test_appender.rb +0 -152
- data/lib/logging/test/test_consolidate.rb +0 -46
- data/lib/logging/test/test_layout.rb +0 -110
- data/lib/logging/test/test_log_event.rb +0 -80
- data/lib/logging/test/test_logger.rb +0 -699
- data/lib/logging/test/test_logging.rb +0 -267
- data/lib/logging/test/test_repository.rb +0 -158
- data/lib/logging/test/test_root_logger.rb +0 -81
- data/lib/logging/test/test_stats.rb +0 -274
- data/lib/logging/test/test_utils.rb +0 -116
- data/plugins/application/plugin.yaml +0 -11
- data/plugins/application_swt/plugin.yaml +0 -11
- data/plugins/auto_indenter/plugin.yaml +0 -12
- data/plugins/core/plugin.yaml +0 -7
- data/plugins/edit_view/plugin.yaml +0 -14
- data/plugins/edit_view_swt/plugin.yaml +0 -14
- data/plugins/project/plugin.yaml +0 -12
- data/plugins/redcar/plugin.yaml +0 -18
- data/plugins/repl/plugin.yaml +0 -12
- data/plugins/tree/plugin.yaml +0 -14
- data/plugins/tree_view_swt/plugin.yaml +0 -14
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Purpose: FreeBASE constant declarations and module inclusion
|
|
2
|
-
#
|
|
3
|
-
# $Id: freebase.rb,v 1.3 2003/07/16 21:07:08 ljulliar Exp $
|
|
4
|
-
#
|
|
5
|
-
# Authors: Rich Kilmer <rich@infoether.com>
|
|
6
|
-
# Contributors:
|
|
7
|
-
#
|
|
8
|
-
# This file is part of the FreeRIDE project
|
|
9
|
-
#
|
|
10
|
-
# This application is free software; you can redistribute it and/or
|
|
11
|
-
# modify it under the terms of the Ruby license defined in the
|
|
12
|
-
# COPYING file.
|
|
13
|
-
#
|
|
14
|
-
# Copyright (c) 2001 Rich Kilmer. All rights reserved.
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
module FreeBASE
|
|
18
|
-
|
|
19
|
-
#version information
|
|
20
|
-
VERSION_MAJOR = 0
|
|
21
|
-
VERSION_MINOR = 1
|
|
22
|
-
VERSION_RELEASE = 0
|
|
23
|
-
|
|
24
|
-
#state transitions for plugins
|
|
25
|
-
UNLOADED = "UNLOADED"
|
|
26
|
-
LOADING = "LOADING"
|
|
27
|
-
LOADED = "LOADED"
|
|
28
|
-
STARTING = "STARTING"
|
|
29
|
-
RUNNING = "RUNNING"
|
|
30
|
-
STOPPING = "STOPPING"
|
|
31
|
-
UNLOADING = "UNLOADING"
|
|
32
|
-
ERROR = "ERROR"
|
|
33
|
-
|
|
34
|
-
#system state transition order
|
|
35
|
-
STARTUP_STATES = [UNLOADED, LOADING, LOADED, STARTING, RUNNING]
|
|
36
|
-
SHUTDOWN_STATES = [STOPPING, LOADED, UNLOADING, UNLOADED]
|
|
37
|
-
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
##
|
|
41
|
-
# Test whether a file path is absolute or relative
|
|
42
|
-
# (used in several method of freebase to load/store
|
|
43
|
-
# plugin config files
|
|
44
|
-
#
|
|
45
|
-
class File
|
|
46
|
-
def File.absolute_path?(path)
|
|
47
|
-
if RUBY_PLATFORM =~ /(mswin32|mingw32)/
|
|
48
|
-
path =~ %r{^([a-zA-Z]:)*[/\\]+}
|
|
49
|
-
else
|
|
50
|
-
path[0..0] == File::SEPARATOR
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
require File.dirname(__FILE__) + '/core'
|
|
56
|
-
require File.dirname(__FILE__) + '/plugin'
|
|
57
|
-
require File.dirname(__FILE__) + '/databus'
|
|
58
|
-
require File.dirname(__FILE__) + '/properties'
|
|
59
|
-
require File.dirname(__FILE__) + '/readers'
|
|
60
|
-
require File.dirname(__FILE__) + '/configuration'
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
# Purpose: Sample logger plugin
|
|
2
|
-
#
|
|
3
|
-
# $Id: logger.rb,v 1.2 2003/06/24 05:00:43 richkilmer Exp $
|
|
4
|
-
#
|
|
5
|
-
# Authors: Rich Kilmer <rich@infoether.com>
|
|
6
|
-
# Contributors:
|
|
7
|
-
#
|
|
8
|
-
# This file is part of the FreeRIDE project
|
|
9
|
-
#
|
|
10
|
-
# This application is free software; you can redistribute it and/or
|
|
11
|
-
# modify it under the terms of the Ruby license defined in the
|
|
12
|
-
# COPYING file.
|
|
13
|
-
#
|
|
14
|
-
# Copyright (c) 2001 Rich Kilmer. All rights reserved.
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
module FreeBASE
|
|
18
|
-
module Plugins
|
|
19
|
-
class Logger
|
|
20
|
-
|
|
21
|
-
class SimpleFileLogger
|
|
22
|
-
LEVELS = ['disabled', 'error', 'info', 'debug']
|
|
23
|
-
def initialize(logName, logFile, logLevel)
|
|
24
|
-
@logName = logName
|
|
25
|
-
@logFile = logFile
|
|
26
|
-
ensure_logdir
|
|
27
|
-
self.logLevel = logLevel
|
|
28
|
-
@file = File.new(logFile, "a")
|
|
29
|
-
@file.sync = true
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def ensure_logdir
|
|
33
|
-
path = File.dirname(@logFile).split(File::SEPARATOR)
|
|
34
|
-
(path.size-1).times do |i|
|
|
35
|
-
dir = File.join(*path[0,i+2])
|
|
36
|
-
unless File.exist?(dir)
|
|
37
|
-
Dir.mkdir(dir)
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def logLevel=(logLevel)
|
|
43
|
-
logLevel = LEVELS[logLevel] if logLevel.kind_of? Numeric
|
|
44
|
-
@logLevel = logLevel.downcase
|
|
45
|
-
case @logLevel
|
|
46
|
-
when 'disabled'
|
|
47
|
-
@logLevelInt = 0
|
|
48
|
-
when 'error'
|
|
49
|
-
@logLevelInt = 1
|
|
50
|
-
when 'info'
|
|
51
|
-
@logLevelInt = 2
|
|
52
|
-
when 'debug'
|
|
53
|
-
@logLevelInt = 3
|
|
54
|
-
else
|
|
55
|
-
raise "Unknown Logger level: #{@logLevel}"
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
def close
|
|
60
|
-
@file.close
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def time
|
|
64
|
-
Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def error(message)
|
|
68
|
-
return if @logLevelInt < 1
|
|
69
|
-
@file.puts "#{time} :: [ERROR] #{message}"
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
def info(message)
|
|
73
|
-
return if @logLevelInt < 2
|
|
74
|
-
@file.puts "#{time} :: [INFO] #{message}"
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
def debug(message)
|
|
78
|
-
return if @logLevelInt < 3
|
|
79
|
-
@file.puts "#{time} :: [DEBUG] #{message}"
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
extend FreeBASE::StandardPlugin
|
|
85
|
-
|
|
86
|
-
def self.start(plugin)
|
|
87
|
-
begin
|
|
88
|
-
system_properties = plugin["/system/properties"].manager
|
|
89
|
-
logName = system_properties["config/log_name"]
|
|
90
|
-
logFile = system_properties["config/log_file"]
|
|
91
|
-
# Create log file in user directory if it exists
|
|
92
|
-
user_logFile = DefaultPropertiesReader.user_filename(logFile)
|
|
93
|
-
if !user_logFile.nil?
|
|
94
|
-
logFile = user_logFile
|
|
95
|
-
end
|
|
96
|
-
logLevel = system_properties["config/log_level"]
|
|
97
|
-
logger = SimpleFileLogger.new(logName, logFile, logLevel)
|
|
98
|
-
["info", "error", "debug"].each do |logType| #clear the existing log entries
|
|
99
|
-
while msg = plugin["/log/#{logType}"].queue.leave
|
|
100
|
-
logger.send(logType, msg)
|
|
101
|
-
end
|
|
102
|
-
end
|
|
103
|
-
plugin["close"].set_proc { logger.close }
|
|
104
|
-
plugin["set_level"].set_proc{ |level| logger.logLevel = level }
|
|
105
|
-
plugin["/log"].set_proc { |logType, message| logger.send(logType, message) }
|
|
106
|
-
plugin["/log"].manager = logger
|
|
107
|
-
plugin.transition(FreeBASE::RUNNING)
|
|
108
|
-
rescue
|
|
109
|
-
puts $!
|
|
110
|
-
puts $!.backtrace.join("\n")
|
|
111
|
-
plugin.transition_failure
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
end
|
|
117
|
-
end
|
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
# Purpose: Wrapper for FreeBASE plugin instanciation
|
|
2
|
-
#
|
|
3
|
-
# $Id: plugin.rb,v 1.2 2003/06/11 21:23:01 ljulliar Exp $
|
|
4
|
-
#
|
|
5
|
-
# Authors: Rich Kilmer <rich@infoether.com>
|
|
6
|
-
# Contributors:
|
|
7
|
-
#
|
|
8
|
-
# This file is part of the FreeRIDE project
|
|
9
|
-
#
|
|
10
|
-
# This application is free software; you can redistribute it and/or
|
|
11
|
-
# modify it under the terms of the Ruby license defined in the
|
|
12
|
-
# COPYING file.
|
|
13
|
-
#
|
|
14
|
-
# Copyright (c) 2001 Rich Kilmer. All rights reserved.
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
require 'rexml/document'
|
|
18
|
-
|
|
19
|
-
module FreeBASE
|
|
20
|
-
|
|
21
|
-
module StandardPlugin
|
|
22
|
-
def load(plugin)
|
|
23
|
-
plugin.transition(FreeBASE::LOADED)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def start(plugin)
|
|
27
|
-
plugin.transition(FreeBASE::RUNNING)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def stop(plugin)
|
|
31
|
-
plugin.transition(FreeBASE::LOADED)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def unload(plugin)
|
|
35
|
-
plugin.transition(FreeBASE::UNLOADED)
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
class SubsystemPlugin
|
|
40
|
-
extend StandardPlugin
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
##
|
|
44
|
-
# The Plugin class is the wrapper for the actual plugin instance
|
|
45
|
-
#
|
|
46
|
-
class Plugin
|
|
47
|
-
|
|
48
|
-
attr_reader :plugin_configuration, :core
|
|
49
|
-
|
|
50
|
-
#transition definitions
|
|
51
|
-
FAILURE_TRANSITIONS =
|
|
52
|
-
{ LOADING => UNLOADED,
|
|
53
|
-
STARTING => LOADED,
|
|
54
|
-
STOPPING => RUNNING,
|
|
55
|
-
UNLOADING => LOADED }
|
|
56
|
-
|
|
57
|
-
LEGAL_TRANSITIONS =
|
|
58
|
-
{ UNLOADED => [LOADING],
|
|
59
|
-
LOADING => [LOADED],
|
|
60
|
-
LOADED => [STARTING, UNLOADING],
|
|
61
|
-
STARTING => [RUNNING],
|
|
62
|
-
RUNNING => [STOPPING],
|
|
63
|
-
STOPPING => [LOADED, RUNNING],
|
|
64
|
-
UNLOADING => [UNLOADED] }
|
|
65
|
-
|
|
66
|
-
SYSTEM_TRANSITIONS =
|
|
67
|
-
{ LOADING => [UNLOADED, :load],
|
|
68
|
-
STARTING => [LOADED, :start],
|
|
69
|
-
STOPPING => [RUNNING, :stop],
|
|
70
|
-
UNLOADING => [LOADED, :unload] }
|
|
71
|
-
|
|
72
|
-
ST_CONDITION = 0
|
|
73
|
-
ST_METHOD = 1
|
|
74
|
-
|
|
75
|
-
##
|
|
76
|
-
# Returns the properties object for this plugin. This raises an
|
|
77
|
-
# exception if there is not properties file definded in the plugin.xml
|
|
78
|
-
# file <properties>.....</properties.
|
|
79
|
-
#
|
|
80
|
-
# return:: [FreeBASE::DataBus::Properties] The Properties object
|
|
81
|
-
# raise:: [RuntimException] If the properties is undefined.
|
|
82
|
-
#
|
|
83
|
-
def properties
|
|
84
|
-
raise "No properties file defined for #{@plugin_configuration.name} in plugin.xml" unless @properties
|
|
85
|
-
@properties
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
##
|
|
89
|
-
# Loads the supplied .xml file and extracts its attribute values
|
|
90
|
-
#
|
|
91
|
-
# core:: [FreeBASE::Core] The FreeBASE core instance
|
|
92
|
-
# plugin_configuration:: [FreeBASE::PluginConfiguration] The object that holds this plugin's configuration
|
|
93
|
-
#
|
|
94
|
-
def initialize(core, plugin_configuration)
|
|
95
|
-
@core = core
|
|
96
|
-
@plugin_configuration = plugin_configuration
|
|
97
|
-
# configure base slot
|
|
98
|
-
@base_slot = @core.bus["/plugins/#{@plugin_configuration.name}"]
|
|
99
|
-
@base_slot.data = self
|
|
100
|
-
@base_slot.propagate_notifications = false
|
|
101
|
-
@base_slot.manager = self
|
|
102
|
-
# create properties manager
|
|
103
|
-
if @plugin_configuration.properties_path
|
|
104
|
-
@properties = Properties.new(@plugin_configuration.name, "1.0", @base_slot["properties"], @plugin_configuration.base_path+"/"+@plugin_configuration.properties_path)
|
|
105
|
-
end
|
|
106
|
-
#local log
|
|
107
|
-
@base_slot["log/info"].queue
|
|
108
|
-
@base_slot["log/error"].queue
|
|
109
|
-
@base_slot["log/debug"].queue
|
|
110
|
-
@base_slot["log"].subscribe self
|
|
111
|
-
@base_slot["state"].data = UNLOADED
|
|
112
|
-
@base_slot["info/author"].data = @plugin_configuration.author
|
|
113
|
-
@base_slot["info/version"].data = @plugin_configuration.version
|
|
114
|
-
@base_slot["info/description"].data = @plugin_configuration.description
|
|
115
|
-
@base_slot["actions/reload"].set_proc do
|
|
116
|
-
self.reload
|
|
117
|
-
end
|
|
118
|
-
if @plugin_configuration.tests
|
|
119
|
-
@base_slot["actions/test"].set_proc do
|
|
120
|
-
self.test
|
|
121
|
-
end
|
|
122
|
-
@plugin_configuration.tests.each do |testcase|
|
|
123
|
-
@base_slot["actions/test/#{testcase["testcase"]}"].set_proc do
|
|
124
|
-
self.test(testcase["testcase"])
|
|
125
|
-
end
|
|
126
|
-
end
|
|
127
|
-
end
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
##
|
|
131
|
-
# Gets the info log slot
|
|
132
|
-
#
|
|
133
|
-
# return:: [FreeBASE::DataBus::Slot] The slot used for logging informational messages
|
|
134
|
-
#
|
|
135
|
-
def log_info
|
|
136
|
-
@base_slot["log/info"]
|
|
137
|
-
end
|
|
138
|
-
|
|
139
|
-
##
|
|
140
|
-
# Gets the debug log slot
|
|
141
|
-
#
|
|
142
|
-
# return:: [FreeBASE::DataBus::Slot] The slot used for logging debug messages
|
|
143
|
-
#
|
|
144
|
-
def log_debug
|
|
145
|
-
@base_slot["log/debug"]
|
|
146
|
-
end
|
|
147
|
-
|
|
148
|
-
##
|
|
149
|
-
# Gets the error log slot
|
|
150
|
-
#
|
|
151
|
-
# return:: [FreeBASE::DataBus::Slot] The slot used for logging error messages
|
|
152
|
-
#
|
|
153
|
-
def log_error
|
|
154
|
-
@base_slot["log/error"]
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
##
|
|
158
|
-
# Handle callback from Slot object
|
|
159
|
-
#
|
|
160
|
-
def databus_notify(event, slot)
|
|
161
|
-
basePath = @base_slot.path
|
|
162
|
-
case slot.path
|
|
163
|
-
when basePath+"log/info/", basePath+"log/error/", basePath+"log/debug/"
|
|
164
|
-
if event == :notify_queue_join
|
|
165
|
-
@base_slot["/log/#{slot.name}"].queue << "Plugin(#{@plugin_configuration.name}): #{slot.queue.leave}"
|
|
166
|
-
end
|
|
167
|
-
end
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
##
|
|
171
|
-
# Transitions from current state to error state
|
|
172
|
-
# as specified in FAILURE_TRANSITIONS table
|
|
173
|
-
#
|
|
174
|
-
def transition_failure
|
|
175
|
-
state = FAILURE_TRANSITIONS[@base_slot["state"].data]
|
|
176
|
-
@base_slot["state"].data = state if state
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
##
|
|
180
|
-
# Transitions to the new state (sets ./state slot)
|
|
181
|
-
#
|
|
182
|
-
# state:: [String] The state to transition to
|
|
183
|
-
# raise:: [RuntimeException] If you cannot transition from current to proposed state
|
|
184
|
-
#
|
|
185
|
-
def transition(state)
|
|
186
|
-
currentState = @base_slot["state"].data
|
|
187
|
-
@base_slot["log/debug"] << "State transition: #{currentState} -> #{state}"
|
|
188
|
-
# puts "#{plugin_configuration.name} State transition: #{currentState} -> #{state}"
|
|
189
|
-
# puts "dependencies: #{plugin_configuration.fwd_start_graph.map{|p| p.name}.inspect}"
|
|
190
|
-
# puts "reverse_deps: #{plugin_configuration.rev_start_graph.map{|p| p.name}.inspect}"
|
|
191
|
-
unless LEGAL_TRANSITIONS[currentState].include?(state)
|
|
192
|
-
raise "Cannot transition to #{state} from #{currentState}"
|
|
193
|
-
end
|
|
194
|
-
@base_slot["state"].data = state
|
|
195
|
-
end
|
|
196
|
-
|
|
197
|
-
def state
|
|
198
|
-
@base_slot['state'].data
|
|
199
|
-
end
|
|
200
|
-
|
|
201
|
-
# Require the plugins files
|
|
202
|
-
def require_files
|
|
203
|
-
log_requires do
|
|
204
|
-
$LOAD_PATH << File.expand_path(
|
|
205
|
-
File.join(
|
|
206
|
-
@plugin_configuration.full_base_path,
|
|
207
|
-
"lib"))
|
|
208
|
-
if @plugin_configuration.require_path
|
|
209
|
-
require @plugin_configuration.require_path
|
|
210
|
-
else
|
|
211
|
-
# loads from default path plugin_dir/lib/plugin_name if no load path given
|
|
212
|
-
path = File.expand_path(
|
|
213
|
-
File.join(
|
|
214
|
-
@plugin_configuration.full_base_path,
|
|
215
|
-
"lib",
|
|
216
|
-
@plugin_configuration.name))
|
|
217
|
-
require path
|
|
218
|
-
end
|
|
219
|
-
end
|
|
220
|
-
end
|
|
221
|
-
|
|
222
|
-
##
|
|
223
|
-
# Loads the plugin instance by calling load on the Module defined by startup_module.
|
|
224
|
-
#
|
|
225
|
-
def load
|
|
226
|
-
transition(LOADING)
|
|
227
|
-
begin
|
|
228
|
-
raise Exception.new("unment dependencies") unless @plugin_configuration.dependencies_met?
|
|
229
|
-
require @plugin_configuration.dependencies_path if @plugin_configuration.dependencies_path
|
|
230
|
-
require_files
|
|
231
|
-
object = eval(@plugin_configuration.startup_module)
|
|
232
|
-
object.load if object.respond_to?(:load)
|
|
233
|
-
transition(FreeBASE::LOADED)
|
|
234
|
-
rescue Exception => error
|
|
235
|
-
if error.is_a?(SystemExit)
|
|
236
|
-
exit
|
|
237
|
-
end
|
|
238
|
-
puts error
|
|
239
|
-
puts error.backtrace
|
|
240
|
-
log_error << "Error loading #{@plugin_configuration.name}\n#{error.to_s}\n#{error.backtrace.join("\n")}"
|
|
241
|
-
transition_failure
|
|
242
|
-
end
|
|
243
|
-
end
|
|
244
|
-
|
|
245
|
-
##
|
|
246
|
-
# Starts the plugin instance by calling start on the Module defined by startup_module.
|
|
247
|
-
#
|
|
248
|
-
def start
|
|
249
|
-
if @base_slot['state'].data == LOADED
|
|
250
|
-
transition(STARTING)
|
|
251
|
-
begin
|
|
252
|
-
raise Exception.new("unment dependencies") unless @plugin_configuration.dependencies_met?
|
|
253
|
-
log_requires do
|
|
254
|
-
object = eval(@plugin_configuration.startup_module)
|
|
255
|
-
object.start if object.respond_to?(:start)
|
|
256
|
-
end
|
|
257
|
-
transition(FreeBASE::RUNNING)
|
|
258
|
-
rescue Exception => error
|
|
259
|
-
puts error
|
|
260
|
-
puts error.backtrace
|
|
261
|
-
log_error << "Error starting #{@plugin_configuration.name}\n#{error.to_s}\n#{error.backtrace.join("\n")}"
|
|
262
|
-
transition_failure
|
|
263
|
-
end
|
|
264
|
-
end
|
|
265
|
-
end
|
|
266
|
-
|
|
267
|
-
##
|
|
268
|
-
# Stops the plugin instance by calling stop on the Module defined by startup_module.
|
|
269
|
-
#
|
|
270
|
-
def stop
|
|
271
|
-
if @base_slot["state"].data == RUNNING
|
|
272
|
-
transition(STOPPING)
|
|
273
|
-
eval(@plugin_configuration.startup_module).stop(self)
|
|
274
|
-
end
|
|
275
|
-
end
|
|
276
|
-
|
|
277
|
-
##
|
|
278
|
-
# Unloads the plugin instance by calling unload on the Module defined by startup_module.
|
|
279
|
-
#
|
|
280
|
-
def unload
|
|
281
|
-
if @base_slot['state'].data == LOADED
|
|
282
|
-
transition(UNLOADING)
|
|
283
|
-
eval(@plugin_configuration.startup_module).unload(self)
|
|
284
|
-
end
|
|
285
|
-
end
|
|
286
|
-
|
|
287
|
-
##
|
|
288
|
-
# Calls the [](path) method on the @local_bus DataBus
|
|
289
|
-
#
|
|
290
|
-
def [](path)
|
|
291
|
-
return @base_slot[path]
|
|
292
|
-
end
|
|
293
|
-
|
|
294
|
-
##
|
|
295
|
-
# Logs all files that Ruby loads during the invocation of the block passed in.
|
|
296
|
-
#
|
|
297
|
-
def log_requires(type=:plugin)
|
|
298
|
-
before = $".dup
|
|
299
|
-
yield
|
|
300
|
-
after = $".dup
|
|
301
|
-
prev = @base_slot["files/"+type.to_s].data || []
|
|
302
|
-
diff = (after-before)
|
|
303
|
-
diff = diff.reject do
|
|
304
|
-
end
|
|
305
|
-
@base_slot["files/"+type.to_s].data = (prev + diff).uniq
|
|
306
|
-
end
|
|
307
|
-
|
|
308
|
-
##
|
|
309
|
-
# Reloads all files logged as having been loaded by this plugin.
|
|
310
|
-
#
|
|
311
|
-
def reload
|
|
312
|
-
print "[FB2] reloading #{@plugin_configuration.name} ["
|
|
313
|
-
plugin = @base_slot.manager
|
|
314
|
-
plugin.stop
|
|
315
|
-
plugin.unload
|
|
316
|
-
# remove methods from testcase
|
|
317
|
-
if pm = @plugin_configuration.test_module
|
|
318
|
-
begin
|
|
319
|
-
if tc = eval(pm)
|
|
320
|
-
tc.instance_methods.select{|m| m=~/^test_/}.each do |meth|
|
|
321
|
-
tc.class_eval { remove_method(meth) }
|
|
322
|
-
end
|
|
323
|
-
end
|
|
324
|
-
rescue
|
|
325
|
-
end
|
|
326
|
-
end
|
|
327
|
-
|
|
328
|
-
@base_slot["files"].each_slot do |s|
|
|
329
|
-
(s.data||[]).each do |f|
|
|
330
|
-
if File.extname(f) == ".rb"
|
|
331
|
-
Kernel.load f
|
|
332
|
-
print "'#{f}', "
|
|
333
|
-
end
|
|
334
|
-
end
|
|
335
|
-
end
|
|
336
|
-
puts "]"
|
|
337
|
-
plugin.load
|
|
338
|
-
plugin.start
|
|
339
|
-
end
|
|
340
|
-
|
|
341
|
-
def require_testcase(testcase_path)
|
|
342
|
-
log_requires(:test) do
|
|
343
|
-
require testcase_path
|
|
344
|
-
end
|
|
345
|
-
end
|
|
346
|
-
|
|
347
|
-
##
|
|
348
|
-
# Loads and executes the plugin's test path.
|
|
349
|
-
#
|
|
350
|
-
def test(testcase=nil)
|
|
351
|
-
if @plugin_configuration.tests
|
|
352
|
-
require 'test/unit'
|
|
353
|
-
|
|
354
|
-
# we do not want the tests to run on exit:
|
|
355
|
-
Test::Unit.run = false
|
|
356
|
-
|
|
357
|
-
suite = Test::Unit::TestSuite.new(testcase)
|
|
358
|
-
|
|
359
|
-
@plugin_configuration.tests.each do |test_info|
|
|
360
|
-
if testcase == nil or test_info["testcase"] == testcase
|
|
361
|
-
log_requires(:test) do
|
|
362
|
-
require test_info["path"]
|
|
363
|
-
end
|
|
364
|
-
suite << eval(test_info["testcase"]).suite
|
|
365
|
-
end
|
|
366
|
-
end
|
|
367
|
-
|
|
368
|
-
require 'test/unit/ui/console/testrunner'
|
|
369
|
-
begin
|
|
370
|
-
Test::Unit::UI::Console::TestRunner.new(suite).start
|
|
371
|
-
rescue Object => e
|
|
372
|
-
puts e
|
|
373
|
-
puts e.message
|
|
374
|
-
puts e.backtrace
|
|
375
|
-
end
|
|
376
|
-
end
|
|
377
|
-
end
|
|
378
|
-
|
|
379
|
-
# Load and run specs for the plugin
|
|
380
|
-
def spec
|
|
381
|
-
puts "running specs"
|
|
382
|
-
end
|
|
383
|
-
end
|
|
384
|
-
end
|