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,57 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
|
2
|
+
require "rake/testtask"
|
|
3
|
+
|
|
4
|
+
begin
|
|
5
|
+
require "rake/extensiontask"
|
|
6
|
+
task :build => :compile
|
|
7
|
+
|
|
8
|
+
Rake::ExtensionTask.new("debug") do |ext|
|
|
9
|
+
ext.lib_dir = "lib/debug"
|
|
10
|
+
end
|
|
11
|
+
rescue LoadError
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
task :default => [:clobber, :compile, 'README.md', :check_readme, :test_console]
|
|
15
|
+
|
|
16
|
+
file 'README.md' => ['lib/debug/session.rb', 'lib/debug/config.rb',
|
|
17
|
+
'exe/rdbg', 'misc/README.md.erb'] do
|
|
18
|
+
require_relative 'lib/debug/session'
|
|
19
|
+
require 'erb'
|
|
20
|
+
File.write 'README.md', ERB.new(File.read('misc/README.md.erb')).result
|
|
21
|
+
puts 'README.md is updated.'
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
task :check_readme do
|
|
25
|
+
require_relative 'lib/debug/session'
|
|
26
|
+
require 'erb'
|
|
27
|
+
current_readme = File.read("README.md")
|
|
28
|
+
generated_readme = ERB.new(File.read('misc/README.md.erb')).result
|
|
29
|
+
|
|
30
|
+
if current_readme != generated_readme
|
|
31
|
+
fail <<~MSG
|
|
32
|
+
The content of README.md doesn't match its template and/or source.
|
|
33
|
+
Please apply the changes to info source (e.g. command comments) or the template and run 'rake README.md' to update README.md.
|
|
34
|
+
MSG
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
desc "Run debug.gem test-framework tests"
|
|
39
|
+
Rake::TestTask.new(:test_test) do |t|
|
|
40
|
+
t.test_files = FileList["test/support/*_test.rb"]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
desc "Run all debugger console related tests"
|
|
44
|
+
Rake::TestTask.new(:test_console) do |t|
|
|
45
|
+
t.test_files = FileList["test/console/*_test.rb"]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
desc "Run all debugger protocols (CAP & DAP) related tests"
|
|
49
|
+
Rake::TestTask.new(:test_protocol) do |t|
|
|
50
|
+
t.test_files = FileList["test/protocol/*_test.rb"]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
task test: 'test_console' do
|
|
54
|
+
warn '`rake test` doesn\'t run protocol tests. Use `rake test_all` to test all.'
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
task test_all: [:test_test, :test_console, :test_protocol]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# TODO
|
|
2
|
+
|
|
3
|
+
## Basic functionality
|
|
4
|
+
|
|
5
|
+
* Support Fibers and Ractors
|
|
6
|
+
|
|
7
|
+
## UI
|
|
8
|
+
|
|
9
|
+
* Multi-line support
|
|
10
|
+
* Completion for Ruby's code
|
|
11
|
+
* Interactive breakpoint setting
|
|
12
|
+
* Interactive record & play debugging
|
|
13
|
+
* irb integration
|
|
14
|
+
|
|
15
|
+
## Debug command
|
|
16
|
+
|
|
17
|
+
* Watch points
|
|
18
|
+
* Lightweight watchpoints for instance variables with Ruby 3.3 features (TP:ivar_set)
|
|
19
|
+
* Alias
|
|
20
|
+
|
|
21
|
+
## Debug port
|
|
22
|
+
|
|
23
|
+
* Debug port for monitoring
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require_relative 'lib/debug/version'
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |spec|
|
|
4
|
+
spec.name = "debug"
|
|
5
|
+
spec.version = DEBUGGER__::VERSION
|
|
6
|
+
spec.authors = ["Koichi Sasada"]
|
|
7
|
+
spec.email = ["ko1@atdot.net"]
|
|
8
|
+
|
|
9
|
+
spec.summary = %q{Debugging functionality for Ruby}
|
|
10
|
+
spec.description = %q{Debugging functionality for Ruby. This is completely rewritten debug.rb which was contained by the ancient Ruby versions.}
|
|
11
|
+
spec.homepage = "https://github.com/ruby/debug"
|
|
12
|
+
spec.licenses = ["Ruby", "BSD-2-Clause"]
|
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
|
14
|
+
|
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
16
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
|
17
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/releases/tag/v#{spec.version}"
|
|
18
|
+
|
|
19
|
+
# Specify which files should be added to the gem when it is released.
|
|
20
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
21
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
22
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
|
23
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
spec.bindir = "exe"
|
|
27
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
28
|
+
spec.require_paths = ["lib"]
|
|
29
|
+
spec.extensions = ['ext/debug/extconf.rb']
|
|
30
|
+
|
|
31
|
+
spec.add_dependency "irb", "~> 1.10" # for irb:debug integration
|
|
32
|
+
spec.add_dependency "reline", ">= 0.3.8"
|
|
33
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require_relative '../lib/debug/config'
|
|
4
|
+
config = DEBUGGER__::Config::parse_argv(ARGV)
|
|
5
|
+
|
|
6
|
+
# mode is not an actual configuration option
|
|
7
|
+
# it's only used to carry the result of parse_argv here
|
|
8
|
+
case config.delete(:mode)
|
|
9
|
+
when :start
|
|
10
|
+
require 'rbconfig'
|
|
11
|
+
|
|
12
|
+
libpath = File.join(File.expand_path(File.dirname(__dir__)), 'lib/debug')
|
|
13
|
+
start_mode = config[:open] ? "open" : 'start'
|
|
14
|
+
cmd = config[:command] ? ARGV.shift : (ENV['RUBY'] || RbConfig.ruby)
|
|
15
|
+
|
|
16
|
+
if defined?($:.resolve_feature_path)
|
|
17
|
+
begin
|
|
18
|
+
_, sopath = $:.resolve_feature_path('debug/debug.so')
|
|
19
|
+
rescue LoadError
|
|
20
|
+
# raises LoadError before 3.1 (2.7 and 3.0)
|
|
21
|
+
else
|
|
22
|
+
sopath = File.dirname(File.dirname(sopath)) if sopath
|
|
23
|
+
end
|
|
24
|
+
else
|
|
25
|
+
# `$:.resolve_feature_path` is not defined in 2.6 or earlier.
|
|
26
|
+
so = "debug/debug.#{RbConfig::CONFIG['DLEXT']}"
|
|
27
|
+
sopath = $:.find {|dir| File.exist?(File.join(dir, so))}
|
|
28
|
+
end
|
|
29
|
+
added = "-r #{libpath}/#{start_mode}"
|
|
30
|
+
added = "-I #{sopath} #{added}" if sopath
|
|
31
|
+
rubyopt = ENV['RUBYOPT']
|
|
32
|
+
env = ::DEBUGGER__::Config.config_to_env_hash(config)
|
|
33
|
+
env['RUBY_DEBUG_ADDED_RUBYOPT'] = added
|
|
34
|
+
env['RUBYOPT'] = "#{rubyopt} #{added}"
|
|
35
|
+
|
|
36
|
+
exec(env, cmd, *ARGV)
|
|
37
|
+
|
|
38
|
+
when :attach
|
|
39
|
+
require_relative "../lib/debug/client"
|
|
40
|
+
::DEBUGGER__::CONFIG.set_config(**config)
|
|
41
|
+
|
|
42
|
+
begin
|
|
43
|
+
if ARGV.empty? && config[:port]
|
|
44
|
+
DEBUGGER__::Client.new([config[:host], config[:port]].compact).connect
|
|
45
|
+
else
|
|
46
|
+
DEBUGGER__::Client.new(ARGV).connect
|
|
47
|
+
end
|
|
48
|
+
rescue DEBUGGER__::CommandLineOptionError
|
|
49
|
+
puts opt.help
|
|
50
|
+
end
|
|
51
|
+
else
|
|
52
|
+
raise # assert
|
|
53
|
+
end
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
|
|
2
|
+
SHELL = /bin/sh
|
|
3
|
+
|
|
4
|
+
# V=0 quiet, V=1 verbose. other values don't work.
|
|
5
|
+
V = 0
|
|
6
|
+
V0 = $(V:0=)
|
|
7
|
+
Q1 = $(V:1=)
|
|
8
|
+
Q = $(Q1:0=@)
|
|
9
|
+
ECHO1 = $(V:1=@ :)
|
|
10
|
+
ECHO = $(ECHO1:0=@ echo)
|
|
11
|
+
NULLCMD = :
|
|
12
|
+
|
|
13
|
+
#### Start of system configuration section. ####
|
|
14
|
+
|
|
15
|
+
srcdir = .
|
|
16
|
+
topdir = /Users/pralish/.rvm/rubies/ruby-3.4.1/include/ruby-3.4.0
|
|
17
|
+
hdrdir = $(topdir)
|
|
18
|
+
arch_hdrdir = /Users/pralish/.rvm/rubies/ruby-3.4.1/include/ruby-3.4.0/arm64-darwin23
|
|
19
|
+
PATH_SEPARATOR = :
|
|
20
|
+
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
|
21
|
+
prefix = $(DESTDIR)/Users/pralish/.rvm/rubies/ruby-3.4.1
|
|
22
|
+
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
|
|
23
|
+
rubyarchprefix = $(rubylibprefix)/$(arch)
|
|
24
|
+
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
|
25
|
+
exec_prefix = $(prefix)
|
|
26
|
+
vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
|
|
27
|
+
sitearchhdrdir = $(sitehdrdir)/$(sitearch)
|
|
28
|
+
rubyarchhdrdir = $(rubyhdrdir)/$(arch)
|
|
29
|
+
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
|
30
|
+
sitehdrdir = $(rubyhdrdir)/site_ruby
|
|
31
|
+
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
|
|
32
|
+
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
|
33
|
+
vendorlibdir = $(vendordir)/$(ruby_version)
|
|
34
|
+
vendordir = $(rubylibprefix)/vendor_ruby
|
|
35
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
|
36
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
|
37
|
+
sitedir = $(rubylibprefix)/site_ruby
|
|
38
|
+
rubyarchdir = $(rubylibdir)/$(arch)
|
|
39
|
+
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
|
40
|
+
sitearchincludedir = $(includedir)/$(sitearch)
|
|
41
|
+
archincludedir = $(includedir)/$(arch)
|
|
42
|
+
sitearchlibdir = $(libdir)/$(sitearch)
|
|
43
|
+
archlibdir = $(libdir)/$(arch)
|
|
44
|
+
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
|
45
|
+
modular_gc_dir = $(DESTDIR)
|
|
46
|
+
mandir = $(datarootdir)/man
|
|
47
|
+
localedir = $(datarootdir)/locale
|
|
48
|
+
libdir = $(exec_prefix)/lib
|
|
49
|
+
psdir = $(docdir)
|
|
50
|
+
pdfdir = $(docdir)
|
|
51
|
+
dvidir = $(docdir)
|
|
52
|
+
htmldir = $(docdir)
|
|
53
|
+
infodir = $(datarootdir)/info
|
|
54
|
+
docdir = $(datarootdir)/doc/$(PACKAGE)
|
|
55
|
+
oldincludedir = $(DESTDIR)/usr/include
|
|
56
|
+
includedir = $(SDKROOT)$(prefix)/include
|
|
57
|
+
runstatedir = $(localstatedir)/run
|
|
58
|
+
localstatedir = $(prefix)/var
|
|
59
|
+
sharedstatedir = $(prefix)/com
|
|
60
|
+
sysconfdir = $(prefix)/etc
|
|
61
|
+
datadir = $(datarootdir)
|
|
62
|
+
datarootdir = $(prefix)/share
|
|
63
|
+
libexecdir = $(exec_prefix)/libexec
|
|
64
|
+
sbindir = $(exec_prefix)/sbin
|
|
65
|
+
bindir = $(exec_prefix)/bin
|
|
66
|
+
archdir = $(rubyarchdir)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
CC_WRAPPER =
|
|
70
|
+
CC = gcc
|
|
71
|
+
CXX = g++ -std=gnu++11
|
|
72
|
+
LIBRUBY = $(LIBRUBY_SO)
|
|
73
|
+
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
|
74
|
+
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
|
|
75
|
+
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation $(MAINLIBS)
|
|
76
|
+
empty =
|
|
77
|
+
OUTFLAG = -o $(empty)
|
|
78
|
+
COUTFLAG = -o $(empty)
|
|
79
|
+
CSRCFLAG = $(empty)
|
|
80
|
+
|
|
81
|
+
RUBY_EXTCONF_H =
|
|
82
|
+
cflags = $(hardenflags) -fdeclspec $(optflags) $(debugflags) $(warnflags)
|
|
83
|
+
cxxflags =
|
|
84
|
+
optflags = -O3 -fno-fast-math
|
|
85
|
+
debugflags = -ggdb3
|
|
86
|
+
warnflags = -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef
|
|
87
|
+
cppflags =
|
|
88
|
+
CCDLFLAGS = -fno-common
|
|
89
|
+
CFLAGS = $(CCDLFLAGS) -O3 -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@3/include $(cflags) -fno-common -pipe $(ARCH_FLAG)
|
|
90
|
+
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
|
91
|
+
DEFS =
|
|
92
|
+
CPPFLAGS = -DHAVE_RB_ISEQ -DHAVE_RB_ISEQ_PARAMETERS -DHAVE_RB_ISEQ_CODE_LOCATION -DHAVE_RB_ISEQ_TYPE -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
|
|
93
|
+
CXXFLAGS = $(CCDLFLAGS) -fdeclspec $(ARCH_FLAG)
|
|
94
|
+
ldflags = -L. -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@3/lib -fstack-protector-strong
|
|
95
|
+
dldflags = -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@3/lib -Wl,-undefined,dynamic_lookup
|
|
96
|
+
ARCH_FLAG = -arch arm64
|
|
97
|
+
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
|
98
|
+
LDSHARED = $(CC) -dynamic -bundle
|
|
99
|
+
LDSHAREDXX = $(CXX) -dynamic -bundle
|
|
100
|
+
POSTLINK = dsymutil $@ 2>/dev/null; { test -z '$(RUBY_CODESIGN)' || codesign -s '$(RUBY_CODESIGN)' $@; }
|
|
101
|
+
AR = ar
|
|
102
|
+
LD = ld
|
|
103
|
+
EXEEXT =
|
|
104
|
+
|
|
105
|
+
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
|
106
|
+
RUBY_SO_NAME = ruby.3.4
|
|
107
|
+
RUBYW_INSTALL_NAME =
|
|
108
|
+
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
|
|
109
|
+
RUBYW_BASE_NAME = rubyw
|
|
110
|
+
RUBY_BASE_NAME = ruby
|
|
111
|
+
|
|
112
|
+
arch = arm64-darwin23
|
|
113
|
+
sitearch = $(arch)
|
|
114
|
+
ruby_version = 3.4.0
|
|
115
|
+
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
|
116
|
+
RUBY = $(ruby)
|
|
117
|
+
BUILTRUBY = $(bindir)/$(RUBY_BASE_NAME)
|
|
118
|
+
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
|
|
119
|
+
|
|
120
|
+
RM = rm -f
|
|
121
|
+
RM_RF = rm -fr
|
|
122
|
+
RMDIRS = rmdir -p
|
|
123
|
+
MAKEDIRS = /opt/homebrew/opt/coreutils/bin/gmkdir -p
|
|
124
|
+
INSTALL = /opt/homebrew/opt/coreutils/bin/ginstall -c
|
|
125
|
+
INSTALL_PROG = $(INSTALL) -m 0755
|
|
126
|
+
INSTALL_DATA = $(INSTALL) -m 644
|
|
127
|
+
COPY = cp
|
|
128
|
+
TOUCH = exit >
|
|
129
|
+
|
|
130
|
+
#### End of system configuration section. ####
|
|
131
|
+
|
|
132
|
+
preload =
|
|
133
|
+
libpath = . $(libdir)
|
|
134
|
+
LIBPATH = -L. -L$(libdir)
|
|
135
|
+
DEFFILE =
|
|
136
|
+
|
|
137
|
+
CLEANFILES = mkmf.log
|
|
138
|
+
DISTCLEANFILES = debug_version.h
|
|
139
|
+
DISTCLEANDIRS =
|
|
140
|
+
|
|
141
|
+
extout =
|
|
142
|
+
extout_prefix =
|
|
143
|
+
target_prefix = /debug
|
|
144
|
+
LOCAL_LIBS =
|
|
145
|
+
LIBS = $(LIBRUBYARG_SHARED) -lpthread
|
|
146
|
+
ORIG_SRCS = debug.c iseq_collector.c
|
|
147
|
+
SRCS = $(ORIG_SRCS)
|
|
148
|
+
OBJS = debug.o iseq_collector.o
|
|
149
|
+
HDRS = $(srcdir)/debug_version.h
|
|
150
|
+
LOCAL_HDRS =
|
|
151
|
+
TARGET = debug
|
|
152
|
+
TARGET_NAME = debug
|
|
153
|
+
TARGET_ENTRY = Init_$(TARGET_NAME)
|
|
154
|
+
DLLIB = $(TARGET).bundle
|
|
155
|
+
EXTSTATIC =
|
|
156
|
+
STATIC_LIB =
|
|
157
|
+
|
|
158
|
+
TIMESTAMP_DIR = .
|
|
159
|
+
BINDIR = $(bindir)
|
|
160
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
|
161
|
+
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
|
162
|
+
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
|
163
|
+
HDRDIR = $(sitehdrdir)$(target_prefix)
|
|
164
|
+
ARCHHDRDIR = $(sitearchhdrdir)$(target_prefix)
|
|
165
|
+
TARGET_SO_DIR =
|
|
166
|
+
TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
|
|
167
|
+
CLEANLIBS = $(TARGET_SO) $(TARGET_SO:=.dSYM)
|
|
168
|
+
CLEANOBJS = $(OBJS) *.bak
|
|
169
|
+
TARGET_SO_DIR_TIMESTAMP = $(TIMESTAMP_DIR)/.sitearchdir.-.debug.time
|
|
170
|
+
|
|
171
|
+
all: $(DLLIB)
|
|
172
|
+
static: $(STATIC_LIB)
|
|
173
|
+
.PHONY: all install static install-so install-rb
|
|
174
|
+
.PHONY: clean clean-so clean-static clean-rb
|
|
175
|
+
|
|
176
|
+
clean-static::
|
|
177
|
+
clean-rb-default::
|
|
178
|
+
clean-rb::
|
|
179
|
+
clean-so::
|
|
180
|
+
clean: clean-so clean-static clean-rb-default clean-rb
|
|
181
|
+
-$(Q)$(RM_RF) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
|
|
182
|
+
|
|
183
|
+
distclean-rb-default::
|
|
184
|
+
distclean-rb::
|
|
185
|
+
distclean-so::
|
|
186
|
+
distclean-static::
|
|
187
|
+
distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
|
|
188
|
+
-$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
|
189
|
+
-$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
|
190
|
+
-$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
|
|
191
|
+
|
|
192
|
+
realclean: distclean
|
|
193
|
+
install: install-so install-rb
|
|
194
|
+
|
|
195
|
+
install-so: $(DLLIB) $(TARGET_SO_DIR_TIMESTAMP)
|
|
196
|
+
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
|
197
|
+
clean-static::
|
|
198
|
+
-$(Q)$(RM) $(STATIC_LIB)
|
|
199
|
+
install-rb: pre-install-rb do-install-rb install-rb-default
|
|
200
|
+
install-rb-default: pre-install-rb-default do-install-rb-default
|
|
201
|
+
pre-install-rb: Makefile
|
|
202
|
+
pre-install-rb-default: Makefile
|
|
203
|
+
do-install-rb:
|
|
204
|
+
do-install-rb-default:
|
|
205
|
+
pre-install-rb-default:
|
|
206
|
+
@$(NULLCMD)
|
|
207
|
+
$(TARGET_SO_DIR_TIMESTAMP):
|
|
208
|
+
$(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
|
|
209
|
+
$(Q) $(TOUCH) $@
|
|
210
|
+
|
|
211
|
+
site-install: site-install-so site-install-rb
|
|
212
|
+
site-install-so: install-so
|
|
213
|
+
site-install-rb: install-rb
|
|
214
|
+
|
|
215
|
+
.SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
|
|
216
|
+
|
|
217
|
+
.cc.o:
|
|
218
|
+
$(ECHO) compiling $(<)
|
|
219
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
|
220
|
+
|
|
221
|
+
.cc.S:
|
|
222
|
+
$(ECHO) translating $(<)
|
|
223
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
|
224
|
+
|
|
225
|
+
.mm.o:
|
|
226
|
+
$(ECHO) compiling $(<)
|
|
227
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
|
228
|
+
|
|
229
|
+
.mm.S:
|
|
230
|
+
$(ECHO) translating $(<)
|
|
231
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
|
232
|
+
|
|
233
|
+
.cxx.o:
|
|
234
|
+
$(ECHO) compiling $(<)
|
|
235
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
|
236
|
+
|
|
237
|
+
.cxx.S:
|
|
238
|
+
$(ECHO) translating $(<)
|
|
239
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
|
240
|
+
|
|
241
|
+
.cpp.o:
|
|
242
|
+
$(ECHO) compiling $(<)
|
|
243
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
|
244
|
+
|
|
245
|
+
.cpp.S:
|
|
246
|
+
$(ECHO) translating $(<)
|
|
247
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
|
248
|
+
|
|
249
|
+
.c.o:
|
|
250
|
+
$(ECHO) compiling $(<)
|
|
251
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
|
252
|
+
|
|
253
|
+
.c.S:
|
|
254
|
+
$(ECHO) translating $(<)
|
|
255
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
|
256
|
+
|
|
257
|
+
.m.o:
|
|
258
|
+
$(ECHO) compiling $(<)
|
|
259
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
|
260
|
+
|
|
261
|
+
.m.S:
|
|
262
|
+
$(ECHO) translating $(<)
|
|
263
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
|
264
|
+
|
|
265
|
+
$(TARGET_SO): $(OBJS) Makefile
|
|
266
|
+
$(ECHO) linking shared-object debug/$(DLLIB)
|
|
267
|
+
-$(Q)$(RM) $(@)
|
|
268
|
+
$(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
|
269
|
+
$(Q) $(POSTLINK)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
$(OBJS): $(HDRS) $(ruby_headers)
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
|
|
2
|
+
#include "ruby/ruby.h"
|
|
3
|
+
#include "ruby/debug.h"
|
|
4
|
+
#include "ruby/encoding.h"
|
|
5
|
+
#include "debug_version.h"
|
|
6
|
+
//
|
|
7
|
+
static VALUE rb_mDebugger;
|
|
8
|
+
|
|
9
|
+
// iseq
|
|
10
|
+
typedef struct rb_iseq_struct rb_iseq_t;
|
|
11
|
+
const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw);
|
|
12
|
+
VALUE rb_iseq_realpath(const rb_iseq_t *iseq);
|
|
13
|
+
|
|
14
|
+
static VALUE
|
|
15
|
+
iseq_realpath(VALUE iseqw)
|
|
16
|
+
{
|
|
17
|
+
return rb_iseq_realpath(rb_iseqw_to_iseq(iseqw));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static VALUE rb_cFrameInfo;
|
|
21
|
+
|
|
22
|
+
static VALUE
|
|
23
|
+
di_entry(VALUE loc, VALUE self, VALUE binding, VALUE iseq, VALUE klass, VALUE depth)
|
|
24
|
+
{
|
|
25
|
+
return rb_struct_new(rb_cFrameInfo,
|
|
26
|
+
// :location, :self, :binding, :iseq, :class, :frame_depth,
|
|
27
|
+
loc, self, binding, iseq, klass, depth,
|
|
28
|
+
// :has_return_value, :return_value,
|
|
29
|
+
Qnil, Qnil,
|
|
30
|
+
// :has_raised_exception, :raised_exception,
|
|
31
|
+
Qnil, Qnil,
|
|
32
|
+
// :show_line, :local_variables
|
|
33
|
+
Qnil,
|
|
34
|
+
// :_local_variables, :_callee # for recorder
|
|
35
|
+
Qnil, Qnil,
|
|
36
|
+
// :dupped_binding
|
|
37
|
+
Qnil
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static int
|
|
42
|
+
str_start_with(VALUE str, VALUE prefix)
|
|
43
|
+
{
|
|
44
|
+
StringValue(prefix);
|
|
45
|
+
rb_enc_check(str, prefix);
|
|
46
|
+
if (RSTRING_LEN(str) >= RSTRING_LEN(prefix) &&
|
|
47
|
+
memcmp(RSTRING_PTR(str), RSTRING_PTR(prefix), RSTRING_LEN(prefix)) == 0) {
|
|
48
|
+
return 1;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static VALUE
|
|
56
|
+
di_body(const rb_debug_inspector_t *dc, void *ptr)
|
|
57
|
+
{
|
|
58
|
+
VALUE skip_path_prefix = (VALUE)ptr;
|
|
59
|
+
VALUE locs = rb_debug_inspector_backtrace_locations(dc);
|
|
60
|
+
VALUE ary = rb_ary_new();
|
|
61
|
+
long len = RARRAY_LEN(locs);
|
|
62
|
+
long i;
|
|
63
|
+
|
|
64
|
+
for (i=1; i<len; i++) {
|
|
65
|
+
VALUE e;
|
|
66
|
+
VALUE iseq = rb_debug_inspector_frame_iseq_get(dc, i);
|
|
67
|
+
VALUE loc = RARRAY_AREF(locs, i);
|
|
68
|
+
VALUE path;
|
|
69
|
+
|
|
70
|
+
if (!NIL_P(iseq)) {
|
|
71
|
+
path = iseq_realpath(iseq);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
// C frame
|
|
75
|
+
path = rb_funcall(loc, rb_intern("path"), 0);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (!NIL_P(path) && !NIL_P(skip_path_prefix) && str_start_with(path, skip_path_prefix)) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
e = di_entry(loc,
|
|
83
|
+
rb_debug_inspector_frame_self_get(dc, i),
|
|
84
|
+
rb_debug_inspector_frame_binding_get(dc, i),
|
|
85
|
+
iseq,
|
|
86
|
+
rb_debug_inspector_frame_class_get(dc, i),
|
|
87
|
+
#ifdef RB_DEBUG_INSPECTOR_FRAME_DEPTH
|
|
88
|
+
rb_debug_inspector_frame_depth(dc, i)
|
|
89
|
+
#else
|
|
90
|
+
INT2FIX(len - i)
|
|
91
|
+
#endif
|
|
92
|
+
);
|
|
93
|
+
rb_ary_push(ary, e);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return ary;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
static VALUE
|
|
100
|
+
capture_frames(VALUE self, VALUE skip_path_prefix)
|
|
101
|
+
{
|
|
102
|
+
return rb_debug_inspector_open(di_body, (void *)skip_path_prefix);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
#ifdef RB_DEBUG_INSPECTOR_FRAME_DEPTH
|
|
106
|
+
static VALUE
|
|
107
|
+
frame_depth(VALUE self)
|
|
108
|
+
{
|
|
109
|
+
return rb_debug_inspector_current_depth();
|
|
110
|
+
}
|
|
111
|
+
#else
|
|
112
|
+
static VALUE
|
|
113
|
+
frame_depth(VALUE self)
|
|
114
|
+
{
|
|
115
|
+
// TODO: more efficient API
|
|
116
|
+
VALUE bt = rb_make_backtrace();
|
|
117
|
+
return INT2FIX(RARRAY_LEN(bt));
|
|
118
|
+
}
|
|
119
|
+
#endif
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
// iseq
|
|
123
|
+
|
|
124
|
+
const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw);
|
|
125
|
+
|
|
126
|
+
#ifdef HAVE_RB_ISEQ_TYPE
|
|
127
|
+
VALUE rb_iseq_type(const rb_iseq_t *);
|
|
128
|
+
|
|
129
|
+
static VALUE
|
|
130
|
+
iseq_type(VALUE iseqw)
|
|
131
|
+
{
|
|
132
|
+
const rb_iseq_t *iseq = rb_iseqw_to_iseq(iseqw);
|
|
133
|
+
return rb_iseq_type(iseq);
|
|
134
|
+
}
|
|
135
|
+
#endif
|
|
136
|
+
|
|
137
|
+
#ifdef HAVE_RB_ISEQ_PARAMETERS
|
|
138
|
+
VALUE rb_iseq_parameters(const rb_iseq_t *, int is_proc);
|
|
139
|
+
|
|
140
|
+
static VALUE
|
|
141
|
+
iseq_parameters_symbols(VALUE iseqw)
|
|
142
|
+
{
|
|
143
|
+
const rb_iseq_t *iseq = rb_iseqw_to_iseq(iseqw);
|
|
144
|
+
VALUE params = rb_iseq_parameters(iseq, 0);
|
|
145
|
+
VALUE ary = rb_ary_new();
|
|
146
|
+
|
|
147
|
+
static VALUE sym_ast, sym_astast, sym_amp;
|
|
148
|
+
|
|
149
|
+
if (sym_ast == 0) {
|
|
150
|
+
sym_ast = ID2SYM(rb_intern("*"));
|
|
151
|
+
sym_astast = ID2SYM(rb_intern("**"));
|
|
152
|
+
sym_amp = ID2SYM(rb_intern("&"));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
for (long i=0; i<RARRAY_LEN(params); i++) {
|
|
156
|
+
VALUE e = RARRAY_AREF(params, i);
|
|
157
|
+
if (RARRAY_LEN(e) == 2) {
|
|
158
|
+
VALUE sym = RARRAY_AREF(e, 1);
|
|
159
|
+
if (sym != sym_ast &&
|
|
160
|
+
sym != sym_astast &&
|
|
161
|
+
sym != sym_amp) rb_ary_push(ary, RARRAY_AREF(e, 1));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return ary;
|
|
166
|
+
}
|
|
167
|
+
#endif
|
|
168
|
+
|
|
169
|
+
#ifdef HAVE_RB_ISEQ_CODE_LOCATION
|
|
170
|
+
void rb_iseq_code_location(const rb_iseq_t *, int *first_lineno, int *first_column, int *last_lineno, int *last_column);
|
|
171
|
+
|
|
172
|
+
static VALUE
|
|
173
|
+
iseq_first_line(VALUE iseqw)
|
|
174
|
+
{
|
|
175
|
+
const rb_iseq_t *iseq = rb_iseqw_to_iseq(iseqw);
|
|
176
|
+
int line;
|
|
177
|
+
rb_iseq_code_location(iseq, &line, NULL, NULL, NULL);
|
|
178
|
+
return INT2NUM(line);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
static VALUE
|
|
182
|
+
iseq_last_line(VALUE iseqw)
|
|
183
|
+
{
|
|
184
|
+
const rb_iseq_t *iseq = rb_iseqw_to_iseq(iseqw);
|
|
185
|
+
int line;
|
|
186
|
+
rb_iseq_code_location(iseq, NULL, NULL, &line, NULL);
|
|
187
|
+
return INT2NUM(line);
|
|
188
|
+
}
|
|
189
|
+
#endif
|
|
190
|
+
|
|
191
|
+
#ifdef HAVE_RB_ISEQ
|
|
192
|
+
void Init_iseq_collector(void);
|
|
193
|
+
#endif
|
|
194
|
+
|
|
195
|
+
void
|
|
196
|
+
Init_debug(void)
|
|
197
|
+
{
|
|
198
|
+
#ifdef HAVE_RB_ISEQ
|
|
199
|
+
VALUE rb_mRubyVM = rb_const_get(rb_cObject, rb_intern("RubyVM"));
|
|
200
|
+
VALUE rb_cISeq = rb_const_get(rb_mRubyVM, rb_intern("InstructionSequence"));
|
|
201
|
+
#endif
|
|
202
|
+
rb_mDebugger = rb_const_get(rb_cObject, rb_intern("DEBUGGER__"));
|
|
203
|
+
rb_cFrameInfo = rb_const_get(rb_mDebugger, rb_intern("FrameInfo"));
|
|
204
|
+
|
|
205
|
+
// Debugger and FrameInfo were defined in Ruby. We need to register them
|
|
206
|
+
// as mark objects so they are automatically pinned.
|
|
207
|
+
rb_gc_register_mark_object(rb_mDebugger);
|
|
208
|
+
rb_gc_register_mark_object(rb_cFrameInfo);
|
|
209
|
+
rb_define_singleton_method(rb_mDebugger, "capture_frames", capture_frames, 1);
|
|
210
|
+
rb_define_singleton_method(rb_mDebugger, "frame_depth", frame_depth, 0);
|
|
211
|
+
rb_define_const(rb_mDebugger, "SO_VERSION", rb_str_new2(RUBY_DEBUG_VERSION));
|
|
212
|
+
|
|
213
|
+
// iseq
|
|
214
|
+
#ifdef HAVE_RB_ISEQ_TYPE
|
|
215
|
+
rb_define_method(rb_cISeq, "type", iseq_type, 0);
|
|
216
|
+
#endif
|
|
217
|
+
#ifdef HAVE_RB_ISEQ_PARAMETERS
|
|
218
|
+
rb_define_method(rb_cISeq, "parameters_symbols", iseq_parameters_symbols, 0);
|
|
219
|
+
#endif
|
|
220
|
+
#ifdef HAVE_RB_ISEQ_CODE_LOCATION
|
|
221
|
+
rb_define_method(rb_cISeq, "first_line", iseq_first_line, 0);
|
|
222
|
+
rb_define_method(rb_cISeq, "last_line", iseq_last_line, 0);
|
|
223
|
+
#endif
|
|
224
|
+
|
|
225
|
+
#ifdef HAVE_RB_ISEQ
|
|
226
|
+
Init_iseq_collector();
|
|
227
|
+
#endif
|
|
228
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#define RUBY_DEBUG_VERSION "1.11.0"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'mkmf'
|
|
2
|
+
require_relative '../../lib/debug/version'
|
|
3
|
+
File.write("debug_version.h", "#define RUBY_DEBUG_VERSION \"#{DEBUGGER__::VERSION}\"\n")
|
|
4
|
+
$distcleanfiles << "debug_version.h"
|
|
5
|
+
|
|
6
|
+
if defined? RubyVM
|
|
7
|
+
$defs << '-DHAVE_RB_ISEQ'
|
|
8
|
+
$defs << '-DHAVE_RB_ISEQ_PARAMETERS'
|
|
9
|
+
$defs << '-DHAVE_RB_ISEQ_CODE_LOCATION'
|
|
10
|
+
|
|
11
|
+
if RUBY_VERSION >= '3.1.0'
|
|
12
|
+
$defs << '-DHAVE_RB_ISEQ_TYPE'
|
|
13
|
+
end
|
|
14
|
+
else
|
|
15
|
+
# not on MRI
|
|
16
|
+
|
|
17
|
+
have_func "rb_iseq_parameters(NULL, 0)",
|
|
18
|
+
[["VALUE rb_iseq_parameters(void *, int is_proc);"]]
|
|
19
|
+
|
|
20
|
+
have_func "rb_iseq_code_location(NULL, NULL, NULL, NULL, NULL)",
|
|
21
|
+
[["void rb_iseq_code_location(void *, int *first_lineno, int *first_column, int *last_lineno, int *last_column);"]]
|
|
22
|
+
# from Ruby 3.1
|
|
23
|
+
have_func "rb_iseq_type(NULL)",
|
|
24
|
+
[["VALUE rb_iseq_type(void *);"]]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
create_makefile 'debug/debug'
|