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
@@ -1,47 +0,0 @@
|
|
1
|
-
|
2
|
-
module Logging
|
3
|
-
module Layouts
|
4
|
-
|
5
|
-
# Accessor / Factory for the Basic layout.
|
6
|
-
#
|
7
|
-
def basic( *args )
|
8
|
-
return ::Logging::Layouts::Basic if args.empty?
|
9
|
-
::Logging::Layouts::Basic.new(*args)
|
10
|
-
end
|
11
|
-
|
12
|
-
# Accessor / Factory for the Pattern layout.
|
13
|
-
#
|
14
|
-
def pattern( *args )
|
15
|
-
return ::Logging::Layouts::Pattern if args.empty?
|
16
|
-
::Logging::Layouts::Pattern.new(*args)
|
17
|
-
end
|
18
|
-
|
19
|
-
# Accessor for the Parseable layout.
|
20
|
-
#
|
21
|
-
def parseable
|
22
|
-
::Logging::Layouts::Parseable
|
23
|
-
end
|
24
|
-
|
25
|
-
# Factory for the Parseable layout using JSON formatting.
|
26
|
-
#
|
27
|
-
def json( *args )
|
28
|
-
::Logging::Layouts::Parseable.json(*args)
|
29
|
-
end
|
30
|
-
|
31
|
-
# Factory for the Parseable layout using YAML formatting.
|
32
|
-
#
|
33
|
-
def yaml( *args )
|
34
|
-
::Logging::Layouts::Parseable.yaml(*args)
|
35
|
-
end
|
36
|
-
|
37
|
-
extend self
|
38
|
-
end # module Layouts
|
39
|
-
end # module Logging
|
40
|
-
|
41
|
-
|
42
|
-
%w[basic parseable pattern].
|
43
|
-
each do |fn|
|
44
|
-
require ::Logging.libpath('logging', 'layouts', fn)
|
45
|
-
end
|
46
|
-
|
47
|
-
# EOF
|
@@ -1,32 +0,0 @@
|
|
1
|
-
|
2
|
-
module Logging::Layouts
|
3
|
-
|
4
|
-
# The +Basic+ layout class provides methods for simple formatting of log
|
5
|
-
# events. The resulting string follows the format below.
|
6
|
-
#
|
7
|
-
# LEVEL LoggerName : log message
|
8
|
-
#
|
9
|
-
# _LEVEL_ is the log level of the event. _LoggerName_ is the name of the
|
10
|
-
# logger that generated the event. <em>log message</em> is the message
|
11
|
-
# or object that was passed to the logger. If multiple message or objects
|
12
|
-
# were passed to the logger then each will be printed on its own line with
|
13
|
-
# the format show above.
|
14
|
-
#
|
15
|
-
class Basic < ::Logging::Layout
|
16
|
-
|
17
|
-
# call-seq:
|
18
|
-
# format( event )
|
19
|
-
#
|
20
|
-
# Returns a string representation of the given loggging _event_. See the
|
21
|
-
# class documentation for details about the formatting used.
|
22
|
-
#
|
23
|
-
def format( event )
|
24
|
-
obj = format_obj(event.data)
|
25
|
-
sprintf("%*s %s : %s\n", ::Logging::MAX_LEVEL_LENGTH,
|
26
|
-
::Logging::LNAMES[event.level], event.logger, obj)
|
27
|
-
end
|
28
|
-
|
29
|
-
end # class Basic
|
30
|
-
end # module Logging::Layouts
|
31
|
-
|
32
|
-
# EOF
|
@@ -1,211 +0,0 @@
|
|
1
|
-
|
2
|
-
module Logging::Layouts
|
3
|
-
|
4
|
-
# This layout will produce parseable log output in either JSON or YAML
|
5
|
-
# format. This makes it much easier for machines to parse log files and
|
6
|
-
# perform analysis on those logs.
|
7
|
-
#
|
8
|
-
# The information about the log event can be configured when the layout is
|
9
|
-
# created. Any or all of the following labels can be set as the _items_ to
|
10
|
-
# log:
|
11
|
-
#
|
12
|
-
# 'logger' Used to output the name of the logger that generated the
|
13
|
-
# log event.
|
14
|
-
# 'timestamp' Used to output the timestamp of the log event.
|
15
|
-
# 'level' Used to output the level of the log event.
|
16
|
-
# 'message' Used to output the application supplied message
|
17
|
-
# associated with the log event.
|
18
|
-
# 'file' Used to output the file name where the logging request
|
19
|
-
# was issued.
|
20
|
-
# 'line' Used to output the line number where the logging request
|
21
|
-
# was issued.
|
22
|
-
# 'method' Used to output the method name where the logging request
|
23
|
-
# was issued.
|
24
|
-
# 'pid' Used to output the process ID of the currently running
|
25
|
-
# program.
|
26
|
-
# 'millis' Used to output the number of milliseconds elapsed from
|
27
|
-
# the construction of the Layout until creation of the log
|
28
|
-
# event.
|
29
|
-
# 'thread_id' Used to output the object ID of the thread that generated
|
30
|
-
# the log event.
|
31
|
-
# 'thread' Used to output the name of the thread that generated the
|
32
|
-
# log event. Name can be specified using Thread.current[:name]
|
33
|
-
# notation. Output empty string if name not specified. This
|
34
|
-
# option helps to create more human readable output for
|
35
|
-
# multithread application logs.
|
36
|
-
#
|
37
|
-
# These items are supplied to the layout as an array of strings. The items
|
38
|
-
# 'file', 'line', and 'method' will only work if the Logger generating the
|
39
|
-
# events is configured to generate tracing information. If this is not the
|
40
|
-
# case these fields will always be empty.
|
41
|
-
#
|
42
|
-
# When configured to output log events in YAML format, each log message
|
43
|
-
# will be formatted as a hash in it's own YAML document. The hash keys are
|
44
|
-
# the name of the item, and the value is what you would expect it to be.
|
45
|
-
# Therefore, for the default set of times log message would appear as
|
46
|
-
# follows:
|
47
|
-
#
|
48
|
-
# ---
|
49
|
-
# timestamp: 2009-04-17 16:15:42
|
50
|
-
# level: INFO
|
51
|
-
# logger: Foo::Bar
|
52
|
-
# message: this is a log message
|
53
|
-
# ---
|
54
|
-
# timestamp: 2009-04-17 16:15:43
|
55
|
-
# level: ERROR
|
56
|
-
# logger: Foo
|
57
|
-
# message: <RuntimeError> Oooops!!
|
58
|
-
#
|
59
|
-
# The output order of the fields is not guaranteed to be the same as the
|
60
|
-
# order specified in the _items_ list. This is because Ruby hashes are not
|
61
|
-
# ordered by default (unless your running this in Ruby 1.9).
|
62
|
-
#
|
63
|
-
# When configured to output log events in JSON format, each log message
|
64
|
-
# will be formatted as an object (in the JSON sense of the work) on it's
|
65
|
-
# own line in the log output. Therefore, to parse the output you must read
|
66
|
-
# it line by line and parse the individual objects. Taking the same
|
67
|
-
# example above the JSON output would be:
|
68
|
-
#
|
69
|
-
# {"timestamp":"2009-04-17 16:15:42","level":"INFO","logger":"Foo::Bar","message":"this is a log message"}
|
70
|
-
# {"timestamp":"2009-04-17 16:15:43","level":"ERROR","logger":"Foo","message":"<RuntimeError> Oooops!!"}
|
71
|
-
#
|
72
|
-
# The output order of the fields is guaranteed to be the same as the order
|
73
|
-
# specified in the _items_ list.
|
74
|
-
#
|
75
|
-
class Parseable < ::Logging::Layout
|
76
|
-
|
77
|
-
# :stopdoc:
|
78
|
-
# Arguments to sprintf keyed to directive letters
|
79
|
-
DIRECTIVE_TABLE = {
|
80
|
-
'logger' => 'event.logger',
|
81
|
-
'timestamp' => 'event.time.strftime(Pattern::ISO8601)',
|
82
|
-
'level' => '::Logging::LNAMES[event.level]',
|
83
|
-
'message' => 'format_obj(event.data)',
|
84
|
-
'file' => 'event.file',
|
85
|
-
'line' => 'event.line',
|
86
|
-
'method' => 'event.method',
|
87
|
-
'pid' => 'Process.pid',
|
88
|
-
'millis' => 'Integer((event.time-@created_at)*1000)',
|
89
|
-
'thread_id' => 'Thread.current.object_id',
|
90
|
-
'thread' => 'Thread.current[:name]'
|
91
|
-
}
|
92
|
-
|
93
|
-
# call-seq:
|
94
|
-
# Pattern.create_yaml_format_methods( layout )
|
95
|
-
#
|
96
|
-
# This method will create the +format+ method in the given Parseable
|
97
|
-
# _layout_ based on the configured items for the layout instance.
|
98
|
-
#
|
99
|
-
def self.create_yaml_format_method( layout )
|
100
|
-
code = "undef :format if method_defined? :format\n"
|
101
|
-
code << "def format( event )\nstr = {\n"
|
102
|
-
|
103
|
-
code << layout.items.map {|name|
|
104
|
-
"'#{name}' => #{Parseable::DIRECTIVE_TABLE[name]}"
|
105
|
-
}.join(",\n")
|
106
|
-
code << "\n}.to_yaml\nreturn str\nend\n"
|
107
|
-
|
108
|
-
(class << layout; self end).class_eval(code, __FILE__, __LINE__)
|
109
|
-
end
|
110
|
-
|
111
|
-
# call-seq:
|
112
|
-
# Pattern.create_json_format_methods( layout )
|
113
|
-
#
|
114
|
-
# This method will create the +format+ method in the given Parseable
|
115
|
-
# _layout_ based on the configured items for the layout instance.
|
116
|
-
#
|
117
|
-
def self.create_json_format_method( layout )
|
118
|
-
code = "undef :format if method_defined? :format\n"
|
119
|
-
code << "def format( event )\n\"{"
|
120
|
-
|
121
|
-
args = []
|
122
|
-
code << layout.items.map {|name|
|
123
|
-
args << "format_as_json(#{Parseable::DIRECTIVE_TABLE[name]})"
|
124
|
-
"\\\"#{name}\\\":%s"
|
125
|
-
}.join(',')
|
126
|
-
code << "}\\n\" % [#{args.join(', ')}]\nend"
|
127
|
-
|
128
|
-
(class << layout; self end).class_eval(code, __FILE__, __LINE__)
|
129
|
-
end
|
130
|
-
# :startdoc:
|
131
|
-
|
132
|
-
# call-seq:
|
133
|
-
# Parseable.json( opts )
|
134
|
-
#
|
135
|
-
# Create a new Parseable layout that outputs log events usig JSON style
|
136
|
-
# formatting. See the initializer documentation for available options.
|
137
|
-
#
|
138
|
-
def self.json( opts = {} )
|
139
|
-
opts[:style] = 'json'
|
140
|
-
new(opts)
|
141
|
-
end
|
142
|
-
|
143
|
-
# call-seq:
|
144
|
-
# Parseable.yaml( opts )
|
145
|
-
#
|
146
|
-
# Create a new Parseable layout that outputs log events usig YAML style
|
147
|
-
# formatting. See the initializer documentation for available options.
|
148
|
-
#
|
149
|
-
def self.yaml( opts = {} )
|
150
|
-
opts[:style] = 'yaml'
|
151
|
-
new(opts)
|
152
|
-
end
|
153
|
-
|
154
|
-
# call-seq:
|
155
|
-
# Parseable.new( opts )
|
156
|
-
#
|
157
|
-
# Creates a new Parseable layout using the following options:
|
158
|
-
#
|
159
|
-
# :style => :json or :yaml
|
160
|
-
# :items => %w[timestamp level logger message]
|
161
|
-
#
|
162
|
-
def initialize( opts = {} )
|
163
|
-
super
|
164
|
-
@created_at = Time.now
|
165
|
-
@style = opts.getopt(:style, 'json').to_s.intern
|
166
|
-
self.items = opts.getopt(:items, %w[timestamp level logger message])
|
167
|
-
end
|
168
|
-
|
169
|
-
attr_reader :items
|
170
|
-
|
171
|
-
# call-seq:
|
172
|
-
# layout.items = %w[timestamp level logger message]
|
173
|
-
#
|
174
|
-
# Set the log event items that will be formatted by this layout. These
|
175
|
-
# items, and only these items, will appear in the log output.
|
176
|
-
#
|
177
|
-
def items=( ary )
|
178
|
-
@items = Array(ary).map {|name| name.to_s.downcase}
|
179
|
-
valid = DIRECTIVE_TABLE.keys
|
180
|
-
@items.each do |name|
|
181
|
-
raise ArgumentError, "unknown item - #{name.inspect}" unless valid.include? name
|
182
|
-
end
|
183
|
-
create_format_method
|
184
|
-
end
|
185
|
-
|
186
|
-
|
187
|
-
private
|
188
|
-
|
189
|
-
# Take the given _value_ and format it into a JSON compatible string.
|
190
|
-
#
|
191
|
-
def format_as_json( value )
|
192
|
-
case value
|
193
|
-
when String, Integer, Float; value.inspect
|
194
|
-
when nil; 'null'
|
195
|
-
else value.to_s.inspect end
|
196
|
-
end
|
197
|
-
|
198
|
-
# Call the appropriate class level create format method based on the
|
199
|
-
# style of this parseable layout.
|
200
|
-
#
|
201
|
-
def create_format_method
|
202
|
-
case @style
|
203
|
-
when :json; Parseable.create_json_format_method(self)
|
204
|
-
when :yaml; Parseable.create_yaml_format_method(self)
|
205
|
-
else raise ArgumentError, "unknown format style '#@style'" end
|
206
|
-
end
|
207
|
-
|
208
|
-
end # class Parseable
|
209
|
-
end # module Logging::Layouts
|
210
|
-
|
211
|
-
# EOF
|
@@ -1,311 +0,0 @@
|
|
1
|
-
|
2
|
-
module Logging::Layouts
|
3
|
-
|
4
|
-
# A flexible layout configurable with pattern string.
|
5
|
-
#
|
6
|
-
# The goal of this class is to format a LogEvent and return the results as
|
7
|
-
# a String. The results depend on the conversion pattern.
|
8
|
-
#
|
9
|
-
# The conversion pattern is closely related to the conversion pattern of
|
10
|
-
# the sprintf function. A conversion pattern is composed of literal text
|
11
|
-
# and format control expressions called conversion specifiers.
|
12
|
-
#
|
13
|
-
# You are free to insert any literal text within the conversion pattern.
|
14
|
-
#
|
15
|
-
# Each conversion specifier starts with a percent sign (%) and is followed
|
16
|
-
# by optional format modifiers and a conversion character. The conversion
|
17
|
-
# character specifies the type of data, e.g. logger, level, date, thread
|
18
|
-
# ID. The format modifiers control such things as field width, padding,
|
19
|
-
# left and right justification. The following is a simple example.
|
20
|
-
#
|
21
|
-
# Let the conversion pattern be "%-5l [%c]: %m\n" and assume that the
|
22
|
-
# logging environment was set to use a Pattern layout. Then the statements
|
23
|
-
#
|
24
|
-
# root = Logging.logger[:root]
|
25
|
-
# root.debug("Message 1")
|
26
|
-
# root.warn("Message 2")
|
27
|
-
#
|
28
|
-
# would yield the output
|
29
|
-
#
|
30
|
-
# DEBUG [root]: Message 1
|
31
|
-
# WARN [root]: Message 2
|
32
|
-
#
|
33
|
-
# Note that there is no explicit separator between text and conversion
|
34
|
-
# specifiers. The pattern parser knows when it has reached the end of a
|
35
|
-
# conversion specifier when it reads a conversion character. In the example
|
36
|
-
# above the conversion specifier %-5l means the level of the logging event
|
37
|
-
# should be left justified to a width of five characters. The recognized
|
38
|
-
# conversion characters are
|
39
|
-
#
|
40
|
-
# [c] Used to output the name of the logger that generated the log
|
41
|
-
# event. Supports an optional "precision" described further below.
|
42
|
-
# [d] Used to output the date of the log event. The format of the
|
43
|
-
# date is specified using the :date_pattern option when the Layout
|
44
|
-
# is created. ISO8601 format is assumed if not date pattern is given.
|
45
|
-
# [F] Used to output the file name where the logging request was issued.
|
46
|
-
# [l] Used to output the level of the log event.
|
47
|
-
# [L] Used to output the line number where the logging request was
|
48
|
-
# issued.
|
49
|
-
# [m] Used to output the application supplied message associated with
|
50
|
-
# the log event.
|
51
|
-
# [M] Used to output the method name where the logging request was
|
52
|
-
# issued.
|
53
|
-
# [p] Used to output the process ID of the currently running program.
|
54
|
-
# [r] Used to output the number of milliseconds elapsed from the
|
55
|
-
# construction of the Layout until creation of the log event.
|
56
|
-
# [t] Used to output the object ID of the thread that generated the
|
57
|
-
# log event.
|
58
|
-
# [T] Used to output the name of the thread that generated the log event.
|
59
|
-
# Name can be specified using Thread.current[:name] notation. Output
|
60
|
-
# empty string if name not specified. This option helps to create
|
61
|
-
# more human readable output for multithread application logs.
|
62
|
-
# [%] The sequence '%%' outputs a single percent sign.
|
63
|
-
#
|
64
|
-
# The logger name directive 'c' accepts an optional precision that will
|
65
|
-
# only print the rightmost number of namespace identifiers for the logger.
|
66
|
-
# By default the logger name is printed in full. For example, for the
|
67
|
-
# logger name "Foo::Bar::Baz" the pattern %c{2} will output "Bar::Baz".
|
68
|
-
#
|
69
|
-
# The directives F, L, and M will only work if the Logger generating the
|
70
|
-
# events is configured to generate tracing information. If this is not
|
71
|
-
# the case these fields will always be empty.
|
72
|
-
#
|
73
|
-
# By default the relevant information is output as is. However, with the
|
74
|
-
# aid of format modifiers it is possible to change the minimum field width,
|
75
|
-
# the maximum field width and justification.
|
76
|
-
#
|
77
|
-
# The optional format modifier is placed between the percent sign and the
|
78
|
-
# conversion character.
|
79
|
-
#
|
80
|
-
# The first optional format modifier is the left justification flag which
|
81
|
-
# is just the minus (-) character. Then comes the optional minimum field
|
82
|
-
# width modifier. This is a decimal constant that represents the minimum
|
83
|
-
# number of characters to output. If the data item requires fewer
|
84
|
-
# characters, it is padded on either the left or the right until the
|
85
|
-
# minimum width is reached. The default is to pad on the left (right
|
86
|
-
# justify) but you can specify right padding with the left justification
|
87
|
-
# flag. The padding character is space. If the data item is larger than the
|
88
|
-
# minimum field width, the field is expanded to accommodate the data. The
|
89
|
-
# value is never truncated.
|
90
|
-
#
|
91
|
-
# This behavior can be changed using the maximum field width modifier which
|
92
|
-
# is designated by a period followed by a decimal constant. If the data
|
93
|
-
# item is longer than the maximum field, then the extra characters are
|
94
|
-
# removed from the end of the data item.
|
95
|
-
#
|
96
|
-
# Below are various format modifier examples for the category conversion
|
97
|
-
# specifier.
|
98
|
-
#
|
99
|
-
# [%20c] Left pad with spaces if the logger name is less than 20
|
100
|
-
# characters long
|
101
|
-
# [%-20c] Right pad with spaces if the logger name is less than 20
|
102
|
-
# characters long
|
103
|
-
# [%.30c] Truncates the logger name if it is longer than 30 characters
|
104
|
-
# [%20.30c] Left pad with spaces if the logger name is shorter than
|
105
|
-
# 20 characters. However, if the logger name is longer than
|
106
|
-
# 30 characters, then truncate the name.
|
107
|
-
# [%-20.30c] Right pad with spaces if the logger name is shorter than
|
108
|
-
# 20 characters. However, if the logger name is longer than
|
109
|
-
# 30 characters, then truncate the name.
|
110
|
-
#
|
111
|
-
# Below are examples of some conversion patterns.
|
112
|
-
#
|
113
|
-
# %.1l, [%d] %5l -- %c: %m\n
|
114
|
-
#
|
115
|
-
# This is how the Logger class in the Ruby standard library formats
|
116
|
-
# messages. The main difference will be in the date format (the Pattern
|
117
|
-
# Layout uses the ISO8601 date format). Set the :date_method on the
|
118
|
-
# Pattern Layout to be 'to_s' and then the date formats will agree.
|
119
|
-
#
|
120
|
-
class Pattern < ::Logging::Layout
|
121
|
-
|
122
|
-
# :stopdoc:
|
123
|
-
|
124
|
-
# Arguments to sprintf keyed to directive letters
|
125
|
-
DIRECTIVE_TABLE = {
|
126
|
-
'c' => 'event.logger'.freeze,
|
127
|
-
'd' => 'format_date(event.time)'.freeze,
|
128
|
-
'F' => 'event.file'.freeze,
|
129
|
-
'l' => '::Logging::LNAMES[event.level]'.freeze,
|
130
|
-
'L' => 'event.line'.freeze,
|
131
|
-
'm' => 'format_obj(event.data)'.freeze,
|
132
|
-
'M' => 'event.method'.freeze,
|
133
|
-
'p' => 'Process.pid'.freeze,
|
134
|
-
'r' => 'Integer((event.time-@created_at)*1000).to_s'.freeze,
|
135
|
-
't' => 'Thread.current.object_id.to_s'.freeze,
|
136
|
-
'T' => 'Thread.current[:name]'.freeze,
|
137
|
-
'%' => :placeholder
|
138
|
-
}.freeze
|
139
|
-
|
140
|
-
# Matches the first directive encountered and the stuff around it.
|
141
|
-
#
|
142
|
-
# * $1 is the stuff before directive or "" if not applicable
|
143
|
-
# * $2 is the %#.# match within directive group
|
144
|
-
# * $3 is the directive letter
|
145
|
-
# * $4 is the precision specifier for the logger name
|
146
|
-
# * $5 is the stuff after the directive or "" if not applicable
|
147
|
-
DIRECTIVE_RGXP = %r/([^%]*)(?:(%-?\d*(?:\.\d+)?)([a-zA-Z%])(?:\{(\d+)\})?)?(.*)/m
|
148
|
-
|
149
|
-
# default date format
|
150
|
-
ISO8601 = "%Y-%m-%d %H:%M:%S".freeze
|
151
|
-
|
152
|
-
# call-seq:
|
153
|
-
# Pattern.create_date_format_methods( pf )
|
154
|
-
#
|
155
|
-
# This method will create the +date_format+ method in the given Pattern
|
156
|
-
# Layout _pf_ based on the configured date patten and/or date method
|
157
|
-
# specified by the user.
|
158
|
-
#
|
159
|
-
def self.create_date_format_methods( pf )
|
160
|
-
code = "undef :format_date if method_defined? :format_date\n"
|
161
|
-
code << "def format_date( time )\n"
|
162
|
-
if pf.date_method.nil?
|
163
|
-
if pf.date_pattern =~ %r/%s/
|
164
|
-
code << <<-CODE
|
165
|
-
dp = '#{pf.date_pattern}'.gsub('%s','%06d' % time.usec)
|
166
|
-
time.strftime dp
|
167
|
-
CODE
|
168
|
-
else
|
169
|
-
code << "time.strftime '#{pf.date_pattern}'\n"
|
170
|
-
end
|
171
|
-
else
|
172
|
-
code << "time.#{pf.date_method}\n"
|
173
|
-
end
|
174
|
-
code << "end\n"
|
175
|
-
::Logging.log_internal(0) {code}
|
176
|
-
|
177
|
-
pf._meta_eval(code, __FILE__, __LINE__)
|
178
|
-
end
|
179
|
-
|
180
|
-
# call-seq:
|
181
|
-
# Pattern.create_format_method( pf )
|
182
|
-
#
|
183
|
-
# This method will create the +format+ method in the given Pattern
|
184
|
-
# Layout _pf_ based on the configured format pattern specified by the
|
185
|
-
# user.
|
186
|
-
#
|
187
|
-
def self.create_format_method( pf )
|
188
|
-
# Create the format(event) method
|
189
|
-
code = "undef :format if method_defined? :format\n"
|
190
|
-
code << "def format( event )\nsprintf(\""
|
191
|
-
pattern = pf.pattern.dup
|
192
|
-
args = []
|
193
|
-
|
194
|
-
while true
|
195
|
-
m = DIRECTIVE_RGXP.match(pattern)
|
196
|
-
code << m[1] unless m[1].empty?
|
197
|
-
|
198
|
-
case m[3]
|
199
|
-
when '%'; code << '%%'
|
200
|
-
when 'c'
|
201
|
-
code << m[2] + 's'
|
202
|
-
args << DIRECTIVE_TABLE[m[3]].dup
|
203
|
-
if m[4]
|
204
|
-
raise ArgumentError, "logger name precision must be an integer greater than zero: #{m[4]}" unless Integer(m[4]) > 0
|
205
|
-
args.last <<
|
206
|
-
".split(::Logging::Repository::PATH_DELIMITER)" \
|
207
|
-
".last(#{m[4]}).join(::Logging::Repository::PATH_DELIMITER)"
|
208
|
-
end
|
209
|
-
when *DIRECTIVE_TABLE.keys
|
210
|
-
code << m[2] + 's'
|
211
|
-
code << "{#{m[4]}}" if m[4]
|
212
|
-
args << DIRECTIVE_TABLE[m[3]]
|
213
|
-
when nil; break
|
214
|
-
else
|
215
|
-
raise ArgumentError, "illegal format character - '#{m[3]}'"
|
216
|
-
end
|
217
|
-
|
218
|
-
break if m[5].empty?
|
219
|
-
pattern = m[5]
|
220
|
-
end
|
221
|
-
|
222
|
-
code << '"'
|
223
|
-
code << ', ' + args.join(', ') unless args.empty?
|
224
|
-
code << ")\n"
|
225
|
-
code << "end\n"
|
226
|
-
::Logging.log_internal(0) {code}
|
227
|
-
|
228
|
-
pf._meta_eval(code, __FILE__, __LINE__)
|
229
|
-
end
|
230
|
-
# :startdoc:
|
231
|
-
|
232
|
-
# call-seq:
|
233
|
-
# Pattern.new( opts )
|
234
|
-
#
|
235
|
-
# Creates a new Pattern layout using the following options.
|
236
|
-
#
|
237
|
-
# :pattern => "[%d] %-5l -- %c : %m\n"
|
238
|
-
# :date_pattern => "%Y-%m-%d %H:%M:%S"
|
239
|
-
# :date_method => 'usec' or 'to_s'
|
240
|
-
#
|
241
|
-
# If used, :date_method will supersede :date_pattern.
|
242
|
-
#
|
243
|
-
def initialize( opts = {} )
|
244
|
-
super
|
245
|
-
@created_at = Time.now
|
246
|
-
|
247
|
-
@date_pattern = opts.getopt(:date_pattern)
|
248
|
-
@date_method = opts.getopt(:date_method)
|
249
|
-
@date_pattern = ISO8601 if @date_pattern.nil? and @date_method.nil?
|
250
|
-
|
251
|
-
@pattern = opts.getopt(:pattern,
|
252
|
-
"[%d] %-#{::Logging::MAX_LEVEL_LENGTH}l -- %c : %m\n")
|
253
|
-
|
254
|
-
Pattern.create_date_format_methods(self)
|
255
|
-
Pattern.create_format_method(self)
|
256
|
-
end
|
257
|
-
|
258
|
-
attr_reader :pattern, :date_pattern, :date_method
|
259
|
-
|
260
|
-
# call-seq:
|
261
|
-
# appender.pattern = "[%d] %-5l -- %c : %m\n"
|
262
|
-
#
|
263
|
-
# Set the message formatting pattern to be used by the layout.
|
264
|
-
#
|
265
|
-
def pattern=( var )
|
266
|
-
@pattern = var
|
267
|
-
Pattern.create_format_method(self)
|
268
|
-
end
|
269
|
-
|
270
|
-
# call-seq:
|
271
|
-
# appender.date_pattern = "%Y-%m-%d %H:%M:%S"
|
272
|
-
#
|
273
|
-
# Set the date formatting pattern to be used when outputting timestamps
|
274
|
-
# in the log messages.
|
275
|
-
#
|
276
|
-
def date_pattern=( var )
|
277
|
-
@date_pattern = var
|
278
|
-
Pattern.create_date_format_methods(self)
|
279
|
-
end
|
280
|
-
|
281
|
-
# call-seq:
|
282
|
-
# appender.date_method = 'to_s'
|
283
|
-
# appender.date_method = :usec
|
284
|
-
#
|
285
|
-
# Set the date method to be used when outputting timestamps in the log
|
286
|
-
# messages. If a date method is configured, the output of that method
|
287
|
-
# will be used in leu of the date pattern.
|
288
|
-
#
|
289
|
-
def date_method=( var )
|
290
|
-
@date_method = var
|
291
|
-
Pattern.create_date_format_methods(self)
|
292
|
-
end
|
293
|
-
|
294
|
-
# :stopdoc:
|
295
|
-
|
296
|
-
# call-seq:
|
297
|
-
# _meta_eval( code )
|
298
|
-
#
|
299
|
-
# Evaluates the given string of _code_ if the singleton class of this
|
300
|
-
# Pattern Layout object.
|
301
|
-
#
|
302
|
-
def _meta_eval( code, file = nil, line = nil )
|
303
|
-
meta = class << self; self end
|
304
|
-
meta.class_eval code, file, line
|
305
|
-
end
|
306
|
-
# :startdoc:
|
307
|
-
|
308
|
-
end # class Pattern
|
309
|
-
end # module Logging::Layouts
|
310
|
-
|
311
|
-
# EOF
|