redcar 0.3.1dev → 0.3.2dev
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/config/default.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
#### Properties: Core configuration file - Version: 1.0
|
2
|
-
properties: ~
|
3
|
-
"|":
|
4
|
-
- config: ''
|
5
|
-
"|":
|
6
|
-
- log_file: "redcar.log"
|
7
|
-
- log_level: 0
|
8
|
-
- log_name: REDCAR
|
9
|
-
- plugin_path: "plugins"
|
10
|
-
- product_name: "Redcar"
|
11
|
-
- version: ''
|
12
|
-
"|":
|
13
|
-
- major: 0
|
14
|
-
- minor: 1
|
15
|
-
- release: 0
|
data/lib/freebase2/README.txt
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
FreeBASE 2.0
|
2
|
-
by Daniel Lucraft, based on FreeBASE 1.0 by Rich Kilmer
|
3
|
-
http://www.daniellucraft.com/blog
|
4
|
-
|
5
|
-
== DESCRIPTION:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
== FEATURES/PROBLEMS:
|
10
|
-
|
11
|
-
|
12
|
-
== SYNOPSIS:
|
13
|
-
|
14
|
-
FIX (code sample
|
15
|
-
|
16
|
-
== REQUIREMENTS:
|
17
|
-
|
18
|
-
* Ruby
|
19
|
-
|
20
|
-
== INSTALL:
|
21
|
-
|
22
|
-
* sudo gem install freebase2 (NOT YET)
|
23
|
-
|
24
|
-
== LICENSE:
|
25
|
-
|
26
|
-
(The MIT License)
|
27
|
-
|
28
|
-
Copyright (c) 2007 FIX
|
29
|
-
|
30
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
31
|
-
a copy of this software and associated documentation files (the
|
32
|
-
'Software'), to deal in the Software without restriction, including
|
33
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
34
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
35
|
-
permit persons to whom the Software is furnished to do so, subject to
|
36
|
-
the following conditions:
|
37
|
-
|
38
|
-
The above copyright notice and this permission notice shall be
|
39
|
-
included in all copies or substantial portions of the Software.
|
40
|
-
|
41
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
42
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
43
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
44
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
45
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
46
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
47
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,15 +0,0 @@
|
|
1
|
-
#### Properties: Core configuration file - Version: 1.0
|
2
|
-
properties: ~
|
3
|
-
"|":
|
4
|
-
- config: ''
|
5
|
-
"|":
|
6
|
-
- log_file: "freebase.log"
|
7
|
-
- log_level: 2
|
8
|
-
- log_name: FREEBASE
|
9
|
-
- plugin_path: "../plugins"
|
10
|
-
- product_name: "Freebase Example Application"
|
11
|
-
- version: ''
|
12
|
-
"|":
|
13
|
-
- major: 1
|
14
|
-
- minor: 2
|
15
|
-
- release: 0
|
@@ -1,42 +0,0 @@
|
|
1
|
-
require 'rbconfig'
|
2
|
-
require 'find'
|
3
|
-
require 'ftools'
|
4
|
-
|
5
|
-
Dir.chdir ".." if Dir.pwd =~ /bin.?$/
|
6
|
-
|
7
|
-
include Config
|
8
|
-
|
9
|
-
$srcdir = CONFIG["srcdir"]
|
10
|
-
$version = CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
|
11
|
-
$libdir = File.join(CONFIG["libdir"], "ruby", $version)
|
12
|
-
$archdir = File.join($libdir, CONFIG["arch"])
|
13
|
-
$site_libdir = $:.find {|x| x =~ /site_ruby$/}
|
14
|
-
if !$site_libdir
|
15
|
-
$site_libdir = File.join($libdir, "site_ruby")
|
16
|
-
elsif $site_libdir !~ Regexp.quote($version)
|
17
|
-
$site_libdir = File.join($site_libdir, $version)
|
18
|
-
end
|
19
|
-
|
20
|
-
def install_rb(srcdir = nil)
|
21
|
-
libdir = "lib"
|
22
|
-
libdir = File.join(srcdir, libdir) if srcdir
|
23
|
-
path = []
|
24
|
-
dir = []
|
25
|
-
Find.find(libdir) do |f|
|
26
|
-
next unless FileTest.file?(f)
|
27
|
-
next if (f = f[libdir.length+1..-1]) == nil
|
28
|
-
next if (/CVS$/ =~ File.dirname(f))
|
29
|
-
path.push f
|
30
|
-
dir |= [File.dirname(f)]
|
31
|
-
end
|
32
|
-
for f in dir
|
33
|
-
next if f == "."
|
34
|
-
next if f == "CVS"
|
35
|
-
File::makedirs(File.join($site_libdir, f))
|
36
|
-
end
|
37
|
-
for f in path
|
38
|
-
File::install(File.join("lib", f), File.join($site_libdir, f), 0644, true)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
install_rb
|
data/lib/freebase2/bin/run.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
$FREEBASE_APPLICATION = "freebase"
|
2
|
-
|
3
|
-
$:.unshift "../lib"
|
4
|
-
|
5
|
-
require 'rbconfig'
|
6
|
-
|
7
|
-
module FreeBASE
|
8
|
-
module Example
|
9
|
-
class Bootstrap
|
10
|
-
#version information
|
11
|
-
VERSION_MAJOR = 1
|
12
|
-
VERSION_MINOR = 2
|
13
|
-
VERSION_RELEASE = 0
|
14
|
-
|
15
|
-
##
|
16
|
-
# Start up the FreeBASE and block until shut down event is received
|
17
|
-
#
|
18
|
-
# dir:: [String] The directory which holds the properties.yaml and/or default.yaml
|
19
|
-
#
|
20
|
-
def self.startup(dir)
|
21
|
-
|
22
|
-
require 'freebase/freebase'
|
23
|
-
|
24
|
-
#verify the existence of the supplied directory
|
25
|
-
begin
|
26
|
-
files = Dir.entries(".")
|
27
|
-
rescue
|
28
|
-
raise "Could not locate directory '.'"
|
29
|
-
end
|
30
|
-
|
31
|
-
#make sure that either freebase.yaml exists or default.yaml
|
32
|
-
unless files.include?("freebase.yaml")
|
33
|
-
raise "Could not locate default.yaml in #{dir}" unless files.include?("default.yaml")
|
34
|
-
end
|
35
|
-
|
36
|
-
#This method will not return until FreeBASE is closed (shut down)
|
37
|
-
FreeBASE::Core.startup("freebase.yaml", "default.yaml")
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
if $0==__FILE__
|
44
|
-
baseDir = '.'
|
45
|
-
baseDir = ARGV[0] if ARGV.size > 0
|
46
|
-
FreeBASE::Example::Bootstrap.startup(baseDir)
|
47
|
-
end
|
48
|
-
|
@@ -1,535 +0,0 @@
|
|
1
|
-
# Purpose: Configuration classes for FreeBASE
|
2
|
-
#
|
3
|
-
# Authors: Rich Kilmer <rich@infoether.com>
|
4
|
-
# Contributors:
|
5
|
-
#
|
6
|
-
# This file is part of the FreeRIDE project
|
7
|
-
#
|
8
|
-
# This application is free software; you can redistribute it and/or
|
9
|
-
# modify it under the terms of the Ruby license defined in the
|
10
|
-
# COPYING file.
|
11
|
-
#
|
12
|
-
# Copyright (c) 2001 Rich Kilmer. All rights reserved.
|
13
|
-
#
|
14
|
-
|
15
|
-
module FreeBASE
|
16
|
-
|
17
|
-
##
|
18
|
-
# Main configuration control class. Responsible for processing
|
19
|
-
# subsystem/plugins from supplied paths, resolving dependencies,
|
20
|
-
# and providing plugin lifecycle (load/start/stop/unload).
|
21
|
-
#
|
22
|
-
class Configuration
|
23
|
-
|
24
|
-
attr_reader :plugins, :core, :plugin_paths
|
25
|
-
|
26
|
-
##
|
27
|
-
# Creates a configuration class from for the given FreeBASE core.
|
28
|
-
# Reads in the configuration files and resolves dependencies
|
29
|
-
#
|
30
|
-
# core:: [FreeBASE::Core] The core object.
|
31
|
-
# plugin_paths:: [String] A semicolon separated list of directories to search for plugins
|
32
|
-
#
|
33
|
-
def initialize(core, plugin_paths)
|
34
|
-
@core = core
|
35
|
-
@plugin_paths = plugin_paths
|
36
|
-
@plugins = {}
|
37
|
-
YAMLConfigurationReader.new(self)
|
38
|
-
resolve_dependencies
|
39
|
-
end
|
40
|
-
|
41
|
-
##
|
42
|
-
# Regsiters a config object (subsystem or plugin) with FreeBASE
|
43
|
-
#
|
44
|
-
# config:: [FreeBASE::SubsystemConfiguration | FreeBASE::PluginConfiguration] The configuration object
|
45
|
-
#
|
46
|
-
def register(config, base_path)
|
47
|
-
config.configuration = self
|
48
|
-
config.base_path = base_path
|
49
|
-
if File.absolute_path?(base_path)
|
50
|
-
config.full_base_path = base_path
|
51
|
-
else
|
52
|
-
config.full_base_path = File.expand_path(File.join($FR_CODEBASE, base_path))
|
53
|
-
end
|
54
|
-
if config.kind_of? SubsystemConfiguration
|
55
|
-
config.each_plugin {|plugin_config| register(plugin_config, base_path)}
|
56
|
-
return
|
57
|
-
end
|
58
|
-
@plugins[config.name] = config if config.autoload?
|
59
|
-
end
|
60
|
-
|
61
|
-
##
|
62
|
-
# Requires all the plugins based on the load list calculated by the dependency resolution
|
63
|
-
#
|
64
|
-
def require_plugins
|
65
|
-
num = 0
|
66
|
-
if @load_list.size == 0
|
67
|
-
puts "[FreeBASE] no plugins to require" if ARGV.include?("--debug-freebase")
|
68
|
-
exit
|
69
|
-
end
|
70
|
-
while num < @load_list.size
|
71
|
-
plugin = @load_list[num]
|
72
|
-
plugin.instance.require_files
|
73
|
-
num += 1
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
##
|
78
|
-
# Loads all the plugins based on the load list calculated by the dependency resolution
|
79
|
-
#
|
80
|
-
def load_plugins
|
81
|
-
num = 0
|
82
|
-
if @load_list.size == 0
|
83
|
-
puts "[FreeBASE] no plugins to load" if ARGV.include?("--debug-freebase")
|
84
|
-
exit
|
85
|
-
end
|
86
|
-
while num < @load_list.size
|
87
|
-
plugin = @load_list[num]
|
88
|
-
plugin.instance.load
|
89
|
-
if plugin.instance.state != LOADED
|
90
|
-
puts "[FreeBASE] failed to load: #{plugin.name}"
|
91
|
-
fail_load_dependencies(plugin)
|
92
|
-
fail_start_dependencies(plugin)
|
93
|
-
else
|
94
|
-
puts "[FreeBASE] loaded: #{plugin.name}" if ARGV.include?("--debug-freebase")
|
95
|
-
num += 1
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
##
|
101
|
-
# Starts all the plugins based on the start list calculated by the dependency resolution
|
102
|
-
#
|
103
|
-
def start_plugins
|
104
|
-
num = 0
|
105
|
-
while num < @start_list.size
|
106
|
-
plugin = @start_list[num]
|
107
|
-
plugin.instance.start
|
108
|
-
if plugin.instance.state != RUNNING
|
109
|
-
puts "[FreeBASE] failed to start: #{plugin.name}"
|
110
|
-
fail_start_dependencies(plugin)
|
111
|
-
else
|
112
|
-
puts "[FreeBASE] started: #{plugin.name}" if ARGV.include?("--debug-freebase")
|
113
|
-
num += 1
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
##
|
119
|
-
# Stops all the plugins based on reversing the start list calculated by the dependency resolution
|
120
|
-
#
|
121
|
-
def stop_plugins
|
122
|
-
@start_list.reverse.each do |plugin|
|
123
|
-
plugin.instance.stop
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
##
|
128
|
-
# Unloads all the plugins based on by reversing the load list calculated by the dependency resolution
|
129
|
-
#
|
130
|
-
def unload_plugins
|
131
|
-
@load_list.reverse.each do |plugin|
|
132
|
-
plugin.instance.unload
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
private
|
137
|
-
|
138
|
-
def fail_load_dependencies(plugin)
|
139
|
-
@load_list.delete(plugin)
|
140
|
-
plugin.rev_load_graph.each { |other| fail_load_dependencies(other) }
|
141
|
-
end
|
142
|
-
|
143
|
-
def fail_start_dependencies(plugin)
|
144
|
-
@start_list.delete(plugin)
|
145
|
-
plugin.rev_start_graph.each { |other| fail_start_dependencies(other) }
|
146
|
-
end
|
147
|
-
|
148
|
-
def resolve_dependencies
|
149
|
-
# graph dependencies
|
150
|
-
@plugins.each_value do |plugin|
|
151
|
-
plugin.build_graph
|
152
|
-
end
|
153
|
-
# compute load and start levels
|
154
|
-
@plugins.each_value do |plugin|
|
155
|
-
plugin.compute_levels
|
156
|
-
end
|
157
|
-
# build load list
|
158
|
-
@load_list = @plugins.values
|
159
|
-
@load_list.sort! do |a, b|
|
160
|
-
a.load_level<=>b.load_level
|
161
|
-
end
|
162
|
-
# build start list
|
163
|
-
@start_list = @plugins.values
|
164
|
-
@start_list.sort! do |a, b|
|
165
|
-
a.start_level<=>b.start_level
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
|
-
def debug
|
170
|
-
@plugins.each do |name, plugin|
|
171
|
-
puts "Plugin: #{name} Load Level: #{plugin.load_level} Dep: #{plugin.fwd_load_graph.collect {|p| p.name}.join(', ')}"
|
172
|
-
end
|
173
|
-
puts "_"*30
|
174
|
-
@load_list.each {|plugin| puts "#{plugin.load_level}: #{plugin.name}"}
|
175
|
-
puts "_"*30
|
176
|
-
puts "_"*30
|
177
|
-
@plugins.each do |name, plugin|
|
178
|
-
puts "Plugin: #{name} Start Level: #{plugin.start_level} Dep: #{plugin.fwd_start_graph.collect {|p| p.name}.join(', ')}"
|
179
|
-
end
|
180
|
-
puts "_"*30
|
181
|
-
@start_list.each {|plugin| puts "#{plugin.start_level}: #{plugin.name}"}
|
182
|
-
exit
|
183
|
-
end
|
184
|
-
|
185
|
-
end
|
186
|
-
|
187
|
-
##
|
188
|
-
# Represents a subsystem (set of plugins) in FreeBASE. It creates
|
189
|
-
# a plugin named the subsystem name which is dependent on all plugins
|
190
|
-
# in the subsystem. This allows another plugin to be dependent on
|
191
|
-
# all the plugins in the subsystem by simply being dependent on the
|
192
|
-
# plugin named after the subsystem
|
193
|
-
#
|
194
|
-
class SubsystemConfiguration
|
195
|
-
attr_accessor :name, :version, :base_path, :full_base_path
|
196
|
-
attr_reader :plugins
|
197
|
-
attr_reader :configuration
|
198
|
-
|
199
|
-
##
|
200
|
-
# Orders the properties to export when this object is serialized
|
201
|
-
# to YAML
|
202
|
-
#
|
203
|
-
# return:: [Array] List of properties to export...used by YAML
|
204
|
-
#
|
205
|
-
def to_yaml_properties
|
206
|
-
['@name', '@version', '@plugins']
|
207
|
-
end
|
208
|
-
|
209
|
-
##
|
210
|
-
# Constructs a SubsystemConfiguration object. May optionally
|
211
|
-
# supply block with yielded instance of 'self' to set properties.
|
212
|
-
#
|
213
|
-
def initialize
|
214
|
-
@plugins = []
|
215
|
-
yield self if block_given?
|
216
|
-
end
|
217
|
-
|
218
|
-
##
|
219
|
-
# Set the configuration instance. Also builds the plugin which represents
|
220
|
-
# the subsystem. This should be called only after all plugins configurations
|
221
|
-
# have beed processed and added to this subsystem.
|
222
|
-
#
|
223
|
-
# configuration:: [FreeBASE::Configuration] The FreeBASE configuration manager
|
224
|
-
#
|
225
|
-
def configuration=(configuration)
|
226
|
-
@configuration = configuration
|
227
|
-
each_plugin {|plugin| plugin.configuration = configuration}
|
228
|
-
#add plugin to represent the subsystem itself
|
229
|
-
add_plugin do |plugin|
|
230
|
-
plugin.name = @name
|
231
|
-
plugin.version = @version
|
232
|
-
plugin.require_path = nil #"freebase/plugin"
|
233
|
-
plugin.startup_module = "FreeBASE::SubsystemPlugin"
|
234
|
-
plugin.autoload = true
|
235
|
-
@plugins.each do |other|
|
236
|
-
plugin.add_load_dependency(other.name)
|
237
|
-
end
|
238
|
-
@plugins.each do |other|
|
239
|
-
plugin.add_start_dependency(other.name)
|
240
|
-
end
|
241
|
-
end
|
242
|
-
end
|
243
|
-
|
244
|
-
##
|
245
|
-
# Returns a newly created plugin accepting an optional block
|
246
|
-
# which can be used to set attributes of the plugin
|
247
|
-
#
|
248
|
-
# &block:: [Block] Accepts the yielded plugin as the parameter
|
249
|
-
def add_plugin(&block)
|
250
|
-
plugin = PluginConfiguration.new(&block)
|
251
|
-
plugin.configuration = @configuration
|
252
|
-
@plugins << plugin
|
253
|
-
plugin
|
254
|
-
end
|
255
|
-
|
256
|
-
##
|
257
|
-
# Iterates over the list of available plugins yielding each one
|
258
|
-
#
|
259
|
-
def each_plugin
|
260
|
-
@plugins.each {|plugin| yield plugin}
|
261
|
-
end
|
262
|
-
|
263
|
-
end
|
264
|
-
|
265
|
-
##
|
266
|
-
# This class holds the metadata about a plugin. It is created
|
267
|
-
# by a Reader (see reader.rb) from either an XML file or a YAML
|
268
|
-
# load operation.
|
269
|
-
#
|
270
|
-
class PluginConfiguration
|
271
|
-
|
272
|
-
##
|
273
|
-
# Raised if there is a circular dependency in plugins during load/start
|
274
|
-
# holds a reversing list of plugins to be able to show the cycle.
|
275
|
-
#
|
276
|
-
class CircularDependency < RuntimeError
|
277
|
-
attr_reader :plugin_list
|
278
|
-
##
|
279
|
-
# Constructs an exception with the supplied elements
|
280
|
-
#
|
281
|
-
# dep_type:: [String] Ether "load" or "start"
|
282
|
-
# start_plugin:: [FreeBASE::PluginConfiguration] The plugin that the cycle was caught in
|
283
|
-
def initialize(dep_type, start_plugin)
|
284
|
-
@dep_type = dep_type.capitalize
|
285
|
-
@plugin_list = [start_plugin]
|
286
|
-
end
|
287
|
-
|
288
|
-
##
|
289
|
-
# Outputs the cycle:
|
290
|
-
# PluginA -> PluginB -> PluginC -> PluginA
|
291
|
-
#
|
292
|
-
def to_s
|
293
|
-
cycle = (@plugin_list.collect {|plugin| plugin.name}).reverse.join("->")
|
294
|
-
"\n#{@dep_type} Circular Plugin Dependency: #{cycle}"
|
295
|
-
end
|
296
|
-
end
|
297
|
-
|
298
|
-
attr_accessor(:name, :version, :require_path, :dependencies_path,
|
299
|
-
:properties_path, :startup_module,
|
300
|
-
:resource_path, :base_path,
|
301
|
-
:full_base_path,
|
302
|
-
:description, :author, :tests, :test_module)
|
303
|
-
attr_writer :autoload
|
304
|
-
attr_reader :configuration
|
305
|
-
attr_reader :fwd_load_graph, :fwd_start_graph
|
306
|
-
attr_reader :rev_load_graph, :rev_start_graph
|
307
|
-
attr_reader :load_level, :start_level
|
308
|
-
|
309
|
-
def dependencies_met
|
310
|
-
if @dependencies_met == nil
|
311
|
-
true
|
312
|
-
else
|
313
|
-
@dependencies_met
|
314
|
-
end
|
315
|
-
end
|
316
|
-
|
317
|
-
alias :dependencies_met? :dependencies_met
|
318
|
-
|
319
|
-
##
|
320
|
-
# Contructs a plugin configuration. Yields instance of self for initializing instance data.
|
321
|
-
#
|
322
|
-
def initialize
|
323
|
-
yield self if block_given?
|
324
|
-
@dependencies_met = true
|
325
|
-
end
|
326
|
-
|
327
|
-
##
|
328
|
-
# Retrieve the base path in the in the user dir (USERPROFILE or HOME)
|
329
|
-
#
|
330
|
-
def base_user_path
|
331
|
-
filename = DefaultPropertiesReader.user_filename(File.join(@base_path,"foo.bar"))
|
332
|
-
unless @base_user_path
|
333
|
-
if filename
|
334
|
-
require 'fileutils'
|
335
|
-
FileUtils.mkdir_p(File.dirname(filename))
|
336
|
-
@base_user_path = File.dirname(filename)
|
337
|
-
end
|
338
|
-
end
|
339
|
-
@base_user_path
|
340
|
-
end
|
341
|
-
|
342
|
-
##
|
343
|
-
# Retrieve the local user file (in USERPROFILE or HOME) of the supplied filespec.
|
344
|
-
# This method is usefull if a plugin needs to create a file
|
345
|
-
#
|
346
|
-
def user_filename(filespec, ensure_dir=false)
|
347
|
-
filename = DefaultPropertiesReader.user_filename(filespec)
|
348
|
-
if ensure_dir && filename
|
349
|
-
require 'fileutils'
|
350
|
-
FileUtils.mkdir_p(File.dirname(filename))
|
351
|
-
end
|
352
|
-
end
|
353
|
-
|
354
|
-
##
|
355
|
-
# Orders the properties to export when this object is serialized
|
356
|
-
# to YAML
|
357
|
-
#
|
358
|
-
# return:: [Array] List of properties to export...used by YAML
|
359
|
-
#
|
360
|
-
def to_yaml_properties
|
361
|
-
['@name', '@version', '@autoload', '@require_path',
|
362
|
-
'@startup_module', '@properties_path',
|
363
|
-
'@resource_path', '@load_dependencies', '@start_dependencies']
|
364
|
-
end
|
365
|
-
|
366
|
-
##
|
367
|
-
# Gets (and possibly builds if first time called) the FreeBASE::Plugin object
|
368
|
-
#
|
369
|
-
# return:: [FreeBASE::Plugin] The plugin controller for this configuration
|
370
|
-
#
|
371
|
-
def instance
|
372
|
-
unless @plugin_instance
|
373
|
-
@plugin_instance = FreeBASE::Plugin.new(@configuration.core, self)
|
374
|
-
end
|
375
|
-
@plugin_instance
|
376
|
-
end
|
377
|
-
|
378
|
-
##
|
379
|
-
# Builds a graph of dependencies (both forward and reverse) which is used to
|
380
|
-
# detect cycles and block loading/starting of plugins whose dependent plugin
|
381
|
-
# fails
|
382
|
-
#
|
383
|
-
def build_graph
|
384
|
-
each_load_dependency do |other, version|
|
385
|
-
other_plugin = @configuration.plugins[other]
|
386
|
-
unless other_plugin
|
387
|
-
puts "#{@name} has a load dependency not found: #{other}"
|
388
|
-
@dependencies_met = false
|
389
|
-
return false
|
390
|
-
end
|
391
|
-
@fwd_load_graph << other_plugin
|
392
|
-
other_plugin.rev_load_graph << self
|
393
|
-
end
|
394
|
-
each_start_dependency do |other, version|
|
395
|
-
other_plugin = @configuration.plugins[other]
|
396
|
-
unless other_plugin
|
397
|
-
puts "#{@name} has a start dependency not found: #{other}"
|
398
|
-
@dependencies_met = false
|
399
|
-
return false
|
400
|
-
end
|
401
|
-
return false unless other_plugin
|
402
|
-
@fwd_start_graph << other_plugin
|
403
|
-
other_plugin.rev_start_graph << self
|
404
|
-
end
|
405
|
-
return true
|
406
|
-
end
|
407
|
-
|
408
|
-
##
|
409
|
-
# Computes the load level and start level for this plugin configuration
|
410
|
-
#
|
411
|
-
def compute_levels
|
412
|
-
get_load_level
|
413
|
-
get_start_level
|
414
|
-
end
|
415
|
-
|
416
|
-
##
|
417
|
-
# Returns the load level for this plugin configuration. This will always
|
418
|
-
# be one higher than the highest level plugin which this plugin is dependent
|
419
|
-
# on. This method may raise a CircularDependency exception if on is detected.
|
420
|
-
#
|
421
|
-
# return:: [Integer] The load level
|
422
|
-
#
|
423
|
-
def get_load_level
|
424
|
-
raise (CircularDependency.new("Load", self)) if @computing_levels
|
425
|
-
return @load_level if @load_level
|
426
|
-
@computing_levels = true
|
427
|
-
@load_level = 0
|
428
|
-
@fwd_load_graph.each do |other|
|
429
|
-
begin
|
430
|
-
olevel = other.get_load_level + 1
|
431
|
-
rescue CircularDependency => cycle
|
432
|
-
cycle.plugin_list << self
|
433
|
-
raise
|
434
|
-
end
|
435
|
-
@load_level = olevel unless @load_level > olevel
|
436
|
-
end
|
437
|
-
@computing_levels = false
|
438
|
-
return @load_level
|
439
|
-
end
|
440
|
-
|
441
|
-
##
|
442
|
-
# Returns the start level for this plugin configuration. This will always
|
443
|
-
# be one higher than the highest level plugin which this plugin is dependent
|
444
|
-
# on. This method may raise a CircularDependency exception if on is detected.
|
445
|
-
#
|
446
|
-
# return:: [Integer] The start level
|
447
|
-
#
|
448
|
-
def get_start_level
|
449
|
-
raise (CircularDependency.new("Start", self)) if @computing_levels
|
450
|
-
return @start_level if @start_level
|
451
|
-
@computing_levels = true
|
452
|
-
@start_level = 0
|
453
|
-
@fwd_start_graph.each do |other|
|
454
|
-
begin
|
455
|
-
olevel = other.get_start_level + 1
|
456
|
-
rescue CircularDependency => cycle
|
457
|
-
cycle.plugin_list << self
|
458
|
-
raise
|
459
|
-
end
|
460
|
-
@start_level = olevel if @start_level < olevel
|
461
|
-
end
|
462
|
-
@computing_levels = false
|
463
|
-
return @start_level
|
464
|
-
end
|
465
|
-
|
466
|
-
##
|
467
|
-
# Sets the configuration controller for this plugin config.
|
468
|
-
#
|
469
|
-
# configuration:: [FreeBASE::Configuration] The configuration controller instance
|
470
|
-
#
|
471
|
-
def configuration=(configuration)
|
472
|
-
@fwd_load_graph = []
|
473
|
-
@fwd_start_graph = []
|
474
|
-
@rev_load_graph = []
|
475
|
-
@rev_start_graph = []
|
476
|
-
@configuration = configuration
|
477
|
-
end
|
478
|
-
|
479
|
-
##
|
480
|
-
# Returns whether this plugin should automatically load and start
|
481
|
-
#
|
482
|
-
# return:: [Boolean] True if this plugin should load and start, otherwise false
|
483
|
-
#
|
484
|
-
def autoload?
|
485
|
-
@autoload
|
486
|
-
end
|
487
|
-
|
488
|
-
##
|
489
|
-
# Returns instance of self
|
490
|
-
#
|
491
|
-
def each_plugin
|
492
|
-
yield self
|
493
|
-
end
|
494
|
-
|
495
|
-
##
|
496
|
-
# Add a load dependency for this plugin
|
497
|
-
#
|
498
|
-
# plugin:: [String] The plugin name that this plugin is dependent on to load
|
499
|
-
# version:: [String="*"] The version of the plugin that this plugin is dependent on (* for any)
|
500
|
-
#
|
501
|
-
def add_load_dependency(plugin, version="*")
|
502
|
-
@load_dependencies ||= {}
|
503
|
-
@load_dependencies[plugin]=version
|
504
|
-
end
|
505
|
-
|
506
|
-
##
|
507
|
-
# Add a start dependency for this plugin
|
508
|
-
#
|
509
|
-
# plugin:: [String] The plugin name that this plugin is dependent on to start
|
510
|
-
# version:: [String="*"] The version of the plugin that this plugin is dependent on (* for any)
|
511
|
-
#
|
512
|
-
def add_start_dependency(plugin, version="*")
|
513
|
-
@start_dependencies ||= {}
|
514
|
-
@start_dependencies[plugin]=version
|
515
|
-
end
|
516
|
-
|
517
|
-
##
|
518
|
-
# Iterates over each load dependency yielding a |plugin, version| for each iteration.
|
519
|
-
#
|
520
|
-
def each_load_dependency(&block)
|
521
|
-
return unless @load_dependencies
|
522
|
-
@load_dependencies.each(&block)
|
523
|
-
end
|
524
|
-
|
525
|
-
##
|
526
|
-
# Iterates over each start dependency yielding a |plugin, version| for each iteration.
|
527
|
-
#
|
528
|
-
def each_start_dependency(&block)
|
529
|
-
return unless @start_dependencies
|
530
|
-
@start_dependencies.each(&block)
|
531
|
-
end
|
532
|
-
end
|
533
|
-
end
|
534
|
-
|
535
|
-
|