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,68 @@
|
|
|
1
|
+
require 'fluid_cli'
|
|
2
|
+
require "fluid_cli/theme/syncer"
|
|
3
|
+
require 'fluid_cli/theme/theme'
|
|
4
|
+
require "fluid_cli/commands/theme/common/root_helper"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module FluidCLI
|
|
8
|
+
module Commands
|
|
9
|
+
class Theme
|
|
10
|
+
class Pull < FluidCLI::Command
|
|
11
|
+
include Common::RootHelper
|
|
12
|
+
|
|
13
|
+
options do |parser, flags|
|
|
14
|
+
parser.on("-t", "--theme=NAME_OR_ID") { |theme| flags[:theme] = theme }
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def call(_args, name)
|
|
18
|
+
root = root_value(options, name)
|
|
19
|
+
return if exist_and_not_empty?(root) && !valid_theme_directory?(root)
|
|
20
|
+
|
|
21
|
+
delete = !options.flags[:nodelete]
|
|
22
|
+
theme = find_theme(root, **options.flags)
|
|
23
|
+
return if theme.nil?
|
|
24
|
+
|
|
25
|
+
syncer = FluidCLI::Theme::Syncer.new(@ctx, theme: theme)
|
|
26
|
+
begin
|
|
27
|
+
syncer.start_threads
|
|
28
|
+
CLI::UI::Frame.open("pulling theme #{theme.name} (##{theme.id})") do
|
|
29
|
+
FluidCLI::Theme::UI::SyncProgressBar.new(syncer).progress(:download_theme!, delete: delete)
|
|
30
|
+
end
|
|
31
|
+
if syncer.has_any_error?
|
|
32
|
+
@ctx.warn("Some files could not be downloaded. Please check the log file for more details: #{FluidCLI::LOG_FILE}")
|
|
33
|
+
else
|
|
34
|
+
@ctx.done("Theme #{theme.name} (##{theme.id}) pulled successfully.")
|
|
35
|
+
end
|
|
36
|
+
rescue FluidCLI::API::APIRequestNotFoundError
|
|
37
|
+
@ctx.abort("No theme found with ID: ##{theme.id}")
|
|
38
|
+
ensure
|
|
39
|
+
syncer.shutdown
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
private
|
|
45
|
+
|
|
46
|
+
def find_theme(root, theme: nil, **_args)
|
|
47
|
+
if theme
|
|
48
|
+
selected_theme = FluidCLI::Theme::Theme.find_by_identifier(@ctx, root: root, identifier: theme)
|
|
49
|
+
return selected_theme || @ctx.abort("No theme found with identifier: #{theme}")
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
select_theme(root)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def select_theme(root)
|
|
57
|
+
form = FluidCLI::Theme::Forms::Select.ask(
|
|
58
|
+
@ctx,
|
|
59
|
+
[],
|
|
60
|
+
title: "Select a theme to pull",
|
|
61
|
+
root: root,
|
|
62
|
+
)
|
|
63
|
+
form&.theme
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require "fluid_cli/theme/theme"
|
|
3
|
+
require "fluid_cli/theme/development_theme"
|
|
4
|
+
require "fluid_cli/theme/syncer"
|
|
5
|
+
require "fluid_cli/commands/theme/common/root_helper"
|
|
6
|
+
require "fluid_cli/commands/theme/common/company_helper"
|
|
7
|
+
module FluidCLI
|
|
8
|
+
module Commands
|
|
9
|
+
class Theme
|
|
10
|
+
class Push < FluidCLI::Command
|
|
11
|
+
include Common::RootHelper
|
|
12
|
+
include Common::CompanyHelper
|
|
13
|
+
|
|
14
|
+
# recommend_default_ruby_range
|
|
15
|
+
|
|
16
|
+
options do |parser, flags|
|
|
17
|
+
parser.on("-n", "--nodelete") { flags[:nodelete] = true }
|
|
18
|
+
parser.on("-t", "--theme=NAME_OR_ID") { |theme| flags[:theme] = theme }
|
|
19
|
+
# parser.on("-l", "--live") { flags[:live] = true }
|
|
20
|
+
# parser.on("-d", "--development") { flags[:development] = true }
|
|
21
|
+
parser.on("-u", "--unpublished") { flags[:unpublished] = true }
|
|
22
|
+
parser.on("-j", "--json") { flags[:json] = true }
|
|
23
|
+
parser.on("-a", "--allow-live") { flags[:allow_live] = true }
|
|
24
|
+
parser.on("-p", "--publish") { flags[:publish] = true }
|
|
25
|
+
# parser.on("-f", "--force") { flags[:force] = true }
|
|
26
|
+
# parser.on("--development-theme-id=DEVELOPMENT_THEME_ID") do |development_theme_id|
|
|
27
|
+
# flags[:development_theme_id] = development_theme_id.to_i
|
|
28
|
+
# end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def call(_args, name)
|
|
32
|
+
root = root_value(options, name)
|
|
33
|
+
return unless valid_theme_directory?(root)
|
|
34
|
+
|
|
35
|
+
development_theme_id = options.flags[:development_theme_id]
|
|
36
|
+
FluidCLI::DB.set(development_theme_id: development_theme_id) unless development_theme_id.nil?
|
|
37
|
+
|
|
38
|
+
delete = !options.flags[:nodelete]
|
|
39
|
+
theme = find_theme(root, **options.flags)
|
|
40
|
+
return if theme.nil?
|
|
41
|
+
|
|
42
|
+
# if theme.live? && !options.flags[:allow_live]
|
|
43
|
+
# question = @ctx.message("theme.push.live")
|
|
44
|
+
# question += @ctx.message("theme.push.theme", theme.name, theme.id) if options.flags[:live]
|
|
45
|
+
# return unless CLI::UI::Prompt.confirm(question)
|
|
46
|
+
# end
|
|
47
|
+
|
|
48
|
+
syncer = FluidCLI::Theme::Syncer.new(@ctx, theme: theme)
|
|
49
|
+
begin
|
|
50
|
+
syncer.start_threads
|
|
51
|
+
if options.flags[:json]
|
|
52
|
+
syncer.standard_reporter.disable!
|
|
53
|
+
syncer.upload_theme!(delete: delete)
|
|
54
|
+
else
|
|
55
|
+
CLI::UI::Frame.open("Pushing #{theme.name} (##{theme.id}) to #{theme.company}") do
|
|
56
|
+
FluidCLI::Theme::UI::SyncProgressBar.new(syncer).progress(:upload_theme!, delete: delete)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
push_completion_handler(theme, syncer.has_any_error?)
|
|
60
|
+
ensure
|
|
61
|
+
syncer.shutdown
|
|
62
|
+
end
|
|
63
|
+
rescue FluidCLI::API::APIRequestNotFoundError
|
|
64
|
+
@ctx.abort("No theme found with ID: ##{theme.id}")
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def self.help
|
|
68
|
+
"Pushes local theme files to a company's theme."
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
private
|
|
72
|
+
|
|
73
|
+
def push_completion_handler(theme, has_errors)
|
|
74
|
+
if options.flags[:json]
|
|
75
|
+
output = { theme: theme.to_h }
|
|
76
|
+
output[:warning] = "Theme pushed with some errors" if has_errors
|
|
77
|
+
|
|
78
|
+
puts(JSON.generate(output))
|
|
79
|
+
elsif options.flags[:publish]
|
|
80
|
+
theme.publish
|
|
81
|
+
return @ctx.done("Theme published successfully") unless has_errors
|
|
82
|
+
@ctx.warn("Theme published with errors")
|
|
83
|
+
else
|
|
84
|
+
return @ctx.done("Theme pushed successfully") unless has_errors
|
|
85
|
+
@ctx.warn("Theme pushed with errors")
|
|
86
|
+
end
|
|
87
|
+
raise CLI::Kit::AbortSilent if has_errors
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def find_theme(root, theme_id: nil, theme: nil, live: nil, development: nil, unpublished: nil, **_args)
|
|
91
|
+
if live
|
|
92
|
+
return FluidCLI::Theme::Theme.live(@ctx, root: root)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if development
|
|
96
|
+
return FluidCLI::Theme::DevelopmentTheme.find_or_create!(@ctx, root: root)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if unpublished
|
|
100
|
+
name = theme || ask_theme_name
|
|
101
|
+
return FluidCLI::Theme::Theme.create_unpublished(@ctx, root: root, name: name)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if theme
|
|
105
|
+
selected_theme = FluidCLI::Theme::Theme.find_by_identifier(@ctx, root: root, identifier: theme)
|
|
106
|
+
return selected_theme || @ctx.abort("No theme found with identifier: #{theme}")
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
select_theme(root)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def ask_theme_name
|
|
113
|
+
CLI::UI::Prompt.ask("Enter theme name:", allow_empty: false)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def select_theme(root)
|
|
117
|
+
form = FluidCLI::Theme::Forms::Select.ask(
|
|
118
|
+
@ctx,
|
|
119
|
+
[],
|
|
120
|
+
title: "Select a theme to push to #{company}",
|
|
121
|
+
root: root,
|
|
122
|
+
)
|
|
123
|
+
form&.theme
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def themes(root)
|
|
127
|
+
FluidCLI::Theme::Theme.all(@ctx, root: root)
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require "fluid_cli"
|
|
2
|
+
|
|
3
|
+
module FluidCLI
|
|
4
|
+
module Commands
|
|
5
|
+
class Theme < FluidCLI::Command
|
|
6
|
+
subcommand :Dev, 'dev', 'fluid_cli/commands/theme/dev'
|
|
7
|
+
subcommand :Init, 'init', 'fluid_cli/commands/theme/init'
|
|
8
|
+
subcommand :Pull, 'pull', 'fluid_cli/commands/theme/pull'
|
|
9
|
+
subcommand :Push, 'push', 'fluid_cli/commands/theme/push'
|
|
10
|
+
|
|
11
|
+
def call(*args)
|
|
12
|
+
self.class.help(*args)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class << self
|
|
16
|
+
def help(*args)
|
|
17
|
+
subcommands = subcommand_registry.command_names.join(" | ")
|
|
18
|
+
puts "Manage themes.\n\n{{bold:Subcommands:}} {{command:#{subcommands}}}"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require "fluid_cli"
|
|
2
|
+
|
|
3
|
+
module FluidCLI
|
|
4
|
+
module Commands
|
|
5
|
+
class Whoami < FluidCLI::Command
|
|
6
|
+
def call(_args, _name)
|
|
7
|
+
company = FluidCLI::DB.get(:company)
|
|
8
|
+
company_name = FluidCLI::DB.get(:company_name)
|
|
9
|
+
|
|
10
|
+
output = if company.nil?
|
|
11
|
+
"Not logged in to any company."
|
|
12
|
+
else
|
|
13
|
+
"Logged in to company: #{company_name || company}"
|
|
14
|
+
end
|
|
15
|
+
@ctx.puts(output)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.help
|
|
19
|
+
"Displays the currently logged in company."
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'fluid_cli'
|
|
2
|
+
|
|
3
|
+
module FluidCLI
|
|
4
|
+
module Commands
|
|
5
|
+
Registry = CLI::Kit::CommandRegistry.new(default: 'help')
|
|
6
|
+
|
|
7
|
+
def self.register(const, cmd, path)
|
|
8
|
+
autoload(const, path)
|
|
9
|
+
Registry.add(->() { const_get(const) }, cmd)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
register :Login, 'login', 'fluid_cli/commands/login'
|
|
13
|
+
register :Logout, 'logout', 'fluid_cli/commands/logout'
|
|
14
|
+
register :Theme, 'theme', 'fluid_cli/commands/theme'
|
|
15
|
+
register :Help, 'help', 'fluid_cli/commands/help'
|
|
16
|
+
register :Switch, 'switch', 'fluid_cli/commands/switch'
|
|
17
|
+
register :Whoami, 'whoami', 'fluid_cli/commands/whoami'
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
require "fluid_cli"
|
|
2
|
+
|
|
3
|
+
module FluidCLI
|
|
4
|
+
class CompanySwitcher
|
|
5
|
+
class Error < StandardError; end
|
|
6
|
+
class Timeout < StandardError; end
|
|
7
|
+
|
|
8
|
+
attr_accessor :ctx, :identifier, :switched_after_login
|
|
9
|
+
|
|
10
|
+
def initialize(ctx:, company: nil, switched_after_login: false)
|
|
11
|
+
@ctx = ctx
|
|
12
|
+
@identifier = company
|
|
13
|
+
@switched_after_login = switched_after_login
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def switch
|
|
17
|
+
company = find_company
|
|
18
|
+
switch_company(company)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def find_company
|
|
22
|
+
if switched_after_login
|
|
23
|
+
if identifier
|
|
24
|
+
company = companies.find { |c| c["subdomain"] == identifier }
|
|
25
|
+
company ||= select_company
|
|
26
|
+
else
|
|
27
|
+
if companies.size == 1
|
|
28
|
+
company = companies.first
|
|
29
|
+
else
|
|
30
|
+
company = select_company
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
else
|
|
34
|
+
if identifier
|
|
35
|
+
company = companies.find { |c| c["subdomain"] == identifier }
|
|
36
|
+
unless company
|
|
37
|
+
@ctx.abort("Company with subdomain '#{identifier}' not found.")
|
|
38
|
+
end
|
|
39
|
+
else
|
|
40
|
+
company = select_company
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
company
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def select_company
|
|
47
|
+
company_id = CLI::UI::Prompt.ask("Select a company") do |handler|
|
|
48
|
+
companies.each do |c|
|
|
49
|
+
handler.option("#{c["name"]} <#{c["subdomain"]}>") { c["id"] }
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
companies.find { |c| c["id"] == company_id }
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def companies
|
|
56
|
+
@companies ||= begin
|
|
57
|
+
_status, body = FluidCLI::API.new(@ctx).get(path: "/me")
|
|
58
|
+
body["companies"]
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def switch_company(company)
|
|
63
|
+
_status, body = FluidCLI::API.new(@ctx).put(path: "/authentication/company/#{company['id']}/switch")
|
|
64
|
+
FluidCLI::DB.set(jwt: body.dig("company", "jwt"))
|
|
65
|
+
IdentityAuth.new(ctx: @ctx).reauthenticate
|
|
66
|
+
company
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|