docspring 3.0.0 → 3.1.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +4 -4
- data/README.md +11 -5
- data/docs/CreateHtmlSubmissionData.md +3 -1
- data/docs/CreatePdfSubmissionData.md +3 -1
- data/docs/PDFApi.md +156 -10
- data/docs/PublishVersionData.md +20 -0
- data/docs/RestoreVersionData.md +18 -0
- data/docs/Submission.md +4 -0
- data/docs/SubmissionPreview.md +4 -0
- data/docs/Template.md +15 -1
- data/docs/TemplateDeleteResponse.md +24 -0
- data/docs/TemplatePreview.md +13 -1
- data/docs/TemplatePublishVersionResponse.md +22 -0
- data/lib/docspring/api/pdf_api.rb +152 -5
- data/lib/docspring/api_client.rb +1 -1
- data/lib/docspring/models/combined_submission_action.rb +1 -5
- data/lib/docspring/models/create_html_submission_data.rb +13 -4
- data/lib/docspring/models/create_pdf_submission_data.rb +13 -4
- data/lib/docspring/models/publish_version_data.rb +230 -0
- data/lib/docspring/models/restore_version_data.rb +221 -0
- data/lib/docspring/models/submission.rb +41 -1
- data/lib/docspring/models/submission_data_request_event.rb +1 -5
- data/lib/docspring/models/submission_preview.rb +41 -1
- data/lib/docspring/models/template.rb +106 -4
- data/lib/docspring/models/template_delete_response.rb +287 -0
- data/lib/docspring/models/template_preview.rb +88 -4
- data/lib/docspring/models/template_publish_version_response.rb +282 -0
- data/lib/docspring/version.rb +1 -1
- data/lib/docspring.rb +4 -0
- data/spec/api/pdf_api_spec.rb +27 -2
- data/spec/models/create_html_submission_data_spec.rb +6 -0
- data/spec/models/create_pdf_submission_data_spec.rb +6 -0
- data/spec/models/publish_version_data_spec.rb +42 -0
- data/spec/models/restore_version_data_spec.rb +36 -0
- data/spec/models/submission_preview_spec.rb +16 -0
- data/spec/models/submission_spec.rb +16 -0
- data/spec/models/template_delete_response_spec.rb +58 -0
- data/spec/models/template_preview_spec.rb +40 -0
- data/spec/models/template_publish_version_response_spec.rb +52 -0
- data/spec/models/template_spec.rb +46 -0
- data/vendor/bundle/ruby/3.3.0/bin/irb +29 -0
- data/vendor/bundle/ruby/3.3.0/bin/rdbg +29 -0
- data/vendor/bundle/ruby/3.3.0/bin/rdoc +29 -0
- data/vendor/bundle/ruby/3.3.0/bin/ri +29 -0
- data/vendor/bundle/ruby/3.3.0/cache/ast-2.4.3.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/cache/debug-1.10.0.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/cache/io-console-0.8.0.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/cache/irb-1.15.1.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/cache/parser-3.3.7.2.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/cache/pp-0.6.2.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/cache/prettyprint-0.2.0.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/cache/rdoc-6.12.0.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/cache/reline-0.6.0.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/debug-1.10.0/debug/debug.bundle +0 -0
- data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/debug-1.10.0/gem.build_complete +0 -0
- data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/debug-1.10.0/gem_make.out +19 -0
- data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/io-console-0.8.0/gem.build_complete +0 -0
- data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/io-console-0.8.0/gem_make.out +31 -0
- data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/io-console-0.8.0/io/console.bundle +0 -0
- data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/io-console-0.8.0/mkmf.log +447 -0
- data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/LICENSE.MIT +20 -0
- data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/README.YARD.md +12 -0
- data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast/node.rb +268 -0
- data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast/processor/mixin.rb +288 -0
- data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast/processor.rb +12 -0
- data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast/sexp.rb +30 -0
- data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/CONTRIBUTING.md +573 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/Gemfile +10 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/README.md +970 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/Rakefile +57 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/TODO.md +23 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/debug.gemspec +33 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/exe/rdbg +53 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/Makefile +270 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/debug.c +228 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/debug_version.h +1 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/extconf.rb +27 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/iseq_collector.c +93 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/abbrev_command.rb +77 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/breakpoint.rb +556 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/client.rb +263 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/color.rb +123 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/config.rb +590 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/console.rb +213 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/dap_custom/traceInspector.rb +336 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/debug.bundle +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/frame_info.rb +188 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/irb_integration.rb +37 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/local.rb +115 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/open.rb +13 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/open_nonstop.rb +15 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/prelude.rb +50 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/server.rb +534 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/server_cdp.rb +1348 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/server_dap.rb +1108 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/session.rb +2659 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/source_repository.rb +150 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/start.rb +5 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/thread_client.rb +1455 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/tracer.rb +241 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/version.rb +5 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug.rb +9 -0
- data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/misc/README.md.erb +636 -0
- data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/.document +5 -0
- data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/BSDL +22 -0
- data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/COPYING +56 -0
- data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/README.md +46 -0
- data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/Makefile +272 -0
- data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/console.c +1969 -0
- data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/extconf.rb +61 -0
- data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/win32_vk.inc +1390 -0
- data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/lib/io/console/size.rb +23 -0
- data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/lib/io/console.bundle +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/Gemfile +29 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/README.md +125 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/Rakefile +52 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/bin/console +6 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/bin/setup +6 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/doc/irb/irb-tools.rd.ja +184 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/doc/irb/irb.rd.ja +425 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/exe/irb +9 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/irb.gemspec +46 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/cmd/nop.rb +4 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/color.rb +263 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/color_printer.rb +56 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/backtrace.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/base.rb +60 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/break.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/catch.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/cd.rb +51 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/chws.rb +40 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/context.rb +16 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/continue.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/copy.rb +73 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/debug.rb +73 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/delete.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/disable_irb.rb +19 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/edit.rb +63 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/exit.rb +18 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/finish.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/force_exit.rb +18 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/help.rb +83 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/history.rb +45 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/info.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/internal_helpers.rb +27 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/irb_info.rb +33 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/load.rb +91 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/ls.rb +167 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/measure.rb +49 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/next.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/pushws.rb +65 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/show_doc.rb +51 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/show_source.rb +74 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/step.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/subirb.rb +123 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/whereami.rb +23 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command.rb +23 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/completion.rb +504 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/context.rb +751 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/debug/ui.rb +101 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/debug.rb +127 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/default_commands.rb +279 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/easter-egg.rb +152 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/change-ws.rb +37 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/eval_history.rb +149 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/loader.rb +127 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/multi-irb.rb +258 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/tracer.rb +39 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/use-loader.rb +67 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/workspaces.rb +36 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/frame.rb +80 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/help.rb +28 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/helper_method/base.rb +16 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/helper_method/conf.rb +11 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/helper_method.rb +29 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/history.rb +116 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/init.rb +540 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/input-method.rb +515 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/inspector.rb +136 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/lc/error.rb +52 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/lc/help-message +55 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/lc/ja/error.rb +53 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/lc/ja/help-message +58 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/locale.rb +153 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/nesting_parser.rb +239 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/notifier.rb +230 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/output-method.rb +80 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/pager.rb +213 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ruby-lex.rb +476 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ruby_logo.aa +118 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/source_finder.rb +138 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/statement.rb +101 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/version.rb +11 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/workspace.rb +171 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ws-for-case-2.rb +9 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/xmp.rb +164 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb.rb +736 -0
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/man/irb.1 +292 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/LICENSE.txt +26 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/bin/ruby-parse +7 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/bin/ruby-rewrite +7 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/gauntlet_parser.rb +123 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/all.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ast/node.rb +40 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ast/processor.rb +293 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/base.rb +291 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/builders/default.rb +2338 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/clobbering_error.rb +13 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/color.rb +32 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/context.rb +51 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/current.rb +137 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/current_arg_stack.rb +46 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/deprecation.rb +13 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/diagnostic/engine.rb +104 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/diagnostic.rb +163 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer/dedenter.rb +88 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer/explanation.rb +55 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer/literal.rb +284 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer/stack_state.rb +49 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer-F0.rb +12922 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer-F1.rb +14875 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer-strings.rb +5424 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/macruby.rb +9634 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/max_numparam_stack.rb +56 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/messages.rb +125 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/meta.rb +48 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/rewriter.rb +105 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby18.rb +9272 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby19.rb +9558 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby20.rb +10229 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby21.rb +10203 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby22.rb +10302 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby23.rb +10322 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby24.rb +10454 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby25.rb +10374 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby26.rb +10352 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby27.rb +11947 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby30.rb +12243 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby31.rb +12716 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby32.rb +12704 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby33.rb +12589 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby34.rb +12596 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/rubymotion.rb +9515 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/runner/ruby_parse.rb +157 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/runner/ruby_rewrite.rb +101 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/runner.rb +299 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/buffer.rb +369 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/comment/associator.rb +233 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/comment.rb +134 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/collection.rb +18 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/condition.rb +21 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/constant.rb +32 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/definition.rb +23 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/for.rb +19 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/heredoc.rb +19 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/index.rb +33 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/keyword.rb +20 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/method_definition.rb +25 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/objc_kwarg.rb +19 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/operator.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/rescue_body.rb +21 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/send.rb +36 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/ternary.rb +18 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/variable.rb +31 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map.rb +186 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/range.rb +326 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/rewriter/action.rb +44 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/rewriter.rb +513 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/tree_rewriter/action.rb +243 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/tree_rewriter.rb +431 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/static_environment.rb +134 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/syntax_error.rb +21 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/tree_rewriter.rb +133 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/unknown_encoding_in_magic_comment_error.rb +15 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/variables_stack.rb +36 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/version.rb +5 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser.rb +91 -0
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/parser.gemspec +43 -0
- data/vendor/bundle/ruby/3.3.0/gems/pp-0.6.2/BSDL +22 -0
- data/vendor/bundle/ruby/3.3.0/gems/pp-0.6.2/COPYING +56 -0
- data/vendor/bundle/ruby/3.3.0/gems/pp-0.6.2/lib/pp.rb +699 -0
- data/vendor/bundle/ruby/3.3.0/gems/pp-0.6.2/pp.gemspec +35 -0
- data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/.github/dependabot.yml +6 -0
- data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/.github/workflows/test.yml +41 -0
- data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/.gitignore +8 -0
- data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/Gemfile +4 -0
- data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/README.md +43 -0
- data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/Rakefile +10 -0
- data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/bin/console +14 -0
- data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/bin/setup +8 -0
- data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/lib/prettyprint.rb +558 -0
- data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/prettyprint.gemspec +29 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/CONTRIBUTING.rdoc +219 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/CVE-2013-0256.rdoc +49 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/ExampleMarkdown.md +39 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/ExampleRDoc.rdoc +210 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/History.rdoc +1668 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/LEGAL.rdoc +50 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/LICENSE.rdoc +59 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/README.rdoc +142 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/RI.md +842 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/TODO.rdoc +60 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/exe/rdoc +43 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/exe/ri +12 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/alias.rb +111 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/anon_class.rb +10 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/any_method.rb +379 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/attr.rb +175 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/class_module.rb +871 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/constant.rb +186 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/context/section.rb +175 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/context.rb +1264 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/extend.rb +9 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/ghost_method.rb +6 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/include.rb +9 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/meta_method.rb +6 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/method_attr.rb +430 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/mixin.rb +120 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/normal_class.rb +92 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/normal_module.rb +73 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/require.rb +51 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/single_class.rb +30 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/top_level.rb +291 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object.rb +426 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_objects.rb +5 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/comment.rb +239 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/cross_reference.rb +228 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/encoding.rb +120 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/erb_partial.rb +18 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/erbio.rb +37 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/darkfish.rb +824 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/json_index.rb +300 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/markup.rb +159 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/pot/message_extractor.rb +68 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/pot/po.rb +84 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/pot/po_entry.rb +141 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/pot.rb +99 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/ri.rb +30 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_head.rhtml +43 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +19 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +34 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +15 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +9 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +15 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +15 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +21 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +32 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +6 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +14 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +39 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/class.rhtml +206 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/css/fonts.css +167 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/css/rdoc.css +668 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/add.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/bug.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/transparent.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/index.rhtml +23 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/js/darkfish.js +120 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/js/search.js +110 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/page.rhtml +18 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +20 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +65 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +70 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/json_index/js/navigation.js +105 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/json_index/js/searcher.js +229 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator.rb +51 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/i18n/locale.rb +102 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/i18n/text.rb +126 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/i18n.rb +10 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/known_classes.rb +74 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown/entities.rb +2131 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown/literals.kpeg +21 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown/literals.rb +454 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown.kpeg +1244 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown.rb +16793 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/attr_changer.rb +22 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/attr_span.rb +35 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/attribute_manager.rb +405 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/attributes.rb +70 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/blank_line.rb +27 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/block_quote.rb +14 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/document.rb +164 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/formatter.rb +272 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/hard_break.rb +31 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/heading.rb +78 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/include.rb +42 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/indented_paragraph.rb +47 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/list.rb +101 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/list_item.rb +99 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/paragraph.rb +28 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/parser.rb +585 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/pre_process.rb +318 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/raw.rb +69 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/regexp_handling.rb +40 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/rule.rb +20 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/table.rb +56 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_ansi.rb +93 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_bs.rb +102 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_html.rb +452 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_html_crossref.rb +226 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_html_snippet.rb +287 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_joined_paragraph.rb +46 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_label.rb +74 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_markdown.rb +191 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_rdoc.rb +352 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_table_of_contents.rb +88 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_test.rb +69 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_tt_only.rb +120 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/verbatim.rb +83 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup.rb +240 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/options.rb +1397 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/c.rb +1260 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/changelog.rb +350 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/markdown.rb +22 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/prism_ruby.rb +1099 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/rd.rb +22 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/ripper_state_lex.rb +302 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/ruby.rb +2381 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/ruby_tools.rb +165 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/simple.rb +61 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/text.rb +11 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser.rb +297 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/block_parser.rb +1706 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/block_parser.ry +643 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/inline.rb +71 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/inline_parser.rb +1854 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/inline_parser.ry +593 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd.rb +99 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rdoc.rb +566 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/driver.rb +1558 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/formatter.rb +6 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/paths.rb +171 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/store.rb +6 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/task.rb +71 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri.rb +20 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rubygems_hook.rb +330 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/servlet.rb +451 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/stats/normal.rb +58 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/stats/quiet.rb +59 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/stats/verbose.rb +44 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/stats.rb +461 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/store.rb +1001 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/task.rb +354 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/text.rb +322 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/token_stream.rb +118 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/tom_doc.rb +257 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/version.rb +10 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc.rb +211 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rubygems_plugin.rb +23 -0
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/man/ri.1 +247 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/BSDL +22 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/COPYING +56 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/README.md +94 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/config.rb +373 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/face.rb +199 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/history.rb +76 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/io/ansi.rb +325 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/io/dumb.rb +120 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/io/windows.rb +530 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/io.rb +55 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/base.rb +37 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/composite.rb +17 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/emacs.rb +517 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/vi_command.rb +518 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/vi_insert.rb +517 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor.rb +8 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_stroke.rb +119 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/kill_ring.rb +125 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/line_editor.rb +2382 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/unicode/east_asian_width.rb +1267 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/unicode.rb +415 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/version.rb +3 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline.rb +519 -0
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/license_of_rb-readline +25 -0
- data/vendor/bundle/ruby/3.3.0/plugins/rdoc_plugin.rb +1 -0
- data/vendor/bundle/ruby/3.3.0/specifications/ast-2.4.3.gemspec +29 -0
- data/vendor/bundle/ruby/3.3.0/specifications/debug-1.10.0.gemspec +32 -0
- data/vendor/bundle/ruby/3.3.0/specifications/io-console-0.8.0.gemspec +25 -0
- data/vendor/bundle/ruby/3.3.0/specifications/irb-1.15.1.gemspec +31 -0
- data/vendor/bundle/ruby/3.3.0/specifications/parser-3.3.7.2.gemspec +37 -0
- data/vendor/bundle/ruby/3.3.0/specifications/pp-0.6.2.gemspec +27 -0
- data/vendor/bundle/ruby/3.3.0/specifications/prettyprint-0.2.0.gemspec +23 -0
- data/vendor/bundle/ruby/3.3.0/specifications/rdoc-6.12.0.gemspec +31 -0
- data/vendor/bundle/ruby/3.3.0/specifications/reline-0.6.0.gemspec +26 -0
- metadata +499 -3
@@ -0,0 +1,736 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# :markup: markdown
|
4
|
+
# irb.rb - irb main module
|
5
|
+
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
|
6
|
+
#
|
7
|
+
|
8
|
+
require "ripper"
|
9
|
+
require "reline"
|
10
|
+
|
11
|
+
require_relative "irb/init"
|
12
|
+
require_relative "irb/context"
|
13
|
+
require_relative "irb/default_commands"
|
14
|
+
|
15
|
+
require_relative "irb/ruby-lex"
|
16
|
+
require_relative "irb/statement"
|
17
|
+
require_relative "irb/history"
|
18
|
+
require_relative "irb/input-method"
|
19
|
+
require_relative "irb/locale"
|
20
|
+
require_relative "irb/color"
|
21
|
+
|
22
|
+
require_relative "irb/version"
|
23
|
+
require_relative "irb/easter-egg"
|
24
|
+
require_relative "irb/debug"
|
25
|
+
require_relative "irb/pager"
|
26
|
+
|
27
|
+
module IRB
|
28
|
+
|
29
|
+
# An exception raised by IRB.irb_abort
|
30
|
+
class Abort < Exception;end # :nodoc:
|
31
|
+
|
32
|
+
class << self
|
33
|
+
# The current IRB::Context of the session, see IRB.conf
|
34
|
+
#
|
35
|
+
# irb
|
36
|
+
# irb(main):001:0> IRB.CurrentContext.irb_name = "foo"
|
37
|
+
# foo(main):002:0> IRB.conf[:MAIN_CONTEXT].irb_name #=> "foo"
|
38
|
+
def CurrentContext # :nodoc:
|
39
|
+
conf[:MAIN_CONTEXT]
|
40
|
+
end
|
41
|
+
|
42
|
+
# Initializes IRB and creates a new Irb.irb object at the `TOPLEVEL_BINDING`
|
43
|
+
def start(ap_path = nil)
|
44
|
+
STDOUT.sync = true
|
45
|
+
$0 = File::basename(ap_path, ".rb") if ap_path
|
46
|
+
|
47
|
+
setup(ap_path)
|
48
|
+
|
49
|
+
if @CONF[:SCRIPT]
|
50
|
+
irb = Irb.new(nil, @CONF[:SCRIPT])
|
51
|
+
else
|
52
|
+
irb = Irb.new
|
53
|
+
end
|
54
|
+
irb.run(@CONF)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Quits irb
|
58
|
+
def irb_exit(*) # :nodoc:
|
59
|
+
throw :IRB_EXIT, false
|
60
|
+
end
|
61
|
+
|
62
|
+
# Aborts then interrupts irb.
|
63
|
+
#
|
64
|
+
# Will raise an Abort exception, or the given `exception`.
|
65
|
+
def irb_abort(irb, exception = Abort) # :nodoc:
|
66
|
+
irb.context.thread.raise exception, "abort then interrupt!"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
class Irb
|
71
|
+
# Note: instance and index assignment expressions could also be written like:
|
72
|
+
# "foo.bar=(1)" and "foo.[]=(1, bar)", when expressed that way, the former be
|
73
|
+
# parsed as :assign and echo will be suppressed, but the latter is parsed as a
|
74
|
+
# :method_add_arg and the output won't be suppressed
|
75
|
+
|
76
|
+
PROMPT_MAIN_TRUNCATE_LENGTH = 32
|
77
|
+
PROMPT_MAIN_TRUNCATE_OMISSION = '...'
|
78
|
+
CONTROL_CHARACTERS_PATTERN = "\x00-\x1F"
|
79
|
+
|
80
|
+
# Returns the current context of this irb session
|
81
|
+
attr_reader :context
|
82
|
+
# The lexer used by this irb session
|
83
|
+
attr_accessor :scanner
|
84
|
+
|
85
|
+
attr_reader :from_binding
|
86
|
+
|
87
|
+
# Creates a new irb session
|
88
|
+
def initialize(workspace = nil, input_method = nil, from_binding: false)
|
89
|
+
@from_binding = from_binding
|
90
|
+
@context = Context.new(self, workspace, input_method)
|
91
|
+
@context.workspace.load_helper_methods_to_main
|
92
|
+
@signal_status = :IN_IRB
|
93
|
+
@scanner = RubyLex.new
|
94
|
+
@line_no = 1
|
95
|
+
end
|
96
|
+
|
97
|
+
# A hook point for `debug` command's breakpoint after :IRB_EXIT as well as its
|
98
|
+
# clean-up
|
99
|
+
def debug_break
|
100
|
+
# it means the debug integration has been activated
|
101
|
+
if defined?(DEBUGGER__) && DEBUGGER__.respond_to?(:capture_frames_without_irb)
|
102
|
+
# after leaving this initial breakpoint, revert the capture_frames patch
|
103
|
+
DEBUGGER__.singleton_class.send(:alias_method, :capture_frames, :capture_frames_without_irb)
|
104
|
+
# and remove the redundant method
|
105
|
+
DEBUGGER__.singleton_class.send(:undef_method, :capture_frames_without_irb)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def debug_readline(binding)
|
110
|
+
workspace = IRB::WorkSpace.new(binding)
|
111
|
+
context.replace_workspace(workspace)
|
112
|
+
context.workspace.load_helper_methods_to_main
|
113
|
+
@line_no += 1
|
114
|
+
|
115
|
+
# When users run:
|
116
|
+
# 1. Debugging commands, like `step 2`
|
117
|
+
# 2. Any input that's not irb-command, like `foo = 123`
|
118
|
+
#
|
119
|
+
#
|
120
|
+
# Irb#eval_input will simply return the input, and we need to pass it to the
|
121
|
+
# debugger.
|
122
|
+
input = nil
|
123
|
+
forced_exit = catch(:IRB_EXIT) do
|
124
|
+
if History.save_history? && context.io.support_history_saving?
|
125
|
+
# Previous IRB session's history has been saved when `Irb#run` is exited We need
|
126
|
+
# to make sure the saved history is not saved again by resetting the counter
|
127
|
+
context.io.reset_history_counter
|
128
|
+
|
129
|
+
begin
|
130
|
+
input = eval_input
|
131
|
+
ensure
|
132
|
+
context.io.save_history
|
133
|
+
end
|
134
|
+
else
|
135
|
+
input = eval_input
|
136
|
+
end
|
137
|
+
false
|
138
|
+
end
|
139
|
+
|
140
|
+
Kernel.exit if forced_exit
|
141
|
+
|
142
|
+
if input&.include?("\n")
|
143
|
+
@line_no += input.count("\n") - 1
|
144
|
+
end
|
145
|
+
|
146
|
+
input
|
147
|
+
end
|
148
|
+
|
149
|
+
def run(conf = IRB.conf)
|
150
|
+
in_nested_session = !!conf[:MAIN_CONTEXT]
|
151
|
+
conf[:IRB_RC].call(context) if conf[:IRB_RC]
|
152
|
+
prev_context = conf[:MAIN_CONTEXT]
|
153
|
+
conf[:MAIN_CONTEXT] = context
|
154
|
+
|
155
|
+
load_history = !in_nested_session && context.io.support_history_saving?
|
156
|
+
save_history = load_history && History.save_history?
|
157
|
+
|
158
|
+
if load_history
|
159
|
+
context.io.load_history
|
160
|
+
end
|
161
|
+
|
162
|
+
prev_trap = trap("SIGINT") do
|
163
|
+
signal_handle
|
164
|
+
end
|
165
|
+
|
166
|
+
begin
|
167
|
+
if defined?(RubyVM.keep_script_lines)
|
168
|
+
keep_script_lines_backup = RubyVM.keep_script_lines
|
169
|
+
RubyVM.keep_script_lines = true
|
170
|
+
end
|
171
|
+
|
172
|
+
forced_exit = catch(:IRB_EXIT) do
|
173
|
+
eval_input
|
174
|
+
end
|
175
|
+
ensure
|
176
|
+
# Do not restore to nil. It will cause IRB crash when used with threads.
|
177
|
+
IRB.conf[:MAIN_CONTEXT] = prev_context if prev_context
|
178
|
+
|
179
|
+
RubyVM.keep_script_lines = keep_script_lines_backup if defined?(RubyVM.keep_script_lines)
|
180
|
+
trap("SIGINT", prev_trap)
|
181
|
+
conf[:AT_EXIT].each{|hook| hook.call}
|
182
|
+
|
183
|
+
context.io.save_history if save_history
|
184
|
+
Kernel.exit if forced_exit
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
# Evaluates input for this session.
|
189
|
+
def eval_input
|
190
|
+
configure_io
|
191
|
+
|
192
|
+
each_top_level_statement do |statement, line_no|
|
193
|
+
signal_status(:IN_EVAL) do
|
194
|
+
begin
|
195
|
+
# If the integration with debugger is activated, we return certain input if it
|
196
|
+
# should be dealt with by debugger
|
197
|
+
if @context.with_debugger && statement.should_be_handled_by_debugger?
|
198
|
+
return statement.code
|
199
|
+
end
|
200
|
+
|
201
|
+
@context.evaluate(statement, line_no)
|
202
|
+
|
203
|
+
if @context.echo? && !statement.suppresses_echo?
|
204
|
+
if statement.is_assignment?
|
205
|
+
if @context.echo_on_assignment?
|
206
|
+
output_value(@context.echo_on_assignment? == :truncate)
|
207
|
+
end
|
208
|
+
else
|
209
|
+
output_value
|
210
|
+
end
|
211
|
+
end
|
212
|
+
rescue SystemExit, SignalException
|
213
|
+
raise
|
214
|
+
rescue Interrupt, Exception => exc
|
215
|
+
handle_exception(exc)
|
216
|
+
@context.workspace.local_variable_set(:_, exc)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
def read_input(prompt)
|
223
|
+
signal_status(:IN_INPUT) do
|
224
|
+
@context.io.prompt = prompt
|
225
|
+
if l = @context.io.gets
|
226
|
+
print l if @context.verbose?
|
227
|
+
else
|
228
|
+
if @context.ignore_eof? and @context.io.readable_after_eof?
|
229
|
+
l = "\n"
|
230
|
+
if @context.verbose?
|
231
|
+
printf "Use \"exit\" to leave %s\n", @context.ap_name
|
232
|
+
end
|
233
|
+
else
|
234
|
+
print "\n" if @context.prompting?
|
235
|
+
end
|
236
|
+
end
|
237
|
+
l
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
def readmultiline
|
242
|
+
prompt = generate_prompt([], false, 0)
|
243
|
+
|
244
|
+
# multiline
|
245
|
+
return read_input(prompt) if @context.io.respond_to?(:check_termination)
|
246
|
+
|
247
|
+
# nomultiline
|
248
|
+
code = +''
|
249
|
+
line_offset = 0
|
250
|
+
loop do
|
251
|
+
line = read_input(prompt)
|
252
|
+
unless line
|
253
|
+
return code.empty? ? nil : code
|
254
|
+
end
|
255
|
+
|
256
|
+
code << line
|
257
|
+
return code if command?(code)
|
258
|
+
|
259
|
+
tokens, opens, terminated = @scanner.check_code_state(code, local_variables: @context.local_variables)
|
260
|
+
return code if terminated
|
261
|
+
|
262
|
+
line_offset += 1
|
263
|
+
continue = @scanner.should_continue?(tokens)
|
264
|
+
prompt = generate_prompt(opens, continue, line_offset)
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
def each_top_level_statement
|
269
|
+
loop do
|
270
|
+
code = readmultiline
|
271
|
+
break unless code
|
272
|
+
yield parse_input(code), @line_no
|
273
|
+
@line_no += code.count("\n")
|
274
|
+
rescue RubyLex::TerminateLineInput
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
def parse_input(code)
|
279
|
+
if code.match?(/\A\n*\z/)
|
280
|
+
return Statement::EmptyInput.new
|
281
|
+
end
|
282
|
+
|
283
|
+
code = code.dup.force_encoding(@context.io.encoding)
|
284
|
+
is_assignment_expression = @scanner.assignment_expression?(code, local_variables: @context.local_variables)
|
285
|
+
|
286
|
+
@context.parse_input(code, is_assignment_expression)
|
287
|
+
end
|
288
|
+
|
289
|
+
def command?(code)
|
290
|
+
parse_input(code).is_a?(Statement::Command)
|
291
|
+
end
|
292
|
+
|
293
|
+
def configure_io
|
294
|
+
if @context.io.respond_to?(:check_termination)
|
295
|
+
@context.io.check_termination do |code|
|
296
|
+
if Reline::IOGate.in_pasting?
|
297
|
+
rest = @scanner.check_termination_in_prev_line(code, local_variables: @context.local_variables)
|
298
|
+
if rest
|
299
|
+
Reline.delete_text
|
300
|
+
rest.bytes.reverse_each do |c|
|
301
|
+
Reline.ungetc(c)
|
302
|
+
end
|
303
|
+
true
|
304
|
+
else
|
305
|
+
false
|
306
|
+
end
|
307
|
+
else
|
308
|
+
next true if command?(code)
|
309
|
+
|
310
|
+
_tokens, _opens, terminated = @scanner.check_code_state(code, local_variables: @context.local_variables)
|
311
|
+
terminated
|
312
|
+
end
|
313
|
+
end
|
314
|
+
end
|
315
|
+
if @context.io.respond_to?(:dynamic_prompt)
|
316
|
+
@context.io.dynamic_prompt do |lines|
|
317
|
+
tokens = RubyLex.ripper_lex_without_warning(lines.map{ |l| l + "\n" }.join, local_variables: @context.local_variables)
|
318
|
+
line_results = IRB::NestingParser.parse_by_line(tokens)
|
319
|
+
tokens_until_line = []
|
320
|
+
line_results.map.with_index do |(line_tokens, _prev_opens, next_opens, _min_depth), line_num_offset|
|
321
|
+
line_tokens.each do |token, _s|
|
322
|
+
# Avoid appending duplicated token. Tokens that include "n" like multiline
|
323
|
+
# tstring_content can exist in multiple lines.
|
324
|
+
tokens_until_line << token if token != tokens_until_line.last
|
325
|
+
end
|
326
|
+
continue = @scanner.should_continue?(tokens_until_line)
|
327
|
+
generate_prompt(next_opens, continue, line_num_offset)
|
328
|
+
end
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
if @context.io.respond_to?(:auto_indent) and @context.auto_indent_mode
|
333
|
+
@context.io.auto_indent do |lines, line_index, byte_pointer, is_newline|
|
334
|
+
next nil if lines == [nil] # Workaround for exit IRB with CTRL+d
|
335
|
+
next nil if !is_newline && lines[line_index]&.byteslice(0, byte_pointer)&.match?(/\A\s*\z/)
|
336
|
+
|
337
|
+
code = lines[0..line_index].map { |l| "#{l}\n" }.join
|
338
|
+
tokens = RubyLex.ripper_lex_without_warning(code, local_variables: @context.local_variables)
|
339
|
+
@scanner.process_indent_level(tokens, lines, line_index, is_newline)
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
def convert_invalid_byte_sequence(str, enc)
|
345
|
+
str.force_encoding(enc)
|
346
|
+
str.scrub { |c|
|
347
|
+
c.bytes.map{ |b| "\\x#{b.to_s(16).upcase}" }.join
|
348
|
+
}
|
349
|
+
end
|
350
|
+
|
351
|
+
def encode_with_invalid_byte_sequence(str, enc)
|
352
|
+
conv = Encoding::Converter.new(str.encoding, enc)
|
353
|
+
dst = String.new
|
354
|
+
begin
|
355
|
+
ret = conv.primitive_convert(str, dst)
|
356
|
+
case ret
|
357
|
+
when :invalid_byte_sequence
|
358
|
+
conv.insert_output(conv.primitive_errinfo[3].dump[1..-2])
|
359
|
+
redo
|
360
|
+
when :undefined_conversion
|
361
|
+
c = conv.primitive_errinfo[3].dup.force_encoding(conv.primitive_errinfo[1])
|
362
|
+
conv.insert_output(c.dump[1..-2])
|
363
|
+
redo
|
364
|
+
when :incomplete_input
|
365
|
+
conv.insert_output(conv.primitive_errinfo[3].dump[1..-2])
|
366
|
+
when :finished
|
367
|
+
end
|
368
|
+
break
|
369
|
+
end while nil
|
370
|
+
dst
|
371
|
+
end
|
372
|
+
|
373
|
+
def handle_exception(exc)
|
374
|
+
if exc.backtrace[0] =~ /\/irb(2)?(\/.*|-.*|\.rb)?:/ && exc.class.to_s !~ /^IRB/ &&
|
375
|
+
!(SyntaxError === exc) && !(EncodingError === exc)
|
376
|
+
# The backtrace of invalid encoding hash (ex. {"\xAE": 1}) raises EncodingError without lineno.
|
377
|
+
irb_bug = true
|
378
|
+
else
|
379
|
+
irb_bug = false
|
380
|
+
# To support backtrace filtering while utilizing Exception#full_message, we need to clone
|
381
|
+
# the exception to avoid modifying the original exception's backtrace.
|
382
|
+
exc = exc.clone
|
383
|
+
filtered_backtrace = exc.backtrace.map { |l| @context.workspace.filter_backtrace(l) }.compact
|
384
|
+
backtrace_filter = IRB.conf[:BACKTRACE_FILTER]
|
385
|
+
|
386
|
+
if backtrace_filter
|
387
|
+
if backtrace_filter.respond_to?(:call)
|
388
|
+
filtered_backtrace = backtrace_filter.call(filtered_backtrace)
|
389
|
+
else
|
390
|
+
warn "IRB.conf[:BACKTRACE_FILTER] #{backtrace_filter} should respond to `call` method"
|
391
|
+
end
|
392
|
+
end
|
393
|
+
|
394
|
+
exc.set_backtrace(filtered_backtrace)
|
395
|
+
end
|
396
|
+
|
397
|
+
highlight = Color.colorable?
|
398
|
+
|
399
|
+
order =
|
400
|
+
if RUBY_VERSION < '3.0.0'
|
401
|
+
STDOUT.tty? ? :bottom : :top
|
402
|
+
else # '3.0.0' <= RUBY_VERSION
|
403
|
+
:top
|
404
|
+
end
|
405
|
+
|
406
|
+
message = exc.full_message(order: order, highlight: highlight)
|
407
|
+
message = convert_invalid_byte_sequence(message, exc.message.encoding)
|
408
|
+
message = encode_with_invalid_byte_sequence(message, IRB.conf[:LC_MESSAGES].encoding) unless message.encoding.to_s.casecmp?(IRB.conf[:LC_MESSAGES].encoding.to_s)
|
409
|
+
message = message.gsub(/((?:^\t.+$\n)+)/) { |m|
|
410
|
+
case order
|
411
|
+
when :top
|
412
|
+
lines = m.split("\n")
|
413
|
+
when :bottom
|
414
|
+
lines = m.split("\n").reverse
|
415
|
+
end
|
416
|
+
unless irb_bug
|
417
|
+
if lines.size > @context.back_trace_limit
|
418
|
+
omit = lines.size - @context.back_trace_limit
|
419
|
+
lines = lines[0..(@context.back_trace_limit - 1)]
|
420
|
+
lines << "\t... %d levels..." % omit
|
421
|
+
end
|
422
|
+
end
|
423
|
+
lines = lines.reverse if order == :bottom
|
424
|
+
lines.map{ |l| l + "\n" }.join
|
425
|
+
}
|
426
|
+
# The "<top (required)>" in "(irb)" may be the top level of IRB so imitate the main object.
|
427
|
+
message = message.gsub(/\(irb\):(?<num>\d+):in (?<open_quote>[`'])<(?<frame>top \(required\))>'/) { "(irb):#{$~[:num]}:in #{$~[:open_quote]}<main>'" }
|
428
|
+
puts message
|
429
|
+
|
430
|
+
if irb_bug
|
431
|
+
puts "This may be an issue with IRB. If you believe this is an unexpected behavior, please report it to https://github.com/ruby/irb/issues"
|
432
|
+
end
|
433
|
+
rescue Exception => handler_exc
|
434
|
+
begin
|
435
|
+
puts exc.inspect
|
436
|
+
puts "backtraces are hidden because #{handler_exc} was raised when processing them"
|
437
|
+
rescue Exception
|
438
|
+
puts 'Uninspectable exception occurred'
|
439
|
+
end
|
440
|
+
end
|
441
|
+
|
442
|
+
# Evaluates the given block using the given `path` as the Context#irb_path and
|
443
|
+
# `name` as the Context#irb_name.
|
444
|
+
#
|
445
|
+
# Used by the irb command `source`, see IRB@IRB+Sessions for more information.
|
446
|
+
def suspend_name(path = nil, name = nil)
|
447
|
+
@context.irb_path, back_path = path, @context.irb_path if path
|
448
|
+
@context.irb_name, back_name = name, @context.irb_name if name
|
449
|
+
begin
|
450
|
+
yield back_path, back_name
|
451
|
+
ensure
|
452
|
+
@context.irb_path = back_path if path
|
453
|
+
@context.irb_name = back_name if name
|
454
|
+
end
|
455
|
+
end
|
456
|
+
|
457
|
+
# Evaluates the given block using the given `workspace` as the
|
458
|
+
# Context#workspace.
|
459
|
+
#
|
460
|
+
# Used by the irb command `irb_load`, see IRB@IRB+Sessions for more information.
|
461
|
+
def suspend_workspace(workspace)
|
462
|
+
current_workspace = @context.workspace
|
463
|
+
@context.replace_workspace(workspace)
|
464
|
+
yield
|
465
|
+
ensure
|
466
|
+
@context.replace_workspace current_workspace
|
467
|
+
end
|
468
|
+
|
469
|
+
# Evaluates the given block using the given `input_method` as the Context#io.
|
470
|
+
#
|
471
|
+
# Used by the irb commands `source` and `irb_load`, see IRB@IRB+Sessions for
|
472
|
+
# more information.
|
473
|
+
def suspend_input_method(input_method)
|
474
|
+
back_io = @context.io
|
475
|
+
@context.instance_eval{@io = input_method}
|
476
|
+
begin
|
477
|
+
yield back_io
|
478
|
+
ensure
|
479
|
+
@context.instance_eval{@io = back_io}
|
480
|
+
end
|
481
|
+
end
|
482
|
+
|
483
|
+
# Handler for the signal SIGINT, see Kernel#trap for more information.
|
484
|
+
def signal_handle
|
485
|
+
unless @context.ignore_sigint?
|
486
|
+
print "\nabort!\n" if @context.verbose?
|
487
|
+
exit
|
488
|
+
end
|
489
|
+
|
490
|
+
case @signal_status
|
491
|
+
when :IN_INPUT
|
492
|
+
print "^C\n"
|
493
|
+
raise RubyLex::TerminateLineInput
|
494
|
+
when :IN_EVAL
|
495
|
+
IRB.irb_abort(self)
|
496
|
+
when :IN_LOAD
|
497
|
+
IRB.irb_abort(self, LoadAbort)
|
498
|
+
when :IN_IRB
|
499
|
+
# ignore
|
500
|
+
else
|
501
|
+
# ignore other cases as well
|
502
|
+
end
|
503
|
+
end
|
504
|
+
|
505
|
+
# Evaluates the given block using the given `status`.
|
506
|
+
def signal_status(status)
|
507
|
+
return yield if @signal_status == :IN_LOAD
|
508
|
+
|
509
|
+
signal_status_back = @signal_status
|
510
|
+
@signal_status = status
|
511
|
+
begin
|
512
|
+
yield
|
513
|
+
ensure
|
514
|
+
@signal_status = signal_status_back
|
515
|
+
end
|
516
|
+
end
|
517
|
+
|
518
|
+
def output_value(omit = false) # :nodoc:
|
519
|
+
unless @context.return_format.include?('%')
|
520
|
+
puts @context.return_format
|
521
|
+
return
|
522
|
+
end
|
523
|
+
|
524
|
+
winheight, winwidth = @context.io.winsize
|
525
|
+
if omit
|
526
|
+
content, overflow = Pager.take_first_page(winwidth, 1) do |out|
|
527
|
+
@context.inspect_last_value(out)
|
528
|
+
end
|
529
|
+
if overflow
|
530
|
+
content = "\n#{content}" if @context.newline_before_multiline_output?
|
531
|
+
content = "#{content}..."
|
532
|
+
content = "#{content}\e[0m" if Color.colorable?
|
533
|
+
end
|
534
|
+
puts format(@context.return_format, content.chomp)
|
535
|
+
elsif Pager.should_page? && @context.inspector_support_stream_output?
|
536
|
+
formatter_proc = ->(content, multipage) do
|
537
|
+
content = content.chomp
|
538
|
+
content = "\n#{content}" if @context.newline_before_multiline_output? && (multipage || content.include?("\n"))
|
539
|
+
format(@context.return_format, content)
|
540
|
+
end
|
541
|
+
Pager.page_with_preview(winwidth, winheight, formatter_proc) do |out|
|
542
|
+
@context.inspect_last_value(out)
|
543
|
+
end
|
544
|
+
else
|
545
|
+
content = @context.inspect_last_value.chomp
|
546
|
+
content = "\n#{content}" if @context.newline_before_multiline_output? && content.include?("\n")
|
547
|
+
Pager.page_content(format(@context.return_format, content), retain_content: true)
|
548
|
+
end
|
549
|
+
end
|
550
|
+
|
551
|
+
# Outputs the local variables to this current session, including #signal_status
|
552
|
+
# and #context, using IRB::Locale.
|
553
|
+
def inspect
|
554
|
+
ary = []
|
555
|
+
for iv in instance_variables
|
556
|
+
case (iv = iv.to_s)
|
557
|
+
when "@signal_status"
|
558
|
+
ary.push format("%s=:%s", iv, @signal_status.id2name)
|
559
|
+
when "@context"
|
560
|
+
ary.push format("%s=%s", iv, eval(iv).__to_s__)
|
561
|
+
else
|
562
|
+
ary.push format("%s=%s", iv, eval(iv))
|
563
|
+
end
|
564
|
+
end
|
565
|
+
format("#<%s: %s>", self.class, ary.join(", "))
|
566
|
+
end
|
567
|
+
|
568
|
+
private
|
569
|
+
|
570
|
+
def generate_prompt(opens, continue, line_offset)
|
571
|
+
ltype = @scanner.ltype_from_open_tokens(opens)
|
572
|
+
indent = @scanner.calc_indent_level(opens)
|
573
|
+
continue = opens.any? || continue
|
574
|
+
line_no = @line_no + line_offset
|
575
|
+
|
576
|
+
if ltype
|
577
|
+
f = @context.prompt_s
|
578
|
+
elsif continue
|
579
|
+
f = @context.prompt_c
|
580
|
+
else
|
581
|
+
f = @context.prompt_i
|
582
|
+
end
|
583
|
+
f = "" unless f
|
584
|
+
if @context.prompting?
|
585
|
+
p = format_prompt(f, ltype, indent, line_no)
|
586
|
+
else
|
587
|
+
p = ""
|
588
|
+
end
|
589
|
+
if @context.auto_indent_mode and !@context.io.respond_to?(:auto_indent)
|
590
|
+
unless ltype
|
591
|
+
prompt_i = @context.prompt_i.nil? ? "" : @context.prompt_i
|
592
|
+
ind = format_prompt(prompt_i, ltype, indent, line_no)[/.*\z/].size +
|
593
|
+
indent * 2 - p.size
|
594
|
+
p += " " * ind if ind > 0
|
595
|
+
end
|
596
|
+
end
|
597
|
+
p
|
598
|
+
end
|
599
|
+
|
600
|
+
def truncate_prompt_main(str) # :nodoc:
|
601
|
+
str = str.tr(CONTROL_CHARACTERS_PATTERN, ' ')
|
602
|
+
if str.size <= PROMPT_MAIN_TRUNCATE_LENGTH
|
603
|
+
str
|
604
|
+
else
|
605
|
+
str[0, PROMPT_MAIN_TRUNCATE_LENGTH - PROMPT_MAIN_TRUNCATE_OMISSION.size] + PROMPT_MAIN_TRUNCATE_OMISSION
|
606
|
+
end
|
607
|
+
end
|
608
|
+
|
609
|
+
def format_prompt(format, ltype, indent, line_no) # :nodoc:
|
610
|
+
format.gsub(/%([0-9]+)?([a-zA-Z%])/) do
|
611
|
+
case $2
|
612
|
+
when "N"
|
613
|
+
@context.irb_name
|
614
|
+
when "m"
|
615
|
+
main_str = @context.safe_method_call_on_main(:to_s) rescue "!#{$!.class}"
|
616
|
+
truncate_prompt_main(main_str)
|
617
|
+
when "M"
|
618
|
+
main_str = @context.safe_method_call_on_main(:inspect) rescue "!#{$!.class}"
|
619
|
+
truncate_prompt_main(main_str)
|
620
|
+
when "l"
|
621
|
+
ltype
|
622
|
+
when "i"
|
623
|
+
if indent < 0
|
624
|
+
if $1
|
625
|
+
"-".rjust($1.to_i)
|
626
|
+
else
|
627
|
+
"-"
|
628
|
+
end
|
629
|
+
else
|
630
|
+
if $1
|
631
|
+
format("%" + $1 + "d", indent)
|
632
|
+
else
|
633
|
+
indent.to_s
|
634
|
+
end
|
635
|
+
end
|
636
|
+
when "n"
|
637
|
+
if $1
|
638
|
+
format("%" + $1 + "d", line_no)
|
639
|
+
else
|
640
|
+
line_no.to_s
|
641
|
+
end
|
642
|
+
when "%"
|
643
|
+
"%" unless $1
|
644
|
+
end
|
645
|
+
end
|
646
|
+
end
|
647
|
+
end
|
648
|
+
end
|
649
|
+
|
650
|
+
class Binding
|
651
|
+
# Opens an IRB session where `binding.irb` is called which allows for
|
652
|
+
# interactive debugging. You can call any methods or variables available in the
|
653
|
+
# current scope, and mutate state if you need to.
|
654
|
+
#
|
655
|
+
# Given a Ruby file called `potato.rb` containing the following code:
|
656
|
+
#
|
657
|
+
# class Potato
|
658
|
+
# def initialize
|
659
|
+
# @cooked = false
|
660
|
+
# binding.irb
|
661
|
+
# puts "Cooked potato: #{@cooked}"
|
662
|
+
# end
|
663
|
+
# end
|
664
|
+
#
|
665
|
+
# Potato.new
|
666
|
+
#
|
667
|
+
# Running `ruby potato.rb` will open an IRB session where `binding.irb` is
|
668
|
+
# called, and you will see the following:
|
669
|
+
#
|
670
|
+
# $ ruby potato.rb
|
671
|
+
#
|
672
|
+
# From: potato.rb @ line 4 :
|
673
|
+
#
|
674
|
+
# 1: class Potato
|
675
|
+
# 2: def initialize
|
676
|
+
# 3: @cooked = false
|
677
|
+
# => 4: binding.irb
|
678
|
+
# 5: puts "Cooked potato: #{@cooked}"
|
679
|
+
# 6: end
|
680
|
+
# 7: end
|
681
|
+
# 8:
|
682
|
+
# 9: Potato.new
|
683
|
+
#
|
684
|
+
# irb(#<Potato:0x00007feea1916670>):001:0>
|
685
|
+
#
|
686
|
+
# You can type any valid Ruby code and it will be evaluated in the current
|
687
|
+
# context. This allows you to debug without having to run your code repeatedly:
|
688
|
+
#
|
689
|
+
# irb(#<Potato:0x00007feea1916670>):001:0> @cooked
|
690
|
+
# => false
|
691
|
+
# irb(#<Potato:0x00007feea1916670>):002:0> self.class
|
692
|
+
# => Potato
|
693
|
+
# irb(#<Potato:0x00007feea1916670>):003:0> caller.first
|
694
|
+
# => ".../2.5.1/lib/ruby/2.5.0/irb/workspace.rb:85:in `eval'"
|
695
|
+
# irb(#<Potato:0x00007feea1916670>):004:0> @cooked = true
|
696
|
+
# => true
|
697
|
+
#
|
698
|
+
# You can exit the IRB session with the `exit` command. Note that exiting will
|
699
|
+
# resume execution where `binding.irb` had paused it, as you can see from the
|
700
|
+
# output printed to standard output in this example:
|
701
|
+
#
|
702
|
+
# irb(#<Potato:0x00007feea1916670>):005:0> exit
|
703
|
+
# Cooked potato: true
|
704
|
+
#
|
705
|
+
# See IRB for more information.
|
706
|
+
def irb(show_code: true)
|
707
|
+
# Setup IRB with the current file's path and no command line arguments
|
708
|
+
IRB.setup(source_location[0], argv: []) unless IRB.initialized?
|
709
|
+
# Create a new workspace using the current binding
|
710
|
+
workspace = IRB::WorkSpace.new(self)
|
711
|
+
# Print the code around the binding if show_code is true
|
712
|
+
STDOUT.print(workspace.code_around_binding) if show_code
|
713
|
+
# Get the original IRB instance
|
714
|
+
debugger_irb = IRB.instance_variable_get(:@debugger_irb)
|
715
|
+
|
716
|
+
irb_path = File.expand_path(source_location[0])
|
717
|
+
|
718
|
+
if debugger_irb
|
719
|
+
# If we're already in a debugger session, set the workspace and irb_path for the original IRB instance
|
720
|
+
debugger_irb.context.replace_workspace(workspace)
|
721
|
+
debugger_irb.context.irb_path = irb_path
|
722
|
+
# If we've started a debugger session and hit another binding.irb, we don't want
|
723
|
+
# to start an IRB session instead, we want to resume the irb:rdbg session.
|
724
|
+
IRB::Debug.setup(debugger_irb)
|
725
|
+
IRB::Debug.insert_debug_break
|
726
|
+
debugger_irb.debug_break
|
727
|
+
else
|
728
|
+
# If we're not in a debugger session, create a new IRB instance with the current
|
729
|
+
# workspace
|
730
|
+
binding_irb = IRB::Irb.new(workspace, from_binding: true)
|
731
|
+
binding_irb.context.irb_path = irb_path
|
732
|
+
binding_irb.run(IRB.conf)
|
733
|
+
binding_irb.debug_break
|
734
|
+
end
|
735
|
+
end
|
736
|
+
end
|