brut 0.16.0 → 0.17.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/.gitignore +6 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +4 -1
- data/bin/docs +7 -0
- data/brut-css/package-lock.json +2 -2
- data/brut-css/package.json +1 -1
- data/brut-js/package-lock.json +2 -2
- data/brut-js/package.json +1 -1
- data/brut.gemspec +2 -0
- data/docs/404.html +2 -2
- data/docs/adrs.html +3 -3
- data/docs/ai.html +3 -3
- data/docs/api/Brut/BackEnd/SeedData.html +1 -1
- data/docs/api/Brut/BackEnd/Sidekiq/Middlewares/Server/FlushSpans.html +1 -1
- data/docs/api/Brut/BackEnd/Sidekiq/Middlewares/Server.html +1 -1
- data/docs/api/Brut/BackEnd/Sidekiq/Middlewares.html +1 -1
- data/docs/api/Brut/BackEnd/Sidekiq.html +1 -1
- data/docs/api/Brut/BackEnd/Validators/FormValidator.html +1 -1
- data/docs/api/Brut/BackEnd/Validators.html +1 -1
- data/docs/api/Brut/BackEnd.html +1 -1
- data/docs/api/Brut/CLI/App.html +1 -1
- data/docs/api/Brut/CLI/AppRunner.html +1 -1
- data/docs/api/Brut/CLI/Apps/BuildAssets/All.html +1 -1
- data/docs/api/Brut/CLI/Apps/BuildAssets/CSS.html +1 -1
- data/docs/api/Brut/CLI/Apps/BuildAssets/Images.html +2 -2
- data/docs/api/Brut/CLI/Apps/BuildAssets/JS.html +1 -1
- data/docs/api/Brut/CLI/Apps/BuildAssets.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB/Create.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB/Drop.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB/Migrate.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB/NewMigration.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB/Rebuild.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB/Seed.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB/Status.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB.html +1 -1
- data/docs/api/Brut/CLI/Apps/DeployBase/GitChecks.html +1 -1
- data/docs/api/Brut/CLI/Apps/DeployBase.html +1 -1
- data/docs/api/Brut/CLI/Apps/HerokuContainerBasedDeploy/Deploy.html +2 -2
- data/docs/api/Brut/CLI/Apps/HerokuContainerBasedDeploy.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/Action/Route.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/Action.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/Component.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/CustomElementTest.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/DbModel.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/E2ETest.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/Form.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/Page/Route.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/Page.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/RoutesEditor.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/Test.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold.html +1 -1
- data/docs/api/Brut/CLI/Apps/Test/Audit.html +10 -6
- data/docs/api/Brut/CLI/Apps/Test/E2e.html +1 -1
- data/docs/api/Brut/CLI/Apps/Test/JS.html +1 -1
- data/docs/api/Brut/CLI/Apps/Test/Run.html +1 -1
- data/docs/api/Brut/CLI/Apps/Test.html +1 -1
- data/docs/api/Brut/CLI/Apps.html +1 -1
- data/docs/api/Brut/CLI/Command.html +1 -1
- data/docs/api/Brut/CLI/Error.html +1 -1
- data/docs/api/Brut/CLI/ExecutionResults/Result.html +1 -1
- data/docs/api/Brut/CLI/ExecutionResults.html +1 -1
- data/docs/api/Brut/CLI/Executor.html +1 -1
- data/docs/api/Brut/CLI/InvalidOption.html +1 -1
- data/docs/api/Brut/CLI/Options.html +1 -1
- data/docs/api/Brut/CLI/Output.html +1 -1
- data/docs/api/Brut/CLI/SystemExecError.html +1 -1
- data/docs/api/Brut/CLI.html +1 -1
- data/docs/api/Brut/FactoryBot.html +1 -1
- data/docs/api/Brut/Framework/App.html +1 -1
- data/docs/api/Brut/Framework/Config.html +1 -1
- data/docs/api/Brut/Framework/Container.html +1 -1
- data/docs/api/Brut/Framework/Error.html +1 -1
- data/docs/api/Brut/Framework/Errors/AbstractMethod.html +1 -1
- data/docs/api/Brut/Framework/Errors/Bug.html +1 -1
- data/docs/api/Brut/Framework/Errors/MissingConfiguration.html +1 -1
- data/docs/api/Brut/Framework/Errors/MissingParameter.html +1 -1
- data/docs/api/Brut/Framework/Errors/NoClassForPath.html +1 -1
- data/docs/api/Brut/Framework/Errors/NotFound.html +1 -1
- data/docs/api/Brut/Framework/Errors/NotImplemented.html +1 -1
- data/docs/api/Brut/Framework/Errors.html +1 -1
- data/docs/api/Brut/Framework/FussyTypeEnforcement.html +1 -1
- data/docs/api/Brut/Framework/MCP.html +1 -1
- data/docs/api/Brut/Framework/ProjectEnvironment.html +1 -1
- data/docs/api/Brut/Framework.html +1 -1
- data/docs/api/Brut/FrontEnd/AssetPathResolver.html +1 -1
- data/docs/api/Brut/FrontEnd/Component/Helpers.html +1 -1
- data/docs/api/Brut/FrontEnd/Component.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/ConstraintViolations.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/FormTag.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/I18nTranslations.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/Input.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/Inputs/ButtonTag.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/Inputs/CsrfToken.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/Inputs/InputTag.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/Inputs/RadioButton.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/Inputs/SelectTagWithOptions.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/Inputs/TextareaTag.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/Inputs.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/LocaleDetection.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/PageIdentifier.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/TimeTag.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/Traceparent.html +1 -1
- data/docs/api/Brut/FrontEnd/Components.html +1 -1
- data/docs/api/Brut/FrontEnd/CsrfProtector.html +1 -1
- data/docs/api/Brut/FrontEnd/Download.html +1 -1
- data/docs/api/Brut/FrontEnd/Flash.html +1 -1
- data/docs/api/Brut/FrontEnd/Form.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/Button.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/ButtonInputDefinition.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/ConstraintViolation.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/Input/Color.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/Input/TimeOfDay.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/Input.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/InputDeclarations.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/InputDefinition.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/RadioButtonGroupInput.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/RadioButtonGroupInputDefinition.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/SelectInput.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/SelectInputDefinition.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/ValidityState.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms.html +1 -1
- data/docs/api/Brut/FrontEnd/GenericResponse.html +1 -1
- data/docs/api/Brut/FrontEnd/Handler.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers/CspReportingHandler.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers/InstrumentationHandler/TraceParent.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers/InstrumentationHandler.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers/LocaleDetectionHandler.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers/MissingHandler/Form.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers/MissingHandler.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers.html +1 -1
- data/docs/api/Brut/FrontEnd/HandlingResults.html +1 -1
- data/docs/api/Brut/FrontEnd/HttpMethod.html +1 -1
- data/docs/api/Brut/FrontEnd/HttpStatus.html +1 -1
- data/docs/api/Brut/FrontEnd/InlineSvgLocator.html +1 -1
- data/docs/api/Brut/FrontEnd/Layout.html +1 -1
- data/docs/api/Brut/FrontEnd/Middleware.html +1 -1
- data/docs/api/Brut/FrontEnd/Middlewares/AnnotateBrutOwnedPaths.html +1 -1
- data/docs/api/Brut/FrontEnd/Middlewares/Favicon.html +1 -1
- data/docs/api/Brut/FrontEnd/Middlewares/OpenTelemetrySpan.html +1 -1
- data/docs/api/Brut/FrontEnd/Middlewares/ReloadApp.html +1 -1
- data/docs/api/Brut/FrontEnd/Middlewares.html +1 -1
- data/docs/api/Brut/FrontEnd/Page.html +1 -1
- data/docs/api/Brut/FrontEnd/Pages/MissingPage.html +1 -1
- data/docs/api/Brut/FrontEnd/Pages.html +1 -1
- data/docs/api/Brut/FrontEnd/RequestContext.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHook.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks/AgeFlash.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks/CSPNoInlineScripts.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks/CSPNoInlineStylesOrScripts/ReportOnly.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks/CSPNoInlineStylesOrScripts.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks/LocaleDetection.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks/SetupRequestContext.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/FormHandlerRoute.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/FormRoute.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/MissingForm.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/MissingHandler.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/MissingPage.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/MissingPath.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/PageRoute.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/Route.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing.html +1 -1
- data/docs/api/Brut/FrontEnd/Session.html +1 -1
- data/docs/api/Brut/FrontEnd.html +1 -1
- data/docs/api/Brut/I18n/BaseMethods.html +1 -1
- data/docs/api/Brut/I18n/ForBackEnd.html +1 -1
- data/docs/api/Brut/I18n/ForCLI.html +1 -1
- data/docs/api/Brut/I18n/ForHTML.html +1 -1
- data/docs/api/Brut/I18n/HTTPAcceptLanguage/AlwaysEnglish.html +1 -1
- data/docs/api/Brut/I18n/HTTPAcceptLanguage.html +1 -1
- data/docs/api/Brut/I18n.html +1 -1
- data/docs/api/Brut/Instrumentation/LoggerSpanExporter.html +1 -1
- data/docs/api/Brut/Instrumentation/Methods/ClassMethods.html +1 -1
- data/docs/api/Brut/Instrumentation/Methods.html +1 -1
- data/docs/api/Brut/Instrumentation/OpenTelemetry/NormalizedAttributes.html +1 -1
- data/docs/api/Brut/Instrumentation/OpenTelemetry/Span.html +1 -1
- data/docs/api/Brut/Instrumentation/OpenTelemetry.html +1 -1
- data/docs/api/Brut/Instrumentation.html +1 -1
- data/docs/api/Brut/RubocopConfig.html +1 -1
- data/docs/api/Brut/SinatraHelpers/ClassMethods.html +1 -1
- data/docs/api/Brut/SinatraHelpers.html +1 -1
- data/docs/api/Brut/SpecSupport/ClockSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/ComponentSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/E2ETestServer.html +1 -1
- data/docs/api/Brut/SpecSupport/E2eSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/EnhancedNode.html +1 -1
- data/docs/api/Brut/SpecSupport/FlashSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/GeneralSupport/ClassMethods.html +1 -1
- data/docs/api/Brut/SpecSupport/GeneralSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/HandlerSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/BeABug.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/BePageFor.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/BeRoutingFor.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveConstraintViolation.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveGenerated.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveHTMLAttribute.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveI18nString.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveLinkTo.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveRedirectedTo.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveReturnedHttpStatus.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveReturnedRackResponse.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers.html +1 -1
- data/docs/api/Brut/SpecSupport/RSpecSetup/OptionalSidekiqSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/RSpecSetup.html +1 -1
- data/docs/api/Brut/SpecSupport/SessionSupport.html +1 -1
- data/docs/api/Brut/SpecSupport.html +1 -1
- data/docs/api/Brut/TUI/AnsiEscapeCode/Mod.html +409 -0
- data/docs/api/Brut/TUI/AnsiEscapeCode.html +426 -0
- data/docs/api/Brut/TUI/EventLoop/Deque.html +531 -0
- data/docs/api/Brut/TUI/EventLoop.html +676 -0
- data/docs/api/Brut/TUI/Events/BaseEvent.html +449 -0
- data/docs/api/Brut/TUI/Events/EventBus.html +485 -0
- data/docs/api/Brut/TUI/Events/EventLoopStarted.html +211 -0
- data/docs/api/Brut/TUI/Events/Exception.html +523 -0
- data/docs/api/Brut/TUI/Events/Tick.html +294 -0
- data/docs/api/Brut/TUI/Events.html +131 -0
- data/docs/api/Brut/TUI/MarkupString.html +537 -0
- data/docs/api/Brut/TUI/Script/BlockStep.html +300 -0
- data/docs/api/Brut/TUI/Script/Events/CommandExecutionFailed.html +252 -0
- data/docs/api/Brut/TUI/Script/Events/CommandExecutionSucceeded.html +163 -0
- data/docs/api/Brut/TUI/Script/Events/CommandStdErr.html +163 -0
- data/docs/api/Brut/TUI/Script/Events/CommandStdOut.html +300 -0
- data/docs/api/Brut/TUI/Script/Events/ExecutingCommand.html +298 -0
- data/docs/api/Brut/TUI/Script/Events/Message.html +345 -0
- data/docs/api/Brut/TUI/Script/Events/PhaseCompleted.html +229 -0
- data/docs/api/Brut/TUI/Script/Events/PhaseStarted.html +350 -0
- data/docs/api/Brut/TUI/Script/Events/ScriptCompleted.html +282 -0
- data/docs/api/Brut/TUI/Script/Events/ScriptStarted.html +343 -0
- data/docs/api/Brut/TUI/Script/Events/StepCompleted.html +163 -0
- data/docs/api/Brut/TUI/Script/Events/StepStarted.html +346 -0
- data/docs/api/Brut/TUI/Script/Events.html +115 -0
- data/docs/api/Brut/TUI/Script/ExecStep/ProcessStatusFailed.html +210 -0
- data/docs/api/Brut/TUI/Script/ExecStep.html +493 -0
- data/docs/api/Brut/TUI/Script/LoggingSubscriber.html +914 -0
- data/docs/api/Brut/TUI/Script/PutsSubscriber.html +783 -0
- data/docs/api/Brut/TUI/Script/Step.html +313 -0
- data/docs/api/Brut/TUI/Script.html +1250 -0
- data/docs/api/Brut/TUI/Terminal.html +593 -0
- data/docs/api/Brut/TUI/TerminalTheme.html +1403 -0
- data/docs/api/Brut/TUI/Themes/Dark.html +706 -0
- data/docs/api/Brut/TUI/Themes/Light.html +804 -0
- data/docs/api/Brut/TUI/Themes/None.html +218 -0
- data/docs/api/Brut/TUI/Themes.html +115 -0
- data/docs/api/Brut/TUI.html +129 -0
- data/docs/api/Brut.html +3 -3
- data/docs/api/Clock.html +1 -1
- data/docs/api/ModuleName.html +1 -1
- data/docs/api/RichString.html +1 -1
- data/docs/api/SemanticLogger/Appender/Async.html +1 -1
- data/docs/api/Sequel/Extensions/BrutInstrumentation.html +1 -1
- data/docs/api/Sequel/Extensions/BrutMigrations.html +1 -1
- data/docs/api/Sequel/Extensions.html +1 -1
- data/docs/api/Sequel/Plugins/CreatedAt/InstanceMethods.html +1 -1
- data/docs/api/Sequel/Plugins/CreatedAt.html +1 -1
- data/docs/api/Sequel/Plugins/ExternalId/ClassMethods.html +1 -1
- data/docs/api/Sequel/Plugins/ExternalId/InstanceMethods.html +1 -1
- data/docs/api/Sequel/Plugins/ExternalId.html +1 -1
- data/docs/api/Sequel/Plugins/FindBang/ClassMethods.html +1 -1
- data/docs/api/Sequel/Plugins/FindBang.html +1 -1
- data/docs/api/Sequel/Plugins.html +1 -1
- data/docs/api/Sequel.html +1 -1
- data/docs/api/SpecSupport/Matchers/BeABug.html +143 -0
- data/docs/api/_index.html +246 -1
- data/docs/api/class_list.html +1 -1
- data/docs/api/file.README.html +1 -1
- data/docs/api/index.html +1 -1
- data/docs/api/method_list.html +1551 -431
- data/docs/api/top-level-namespace.html +1 -1
- data/docs/assets/{app.CovevI7X.js → app.B8jAEB7R.js} +1 -1
- data/docs/assets/chunks/@localSearchIndexroot.DJ8mocCj.js +1 -0
- data/docs/assets/chunks/{VPLocalSearchBox.CrvLAvKW.js → VPLocalSearchBox.gF-Po_fz.js} +1 -1
- data/docs/assets/chunks/{theme.BAi5_yQI.js → theme.BjPAOJkz.js} +2 -2
- data/docs/assets/{components.md.9sqJ27Oc.js → components.md.Ber8UBM0.js} +3 -3
- data/docs/assets/{configuration.md.Cb_oAR8Z.js → configuration.md.DrJ6YVoZ.js} +1 -1
- data/docs/assets/{forms.md.BdpYpNIk.js → forms.md.RK0zkhm0.js} +2 -2
- data/docs/assets/{forms.md.BdpYpNIk.lean.js → forms.md.RK0zkhm0.lean.js} +1 -1
- data/docs/assets/{getting-started.md.CKpNGvno.js → getting-started.md.CGJ44juQ.js} +2 -2
- data/docs/assets/{tutorials_02-dialog.md.Z_DOF2mU.js → tutorials_02-dialog.md.DE5WfCXI.js} +1 -1
- data/docs/assets.html +3 -3
- data/docs/brut-css/brut.css +1 -0
- data/docs/brut-js/api/AjaxSubmit.html +1 -1
- data/docs/brut-js/api/AjaxSubmit.js.html +1 -1
- data/docs/brut-js/api/Autosubmit.html +1 -1
- data/docs/brut-js/api/Autosubmit.js.html +1 -1
- data/docs/brut-js/api/BaseCustomElement.html +1 -1
- data/docs/brut-js/api/BaseCustomElement.js.html +1 -1
- data/docs/brut-js/api/BrutCustomElements.html +1 -1
- data/docs/brut-js/api/BufferedLogger.html +1 -1
- data/docs/brut-js/api/ConfirmSubmit.html +1 -1
- data/docs/brut-js/api/ConfirmSubmit.js.html +1 -1
- data/docs/brut-js/api/ConfirmationDialog.html +1 -1
- data/docs/brut-js/api/ConfirmationDialog.js.html +1 -1
- data/docs/brut-js/api/ConstraintViolationMessage.html +1 -1
- data/docs/brut-js/api/ConstraintViolationMessage.js.html +1 -1
- data/docs/brut-js/api/ConstraintViolationMessages.html +1 -1
- data/docs/brut-js/api/ConstraintViolationMessages.js.html +1 -1
- data/docs/brut-js/api/CopyToClipboard.html +1 -1
- data/docs/brut-js/api/CopyToClipboard.js.html +1 -1
- data/docs/brut-js/api/Form.html +1 -1
- data/docs/brut-js/api/Form.js.html +1 -1
- data/docs/brut-js/api/I18nTranslation.html +1 -1
- data/docs/brut-js/api/I18nTranslation.js.html +1 -1
- data/docs/brut-js/api/LocaleDetection.html +1 -1
- data/docs/brut-js/api/LocaleDetection.js.html +1 -1
- data/docs/brut-js/api/Logger.html +1 -1
- data/docs/brut-js/api/Logger.js.html +1 -1
- data/docs/brut-js/api/Message.html +1 -1
- data/docs/brut-js/api/Message.js.html +1 -1
- data/docs/brut-js/api/PrefixedLogger.html +1 -1
- data/docs/brut-js/api/RichString.html +1 -1
- data/docs/brut-js/api/RichString.js.html +1 -1
- data/docs/brut-js/api/Tabs.html +1 -1
- data/docs/brut-js/api/Tabs.js.html +1 -1
- data/docs/brut-js/api/Toast.html +1 -1
- data/docs/brut-js/api/Toast.js.html +1 -1
- data/docs/brut-js/api/Tracing.html +1 -1
- data/docs/brut-js/api/Tracing.js.html +1 -1
- data/docs/brut-js/api/external-CustomElementRegistry.html +1 -1
- data/docs/brut-js/api/external-Performance.html +1 -1
- data/docs/brut-js/api/external-Promise.html +1 -1
- data/docs/brut-js/api/external-ValidityState.html +1 -1
- data/docs/brut-js/api/external-Window.html +1 -1
- data/docs/brut-js/api/external-fetch.html +1 -1
- data/docs/brut-js/api/global.html +1 -1
- data/docs/brut-js/api/index.html +1 -1
- data/docs/brut-js/api/index.js.html +1 -1
- data/docs/brut-js/api/module-testing.html +1 -1
- data/docs/brut-js/api/testing.AssetMetadata.html +1 -1
- data/docs/brut-js/api/testing.AssetMetadataLoader.html +1 -1
- data/docs/brut-js/api/testing.CustomElementTest.html +1 -1
- data/docs/brut-js/api/testing.DOMCreator.html +1 -1
- data/docs/brut-js/api/testing_AssetMetadata.js.html +1 -1
- data/docs/brut-js/api/testing_AssetMetadataLoader.js.html +1 -1
- data/docs/brut-js/api/testing_CustomElementTest.js.html +1 -1
- data/docs/brut-js/api/testing_DOMCreator.js.html +1 -1
- data/docs/brut-js/api/testing_index.js.html +1 -1
- data/docs/brut-js.html +3 -3
- data/docs/business-logic.html +3 -3
- data/docs/cli.html +3 -3
- data/docs/components.html +7 -7
- data/docs/configuration.html +5 -5
- data/docs/css.html +3 -3
- data/docs/custom-element-tests.html +3 -3
- data/docs/database-access.html +3 -3
- data/docs/database-schema.html +3 -3
- data/docs/deployment.html +3 -3
- data/docs/dev-environment.html +3 -3
- data/docs/dir-structure.html +3 -3
- data/docs/doc-conventions.html +3 -3
- data/docs/end-to-end-tests.html +3 -3
- data/docs/features.html +3 -3
- data/docs/flash-and-session.html +3 -3
- data/docs/form-constraints.html +3 -3
- data/docs/forms.html +5 -5
- data/docs/getting-started.html +6 -6
- data/docs/handlers.html +3 -3
- data/docs/hashmap.json +1 -1
- data/docs/hooks.html +3 -3
- data/docs/i18n.html +3 -3
- data/docs/index.html +3 -3
- data/docs/instrumentation.html +3 -3
- data/docs/javascript.html +3 -3
- data/docs/jobs.html +3 -3
- data/docs/keyword-injection.html +3 -3
- data/docs/layouts.html +3 -3
- data/docs/lsp.html +3 -3
- data/docs/markdown-examples.html +3 -3
- data/docs/middleware.html +3 -3
- data/docs/overview.html +3 -3
- data/docs/pages.html +3 -3
- data/docs/recipes/alternate-layouts.html +3 -3
- data/docs/recipes/authentication.html +3 -3
- data/docs/recipes/custom-flash.html +3 -3
- data/docs/recipes/dev-env-secrets.html +3 -3
- data/docs/recipes/form-errors.html +3 -3
- data/docs/recipes/indexed-forms.html +3 -3
- data/docs/recipes/migrations.html +3 -3
- data/docs/recipes/text-field-component.html +3 -3
- data/docs/roadmap.html +3 -3
- data/docs/routes.html +3 -3
- data/docs/security.html +3 -3
- data/docs/seed-data.html +3 -3
- data/docs/space-time-continuum.html +3 -3
- data/docs/tutorial.html +3 -3
- data/docs/tutorials/01-intro.html +3 -3
- data/docs/tutorials/02-dialog.html +5 -5
- data/docs/unit-tests.html +3 -3
- data/docs/why.html +3 -3
- data/lib/brut/cli/apps/build_assets.rb +1 -1
- data/lib/brut/cli/apps/heroku_container_based_deploy.rb +1 -1
- data/lib/brut/cli/apps/test.rb +6 -4
- data/lib/brut/tui/ansi_escape_code.rb +104 -0
- data/lib/brut/tui/event_loop.rb +168 -0
- data/lib/brut/tui/events/base_event.rb +29 -0
- data/lib/brut/tui/events/event_bus.rb +73 -0
- data/lib/brut/tui/events/event_loop_started.rb +5 -0
- data/lib/brut/tui/events/exception.rb +24 -0
- data/lib/brut/tui/events/tick.rb +12 -0
- data/lib/brut/tui/events.rb +7 -0
- data/lib/brut/tui/markup_string.rb +68 -0
- data/lib/brut/tui/script/block_step.rb +17 -0
- data/lib/brut/tui/script/events/command_execution_failed.rb +4 -0
- data/lib/brut/tui/script/events/command_execution_succeeded.rb +3 -0
- data/lib/brut/tui/script/events/command_std_err.rb +3 -0
- data/lib/brut/tui/script/events/command_std_out.rb +13 -0
- data/lib/brut/tui/script/events/executing_command.rb +12 -0
- data/lib/brut/tui/script/events/message.rb +15 -0
- data/lib/brut/tui/script/events/phase_completed.rb +4 -0
- data/lib/brut/tui/script/events/phase_started.rb +14 -0
- data/lib/brut/tui/script/events/script_completed.rb +5 -0
- data/lib/brut/tui/script/events/script_started.rb +12 -0
- data/lib/brut/tui/script/events/step_completed.rb +3 -0
- data/lib/brut/tui/script/events/step_started.rb +12 -0
- data/lib/brut/tui/script/events.rb +14 -0
- data/lib/brut/tui/script/exec_step.rb +60 -0
- data/lib/brut/tui/script/logging_subscriber.rb +98 -0
- data/lib/brut/tui/script/puts_subscriber.rb +109 -0
- data/lib/brut/tui/script/step.rb +13 -0
- data/lib/brut/tui/script.rb +211 -0
- data/lib/brut/tui/terminal.rb +74 -0
- data/lib/brut/tui/terminal_theme.rb +140 -0
- data/lib/brut/tui/themes/dark.rb +14 -0
- data/lib/brut/tui/themes/light.rb +17 -0
- data/lib/brut/tui/themes/none.rb +9 -0
- data/lib/brut/tui/themes.rb +5 -0
- data/lib/brut/tui.rb +15 -0
- data/lib/brut/version.rb +1 -1
- data/lib/brut.rb +1 -0
- data/mkbrut/Gemfile.lock +1 -1
- data/mkbrut/lib/mkbrut/version.rb +1 -1
- data/specs/brut/tui/ansi_escape_code.spec.rb +30 -0
- data/specs/brut/tui/event_loop.spec.rb +70 -0
- data/specs/brut/tui/events/base_event.spec.rb +26 -0
- data/specs/brut/tui/events/event_bus.spec.rb +141 -0
- data/specs/brut/tui/events/exception.spec.rb +19 -0
- data/specs/brut/tui/events/test_event.rb +5 -0
- data/specs/spec_helper.rb +4 -0
- metadata +124 -15
- data/docs/assets/chunks/@localSearchIndexroot.BiNc3tFI.js +0 -1
- /data/docs/assets/{components.md.9sqJ27Oc.lean.js → components.md.Ber8UBM0.lean.js} +0 -0
- /data/docs/assets/{configuration.md.Cb_oAR8Z.lean.js → configuration.md.DrJ6YVoZ.lean.js} +0 -0
- /data/docs/assets/{getting-started.md.CKpNGvno.lean.js → getting-started.md.CGJ44juQ.lean.js} +0 -0
- /data/docs/assets/{tutorials_02-dialog.md.Z_DOF2mU.lean.js → tutorials_02-dialog.md.DE5WfCXI.lean.js} +0 -0
|
@@ -0,0 +1,1250 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>
|
|
7
|
+
Class: Brut::TUI::Script
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.9.37
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript">
|
|
18
|
+
pathId = "Brut::TUI::Script";
|
|
19
|
+
relpath = '../../';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
|
24
|
+
|
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<div class="nav_wrap">
|
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
|
32
|
+
<div id="resizer"></div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="main" tabindex="-1">
|
|
36
|
+
<div id="header">
|
|
37
|
+
<div id="menu">
|
|
38
|
+
|
|
39
|
+
<a href="../../_index.html">Index (S)</a> »
|
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Brut.html" title="Brut (module)">Brut</a></span></span> » <span class='title'><span class='object_link'><a href="../TUI.html" title="Brut::TUI (module)">TUI</a></span></span>
|
|
41
|
+
»
|
|
42
|
+
<span class="title">Script</span>
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div id="search">
|
|
47
|
+
|
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
|
49
|
+
href="../../class_list.html">
|
|
50
|
+
|
|
51
|
+
<svg width="24" height="24">
|
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
</svg>
|
|
56
|
+
</a>
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
<div class="clear"></div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div id="content"><h1>Class: Brut::TUI::Script
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
<dl>
|
|
70
|
+
<dt>Inherits:</dt>
|
|
71
|
+
<dd>
|
|
72
|
+
<span class="inheritName">Object</span>
|
|
73
|
+
|
|
74
|
+
<ul class="fullTree">
|
|
75
|
+
<li>Object</li>
|
|
76
|
+
|
|
77
|
+
<li class="next">Brut::TUI::Script</li>
|
|
78
|
+
|
|
79
|
+
</ul>
|
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
81
|
+
|
|
82
|
+
</dd>
|
|
83
|
+
</dl>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
<dl>
|
|
96
|
+
<dt>Defined in:</dt>
|
|
97
|
+
<dd>lib/brut/tui/script.rb</dd>
|
|
98
|
+
</dl>
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
|
103
|
+
<div class="discussion">
|
|
104
|
+
<p>A TUI script is a set of steps that are executed in order. Steps
|
|
105
|
+
can be grouped int phases, and each step can either shell out
|
|
106
|
+
to an external command or execute Ruby code.</p>
|
|
107
|
+
|
|
108
|
+
<p>You are intended to subclass this class and implement <code>#execute</code>, which can use
|
|
109
|
+
the various methods described here to describe the script. In the context of a
|
|
110
|
+
Brut CLI, your subclass would be used inside the <span class='object_link'><a href="../CLI/Command.html#execute-instance_method" title="Brut::CLI::Command#execute (method)">CLI::Command#execute</a></span> method, where
|
|
111
|
+
it would call <code>#run!</code> (not <code>#execute</code>).</p>
|
|
112
|
+
|
|
113
|
+
<p>Inside <code>#execute</code> you should call <code>#phase</code> for each logical phase/grouping of steps. There must be at least
|
|
114
|
+
one phase. Inside each <code>phase</code> you should call <code>#step</code> one or more times. When a phase is actually executed,
|
|
115
|
+
it's contents are executed, so anything inside the block will be called. Intermediate variables to allow <code>step</code>s to
|
|
116
|
+
communicate will work.</p>
|
|
117
|
+
|
|
118
|
+
<p>After all phases, call <code>done</code> with a success message.</p>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="tags">
|
|
124
|
+
|
|
125
|
+
<div class="examples">
|
|
126
|
+
<h4 class="tag_title">Examples:</h4>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
<pre class="example code"><code><span class='kw'>def</span> <span class='id identifier rubyid_execute'>execute</span>
|
|
130
|
+
<span class='id identifier rubyid_phase'>phase</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set up test data</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
|
131
|
+
<span class='id identifier rubyid_step'>step</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Initializing database</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
|
132
|
+
<span class='label'>exec:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>bin/db rebuild -e test</span><span class='tstring_end'>"</span></span>
|
|
133
|
+
<span class='id identifier rubyid_step'>step</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Loading data</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
|
134
|
+
<span class='const'>MyData</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
|
|
135
|
+
<span class='id identifier rubyid_notify'>notify</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Inserting </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_data'>data</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
136
|
+
<span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_insert!'>insert!</span>
|
|
137
|
+
<span class='kw'>end</span>
|
|
138
|
+
<span class='kw'>end</span>
|
|
139
|
+
<span class='kw'>end</span>
|
|
140
|
+
<span class='id identifier rubyid_phase'>phase</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Checking data integrity</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
|
141
|
+
<span class='id identifier rubyid_problems'>problems</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
142
|
+
<span class='id identifier rubyid_step'>step</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Analyzing data</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
|
143
|
+
<span class='const'>MyData</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
|
|
144
|
+
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_analyze'>analyze</span>
|
|
145
|
+
<span class='id identifier rubyid_problems'>problems</span> <span class='op'><<</span> <span class='id identifier rubyid_data'>data</span>
|
|
146
|
+
<span class='kw'>end</span>
|
|
147
|
+
<span class='kw'>end</span>
|
|
148
|
+
<span class='kw'>end</span>
|
|
149
|
+
<span class='id identifier rubyid_step'>step</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Checking problems</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
|
150
|
+
<span class='id identifier rubyid_abort'>abort</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
151
|
+
<span class='id identifier rubyid_problems'>problems</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_problem'>problem</span><span class='op'>|</span>
|
|
152
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_problem'>problem</span><span class='period'>.</span><span class='id identifier rubyid_warning?'>warning?</span>
|
|
153
|
+
<span class='id identifier rubyid_warning'>warning</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_problem'>problem</span><span class='embexpr_end'>}</span><span class='tstring_content'> may be an issue, but we can proceed</span><span class='tstring_end'>"</span></span>
|
|
154
|
+
<span class='kw'>else</span>
|
|
155
|
+
<span class='id identifier rubyid_error'>error</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_problem'>problem</span><span class='embexpr_end'>}</span><span class='tstring_content'> will prevent our test from working</span><span class='tstring_end'>"</span></span>
|
|
156
|
+
<span class='id identifier rubyid_abort'>abort</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
157
|
+
<span class='kw'>end</span>
|
|
158
|
+
<span class='kw'>end</span>
|
|
159
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_abort'>abort</span>
|
|
160
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Problems prevented script from working</span><span class='tstring_end'>"</span></span>
|
|
161
|
+
<span class='kw'>end</span>
|
|
162
|
+
<span class='kw'>end</span>
|
|
163
|
+
<span class='kw'>end</span>
|
|
164
|
+
|
|
165
|
+
<span class='id identifier rubyid_done'>done</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>All ready to go!</span><span class='tstring_end'>"</span></span>
|
|
166
|
+
<span class='kw'>end</span></code></pre>
|
|
167
|
+
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
</div><h2>Defined Under Namespace</h2>
|
|
172
|
+
<p class="children">
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Script/Events.html" title="Brut::TUI::Script::Events (module)">Events</a></span>
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Script/BlockStep.html" title="Brut::TUI::Script::BlockStep (class)">BlockStep</a></span>, <span class='object_link'><a href="Script/ExecStep.html" title="Brut::TUI::Script::ExecStep (class)">ExecStep</a></span>, <span class='object_link'><a href="Script/LoggingSubscriber.html" title="Brut::TUI::Script::LoggingSubscriber (class)">LoggingSubscriber</a></span>, <span class='object_link'><a href="Script/PutsSubscriber.html" title="Brut::TUI::Script::PutsSubscriber (class)">PutsSubscriber</a></span>, <span class='object_link'><a href="Script/Step.html" title="Brut::TUI::Script::Step (class)">Step</a></span>
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
</p>
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
<h2>
|
|
192
|
+
Class Method Summary
|
|
193
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
194
|
+
</h2>
|
|
195
|
+
|
|
196
|
+
<ul class="summary">
|
|
197
|
+
|
|
198
|
+
<li class="public ">
|
|
199
|
+
<span class="summary_signature">
|
|
200
|
+
|
|
201
|
+
<a href="#log_filename-class_method" title="log_filename (class method)">.<strong>log_filename</strong> ⇒ Object </a>
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
</span>
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
<span class="summary_desc"><div class='inline'><p>Return the basename of a log file unique to this script.</p>
|
|
216
|
+
</div></span>
|
|
217
|
+
|
|
218
|
+
</li>
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
</ul>
|
|
222
|
+
|
|
223
|
+
<h2>
|
|
224
|
+
Instance Method Summary
|
|
225
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
226
|
+
</h2>
|
|
227
|
+
|
|
228
|
+
<ul class="summary">
|
|
229
|
+
|
|
230
|
+
<li class="public ">
|
|
231
|
+
<span class="summary_signature">
|
|
232
|
+
|
|
233
|
+
<a href="#done-instance_method" title="#done (instance method)">#<strong>done</strong>(message) ⇒ Object </a>
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
</span>
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
<span class="summary_desc"><div class='inline'><p>Message to show if the script completes successful.</p>
|
|
248
|
+
</div></span>
|
|
249
|
+
|
|
250
|
+
</li>
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
<li class="public ">
|
|
254
|
+
<span class="summary_signature">
|
|
255
|
+
|
|
256
|
+
<a href="#error-instance_method" title="#error (instance method)">#<strong>error</strong>(message) ⇒ Object </a>
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
</span>
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
<span class="summary_desc"><div class='inline'><p>Let the user know there was an error.</p>
|
|
271
|
+
</div></span>
|
|
272
|
+
|
|
273
|
+
</li>
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
<li class="public ">
|
|
277
|
+
<span class="summary_signature">
|
|
278
|
+
|
|
279
|
+
<a href="#filename-instance_method" title="#filename (instance method)">#<strong>filename</strong>(path) ⇒ Object </a>
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
</span>
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
<span class="summary_desc"><div class='inline'><p>Wrap a fully-qualified filename in code markup and trim the path to only show the path relative to the root dir.</p>
|
|
294
|
+
</div></span>
|
|
295
|
+
|
|
296
|
+
</li>
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
<li class="public ">
|
|
300
|
+
<span class="summary_signature">
|
|
301
|
+
|
|
302
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(root_dir: nil, ansi: true) ⇒ Script </a>
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
</span>
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
<span class="note title constructor">constructor</span>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
<span class="summary_desc"><div class='inline'><p>Create the script.</p>
|
|
319
|
+
</div></span>
|
|
320
|
+
|
|
321
|
+
</li>
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
<li class="public ">
|
|
325
|
+
<span class="summary_signature">
|
|
326
|
+
|
|
327
|
+
<a href="#notify-instance_method" title="#notify (instance method)">#<strong>notify</strong>(message) ⇒ Object </a>
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
</span>
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
<span class="summary_desc"><div class='inline'><p>Notify the user of an event.</p>
|
|
342
|
+
</div></span>
|
|
343
|
+
|
|
344
|
+
</li>
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
<li class="public ">
|
|
348
|
+
<span class="summary_signature">
|
|
349
|
+
|
|
350
|
+
<a href="#phase-instance_method" title="#phase (instance method)">#<strong>phase</strong>(name, &block) ⇒ Object </a>
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
</span>
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
<span class="summary_desc"><div class='inline'><p>Create a new phase for the script.</p>
|
|
365
|
+
</div></span>
|
|
366
|
+
|
|
367
|
+
</li>
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
<li class="public ">
|
|
371
|
+
<span class="summary_signature">
|
|
372
|
+
|
|
373
|
+
<a href="#run!-instance_method" title="#run! (instance method)">#<strong>run!</strong> ⇒ Object </a>
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
</span>
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
<span class="summary_desc"><div class='inline'><p>Entry point for a script.</p>
|
|
388
|
+
</div></span>
|
|
389
|
+
|
|
390
|
+
</li>
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
<li class="public ">
|
|
394
|
+
<span class="summary_signature">
|
|
395
|
+
|
|
396
|
+
<a href="#step-instance_method" title="#step (instance method)">#<strong>step</strong>(description, exec: nil) { ... } ⇒ Object </a>
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
</span>
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
<span class="summary_desc"><div class='inline'><p>A step to run inside a phase.</p>
|
|
411
|
+
</div></span>
|
|
412
|
+
|
|
413
|
+
</li>
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
<li class="public ">
|
|
417
|
+
<span class="summary_signature">
|
|
418
|
+
|
|
419
|
+
<a href="#success-instance_method" title="#success (instance method)">#<strong>success</strong>(message) ⇒ Object </a>
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
</span>
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
<span class="summary_desc"><div class='inline'><p>Let the user know something succeeded.</p>
|
|
434
|
+
</div></span>
|
|
435
|
+
|
|
436
|
+
</li>
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
<li class="public ">
|
|
440
|
+
<span class="summary_signature">
|
|
441
|
+
|
|
442
|
+
<a href="#warning-instance_method" title="#warning (instance method)">#<strong>warning</strong>(message) ⇒ Object </a>
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
</span>
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
<span class="summary_desc"><div class='inline'><p>Warn the user of an event.</p>
|
|
457
|
+
</div></span>
|
|
458
|
+
|
|
459
|
+
</li>
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
</ul>
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
<div id="constructor_details" class="method_details_list">
|
|
466
|
+
<h2>Constructor Details</h2>
|
|
467
|
+
|
|
468
|
+
<div class="method_details first">
|
|
469
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
470
|
+
|
|
471
|
+
#<strong>initialize</strong>(root_dir: nil, ansi: true) ⇒ <tt><span class='object_link'><a href="" title="Brut::TUI::Script (class)">Script</a></span></tt>
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
</h3><div class="docstring">
|
|
478
|
+
<div class="discussion">
|
|
479
|
+
<p>Create the script. By default, two subscribers are set up: <span class='object_link'><a href="Script/LoggingSubscriber.html" title="Brut::TUI::Script::LoggingSubscriber (class)">LoggingSubscriber</a></span>
|
|
480
|
+
and <span class='object_link'><a href="Script/PutsSubscriber.html" title="Brut::TUI::Script::PutsSubscriber (class)">PutsSubscriber</a></span>. The logging subscriber will output a detailed
|
|
481
|
+
log into <code>logs/</code> using the file named by <span class='object_link'><a href="#log_filename-class_method" title="Brut::TUI::Script.log_filename (method)">log_filename</a></span>. The <code>PutsSubscriber</code> will
|
|
482
|
+
output ANSI-Fancy messages as the script proceeds.</p>
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
</div>
|
|
486
|
+
</div>
|
|
487
|
+
<div class="tags">
|
|
488
|
+
<p class="tag_title">Parameters:</p>
|
|
489
|
+
<ul class="param">
|
|
490
|
+
|
|
491
|
+
<li>
|
|
492
|
+
|
|
493
|
+
<span class='name'>root_dir</span>
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
<span class='type'>(<tt>String|Pathname</tt>)</span>
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
—
|
|
503
|
+
<div class='inline'><p>path to the root of the Brut project.</p>
|
|
504
|
+
</div>
|
|
505
|
+
|
|
506
|
+
</li>
|
|
507
|
+
|
|
508
|
+
<li>
|
|
509
|
+
|
|
510
|
+
<span class='name'>ansi</span>
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
<span class='type'>(<tt>true|false</tt>)</span>
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
<em class="default">(defaults to: <tt>true</tt>)</em>
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
—
|
|
520
|
+
<div class='inline'><p>if true, the <span class='object_link'><a href="Script/PutsSubscriber.html" title="Brut::TUI::Script::PutsSubscriber (class)">PutsSubscriber</a></span> will use
|
|
521
|
+
ANSI escape codes to format the output. If false, it won't.</p>
|
|
522
|
+
</div>
|
|
523
|
+
|
|
524
|
+
</li>
|
|
525
|
+
|
|
526
|
+
</ul>
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
</div><table class="source_code">
|
|
530
|
+
<tr>
|
|
531
|
+
<td>
|
|
532
|
+
<pre class="lines">
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
84
|
|
536
|
+
85
|
|
537
|
+
86
|
|
538
|
+
87
|
|
539
|
+
88
|
|
540
|
+
89
|
|
541
|
+
90
|
|
542
|
+
91
|
|
543
|
+
92
|
|
544
|
+
93
|
|
545
|
+
94
|
|
546
|
+
95
|
|
547
|
+
96
|
|
548
|
+
97
|
|
549
|
+
98
|
|
550
|
+
99
|
|
551
|
+
100
|
|
552
|
+
101
|
|
553
|
+
102
|
|
554
|
+
103
|
|
555
|
+
104
|
|
556
|
+
105
|
|
557
|
+
106
|
|
558
|
+
107</pre>
|
|
559
|
+
</td>
|
|
560
|
+
<td>
|
|
561
|
+
<pre class="code"><span class="info file"># File 'lib/brut/tui/script.rb', line 84</span>
|
|
562
|
+
|
|
563
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>root_dir:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>ansi:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
|
564
|
+
<span class='ivar'>@root_dir</span> <span class='op'>=</span> <span class='id identifier rubyid_root_dir'>root_dir</span> <span class='op'>?</span> <span class='const'>Pathname</span><span class='lparen'>(</span><span class='id identifier rubyid_root_dir'>root_dir</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
|
565
|
+
<span class='id identifier rubyid_logs_dir'>logs_dir</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='ivar'>@root_dir</span>
|
|
566
|
+
<span class='ivar'>@root_dir</span> <span class='op'>/</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>logs</span><span class='tstring_end'>"</span></span>
|
|
567
|
+
<span class='kw'>else</span>
|
|
568
|
+
<span class='const'>Pathame</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='op'>/</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>logs</span><span class='tstring_end'>"</span></span>
|
|
569
|
+
<span class='kw'>end</span>
|
|
570
|
+
<span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_mkdir_p'>mkdir_p</span><span class='lparen'>(</span><span class='id identifier rubyid_logs_dir'>logs_dir</span><span class='rparen'>)</span>
|
|
571
|
+
<span class='ivar'>@event_loop</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Brut.html" title="Brut (module)">Brut</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../TUI.html" title="Brut::TUI (module)">TUI</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="EventLoop.html" title="Brut::TUI::EventLoop (class)">EventLoop</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="EventLoop.html#initialize-instance_method" title="Brut::TUI::EventLoop#initialize (method)">new</a></span></span>
|
|
572
|
+
|
|
573
|
+
<span class='id identifier rubyid_logging_subscriber'>logging_subscriber</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Script/LoggingSubscriber.html" title="Brut::TUI::Script::LoggingSubscriber (class)">LoggingSubscriber</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Script/LoggingSubscriber.html#initialize-instance_method" title="Brut::TUI::Script::LoggingSubscriber#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='gvar'>$0</span><span class='comma'>,</span> <span class='label'>logfile:</span> <span class='id identifier rubyid_logs_dir'>logs_dir</span> <span class='op'>/</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_log_filename'>log_filename</span><span class='embexpr_end'>}</span><span class='tstring_content'>.log</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
574
|
+
<span class='id identifier rubyid_terminal'>terminal</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Brut.html" title="Brut (module)">Brut</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../TUI.html" title="Brut::TUI (module)">TUI</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Terminal.html" title="Brut::TUI::Terminal (class)">Terminal</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Terminal.html#initialize-instance_method" title="Brut::TUI::Terminal#initialize (method)">new</a></span></span>
|
|
575
|
+
<span class='id identifier rubyid_theme'>theme</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_ansi'>ansi</span>
|
|
576
|
+
<span class='const'><span class='object_link'><a href="../../Brut.html" title="Brut (module)">Brut</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../TUI.html" title="Brut::TUI (module)">TUI</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="TerminalTheme.html" title="Brut::TUI::TerminalTheme (class)">TerminalTheme</a></span></span><span class='period'>.</span><span class='id identifier rubyid_based_on_background'><span class='object_link'><a href="TerminalTheme.html#based_on_background-class_method" title="Brut::TUI::TerminalTheme.based_on_background (method)">based_on_background</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_terminal'>terminal</span><span class='rparen'>)</span>
|
|
577
|
+
<span class='kw'>else</span>
|
|
578
|
+
<span class='const'><span class='object_link'><a href="../../Brut.html" title="Brut (module)">Brut</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../TUI.html" title="Brut::TUI (module)">TUI</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Themes.html" title="Brut::TUI::Themes (module)">Themes</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Themes/None.html" title="Brut::TUI::Themes::None (class)">None</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="TerminalTheme.html#initialize-instance_method" title="Brut::TUI::TerminalTheme#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_terminal'>terminal</span><span class='rparen'>)</span>
|
|
579
|
+
<span class='kw'>end</span>
|
|
580
|
+
<span class='id identifier rubyid_puts_subscriber'>puts_subscriber</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Brut.html" title="Brut (module)">Brut</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../TUI.html" title="Brut::TUI (module)">TUI</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Brut::TUI::Script (class)">Script</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Script/PutsSubscriber.html" title="Brut::TUI::Script::PutsSubscriber (class)">PutsSubscriber</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Script/PutsSubscriber.html#initialize-instance_method" title="Brut::TUI::Script::PutsSubscriber#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='gvar'>$0</span><span class='comma'>,</span> <span class='label'>terminal:</span><span class='comma'>,</span> <span class='label'>theme:</span><span class='rparen'>)</span>
|
|
581
|
+
|
|
582
|
+
<span class='ivar'>@event_loop</span><span class='period'>.</span><span class='id identifier rubyid_subscribe'>subscribe</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Brut.html" title="Brut (module)">Brut</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../TUI.html" title="Brut::TUI (module)">TUI</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Events.html" title="Brut::TUI::Events (class)">Events</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Events/EventLoopStarted.html" title="Brut::TUI::Events::EventLoopStarted (class)">EventLoopStarted</a></span></span><span class='comma'>,</span><span class='kw'>self</span><span class='rparen'>)</span>
|
|
583
|
+
<span class='ivar'>@event_loop</span><span class='period'>.</span><span class='id identifier rubyid_subscribe_to_all'>subscribe_to_all</span><span class='lparen'>(</span><span class='id identifier rubyid_logging_subscriber'>logging_subscriber</span><span class='rparen'>)</span>
|
|
584
|
+
<span class='ivar'>@event_loop</span><span class='period'>.</span><span class='id identifier rubyid_subscribe_to_all'>subscribe_to_all</span><span class='lparen'>(</span><span class='id identifier rubyid_puts_subscriber'>puts_subscriber</span><span class='rparen'>)</span>
|
|
585
|
+
|
|
586
|
+
<span class='kw'>end</span></pre>
|
|
587
|
+
</td>
|
|
588
|
+
</tr>
|
|
589
|
+
</table>
|
|
590
|
+
</div>
|
|
591
|
+
|
|
592
|
+
</div>
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
<div id="class_method_details" class="method_details_list">
|
|
596
|
+
<h2>Class Method Details</h2>
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
<div class="method_details first">
|
|
600
|
+
<h3 class="signature first" id="log_filename-class_method">
|
|
601
|
+
|
|
602
|
+
.<strong>log_filename</strong> ⇒ <tt>Object</tt>
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
</h3><div class="docstring">
|
|
609
|
+
<div class="discussion">
|
|
610
|
+
<p>Return the basename of a log file unique to this script. This will use
|
|
611
|
+
the subclass name to come up with a reasonable name, however your
|
|
612
|
+
class can override this.</p>
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
</div>
|
|
616
|
+
</div>
|
|
617
|
+
<div class="tags">
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
</div><table class="source_code">
|
|
621
|
+
<tr>
|
|
622
|
+
<td>
|
|
623
|
+
<pre class="lines">
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
71
|
|
627
|
+
72
|
|
628
|
+
73
|
|
629
|
+
74</pre>
|
|
630
|
+
</td>
|
|
631
|
+
<td>
|
|
632
|
+
<pre class="code"><span class="info file"># File 'lib/brut/tui/script.rb', line 71</span>
|
|
633
|
+
|
|
634
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_log_filename'>log_filename</span>
|
|
635
|
+
<span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>Script$</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>::$</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>::</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span>
|
|
636
|
+
<span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>([a-z])([A-Z])</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>\1_\2</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span>
|
|
637
|
+
<span class='kw'>end</span></pre>
|
|
638
|
+
</td>
|
|
639
|
+
</tr>
|
|
640
|
+
</table>
|
|
641
|
+
</div>
|
|
642
|
+
|
|
643
|
+
</div>
|
|
644
|
+
|
|
645
|
+
<div id="instance_method_details" class="method_details_list">
|
|
646
|
+
<h2>Instance Method Details</h2>
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
<div class="method_details first">
|
|
650
|
+
<h3 class="signature first" id="done-instance_method">
|
|
651
|
+
|
|
652
|
+
#<strong>done</strong>(message) ⇒ <tt>Object</tt>
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
</h3><div class="docstring">
|
|
659
|
+
<div class="discussion">
|
|
660
|
+
<p>Message to show if the script completes successful. Should only be called once
|
|
661
|
+
and not inside a phase or step.</p>
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
</div>
|
|
665
|
+
</div>
|
|
666
|
+
<div class="tags">
|
|
667
|
+
<p class="tag_title">Parameters:</p>
|
|
668
|
+
<ul class="param">
|
|
669
|
+
|
|
670
|
+
<li>
|
|
671
|
+
|
|
672
|
+
<span class='name'>message</span>
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
—
|
|
680
|
+
<div class='inline'><p>Message to show</p>
|
|
681
|
+
</div>
|
|
682
|
+
|
|
683
|
+
</li>
|
|
684
|
+
|
|
685
|
+
</ul>
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
</div><table class="source_code">
|
|
689
|
+
<tr>
|
|
690
|
+
<td>
|
|
691
|
+
<pre class="lines">
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
190
|
|
695
|
+
191
|
|
696
|
+
192</pre>
|
|
697
|
+
</td>
|
|
698
|
+
<td>
|
|
699
|
+
<pre class="code"><span class="info file"># File 'lib/brut/tui/script.rb', line 190</span>
|
|
700
|
+
|
|
701
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_done'>done</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
|
702
|
+
<span class='ivar'>@done_message</span> <span class='op'>=</span> <span class='id identifier rubyid_message'>message</span>
|
|
703
|
+
<span class='kw'>end</span></pre>
|
|
704
|
+
</td>
|
|
705
|
+
</tr>
|
|
706
|
+
</table>
|
|
707
|
+
</div>
|
|
708
|
+
|
|
709
|
+
<div class="method_details ">
|
|
710
|
+
<h3 class="signature " id="error-instance_method">
|
|
711
|
+
|
|
712
|
+
#<strong>error</strong>(message) ⇒ <tt>Object</tt>
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
</h3><div class="docstring">
|
|
719
|
+
<div class="discussion">
|
|
720
|
+
<p>Let the user know there was an error. Note that this will not stop
|
|
721
|
+
the script. Raise an exception to do that.</p>
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
</div>
|
|
725
|
+
</div>
|
|
726
|
+
<div class="tags">
|
|
727
|
+
<p class="tag_title">Parameters:</p>
|
|
728
|
+
<ul class="param">
|
|
729
|
+
|
|
730
|
+
<li>
|
|
731
|
+
|
|
732
|
+
<span class='name'>message</span>
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
—
|
|
740
|
+
<div class='inline'><p>Message to show</p>
|
|
741
|
+
</div>
|
|
742
|
+
|
|
743
|
+
</li>
|
|
744
|
+
|
|
745
|
+
</ul>
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
</div><table class="source_code">
|
|
749
|
+
<tr>
|
|
750
|
+
<td>
|
|
751
|
+
<pre class="lines">
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
198
|
|
755
|
+
199
|
|
756
|
+
200</pre>
|
|
757
|
+
</td>
|
|
758
|
+
<td>
|
|
759
|
+
<pre class="code"><span class="info file"># File 'lib/brut/tui/script.rb', line 198</span>
|
|
760
|
+
|
|
761
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
|
762
|
+
<span class='ivar'>@event_loop</span> <span class='op'><<</span> <span class='const'><span class='object_link'><a href="Script/Events.html" title="Brut::TUI::Script::Events (module)">Events</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Script/Events/Message.html" title="Brut::TUI::Script::Events::Message (class)">Message</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Script/Events/Message.html#initialize-instance_method" title="Brut::TUI::Script::Events::Message#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>message:</span><span class='comma'>,</span> <span class='label'>type:</span> <span class='symbol'>:error</span><span class='rparen'>)</span>
|
|
763
|
+
<span class='kw'>end</span></pre>
|
|
764
|
+
</td>
|
|
765
|
+
</tr>
|
|
766
|
+
</table>
|
|
767
|
+
</div>
|
|
768
|
+
|
|
769
|
+
<div class="method_details ">
|
|
770
|
+
<h3 class="signature " id="filename-instance_method">
|
|
771
|
+
|
|
772
|
+
#<strong>filename</strong>(path) ⇒ <tt>Object</tt>
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
</h3><div class="docstring">
|
|
779
|
+
<div class="discussion">
|
|
780
|
+
<p>Wrap a fully-qualified filename in code markup and trim the path to only
|
|
781
|
+
show the path relative to the root dir. This is much friendlier than showing a
|
|
782
|
+
long expanded path.</p>
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
</div>
|
|
786
|
+
</div>
|
|
787
|
+
<div class="tags">
|
|
788
|
+
<p class="tag_title">Parameters:</p>
|
|
789
|
+
<ul class="param">
|
|
790
|
+
|
|
791
|
+
<li>
|
|
792
|
+
|
|
793
|
+
<span class='name'>path</span>
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
<span class='type'>(<tt>String|Pathname</tt>)</span>
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
—
|
|
801
|
+
<div class='inline'><p>a fully-qualified path to something inside your Brut app.</p>
|
|
802
|
+
</div>
|
|
803
|
+
|
|
804
|
+
</li>
|
|
805
|
+
|
|
806
|
+
</ul>
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
</div><table class="source_code">
|
|
810
|
+
<tr>
|
|
811
|
+
<td>
|
|
812
|
+
<pre class="lines">
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
207
|
|
816
|
+
208
|
|
817
|
+
209
|
|
818
|
+
210</pre>
|
|
819
|
+
</td>
|
|
820
|
+
<td>
|
|
821
|
+
<pre class="code"><span class="info file"># File 'lib/brut/tui/script.rb', line 207</span>
|
|
822
|
+
|
|
823
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_filename'>filename</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
|
824
|
+
<span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='const'>Pathname</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span>
|
|
825
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>`</span><span class='tstring_end'>"</span></span> <span class='op'>+</span> <span class='lparen'>(</span><span class='ivar'>@root_dir</span> <span class='op'>?</span> <span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_relative_path_from'>relative_path_from</span><span class='lparen'>(</span><span class='ivar'>@root_dir</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>`</span><span class='tstring_end'>"</span></span>
|
|
826
|
+
<span class='kw'>end</span></pre>
|
|
827
|
+
</td>
|
|
828
|
+
</tr>
|
|
829
|
+
</table>
|
|
830
|
+
</div>
|
|
831
|
+
|
|
832
|
+
<div class="method_details ">
|
|
833
|
+
<h3 class="signature " id="notify-instance_method">
|
|
834
|
+
|
|
835
|
+
#<strong>notify</strong>(message) ⇒ <tt>Object</tt>
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
</h3><div class="docstring">
|
|
842
|
+
<div class="discussion">
|
|
843
|
+
<p>Notify the user of an event</p>
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
</div>
|
|
847
|
+
</div>
|
|
848
|
+
<div class="tags">
|
|
849
|
+
<p class="tag_title">Parameters:</p>
|
|
850
|
+
<ul class="param">
|
|
851
|
+
|
|
852
|
+
<li>
|
|
853
|
+
|
|
854
|
+
<span class='name'>message</span>
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
—
|
|
862
|
+
<div class='inline'><p>Message to show</p>
|
|
863
|
+
</div>
|
|
864
|
+
|
|
865
|
+
</li>
|
|
866
|
+
|
|
867
|
+
</ul>
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
</div><table class="source_code">
|
|
871
|
+
<tr>
|
|
872
|
+
<td>
|
|
873
|
+
<pre class="lines">
|
|
874
|
+
|
|
875
|
+
|
|
876
|
+
168
|
|
877
|
+
169
|
|
878
|
+
170</pre>
|
|
879
|
+
</td>
|
|
880
|
+
<td>
|
|
881
|
+
<pre class="code"><span class="info file"># File 'lib/brut/tui/script.rb', line 168</span>
|
|
882
|
+
|
|
883
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_notify'>notify</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
|
884
|
+
<span class='ivar'>@event_loop</span> <span class='op'><<</span> <span class='const'><span class='object_link'><a href="Script/Events.html" title="Brut::TUI::Script::Events (module)">Events</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Script/Events/Message.html" title="Brut::TUI::Script::Events::Message (class)">Message</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Script/Events/Message.html#initialize-instance_method" title="Brut::TUI::Script::Events::Message#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>message:</span><span class='comma'>,</span> <span class='label'>type:</span> <span class='symbol'>:notification</span><span class='rparen'>)</span>
|
|
885
|
+
<span class='kw'>end</span></pre>
|
|
886
|
+
</td>
|
|
887
|
+
</tr>
|
|
888
|
+
</table>
|
|
889
|
+
</div>
|
|
890
|
+
|
|
891
|
+
<div class="method_details ">
|
|
892
|
+
<h3 class="signature " id="phase-instance_method">
|
|
893
|
+
|
|
894
|
+
#<strong>phase</strong>(name, &block) ⇒ <tt>Object</tt>
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
</h3><div class="docstring">
|
|
901
|
+
<div class="discussion">
|
|
902
|
+
<p>Create a new phase for the script. A phase is basically a named group
|
|
903
|
+
of steps. The block is not executed immediately, so you may not pass
|
|
904
|
+
data from one phase to another.</p>
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
</div>
|
|
908
|
+
</div>
|
|
909
|
+
<div class="tags">
|
|
910
|
+
<p class="tag_title">Parameters:</p>
|
|
911
|
+
<ul class="param">
|
|
912
|
+
|
|
913
|
+
<li>
|
|
914
|
+
|
|
915
|
+
<span class='name'>name</span>
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
—
|
|
923
|
+
<div class='inline'><p>The name of the phase</p>
|
|
924
|
+
</div>
|
|
925
|
+
|
|
926
|
+
</li>
|
|
927
|
+
|
|
928
|
+
<li>
|
|
929
|
+
|
|
930
|
+
<span class='name'>block</span>
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
<span class='type'>(<tt>Proc</tt>)</span>
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
—
|
|
938
|
+
<div class='inline'><p>The block to execute for the phase</p>
|
|
939
|
+
</div>
|
|
940
|
+
|
|
941
|
+
</li>
|
|
942
|
+
|
|
943
|
+
</ul>
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
</div><table class="source_code">
|
|
947
|
+
<tr>
|
|
948
|
+
<td>
|
|
949
|
+
<pre class="lines">
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
145
|
|
953
|
+
146
|
|
954
|
+
147</pre>
|
|
955
|
+
</td>
|
|
956
|
+
<td>
|
|
957
|
+
<pre class="code"><span class="info file"># File 'lib/brut/tui/script.rb', line 145</span>
|
|
958
|
+
|
|
959
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_phase'>phase</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
960
|
+
<span class='ivar'>@phases</span> <span class='op'><<</span> <span class='lbracket'>[</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span> <span class='rbracket'>]</span>
|
|
961
|
+
<span class='kw'>end</span></pre>
|
|
962
|
+
</td>
|
|
963
|
+
</tr>
|
|
964
|
+
</table>
|
|
965
|
+
</div>
|
|
966
|
+
|
|
967
|
+
<div class="method_details ">
|
|
968
|
+
<h3 class="signature " id="run!-instance_method">
|
|
969
|
+
|
|
970
|
+
#<strong>run!</strong> ⇒ <tt>Object</tt>
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
</h3><div class="docstring">
|
|
977
|
+
<div class="discussion">
|
|
978
|
+
<p>Entry point for a script. This method starts the event loop.</p>
|
|
979
|
+
|
|
980
|
+
|
|
981
|
+
</div>
|
|
982
|
+
</div>
|
|
983
|
+
<div class="tags">
|
|
984
|
+
|
|
985
|
+
|
|
986
|
+
</div><table class="source_code">
|
|
987
|
+
<tr>
|
|
988
|
+
<td>
|
|
989
|
+
<pre class="lines">
|
|
990
|
+
|
|
991
|
+
|
|
992
|
+
131
|
|
993
|
+
132
|
|
994
|
+
133
|
|
995
|
+
134
|
|
996
|
+
135
|
|
997
|
+
136
|
|
998
|
+
137</pre>
|
|
999
|
+
</td>
|
|
1000
|
+
<td>
|
|
1001
|
+
<pre class="code"><span class="info file"># File 'lib/brut/tui/script.rb', line 131</span>
|
|
1002
|
+
|
|
1003
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_run!'>run!</span>
|
|
1004
|
+
<span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_methods'>methods</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='symbol'>:execute</span><span class='rparen'>)</span>
|
|
1005
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>You must implement the execute method in your Brut::TUI::Script subclass</span><span class='tstring_end'>"</span></span>
|
|
1006
|
+
<span class='kw'>end</span>
|
|
1007
|
+
<span class='ivar'>@event_loop</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span>
|
|
1008
|
+
<span class='int'>0</span>
|
|
1009
|
+
<span class='kw'>end</span></pre>
|
|
1010
|
+
</td>
|
|
1011
|
+
</tr>
|
|
1012
|
+
</table>
|
|
1013
|
+
</div>
|
|
1014
|
+
|
|
1015
|
+
<div class="method_details ">
|
|
1016
|
+
<h3 class="signature " id="step-instance_method">
|
|
1017
|
+
|
|
1018
|
+
#<strong>step</strong>(description, exec: nil) { ... } ⇒ <tt>Object</tt>
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
</h3><div class="docstring">
|
|
1025
|
+
<div class="discussion">
|
|
1026
|
+
<p>A step to run inside a phase. Steps within phases are executed immediately once the phase
|
|
1027
|
+
has started, so they can pass data to one anther.</p>
|
|
1028
|
+
|
|
1029
|
+
|
|
1030
|
+
</div>
|
|
1031
|
+
</div>
|
|
1032
|
+
<div class="tags">
|
|
1033
|
+
<p class="tag_title">Parameters:</p>
|
|
1034
|
+
<ul class="param">
|
|
1035
|
+
|
|
1036
|
+
<li>
|
|
1037
|
+
|
|
1038
|
+
<span class='name'>description</span>
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
—
|
|
1046
|
+
<div class='inline'><p>Message to show the user about this step.</p>
|
|
1047
|
+
</div>
|
|
1048
|
+
|
|
1049
|
+
</li>
|
|
1050
|
+
|
|
1051
|
+
<li>
|
|
1052
|
+
|
|
1053
|
+
<span class='name'>exec</span>
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
<span class='type'>(<tt>String|nil</tt>)</span>
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
—
|
|
1063
|
+
<div class='inline'><p>if non-nil, this step will execute this as a command. A block given is ignored.
|
|
1064
|
+
If <code>nil</code>, a block should be given that contains the step's code.</p>
|
|
1065
|
+
</div>
|
|
1066
|
+
|
|
1067
|
+
</li>
|
|
1068
|
+
|
|
1069
|
+
</ul>
|
|
1070
|
+
|
|
1071
|
+
<p class="tag_title">Yields:</p>
|
|
1072
|
+
<ul class="yield">
|
|
1073
|
+
|
|
1074
|
+
<li>
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
<span class='type'></span>
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
<div class='inline'><p>if <code>exec</code> is <code>nil</code>, this block will be executed for the step</p>
|
|
1083
|
+
</div>
|
|
1084
|
+
|
|
1085
|
+
</li>
|
|
1086
|
+
|
|
1087
|
+
</ul>
|
|
1088
|
+
|
|
1089
|
+
</div><table class="source_code">
|
|
1090
|
+
<tr>
|
|
1091
|
+
<td>
|
|
1092
|
+
<pre class="lines">
|
|
1093
|
+
|
|
1094
|
+
|
|
1095
|
+
156
|
|
1096
|
+
157
|
|
1097
|
+
158
|
|
1098
|
+
159
|
|
1099
|
+
160
|
|
1100
|
+
161
|
|
1101
|
+
162
|
|
1102
|
+
163</pre>
|
|
1103
|
+
</td>
|
|
1104
|
+
<td>
|
|
1105
|
+
<pre class="code"><span class="info file"># File 'lib/brut/tui/script.rb', line 156</span>
|
|
1106
|
+
|
|
1107
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_step'>step</span><span class='lparen'>(</span><span class='id identifier rubyid_description'>description</span><span class='comma'>,</span> <span class='label'>exec:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1108
|
+
<span class='id identifier rubyid_step'>step</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_exec'>exec</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
1109
|
+
<span class='const'><span class='object_link'><a href="Script/BlockStep.html" title="Brut::TUI::Script::BlockStep (class)">BlockStep</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Script/BlockStep.html#initialize-instance_method" title="Brut::TUI::Script::BlockStep#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@event_loop</span><span class='comma'>,</span> <span class='id identifier rubyid_description'>description</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1110
|
+
<span class='kw'>else</span>
|
|
1111
|
+
<span class='const'><span class='object_link'><a href="Script/ExecStep.html" title="Brut::TUI::Script::ExecStep (class)">ExecStep</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Script/ExecStep.html#initialize-instance_method" title="Brut::TUI::Script::ExecStep#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@event_loop</span><span class='comma'>,</span> <span class='id identifier rubyid_description'>description</span><span class='comma'>,</span> <span class='label'>command:</span> <span class='id identifier rubyid_exec'>exec</span><span class='rparen'>)</span>
|
|
1112
|
+
<span class='kw'>end</span>
|
|
1113
|
+
<span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_run!'>run!</span>
|
|
1114
|
+
<span class='kw'>end</span></pre>
|
|
1115
|
+
</td>
|
|
1116
|
+
</tr>
|
|
1117
|
+
</table>
|
|
1118
|
+
</div>
|
|
1119
|
+
|
|
1120
|
+
<div class="method_details ">
|
|
1121
|
+
<h3 class="signature " id="success-instance_method">
|
|
1122
|
+
|
|
1123
|
+
#<strong>success</strong>(message) ⇒ <tt>Object</tt>
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
|
|
1129
|
+
</h3><div class="docstring">
|
|
1130
|
+
<div class="discussion">
|
|
1131
|
+
<p>Let the user know something succeeded</p>
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
</div>
|
|
1135
|
+
</div>
|
|
1136
|
+
<div class="tags">
|
|
1137
|
+
<p class="tag_title">Parameters:</p>
|
|
1138
|
+
<ul class="param">
|
|
1139
|
+
|
|
1140
|
+
<li>
|
|
1141
|
+
|
|
1142
|
+
<span class='name'>message</span>
|
|
1143
|
+
|
|
1144
|
+
|
|
1145
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
—
|
|
1150
|
+
<div class='inline'><p>Message to show</p>
|
|
1151
|
+
</div>
|
|
1152
|
+
|
|
1153
|
+
</li>
|
|
1154
|
+
|
|
1155
|
+
</ul>
|
|
1156
|
+
|
|
1157
|
+
|
|
1158
|
+
</div><table class="source_code">
|
|
1159
|
+
<tr>
|
|
1160
|
+
<td>
|
|
1161
|
+
<pre class="lines">
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
182
|
|
1165
|
+
183
|
|
1166
|
+
184</pre>
|
|
1167
|
+
</td>
|
|
1168
|
+
<td>
|
|
1169
|
+
<pre class="code"><span class="info file"># File 'lib/brut/tui/script.rb', line 182</span>
|
|
1170
|
+
|
|
1171
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_success'>success</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
|
1172
|
+
<span class='ivar'>@event_loop</span> <span class='op'><<</span> <span class='const'><span class='object_link'><a href="Script/Events.html" title="Brut::TUI::Script::Events (module)">Events</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Script/Events/Message.html" title="Brut::TUI::Script::Events::Message (class)">Message</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Script/Events/Message.html#initialize-instance_method" title="Brut::TUI::Script::Events::Message#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>message:</span><span class='comma'>,</span> <span class='label'>type:</span> <span class='symbol'>:success</span><span class='rparen'>)</span>
|
|
1173
|
+
<span class='kw'>end</span></pre>
|
|
1174
|
+
</td>
|
|
1175
|
+
</tr>
|
|
1176
|
+
</table>
|
|
1177
|
+
</div>
|
|
1178
|
+
|
|
1179
|
+
<div class="method_details ">
|
|
1180
|
+
<h3 class="signature " id="warning-instance_method">
|
|
1181
|
+
|
|
1182
|
+
#<strong>warning</strong>(message) ⇒ <tt>Object</tt>
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
|
|
1188
|
+
</h3><div class="docstring">
|
|
1189
|
+
<div class="discussion">
|
|
1190
|
+
<p>Warn the user of an event</p>
|
|
1191
|
+
|
|
1192
|
+
|
|
1193
|
+
</div>
|
|
1194
|
+
</div>
|
|
1195
|
+
<div class="tags">
|
|
1196
|
+
<p class="tag_title">Parameters:</p>
|
|
1197
|
+
<ul class="param">
|
|
1198
|
+
|
|
1199
|
+
<li>
|
|
1200
|
+
|
|
1201
|
+
<span class='name'>message</span>
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1205
|
+
|
|
1206
|
+
|
|
1207
|
+
|
|
1208
|
+
—
|
|
1209
|
+
<div class='inline'><p>Message to show</p>
|
|
1210
|
+
</div>
|
|
1211
|
+
|
|
1212
|
+
</li>
|
|
1213
|
+
|
|
1214
|
+
</ul>
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
</div><table class="source_code">
|
|
1218
|
+
<tr>
|
|
1219
|
+
<td>
|
|
1220
|
+
<pre class="lines">
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
175
|
|
1224
|
+
176
|
|
1225
|
+
177</pre>
|
|
1226
|
+
</td>
|
|
1227
|
+
<td>
|
|
1228
|
+
<pre class="code"><span class="info file"># File 'lib/brut/tui/script.rb', line 175</span>
|
|
1229
|
+
|
|
1230
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_warning'>warning</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
|
1231
|
+
<span class='ivar'>@event_loop</span> <span class='op'><<</span> <span class='const'><span class='object_link'><a href="Script/Events.html" title="Brut::TUI::Script::Events (module)">Events</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Script/Events/Message.html" title="Brut::TUI::Script::Events::Message (class)">Message</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Script/Events/Message.html#initialize-instance_method" title="Brut::TUI::Script::Events::Message#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>message:</span><span class='comma'>,</span> <span class='label'>type:</span> <span class='symbol'>:warning</span><span class='rparen'>)</span>
|
|
1232
|
+
<span class='kw'>end</span></pre>
|
|
1233
|
+
</td>
|
|
1234
|
+
</tr>
|
|
1235
|
+
</table>
|
|
1236
|
+
</div>
|
|
1237
|
+
|
|
1238
|
+
</div>
|
|
1239
|
+
|
|
1240
|
+
</div>
|
|
1241
|
+
|
|
1242
|
+
<div id="footer">
|
|
1243
|
+
Generated on Sun Nov 30 20:50:11 2025 by
|
|
1244
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1245
|
+
0.9.37 (ruby-3.4.6).
|
|
1246
|
+
</div>
|
|
1247
|
+
|
|
1248
|
+
</div>
|
|
1249
|
+
</body>
|
|
1250
|
+
</html>
|