fluid_cli 0.1.2
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 +7 -0
- data/README.md +1 -0
- data/dev.yml +5 -0
- data/exe/fluid +24 -0
- data/lib/fluid_cli/api.rb +135 -0
- data/lib/fluid_cli/assets/post_auth_page/index.html.erb +34 -0
- data/lib/fluid_cli/assets/post_auth_page/style.css +58 -0
- data/lib/fluid_cli/command.rb +55 -0
- data/lib/fluid_cli/commands/help.rb +21 -0
- data/lib/fluid_cli/commands/login.rb +30 -0
- data/lib/fluid_cli/commands/logout.rb +38 -0
- data/lib/fluid_cli/commands/switch.rb +23 -0
- data/lib/fluid_cli/commands/theme/common/company_helper.rb +15 -0
- data/lib/fluid_cli/commands/theme/common/root_helper.rb +95 -0
- data/lib/fluid_cli/commands/theme/dev.rb +61 -0
- data/lib/fluid_cli/commands/theme/help.rb +21 -0
- data/lib/fluid_cli/commands/theme/init.rb +46 -0
- data/lib/fluid_cli/commands/theme/pull.rb +68 -0
- data/lib/fluid_cli/commands/theme/push.rb +132 -0
- data/lib/fluid_cli/commands/theme.rb +23 -0
- data/lib/fluid_cli/commands/whoami.rb +23 -0
- data/lib/fluid_cli/commands.rb +19 -0
- data/lib/fluid_cli/company_switcher.rb +69 -0
- data/lib/fluid_cli/context.rb +691 -0
- data/lib/fluid_cli/db.rb +114 -0
- data/lib/fluid_cli/entry_point.rb +10 -0
- data/lib/fluid_cli/environment.rb +32 -0
- data/lib/fluid_cli/file_system_listener.rb +29 -0
- data/lib/fluid_cli/form.rb +42 -0
- data/lib/fluid_cli/git.rb +319 -0
- data/lib/fluid_cli/http_request.rb +54 -0
- data/lib/fluid_cli/identity_auth/servlet.rb +39 -0
- data/lib/fluid_cli/identity_auth.rb +126 -0
- data/lib/fluid_cli/options.rb +38 -0
- data/lib/fluid_cli/theme/dev_server/certificate_manager.rb +79 -0
- data/lib/fluid_cli/theme/dev_server/errors.rb +9 -0
- data/lib/fluid_cli/theme/dev_server/header_hash.rb +98 -0
- data/lib/fluid_cli/theme/dev_server/hooks/file_change_hook.rb +39 -0
- data/lib/fluid_cli/theme/dev_server/hot_reload/resources/hot-reload-no-script.html +27 -0
- data/lib/fluid_cli/theme/dev_server/hot_reload/resources/hot_reload.js +28 -0
- data/lib/fluid_cli/theme/dev_server/hot_reload/resources/sse_client.js +43 -0
- data/lib/fluid_cli/theme/dev_server/hot_reload/resources/theme.js +16 -0
- data/lib/fluid_cli/theme/dev_server/hot_reload/script_injector.rb +54 -0
- data/lib/fluid_cli/theme/dev_server/hot_reload.rb +75 -0
- data/lib/fluid_cli/theme/dev_server/local_assets.rb +92 -0
- data/lib/fluid_cli/theme/dev_server/proxy.rb +235 -0
- data/lib/fluid_cli/theme/dev_server/proxy_param_builder.rb +82 -0
- data/lib/fluid_cli/theme/dev_server/reload_mode.rb +34 -0
- data/lib/fluid_cli/theme/dev_server/sse.rb +75 -0
- data/lib/fluid_cli/theme/dev_server/watcher.rb +57 -0
- data/lib/fluid_cli/theme/dev_server/web_server.rb +140 -0
- data/lib/fluid_cli/theme/dev_server.rb +289 -0
- data/lib/fluid_cli/theme/development_theme.rb +101 -0
- data/lib/fluid_cli/theme/file.rb +105 -0
- data/lib/fluid_cli/theme/forms/select.rb +33 -0
- data/lib/fluid_cli/theme/mime_type.rb +34 -0
- data/lib/fluid_cli/theme/presenters/theme_presenter.rb +49 -0
- data/lib/fluid_cli/theme/presenters/themes_presenter.rb +31 -0
- data/lib/fluid_cli/theme/root.rb +62 -0
- data/lib/fluid_cli/theme/syncer/checksums.rb +66 -0
- data/lib/fluid_cli/theme/syncer/downloader.rb +54 -0
- data/lib/fluid_cli/theme/syncer/error_reporter.rb +45 -0
- data/lib/fluid_cli/theme/syncer/merger.rb +53 -0
- data/lib/fluid_cli/theme/syncer/operation.rb +58 -0
- data/lib/fluid_cli/theme/syncer/standard_reporter.rb +32 -0
- data/lib/fluid_cli/theme/syncer/unsupported_script_warning.rb +90 -0
- data/lib/fluid_cli/theme/syncer/uploader/forms/apply_to_all.rb +41 -0
- data/lib/fluid_cli/theme/syncer/uploader/forms/apply_to_all_form.rb +37 -0
- data/lib/fluid_cli/theme/syncer/uploader/forms/base_strategy_form.rb +64 -0
- data/lib/fluid_cli/theme/syncer/uploader/forms/select_delete_strategy.rb +29 -0
- data/lib/fluid_cli/theme/syncer/uploader/forms/select_update_strategy.rb +30 -0
- data/lib/fluid_cli/theme/syncer/uploader/json_delete_handler.rb +49 -0
- data/lib/fluid_cli/theme/syncer/uploader/json_update_handler.rb +71 -0
- data/lib/fluid_cli/theme/syncer/uploader.rb +105 -0
- data/lib/fluid_cli/theme/syncer.rb +412 -0
- data/lib/fluid_cli/theme/theme.rb +186 -0
- data/lib/fluid_cli/theme/ui/sync_progress_bar.rb +22 -0
- data/lib/fluid_cli/thread_pool/job.rb +35 -0
- data/lib/fluid_cli/thread_pool.rb +49 -0
- data/lib/fluid_cli/version.rb +3 -0
- data/lib/fluid_cli.rb +59 -0
- data/vendor/deps/base64/.document +5 -0
- data/vendor/deps/base64/.gitignore +9 -0
- data/vendor/deps/base64/BSDL +22 -0
- data/vendor/deps/base64/COPYING +56 -0
- data/vendor/deps/base64/Gemfile +9 -0
- data/vendor/deps/base64/LEGAL +60 -0
- data/vendor/deps/base64/README.md +48 -0
- data/vendor/deps/base64/Rakefile +31 -0
- data/vendor/deps/base64/base64.gemspec +28 -0
- data/vendor/deps/base64/bin/console +14 -0
- data/vendor/deps/base64/bin/setup +8 -0
- data/vendor/deps/base64/lib/base64.rb +382 -0
- data/vendor/deps/base64/sig/base64.rbs +358 -0
- data/vendor/deps/base64/test/base64/test_base64.rb +115 -0
- data/vendor/deps/base64/test_sig/test_base64.rb +44 -0
- data/vendor/deps/cli-kit/REVISION +1 -0
- data/vendor/deps/cli-kit/lib/cli/kit/args/definition.rb +286 -0
- data/vendor/deps/cli-kit/lib/cli/kit/args/evaluation.rb +215 -0
- data/vendor/deps/cli-kit/lib/cli/kit/args/parser/node.rb +128 -0
- data/vendor/deps/cli-kit/lib/cli/kit/args/parser.rb +125 -0
- data/vendor/deps/cli-kit/lib/cli/kit/args/tokenizer.rb +130 -0
- data/vendor/deps/cli-kit/lib/cli/kit/args.rb +16 -0
- data/vendor/deps/cli-kit/lib/cli/kit/base_command.rb +30 -0
- data/vendor/deps/cli-kit/lib/cli/kit/command_help.rb +268 -0
- data/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb +150 -0
- data/vendor/deps/cli-kit/lib/cli/kit/config.rb +137 -0
- data/vendor/deps/cli-kit/lib/cli/kit/core_ext.rb +28 -0
- data/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb +166 -0
- data/vendor/deps/cli-kit/lib/cli/kit/executor.rb +92 -0
- data/vendor/deps/cli-kit/lib/cli/kit/ini.rb +91 -0
- data/vendor/deps/cli-kit/lib/cli/kit/levenshtein.rb +92 -0
- data/vendor/deps/cli-kit/lib/cli/kit/logger.rb +94 -0
- data/vendor/deps/cli-kit/lib/cli/kit/opts.rb +248 -0
- data/vendor/deps/cli-kit/lib/cli/kit/parse_args.rb +55 -0
- data/vendor/deps/cli-kit/lib/cli/kit/resolver.rb +66 -0
- data/vendor/deps/cli-kit/lib/cli/kit/support/test_helper.rb +260 -0
- data/vendor/deps/cli-kit/lib/cli/kit/support.rb +11 -0
- data/vendor/deps/cli-kit/lib/cli/kit/system.rb +290 -0
- data/vendor/deps/cli-kit/lib/cli/kit/util.rb +118 -0
- data/vendor/deps/cli-kit/lib/cli/kit/version.rb +7 -0
- data/vendor/deps/cli-kit/lib/cli/kit.rb +139 -0
- data/vendor/deps/cli-ui/REVISION +1 -0
- data/vendor/deps/cli-ui/lib/cli/ui/ansi.rb +218 -0
- data/vendor/deps/cli-ui/lib/cli/ui/color.rb +101 -0
- data/vendor/deps/cli-ui/lib/cli/ui/formatter.rb +219 -0
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_stack.rb +67 -0
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style/box.rb +179 -0
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style/bracket.rb +152 -0
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style.rb +127 -0
- data/vendor/deps/cli-ui/lib/cli/ui/frame.rb +286 -0
- data/vendor/deps/cli-ui/lib/cli/ui/glyph.rb +92 -0
- data/vendor/deps/cli-ui/lib/cli/ui/os.rb +63 -0
- data/vendor/deps/cli-ui/lib/cli/ui/printer.rb +64 -0
- data/vendor/deps/cli-ui/lib/cli/ui/progress.rb +132 -0
- data/vendor/deps/cli-ui/lib/cli/ui/progress_reporter.rb +209 -0
- data/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb +583 -0
- data/vendor/deps/cli-ui/lib/cli/ui/prompt/options_handler.rb +36 -0
- data/vendor/deps/cli-ui/lib/cli/ui/prompt.rb +381 -0
- data/vendor/deps/cli-ui/lib/cli/ui/spinner/async.rb +48 -0
- data/vendor/deps/cli-ui/lib/cli/ui/spinner/spin_group.rb +602 -0
- data/vendor/deps/cli-ui/lib/cli/ui/spinner.rb +79 -0
- data/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb +399 -0
- data/vendor/deps/cli-ui/lib/cli/ui/table.rb +83 -0
- data/vendor/deps/cli-ui/lib/cli/ui/terminal.rb +55 -0
- data/vendor/deps/cli-ui/lib/cli/ui/truncater.rb +106 -0
- data/vendor/deps/cli-ui/lib/cli/ui/version.rb +8 -0
- data/vendor/deps/cli-ui/lib/cli/ui/widgets/base.rb +46 -0
- data/vendor/deps/cli-ui/lib/cli/ui/widgets/status.rb +79 -0
- data/vendor/deps/cli-ui/lib/cli/ui/widgets.rb +89 -0
- data/vendor/deps/cli-ui/lib/cli/ui/work_queue.rb +142 -0
- data/vendor/deps/cli-ui/lib/cli/ui/wrap.rb +61 -0
- data/vendor/deps/cli-ui/lib/cli/ui.rb +359 -0
- data/vendor/deps/cli-ui/vendor/reentrant_mutex.rb +78 -0
- data/vendor/deps/debug/CONTRIBUTING.md +573 -0
- data/vendor/deps/debug/Gemfile +10 -0
- data/vendor/deps/debug/LICENSE.txt +22 -0
- data/vendor/deps/debug/README.md +996 -0
- data/vendor/deps/debug/Rakefile +57 -0
- data/vendor/deps/debug/TODO.md +23 -0
- data/vendor/deps/debug/debug.gemspec +33 -0
- data/vendor/deps/debug/exe/rdbg +53 -0
- data/vendor/deps/debug/ext/debug/Makefile +273 -0
- data/vendor/deps/debug/ext/debug/debug.c +228 -0
- data/vendor/deps/debug/ext/debug/debug_version.h +1 -0
- data/vendor/deps/debug/ext/debug/extconf.rb +27 -0
- data/vendor/deps/debug/ext/debug/iseq_collector.c +93 -0
- data/vendor/deps/debug/lib/debug/abbrev_command.rb +77 -0
- data/vendor/deps/debug/lib/debug/breakpoint.rb +556 -0
- data/vendor/deps/debug/lib/debug/client.rb +263 -0
- data/vendor/deps/debug/lib/debug/color.rb +123 -0
- data/vendor/deps/debug/lib/debug/config.rb +592 -0
- data/vendor/deps/debug/lib/debug/console.rb +224 -0
- data/vendor/deps/debug/lib/debug/dap_custom/traceInspector.rb +336 -0
- data/vendor/deps/debug/lib/debug/debug.bundle +0 -0
- data/vendor/deps/debug/lib/debug/frame_info.rb +190 -0
- data/vendor/deps/debug/lib/debug/irb_integration.rb +37 -0
- data/vendor/deps/debug/lib/debug/local.rb +115 -0
- data/vendor/deps/debug/lib/debug/open.rb +13 -0
- data/vendor/deps/debug/lib/debug/open_nonstop.rb +15 -0
- data/vendor/deps/debug/lib/debug/prelude.rb +50 -0
- data/vendor/deps/debug/lib/debug/server.rb +534 -0
- data/vendor/deps/debug/lib/debug/server_cdp.rb +1348 -0
- data/vendor/deps/debug/lib/debug/server_dap.rb +1108 -0
- data/vendor/deps/debug/lib/debug/session.rb +2667 -0
- data/vendor/deps/debug/lib/debug/source_repository.rb +150 -0
- data/vendor/deps/debug/lib/debug/start.rb +5 -0
- data/vendor/deps/debug/lib/debug/thread_client.rb +1457 -0
- data/vendor/deps/debug/lib/debug/tracer.rb +241 -0
- data/vendor/deps/debug/lib/debug/version.rb +5 -0
- data/vendor/deps/debug/lib/debug.rb +9 -0
- data/vendor/deps/debug/misc/README.md.erb +660 -0
- data/vendor/deps/listen/.github/release-drafter.yml +17 -0
- data/vendor/deps/listen/.github/workflows/development.yml +67 -0
- data/vendor/deps/listen/.github/workflows/push.yml +12 -0
- data/vendor/deps/listen/.gitignore +28 -0
- data/vendor/deps/listen/.rspec +3 -0
- data/vendor/deps/listen/.rubocop.yml +283 -0
- data/vendor/deps/listen/.yardopts +11 -0
- data/vendor/deps/listen/CHANGELOG.md +1 -0
- data/vendor/deps/listen/CONTRIBUTING.md +45 -0
- data/vendor/deps/listen/Gemfile +33 -0
- data/vendor/deps/listen/Guardfile +26 -0
- data/vendor/deps/listen/LICENSE.txt +22 -0
- data/vendor/deps/listen/README.md +490 -0
- data/vendor/deps/listen/Rakefile +154 -0
- data/vendor/deps/listen/bin/listen +11 -0
- data/vendor/deps/listen/lib/listen/adapter/base.rb +129 -0
- data/vendor/deps/listen/lib/listen/adapter/bsd.rb +104 -0
- data/vendor/deps/listen/lib/listen/adapter/config.rb +31 -0
- data/vendor/deps/listen/lib/listen/adapter/darwin.rb +77 -0
- data/vendor/deps/listen/lib/listen/adapter/linux.rb +108 -0
- data/vendor/deps/listen/lib/listen/adapter/polling.rb +40 -0
- data/vendor/deps/listen/lib/listen/adapter/windows.rb +96 -0
- data/vendor/deps/listen/lib/listen/adapter.rb +43 -0
- data/vendor/deps/listen/lib/listen/backend.rb +40 -0
- data/vendor/deps/listen/lib/listen/change.rb +69 -0
- data/vendor/deps/listen/lib/listen/cli.rb +65 -0
- data/vendor/deps/listen/lib/listen/directory.rb +93 -0
- data/vendor/deps/listen/lib/listen/error.rb +11 -0
- data/vendor/deps/listen/lib/listen/event/config.rb +39 -0
- data/vendor/deps/listen/lib/listen/event/loop.rb +92 -0
- data/vendor/deps/listen/lib/listen/event/processor.rb +128 -0
- data/vendor/deps/listen/lib/listen/event/queue.rb +52 -0
- data/vendor/deps/listen/lib/listen/file.rb +95 -0
- data/vendor/deps/listen/lib/listen/fsm.rb +131 -0
- data/vendor/deps/listen/lib/listen/listener/config.rb +41 -0
- data/vendor/deps/listen/lib/listen/listener.rb +136 -0
- data/vendor/deps/listen/lib/listen/logger.rb +65 -0
- data/vendor/deps/listen/lib/listen/monotonic_time.rb +27 -0
- data/vendor/deps/listen/lib/listen/options.rb +24 -0
- data/vendor/deps/listen/lib/listen/queue_optimizer.rb +129 -0
- data/vendor/deps/listen/lib/listen/record/entry.rb +66 -0
- data/vendor/deps/listen/lib/listen/record/symlink_detector.rb +47 -0
- data/vendor/deps/listen/lib/listen/record.rb +122 -0
- data/vendor/deps/listen/lib/listen/silencer/controller.rb +50 -0
- data/vendor/deps/listen/lib/listen/silencer.rb +106 -0
- data/vendor/deps/listen/lib/listen/thread.rb +54 -0
- data/vendor/deps/listen/lib/listen/version.rb +5 -0
- data/vendor/deps/listen/lib/listen.rb +47 -0
- data/vendor/deps/listen/listen.gemspec +40 -0
- data/vendor/deps/listen/spec/acceptance/listen_spec.rb +320 -0
- data/vendor/deps/listen/spec/lib/listen/adapter/base_spec.rb +101 -0
- data/vendor/deps/listen/spec/lib/listen/adapter/bsd_spec.rb +13 -0
- data/vendor/deps/listen/spec/lib/listen/adapter/config_spec.rb +122 -0
- data/vendor/deps/listen/spec/lib/listen/adapter/darwin_spec.rb +82 -0
- data/vendor/deps/listen/spec/lib/listen/adapter/linux_spec.rb +199 -0
- data/vendor/deps/listen/spec/lib/listen/adapter/polling_spec.rb +83 -0
- data/vendor/deps/listen/spec/lib/listen/adapter/windows_spec.rb +13 -0
- data/vendor/deps/listen/spec/lib/listen/adapter_spec.rb +69 -0
- data/vendor/deps/listen/spec/lib/listen/backend_spec.rb +82 -0
- data/vendor/deps/listen/spec/lib/listen/change_spec.rb +102 -0
- data/vendor/deps/listen/spec/lib/listen/cli_spec.rb +116 -0
- data/vendor/deps/listen/spec/lib/listen/directory_spec.rb +284 -0
- data/vendor/deps/listen/spec/lib/listen/event/config_spec.rb +33 -0
- data/vendor/deps/listen/spec/lib/listen/event/loop_spec.rb +118 -0
- data/vendor/deps/listen/spec/lib/listen/event/processor_spec.rb +250 -0
- data/vendor/deps/listen/spec/lib/listen/event/queue_spec.rb +118 -0
- data/vendor/deps/listen/spec/lib/listen/file_spec.rb +254 -0
- data/vendor/deps/listen/spec/lib/listen/fsm_spec.rb +147 -0
- data/vendor/deps/listen/spec/lib/listen/listener/config_spec.rb +29 -0
- data/vendor/deps/listen/spec/lib/listen/listener_spec.rb +321 -0
- data/vendor/deps/listen/spec/lib/listen/logger_spec.rb +212 -0
- data/vendor/deps/listen/spec/lib/listen/monotonic_time_spec.rb +58 -0
- data/vendor/deps/listen/spec/lib/listen/queue_optimizer_spec.rb +111 -0
- data/vendor/deps/listen/spec/lib/listen/record_spec.rb +424 -0
- data/vendor/deps/listen/spec/lib/listen/silencer/controller_spec.rb +97 -0
- data/vendor/deps/listen/spec/lib/listen/silencer_spec.rb +109 -0
- data/vendor/deps/listen/spec/lib/listen/thread_spec.rb +133 -0
- data/vendor/deps/listen/spec/lib/listen_spec.rb +25 -0
- data/vendor/deps/listen/spec/spec_helper.rb +49 -0
- data/vendor/deps/listen/spec/support/acceptance_helper.rb +260 -0
- data/vendor/deps/listen/spec/support/fixtures_helper.rb +32 -0
- data/vendor/deps/listen/spec/support/platform_helper.rb +17 -0
- data/vendor/deps/observer/.github/dependabot.yml +6 -0
- data/vendor/deps/observer/.github/workflows/test.yml +33 -0
- data/vendor/deps/observer/.gitignore +8 -0
- data/vendor/deps/observer/BSDL +22 -0
- data/vendor/deps/observer/COPYING +56 -0
- data/vendor/deps/observer/Gemfile +9 -0
- data/vendor/deps/observer/README.md +139 -0
- data/vendor/deps/observer/Rakefile +10 -0
- data/vendor/deps/observer/bin/console +14 -0
- data/vendor/deps/observer/bin/setup +8 -0
- data/vendor/deps/observer/lib/observer.rb +229 -0
- data/vendor/deps/observer/observer.gemspec +32 -0
- data/vendor/deps/observer/test/test_observer.rb +66 -0
- data/vendor/deps/webrick/.gitignore +9 -0
- data/vendor/deps/webrick/Gemfile +3 -0
- data/vendor/deps/webrick/LICENSE.txt +22 -0
- data/vendor/deps/webrick/README.md +61 -0
- data/vendor/deps/webrick/Rakefile +10 -0
- data/vendor/deps/webrick/lib/webrick/accesslog.rb +157 -0
- data/vendor/deps/webrick/lib/webrick/cgi.rb +313 -0
- data/vendor/deps/webrick/lib/webrick/compat.rb +36 -0
- data/vendor/deps/webrick/lib/webrick/config.rb +158 -0
- data/vendor/deps/webrick/lib/webrick/cookie.rb +172 -0
- data/vendor/deps/webrick/lib/webrick/htmlutils.rb +30 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/authenticator.rb +117 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/basicauth.rb +116 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/digestauth.rb +395 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/htdigest.rb +132 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/htgroup.rb +97 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/htpasswd.rb +158 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/userdb.rb +53 -0
- data/vendor/deps/webrick/lib/webrick/httpauth.rb +96 -0
- data/vendor/deps/webrick/lib/webrick/httpproxy.rb +354 -0
- data/vendor/deps/webrick/lib/webrick/httprequest.rb +636 -0
- data/vendor/deps/webrick/lib/webrick/httpresponse.rb +564 -0
- data/vendor/deps/webrick/lib/webrick/https.rb +152 -0
- data/vendor/deps/webrick/lib/webrick/httpserver.rb +294 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet/abstract.rb +152 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet/cgi_runner.rb +47 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet/cgihandler.rb +126 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet/erbhandler.rb +88 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet/filehandler.rb +552 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet/prochandler.rb +47 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet.rb +23 -0
- data/vendor/deps/webrick/lib/webrick/httpstatus.rb +194 -0
- data/vendor/deps/webrick/lib/webrick/httputils.rb +512 -0
- data/vendor/deps/webrick/lib/webrick/httpversion.rb +76 -0
- data/vendor/deps/webrick/lib/webrick/log.rb +156 -0
- data/vendor/deps/webrick/lib/webrick/server.rb +381 -0
- data/vendor/deps/webrick/lib/webrick/ssl.rb +215 -0
- data/vendor/deps/webrick/lib/webrick/utils.rb +265 -0
- data/vendor/deps/webrick/lib/webrick/version.rb +18 -0
- data/vendor/deps/webrick/lib/webrick.rb +232 -0
- data/vendor/deps/webrick/webrick.gemspec +74 -0
- metadata +412 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module CLI
|
|
5
|
+
module UI
|
|
6
|
+
autoload :ANSI, 'cli/ui/ansi'
|
|
7
|
+
autoload :Glyph, 'cli/ui/glyph'
|
|
8
|
+
autoload :Color, 'cli/ui/color'
|
|
9
|
+
autoload :Frame, 'cli/ui/frame'
|
|
10
|
+
autoload :OS, 'cli/ui/os'
|
|
11
|
+
autoload :Printer, 'cli/ui/printer'
|
|
12
|
+
autoload :Progress, 'cli/ui/progress'
|
|
13
|
+
autoload :ProgressReporter, 'cli/ui/progress_reporter'
|
|
14
|
+
autoload :Prompt, 'cli/ui/prompt'
|
|
15
|
+
autoload :Table, 'cli/ui/table'
|
|
16
|
+
autoload :Terminal, 'cli/ui/terminal'
|
|
17
|
+
autoload :Truncater, 'cli/ui/truncater'
|
|
18
|
+
autoload :Formatter, 'cli/ui/formatter'
|
|
19
|
+
autoload :Spinner, 'cli/ui/spinner'
|
|
20
|
+
autoload :Widgets, 'cli/ui/widgets'
|
|
21
|
+
autoload :Wrap, 'cli/ui/wrap'
|
|
22
|
+
|
|
23
|
+
# Convenience accessor to +CLI::UI::Spinner::SpinGroup+
|
|
24
|
+
SpinGroup = Spinner::SpinGroup
|
|
25
|
+
|
|
26
|
+
#: type colorable = Symbol | String | CLI::UI::Color
|
|
27
|
+
#: type frame_stylable = Symbol | String | CLI::UI::Frame::FrameStyle
|
|
28
|
+
#: type io_like = IO | StringIO
|
|
29
|
+
|
|
30
|
+
class << self
|
|
31
|
+
# Glyph resolution using +CLI::UI::Glyph.lookup+
|
|
32
|
+
# Look at the method signature for +Glyph.lookup+ for more details
|
|
33
|
+
#
|
|
34
|
+
# ==== Attributes
|
|
35
|
+
#
|
|
36
|
+
# * +handle+ - handle of the glyph to resolve
|
|
37
|
+
#
|
|
38
|
+
#: (String handle) -> Glyph
|
|
39
|
+
def glyph(handle)
|
|
40
|
+
CLI::UI::Glyph.lookup(handle)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Color resolution using +CLI::UI::Color.lookup+
|
|
44
|
+
# Will lookup using +Color.lookup+ unless it's already a CLI::UI::Color (or nil)
|
|
45
|
+
#
|
|
46
|
+
# ==== Attributes
|
|
47
|
+
#
|
|
48
|
+
# * +input+ - color to resolve
|
|
49
|
+
#
|
|
50
|
+
#: (colorable input) -> CLI::UI::Color
|
|
51
|
+
def resolve_color(input)
|
|
52
|
+
case input
|
|
53
|
+
when CLI::UI::Color
|
|
54
|
+
input
|
|
55
|
+
else
|
|
56
|
+
CLI::UI::Color.lookup(input)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Frame style resolution using +CLI::UI::Frame::FrameStyle.lookup+.
|
|
61
|
+
# Will lookup using +FrameStyle.lookup+ unless it's already a CLI::UI::Frame::FrameStyle(or nil)
|
|
62
|
+
#
|
|
63
|
+
# ==== Attributes
|
|
64
|
+
#
|
|
65
|
+
# * +input+ - frame style to resolve
|
|
66
|
+
#: (frame_stylable input) -> CLI::UI::Frame::FrameStyle
|
|
67
|
+
def resolve_style(input)
|
|
68
|
+
case input
|
|
69
|
+
when CLI::UI::Frame::FrameStyle
|
|
70
|
+
input
|
|
71
|
+
else
|
|
72
|
+
CLI::UI::Frame::FrameStyle.lookup(input.to_s)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Convenience Method for +CLI::UI::Prompt.confirm+
|
|
77
|
+
#
|
|
78
|
+
# ==== Attributes
|
|
79
|
+
#
|
|
80
|
+
# * +question+ - question to confirm
|
|
81
|
+
#
|
|
82
|
+
#: (String question, ?default: bool) -> bool
|
|
83
|
+
def confirm(question, default: true)
|
|
84
|
+
CLI::UI::Prompt.confirm(question, default: default)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Convenience Method for +CLI::UI::Prompt.any_key+
|
|
88
|
+
#
|
|
89
|
+
# ==== Attributes
|
|
90
|
+
#
|
|
91
|
+
# * +prompt+ - prompt to present
|
|
92
|
+
#
|
|
93
|
+
#: (?String prompt) -> String?
|
|
94
|
+
def any_key(prompt = 'Press any key to continue')
|
|
95
|
+
CLI::UI::Prompt.any_key(prompt)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Convenience Method for +CLI::UI::Prompt.ask+
|
|
99
|
+
#: (String question, ?options: Array[String]?, ?default: (String | Array[String])?, ?is_file: bool, ?allow_empty: bool, ?multiple: bool, ?filter_ui: bool, ?select_ui: bool) ?{ (Prompt::OptionsHandler handler) -> void } -> (String | Array[String])
|
|
100
|
+
def ask(
|
|
101
|
+
question,
|
|
102
|
+
options: nil,
|
|
103
|
+
default: nil,
|
|
104
|
+
is_file: false,
|
|
105
|
+
allow_empty: true,
|
|
106
|
+
multiple: false,
|
|
107
|
+
filter_ui: true,
|
|
108
|
+
select_ui: true,
|
|
109
|
+
&options_proc
|
|
110
|
+
)
|
|
111
|
+
CLI::UI::Prompt.ask(
|
|
112
|
+
question,
|
|
113
|
+
options: options,
|
|
114
|
+
default: default,
|
|
115
|
+
is_file: is_file,
|
|
116
|
+
allow_empty: allow_empty,
|
|
117
|
+
multiple: multiple,
|
|
118
|
+
filter_ui: filter_ui,
|
|
119
|
+
select_ui: select_ui,
|
|
120
|
+
&options_proc
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Convenience Method to resolve text using +CLI::UI::Formatter.format+
|
|
125
|
+
# Check +CLI::UI::Formatter::SGR_MAP+ for available formatting options
|
|
126
|
+
#
|
|
127
|
+
# ==== Attributes
|
|
128
|
+
#
|
|
129
|
+
# * +input+ - input to format
|
|
130
|
+
# * +truncate_to+ - number of characters to truncate the string to (or nil)
|
|
131
|
+
# * +enable_color+ - should color be used? default to true unless output is redirected.
|
|
132
|
+
#
|
|
133
|
+
#: (String input, ?truncate_to: Integer?, ?enable_color: bool) -> String
|
|
134
|
+
def resolve_text(input, truncate_to: nil, enable_color: enable_color?)
|
|
135
|
+
formatted = CLI::UI::Formatter.new(input).format(enable_color: enable_color)
|
|
136
|
+
return formatted unless truncate_to
|
|
137
|
+
|
|
138
|
+
CLI::UI::Truncater.call(formatted, truncate_to)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Convenience Method to format text using +CLI::UI::Formatter.format+
|
|
142
|
+
# Check +CLI::UI::Formatter::SGR_MAP+ for available formatting options
|
|
143
|
+
#
|
|
144
|
+
# https://user-images.githubusercontent.com/3074765/33799827-6d0721a2-dd01-11e7-9ab5-c3d455264afe.png
|
|
145
|
+
# https://user-images.githubusercontent.com/3074765/33799847-9ec03fd0-dd01-11e7-93f7-5f5cc540e61e.png
|
|
146
|
+
#
|
|
147
|
+
# ==== Attributes
|
|
148
|
+
#
|
|
149
|
+
# * +input+ - input to format
|
|
150
|
+
#
|
|
151
|
+
# ==== Options
|
|
152
|
+
#
|
|
153
|
+
# * +enable_color+ - should color be used? default to true unless output is redirected.
|
|
154
|
+
#
|
|
155
|
+
#: (String input, ?enable_color: bool) -> String
|
|
156
|
+
def fmt(input, enable_color: enable_color?)
|
|
157
|
+
CLI::UI::Formatter.new(input).format(enable_color: enable_color)
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
#: (String input) -> String
|
|
161
|
+
def wrap(input)
|
|
162
|
+
CLI::UI::Wrap.new(input).wrap
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Convenience Method for +CLI::UI::Printer.puts+
|
|
166
|
+
#
|
|
167
|
+
# ==== Attributes
|
|
168
|
+
#
|
|
169
|
+
# * +msg+ - Message to print
|
|
170
|
+
# * +kwargs+ - keyword arguments for +Printer.puts+
|
|
171
|
+
#
|
|
172
|
+
#: (String msg, ?frame_color: colorable?, ?to: io_like, ?encoding: Encoding, ?format: bool, ?graceful: bool, ?wrap: bool) -> void
|
|
173
|
+
def puts(
|
|
174
|
+
msg,
|
|
175
|
+
frame_color: nil,
|
|
176
|
+
to: $stdout,
|
|
177
|
+
encoding: Encoding::UTF_8,
|
|
178
|
+
format: true,
|
|
179
|
+
graceful: true,
|
|
180
|
+
wrap: true
|
|
181
|
+
)
|
|
182
|
+
CLI::UI::Printer.puts(
|
|
183
|
+
msg,
|
|
184
|
+
frame_color: frame_color,
|
|
185
|
+
to: to,
|
|
186
|
+
encoding: encoding,
|
|
187
|
+
format: format,
|
|
188
|
+
graceful: graceful,
|
|
189
|
+
wrap: wrap,
|
|
190
|
+
)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Convenience Method for +CLI::UI::Frame.open+
|
|
194
|
+
#
|
|
195
|
+
# ==== Attributes
|
|
196
|
+
#
|
|
197
|
+
# * +args+ - arguments for +Frame.open+
|
|
198
|
+
# * +block+ - block for +Frame.open+
|
|
199
|
+
#
|
|
200
|
+
#: [T] (String text, ?color: colorable?, ?failure_text: String?, ?success_text: String?, ?timing: (Numeric | bool), ?frame_style: frame_stylable, ?to: io_like) ?{ -> T } -> T?
|
|
201
|
+
def frame(
|
|
202
|
+
text,
|
|
203
|
+
color: Frame::DEFAULT_FRAME_COLOR,
|
|
204
|
+
failure_text: nil,
|
|
205
|
+
success_text: nil,
|
|
206
|
+
timing: block_given?,
|
|
207
|
+
frame_style: Frame.frame_style,
|
|
208
|
+
to: $stdout,
|
|
209
|
+
&block
|
|
210
|
+
)
|
|
211
|
+
CLI::UI::Frame.open(
|
|
212
|
+
text,
|
|
213
|
+
color: color,
|
|
214
|
+
failure_text: failure_text,
|
|
215
|
+
success_text: success_text,
|
|
216
|
+
timing: timing,
|
|
217
|
+
frame_style: frame_style,
|
|
218
|
+
to: to,
|
|
219
|
+
&block
|
|
220
|
+
)
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Convenience Method for +CLI::UI::Spinner.spin+
|
|
224
|
+
#
|
|
225
|
+
# ==== Attributes
|
|
226
|
+
#
|
|
227
|
+
# * +args+ - arguments for +Spinner.open+
|
|
228
|
+
# * +block+ - block for +Spinner.open+
|
|
229
|
+
#
|
|
230
|
+
#: (String title, ?auto_debrief: bool, ?to: io_like) { (Spinner::SpinGroup::Task task) -> void } -> bool
|
|
231
|
+
def spinner(title, auto_debrief: true, to: $stdout, &block)
|
|
232
|
+
CLI::UI::Spinner.spin(title, auto_debrief: auto_debrief, to: to, &block)
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Convenience Method to override frame color using +CLI::UI::Frame.with_frame_color+
|
|
236
|
+
#
|
|
237
|
+
# ==== Attributes
|
|
238
|
+
#
|
|
239
|
+
# * +color+ - color to override to
|
|
240
|
+
# * +block+ - block for +Frame.with_frame_color_override+
|
|
241
|
+
#
|
|
242
|
+
#: [T] (colorable color) { -> T } -> T
|
|
243
|
+
def with_frame_color(color, &block)
|
|
244
|
+
CLI::UI::Frame.with_frame_color_override(color, &block)
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Duplicate output to a file path
|
|
248
|
+
#
|
|
249
|
+
# ==== Attributes
|
|
250
|
+
#
|
|
251
|
+
# * +path+ - path to duplicate output to
|
|
252
|
+
#
|
|
253
|
+
#: [T] (String path) { -> T } -> T
|
|
254
|
+
def log_output_to(path, &block)
|
|
255
|
+
if CLI::UI::StdoutRouter.duplicate_output_to
|
|
256
|
+
raise 'multiple logs not allowed'
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
CLI::UI::StdoutRouter.duplicate_output_to = File.open(path, 'w')
|
|
260
|
+
yield
|
|
261
|
+
ensure
|
|
262
|
+
if (file_descriptor = CLI::UI::StdoutRouter.duplicate_output_to)
|
|
263
|
+
begin
|
|
264
|
+
file_descriptor.close
|
|
265
|
+
rescue IOError
|
|
266
|
+
nil
|
|
267
|
+
end
|
|
268
|
+
CLI::UI::StdoutRouter.duplicate_output_to = nil
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# Disable all framing within a block
|
|
273
|
+
#
|
|
274
|
+
# ==== Attributes
|
|
275
|
+
#
|
|
276
|
+
# * +block+ - block in which to disable frames
|
|
277
|
+
#
|
|
278
|
+
#: [T] { -> T } -> T
|
|
279
|
+
def raw(&block)
|
|
280
|
+
prev = Thread.current[:no_cliui_frame_inset]
|
|
281
|
+
Thread.current[:no_cliui_frame_inset] = true
|
|
282
|
+
yield
|
|
283
|
+
ensure
|
|
284
|
+
Thread.current[:no_cliui_frame_inset] = prev
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# Check whether colour is enabled in Formatter, Frame, and Spinner output.
|
|
288
|
+
# By default, colour is enabled when STDOUT is a TTY; that is, when output
|
|
289
|
+
# has not been directed to another program or to a file.
|
|
290
|
+
#
|
|
291
|
+
#: -> bool
|
|
292
|
+
def enable_color?
|
|
293
|
+
@enable_color
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
# Turn colour in Formatter, Frame, and Spinner output on or off.
|
|
297
|
+
#
|
|
298
|
+
# ==== Attributes
|
|
299
|
+
#
|
|
300
|
+
# * +bool+ - true or false; enable or disable colour.
|
|
301
|
+
#
|
|
302
|
+
#: (bool bool) -> void
|
|
303
|
+
def enable_color=(bool)
|
|
304
|
+
@enable_color = !!bool
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
# Check whether cursor control is enabled in Formatter, Frame, and Spinner output.
|
|
308
|
+
# By default, cursor control is enabled when STDOUT is a TTY; that is, when output
|
|
309
|
+
# has not been directed to another program or to a file.
|
|
310
|
+
#
|
|
311
|
+
#: -> bool
|
|
312
|
+
def enable_cursor?
|
|
313
|
+
@enable_cursor
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# Turn cursor control in Formatter, Frame, and Spinner output on or off.
|
|
317
|
+
#
|
|
318
|
+
# ==== Attributes
|
|
319
|
+
#
|
|
320
|
+
# * +bool+ - true or false; enable or disable cursor control.
|
|
321
|
+
#
|
|
322
|
+
#: (bool bool) -> void
|
|
323
|
+
def enable_cursor=(bool)
|
|
324
|
+
@enable_cursor = !!bool
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
# Set the default frame style.
|
|
328
|
+
# Convenience method for setting the default frame style with +CLI::UI::Frame.frame_style=+
|
|
329
|
+
#
|
|
330
|
+
# Raises ArgumentError if +frame_style+ is not valid
|
|
331
|
+
#
|
|
332
|
+
# ==== Attributes
|
|
333
|
+
#
|
|
334
|
+
# * +symbol+ - the default frame style to use for frames
|
|
335
|
+
#
|
|
336
|
+
#: (frame_stylable frame_style) -> void
|
|
337
|
+
def frame_style=(frame_style)
|
|
338
|
+
Frame.frame_style = frame_style
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
# Create a terminal link
|
|
342
|
+
#: (String url, String text, ?format: bool, ?blue_underline: bool) -> String
|
|
343
|
+
def link(url, text, format: true, blue_underline: format)
|
|
344
|
+
raise 'cannot use blue_underline without format' if blue_underline && !format
|
|
345
|
+
|
|
346
|
+
text = "{{blue:{{underline:#{text}}}}}" if blue_underline
|
|
347
|
+
text = CLI::UI.fmt(text) if format
|
|
348
|
+
"\x1b]8;;#{url}\x1b\\#{text}\x1b]8;;\x1b\\"
|
|
349
|
+
end
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
self.enable_color = $stdout.tty? && ENV['TERM'] != 'dumb' #: as !nil
|
|
353
|
+
|
|
354
|
+
# Shopify's CI system supports color, but not cursor control
|
|
355
|
+
self.enable_cursor = $stdout.tty? && ENV['TERM'] != 'dumb' && ENV['CI'].nil? && ENV['JOURNAL_STREAM'].nil? #: as !nil
|
|
356
|
+
end
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
require 'cli/ui/stdout_router'
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Copyright (c) 2014 Boris Bera
|
|
2
|
+
#
|
|
3
|
+
# MIT License
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
# a copy of this software and associated documentation files (the
|
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
# the following conditions:
|
|
12
|
+
#
|
|
13
|
+
# The above copyright notice and this permission notice shall be
|
|
14
|
+
# included in all copies or substantial portions of the Software.
|
|
15
|
+
#
|
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
# Sourced from https://github.com/dotboris/reentrant_mutex
|
|
25
|
+
module CLI
|
|
26
|
+
module UI
|
|
27
|
+
class ReentrantMutex < Mutex
|
|
28
|
+
def initialize
|
|
29
|
+
@count_mutex = Mutex.new
|
|
30
|
+
@counts = Hash.new(0)
|
|
31
|
+
|
|
32
|
+
super
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def synchronize
|
|
36
|
+
raise ThreadError, 'Must be called with a block' unless block_given?
|
|
37
|
+
|
|
38
|
+
begin
|
|
39
|
+
lock
|
|
40
|
+
yield
|
|
41
|
+
ensure
|
|
42
|
+
unlock
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def lock
|
|
47
|
+
c = increase_count Thread.current
|
|
48
|
+
super if c <= 1
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def unlock
|
|
52
|
+
c = decrease_count Thread.current
|
|
53
|
+
if c <= 0
|
|
54
|
+
super
|
|
55
|
+
delete_count Thread.current
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def count
|
|
60
|
+
@count_mutex.synchronize { @counts[Thread.current] }
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
private
|
|
64
|
+
|
|
65
|
+
def increase_count(thread)
|
|
66
|
+
@count_mutex.synchronize { @counts[thread] += 1 }
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def decrease_count(thread)
|
|
70
|
+
@count_mutex.synchronize { @counts[thread] -= 1 }
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def delete_count(thread)
|
|
74
|
+
@count_mutex.synchronize { @counts.delete(thread) }
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|