@shopify/cli-kit 3.69.3 → 3.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{assets/cli-ruby/LICENSE → LICENSE} +0 -2
- package/dist/cli/api/graphql/admin/generated/get_theme_file_bodies.d.ts +41 -0
- package/dist/cli/api/graphql/admin/generated/get_theme_file_bodies.js +165 -0
- package/dist/cli/api/graphql/admin/generated/get_theme_file_bodies.js.map +1 -0
- package/dist/cli/api/graphql/admin/generated/get_theme_file_checksums.d.ts +29 -0
- package/dist/cli/api/graphql/admin/generated/get_theme_file_checksums.js +100 -0
- package/dist/cli/api/graphql/admin/generated/get_theme_file_checksums.js.map +1 -0
- package/dist/cli/api/graphql/admin/generated/theme_delete.d.ts +17 -0
- package/dist/cli/api/graphql/admin/generated/theme_delete.js +53 -0
- package/dist/cli/api/graphql/admin/generated/theme_delete.js.map +1 -0
- package/dist/cli/api/graphql/admin/generated/theme_publish.d.ts +21 -0
- package/dist/cli/api/graphql/admin/generated/theme_publish.js +65 -0
- package/dist/cli/api/graphql/admin/generated/theme_publish.js.map +1 -0
- package/dist/cli/api/graphql/admin/generated/theme_update.d.ts +23 -0
- package/dist/cli/api/graphql/admin/generated/theme_update.js +75 -0
- package/dist/cli/api/graphql/admin/generated/theme_update.js.map +1 -0
- package/dist/private/node/api/graphql.d.ts +2 -2
- package/dist/private/node/api/graphql.js +4 -4
- package/dist/private/node/api/graphql.js.map +1 -1
- package/dist/private/node/api/headers.js +1 -1
- package/dist/private/node/api/headers.js.map +1 -1
- package/dist/private/node/api/rest.d.ts +1 -2
- package/dist/private/node/api/rest.js +2 -3
- package/dist/private/node/api/rest.js.map +1 -1
- package/dist/private/node/api.js +12 -1
- package/dist/private/node/api.js.map +1 -1
- package/dist/private/node/conf-store.d.ts +9 -4
- package/dist/private/node/conf-store.js +8 -6
- package/dist/private/node/conf-store.js.map +1 -1
- package/dist/private/node/constants.d.ts +1 -0
- package/dist/private/node/constants.js +1 -0
- package/dist/private/node/constants.js.map +1 -1
- package/dist/private/node/session/schema.d.ts +40 -40
- package/dist/private/node/ui/components/ConcurrentOutput.d.ts +1 -0
- package/dist/private/node/ui/components/ConcurrentOutput.js +4 -2
- package/dist/private/node/ui/components/ConcurrentOutput.js.map +1 -1
- package/dist/public/common/version.d.ts +1 -1
- package/dist/public/common/version.js +1 -1
- package/dist/public/common/version.js.map +1 -1
- package/dist/public/node/analytics.js +1 -2
- package/dist/public/node/analytics.js.map +1 -1
- package/dist/public/node/api/admin.d.ts +2 -1
- package/dist/public/node/api/admin.js +25 -9
- package/dist/public/node/api/admin.js.map +1 -1
- package/dist/public/node/api/graphql.js +1 -1
- package/dist/public/node/api/graphql.js.map +1 -1
- package/dist/public/node/base-command.js +4 -0
- package/dist/public/node/base-command.js.map +1 -1
- package/dist/public/node/cli.d.ts +4 -0
- package/dist/public/node/cli.js +7 -1
- package/dist/public/node/cli.js.map +1 -1
- package/dist/public/node/context/local.js +7 -0
- package/dist/public/node/context/local.js.map +1 -1
- package/dist/public/node/error-handler.js +1 -1
- package/dist/public/node/error-handler.js.map +1 -1
- package/dist/public/node/error.js +4 -13
- package/dist/public/node/error.js.map +1 -1
- package/dist/public/node/global-context.d.ts +15 -0
- package/dist/public/node/global-context.js +29 -0
- package/dist/public/node/global-context.js.map +1 -0
- package/dist/public/node/is-global.js +2 -1
- package/dist/public/node/is-global.js.map +1 -1
- package/dist/public/node/node-package-manager.js +1 -1
- package/dist/public/node/node-package-manager.js.map +1 -1
- package/dist/public/node/notifications-system.d.ts +191 -0
- package/dist/public/node/notifications-system.js +234 -0
- package/dist/public/node/notifications-system.js.map +1 -0
- package/dist/public/node/themes/api.d.ts +4 -12
- package/dist/public/node/themes/api.js +162 -32
- package/dist/public/node/themes/api.js.map +1 -1
- package/dist/public/node/themes/types.d.ts +1 -0
- package/dist/public/node/themes/types.js.map +1 -1
- package/dist/public/node/themes/utils.d.ts +2 -0
- package/dist/public/node/themes/utils.js +11 -0
- package/dist/public/node/themes/utils.js.map +1 -1
- package/dist/public/node/version.d.ts +13 -0
- package/dist/public/node/version.js +38 -0
- package/dist/public/node/version.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -5
- package/assets/cli-ruby/.devcontainer.json +0 -5
- package/assets/cli-ruby/.rubocop.yml +0 -102
- package/assets/cli-ruby/.rubocop_todo.yml +0 -24
- package/assets/cli-ruby/CHANGELOG.md +0 -634
- package/assets/cli-ruby/CONTRIBUTING.md +0 -3
- package/assets/cli-ruby/Codespace.dockerfile +0 -35
- package/assets/cli-ruby/Gemfile +0 -32
- package/assets/cli-ruby/README.md +0 -30
- package/assets/cli-ruby/Rakefile +0 -167
- package/assets/cli-ruby/SECURITY.md +0 -59
- package/assets/cli-ruby/Tests.dockerfile +0 -35
- package/assets/cli-ruby/assets/logo.png +0 -0
- package/assets/cli-ruby/bin/console +0 -11
- package/assets/cli-ruby/bin/load_shopify.rb +0 -22
- package/assets/cli-ruby/bin/shopify +0 -67
- package/assets/cli-ruby/bin/shopify.bat +0 -3
- package/assets/cli-ruby/dev.yml +0 -29
- package/assets/cli-ruby/docs/README.md +0 -13
- package/assets/cli-ruby/docs/contributors/testing.md +0 -27
- package/assets/cli-ruby/docs/users/installation.md +0 -3
- package/assets/cli-ruby/docs/users/migrate-from-themekit.md +0 -18
- package/assets/cli-ruby/ext/javy/hashes/javy-arm-macos-v0.1.0.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-arm-macos-v0.2.0.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-arm-macos-v0.2.1.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-arm-macos-v0.3.0.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-linux-v0.1.0.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-linux-v0.2.0.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-linux-v0.2.1.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-linux-v0.3.0.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-macos-v0.1.0.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-macos-v0.2.0.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-macos-v0.2.1.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-macos-v0.3.0.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-windows-v0.1.0.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-windows-v0.2.0.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-windows-v0.2.1.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-windows-v0.3.0.gz.sha256 +0 -1
- package/assets/cli-ruby/ext/javy/javy.rb +0 -204
- package/assets/cli-ruby/ext/javy/version +0 -1
- package/assets/cli-ruby/ext/shopify-extensions/extconf.rb +0 -21
- package/assets/cli-ruby/ext/shopify-extensions/shopify_extensions.rb +0 -152
- package/assets/cli-ruby/ext/shopify-extensions/version +0 -1
- package/assets/cli-ruby/features/support/assertions.rb +0 -17
- package/assets/cli-ruby/features/support/cli.rb +0 -7
- package/assets/cli-ruby/features/support/process.rb +0 -27
- package/assets/cli-ruby/features/support/requires.rb +0 -3
- package/assets/cli-ruby/lib/docgen/class_template.md.erb +0 -81
- package/assets/cli-ruby/lib/docgen/index_template.md.erb +0 -5
- package/assets/cli-ruby/lib/docgen/markdown.rb +0 -101
- package/assets/cli-ruby/lib/graphql/admin_introspection.graphql +0 -87
- package/assets/cli-ruby/lib/graphql/all_organizations.graphql +0 -19
- package/assets/cli-ruby/lib/graphql/all_orgs_with_apps.graphql +0 -30
- package/assets/cli-ruby/lib/graphql/api_versions.graphql +0 -6
- package/assets/cli-ruby/lib/graphql/convert_dev_to_test_store.graphql +0 -10
- package/assets/cli-ruby/lib/graphql/create_app.graphql +0 -20
- package/assets/cli-ruby/lib/graphql/create_customer.graphql +0 -9
- package/assets/cli-ruby/lib/graphql/create_draft_order.graphql +0 -8
- package/assets/cli-ruby/lib/graphql/create_product.graphql +0 -9
- package/assets/cli-ruby/lib/graphql/extension_create.graphql +0 -37
- package/assets/cli-ruby/lib/graphql/extension_update_draft.graphql +0 -19
- package/assets/cli-ruby/lib/graphql/fetch_specifications.graphql +0 -14
- package/assets/cli-ruby/lib/graphql/find_organization.graphql +0 -18
- package/assets/cli-ruby/lib/graphql/find_organization_with_apps.graphql +0 -20
- package/assets/cli-ruby/lib/graphql/get_app_by_api_key.graphql +0 -9
- package/assets/cli-ruby/lib/graphql/get_app_urls.graphql +0 -6
- package/assets/cli-ruby/lib/graphql/get_extension_registrations.graphql +0 -28
- package/assets/cli-ruby/lib/graphql/get_variant_id.graphql +0 -16
- package/assets/cli-ruby/lib/graphql/update_dashboard_urls.graphql +0 -8
- package/assets/cli-ruby/lib/project_types/extension/cli.rb +0 -75
- package/assets/cli-ruby/lib/project_types/extension/commands/extension_command.rb +0 -29
- package/assets/cli-ruby/lib/project_types/extension/commands/serve.rb +0 -164
- package/assets/cli-ruby/lib/project_types/extension/errors.rb +0 -9
- package/assets/cli-ruby/lib/project_types/extension/extension_project.rb +0 -151
- package/assets/cli-ruby/lib/project_types/extension/extension_project_keys.rb +0 -12
- package/assets/cli-ruby/lib/project_types/extension/features/argo.rb +0 -50
- package/assets/cli-ruby/lib/project_types/extension/features/argo_config.rb +0 -59
- package/assets/cli-ruby/lib/project_types/extension/features/argo_dependencies.rb +0 -28
- package/assets/cli-ruby/lib/project_types/extension/features/argo_runtime.rb +0 -15
- package/assets/cli-ruby/lib/project_types/extension/features/argo_serve.rb +0 -115
- package/assets/cli-ruby/lib/project_types/extension/features/argo_setup.rb +0 -54
- package/assets/cli-ruby/lib/project_types/extension/features/argo_setup_step.rb +0 -31
- package/assets/cli-ruby/lib/project_types/extension/features/argo_setup_steps.rb +0 -51
- package/assets/cli-ruby/lib/project_types/extension/features/runtimes/admin.rb +0 -29
- package/assets/cli-ruby/lib/project_types/extension/features/runtimes/base.rb +0 -19
- package/assets/cli-ruby/lib/project_types/extension/features/runtimes/checkout_post_purchase.rb +0 -23
- package/assets/cli-ruby/lib/project_types/extension/features/runtimes/checkout_ui_extension.rb +0 -29
- package/assets/cli-ruby/lib/project_types/extension/loaders/project.rb +0 -50
- package/assets/cli-ruby/lib/project_types/extension/loaders/specification_handler.rb +0 -22
- package/assets/cli-ruby/lib/project_types/extension/messages/message_loading.rb +0 -34
- package/assets/cli-ruby/lib/project_types/extension/messages/messages.rb +0 -320
- package/assets/cli-ruby/lib/project_types/extension/models/app.rb +0 -14
- package/assets/cli-ruby/lib/project_types/extension/models/lazy_specification_handler.rb +0 -12
- package/assets/cli-ruby/lib/project_types/extension/models/specification.rb +0 -41
- package/assets/cli-ruby/lib/project_types/extension/models/specification_handlers/default.rb +0 -145
- package/assets/cli-ruby/lib/project_types/extension/models/specification_handlers/theme_app_extension.rb +0 -134
- package/assets/cli-ruby/lib/project_types/extension/models/specifications.rb +0 -91
- package/assets/cli-ruby/lib/project_types/extension/models/validation_error.rb +0 -17
- package/assets/cli-ruby/lib/project_types/extension/models/version.rb +0 -15
- package/assets/cli-ruby/lib/project_types/extension/tasks/configure_features.rb +0 -73
- package/assets/cli-ruby/lib/project_types/extension/tasks/configure_options.rb +0 -21
- package/assets/cli-ruby/lib/project_types/extension/tasks/converters/validation_error_converter.rb +0 -25
- package/assets/cli-ruby/lib/project_types/extension/tasks/converters/version_converter.rb +0 -28
- package/assets/cli-ruby/lib/project_types/extension/tasks/fetch_specifications.rb +0 -21
- package/assets/cli-ruby/lib/project_types/node/cli.rb +0 -12
- package/assets/cli-ruby/lib/project_types/node/forms/create.rb +0 -45
- package/assets/cli-ruby/lib/project_types/node/messages/messages.rb +0 -33
- package/assets/cli-ruby/lib/project_types/php/cli.rb +0 -16
- package/assets/cli-ruby/lib/project_types/php/forms/create.rb +0 -44
- package/assets/cli-ruby/lib/project_types/php/messages/messages.rb +0 -29
- package/assets/cli-ruby/lib/project_types/rails/cli.rb +0 -15
- package/assets/cli-ruby/lib/project_types/rails/forms/create.rb +0 -75
- package/assets/cli-ruby/lib/project_types/rails/gem.rb +0 -110
- package/assets/cli-ruby/lib/project_types/rails/messages/messages.rb +0 -101
- package/assets/cli-ruby/lib/project_types/script/cli.rb +0 -27
- package/assets/cli-ruby/lib/project_types/script/commands/connect.rb +0 -16
- package/assets/cli-ruby/lib/project_types/script/commands/create.rb +0 -24
- package/assets/cli-ruby/lib/project_types/script/commands/javy.rb +0 -24
- package/assets/cli-ruby/lib/project_types/script/commands/push.rb +0 -26
- package/assets/cli-ruby/lib/project_types/script/loaders/project.rb +0 -46
- package/assets/cli-ruby/lib/project_types/script/loaders/specification_handler.rb +0 -22
- package/assets/cli-ruby/lib/project_types/script/messages/messages.rb +0 -11
- package/assets/cli-ruby/lib/project_types/theme/cli.rb +0 -33
- package/assets/cli-ruby/lib/project_types/theme/commands/common/root_helper.rb +0 -94
- package/assets/cli-ruby/lib/project_types/theme/commands/common/shop_helper.rb +0 -13
- package/assets/cli-ruby/lib/project_types/theme/commands/console.rb +0 -23
- package/assets/cli-ruby/lib/project_types/theme/commands/delete.rb +0 -70
- package/assets/cli-ruby/lib/project_types/theme/commands/init.rb +0 -46
- package/assets/cli-ruby/lib/project_types/theme/commands/list.rb +0 -33
- package/assets/cli-ruby/lib/project_types/theme/commands/open.rb +0 -73
- package/assets/cli-ruby/lib/project_types/theme/commands/package.rb +0 -73
- package/assets/cli-ruby/lib/project_types/theme/commands/publish.rb +0 -49
- package/assets/cli-ruby/lib/project_types/theme/commands/pull.rb +0 -118
- package/assets/cli-ruby/lib/project_types/theme/commands/push.rb +0 -160
- package/assets/cli-ruby/lib/project_types/theme/commands/serve.rb +0 -91
- package/assets/cli-ruby/lib/project_types/theme/commands/share.rb +0 -62
- package/assets/cli-ruby/lib/project_types/theme/commands/token.rb +0 -22
- package/assets/cli-ruby/lib/project_types/theme/conversions/base_glob.rb +0 -65
- package/assets/cli-ruby/lib/project_types/theme/conversions/ignore_glob.rb +0 -15
- package/assets/cli-ruby/lib/project_types/theme/conversions/include_glob.rb +0 -15
- package/assets/cli-ruby/lib/project_types/theme/forms/confirm_store.rb +0 -15
- package/assets/cli-ruby/lib/project_types/theme/forms/select.rb +0 -34
- package/assets/cli-ruby/lib/project_types/theme/messages/messages.rb +0 -429
- package/assets/cli-ruby/lib/project_types/theme/models/specification_handlers/theme.rb +0 -19
- package/assets/cli-ruby/lib/project_types/theme/presenters/theme_presenter.rb +0 -48
- package/assets/cli-ruby/lib/project_types/theme/presenters/themes_presenter.rb +0 -29
- package/assets/cli-ruby/lib/project_types/theme/ui/sync_progress_bar.rb +0 -20
- package/assets/cli-ruby/lib/rubygems_plugin.rb +0 -26
- package/assets/cli-ruby/lib/shopify_cli/admin_api.rb +0 -160
- package/assets/cli-ruby/lib/shopify_cli/api.rb +0 -130
- package/assets/cli-ruby/lib/shopify_cli/command/project_command.rb +0 -31
- package/assets/cli-ruby/lib/shopify_cli/command/sub_command.rb +0 -20
- package/assets/cli-ruby/lib/shopify_cli/command.rb +0 -166
- package/assets/cli-ruby/lib/shopify_cli/commands.rb +0 -21
- package/assets/cli-ruby/lib/shopify_cli/constants.rb +0 -101
- package/assets/cli-ruby/lib/shopify_cli/context.rb +0 -709
- package/assets/cli-ruby/lib/shopify_cli/core/cli_version.rb +0 -20
- package/assets/cli-ruby/lib/shopify_cli/core/entry_point.rb +0 -64
- package/assets/cli-ruby/lib/shopify_cli/core/executor.rb +0 -23
- package/assets/cli-ruby/lib/shopify_cli/core/finalize.rb +0 -13
- package/assets/cli-ruby/lib/shopify_cli/core/monorail.rb +0 -122
- package/assets/cli-ruby/lib/shopify_cli/core.rb +0 -8
- package/assets/cli-ruby/lib/shopify_cli/db.rb +0 -114
- package/assets/cli-ruby/lib/shopify_cli/environment.rb +0 -217
- package/assets/cli-ruby/lib/shopify_cli/exception_reporter.rb +0 -80
- package/assets/cli-ruby/lib/shopify_cli/feature.rb +0 -95
- package/assets/cli-ruby/lib/shopify_cli/file_system_listener.rb +0 -30
- package/assets/cli-ruby/lib/shopify_cli/form.rb +0 -42
- package/assets/cli-ruby/lib/shopify_cli/git.rb +0 -320
- package/assets/cli-ruby/lib/shopify_cli/github/issue_url_generator.rb +0 -30
- package/assets/cli-ruby/lib/shopify_cli/github.rb +0 -5
- package/assets/cli-ruby/lib/shopify_cli/helpers/haikunator.rb +0 -92
- package/assets/cli-ruby/lib/shopify_cli/helpers.rb +0 -5
- package/assets/cli-ruby/lib/shopify_cli/http_request.rb +0 -43
- package/assets/cli-ruby/lib/shopify_cli/identity_auth/env_auth_token.rb +0 -34
- package/assets/cli-ruby/lib/shopify_cli/identity_auth.rb +0 -332
- package/assets/cli-ruby/lib/shopify_cli/js_system.rb +0 -115
- package/assets/cli-ruby/lib/shopify_cli/lazy_delegator.rb +0 -55
- package/assets/cli-ruby/lib/shopify_cli/messages/messages.rb +0 -863
- package/assets/cli-ruby/lib/shopify_cli/method_object.rb +0 -123
- package/assets/cli-ruby/lib/shopify_cli/migrator/migration.rb +0 -27
- package/assets/cli-ruby/lib/shopify_cli/migrator/migrations/1631709766_noop.rb +0 -13
- package/assets/cli-ruby/lib/shopify_cli/migrator/migrations/1633691650_merge_reporting_configuration.rb +0 -41
- package/assets/cli-ruby/lib/shopify_cli/migrator.rb +0 -46
- package/assets/cli-ruby/lib/shopify_cli/options.rb +0 -40
- package/assets/cli-ruby/lib/shopify_cli/partners_api/app_extensions/job.rb +0 -36
- package/assets/cli-ruby/lib/shopify_cli/partners_api/app_extensions.rb +0 -46
- package/assets/cli-ruby/lib/shopify_cli/partners_api/organizations.rb +0 -45
- package/assets/cli-ruby/lib/shopify_cli/partners_api.rb +0 -91
- package/assets/cli-ruby/lib/shopify_cli/project.rb +0 -199
- package/assets/cli-ruby/lib/shopify_cli/project_type.rb +0 -66
- package/assets/cli-ruby/lib/shopify_cli/reporting_configuration_controller.rb +0 -29
- package/assets/cli-ruby/lib/shopify_cli/resolve_constant.rb +0 -25
- package/assets/cli-ruby/lib/shopify_cli/resources/env_file.rb +0 -108
- package/assets/cli-ruby/lib/shopify_cli/resources.rb +0 -5
- package/assets/cli-ruby/lib/shopify_cli/result.rb +0 -448
- package/assets/cli-ruby/lib/shopify_cli/shopifolk.rb +0 -82
- package/assets/cli-ruby/lib/shopify_cli/task.rb +0 -20
- package/assets/cli-ruby/lib/shopify_cli/tasks/confirm_store.rb +0 -18
- package/assets/cli-ruby/lib/shopify_cli/tasks/create_api_client.rb +0 -40
- package/assets/cli-ruby/lib/shopify_cli/tasks/ensure_authenticated.rb +0 -19
- package/assets/cli-ruby/lib/shopify_cli/tasks/ensure_dev_store.rb +0 -41
- package/assets/cli-ruby/lib/shopify_cli/tasks/ensure_env.rb +0 -90
- package/assets/cli-ruby/lib/shopify_cli/tasks/ensure_git_dependency.rb +0 -14
- package/assets/cli-ruby/lib/shopify_cli/tasks/ensure_loopback_url.rb +0 -20
- package/assets/cli-ruby/lib/shopify_cli/tasks/ensure_project_type.rb +0 -14
- package/assets/cli-ruby/lib/shopify_cli/tasks/select_org_and_shop.rb +0 -81
- package/assets/cli-ruby/lib/shopify_cli/tasks/update_dashboard_urls.rb +0 -57
- package/assets/cli-ruby/lib/shopify_cli/tasks.rb +0 -44
- package/assets/cli-ruby/lib/shopify_cli/theme/backoff_helper.rb +0 -47
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/cdn_fonts.rb +0 -82
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/certificate_manager.rb +0 -79
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/errors.rb +0 -9
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/header_hash.rb +0 -98
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hooks/file_change_hook.rb +0 -77
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/remote_file_deleter.rb +0 -62
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/remote_file_reloader.rb +0 -63
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/resources/hot-reload-no-script.html +0 -27
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/resources/hot_reload.js +0 -48
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/resources/sse_client.js +0 -43
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/resources/theme.js +0 -114
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/resources/theme_extension.js +0 -121
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/script_injector.rb +0 -57
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/sections_index.rb +0 -50
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload.rb +0 -75
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/local_assets.rb +0 -101
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/proxy.rb +0 -313
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/proxy_param_builder.rb +0 -84
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/reload_mode.rb +0 -34
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/remote_watcher/json_files_update_job.rb +0 -35
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/remote_watcher.rb +0 -44
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/sse.rb +0 -75
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/watcher.rb +0 -64
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/web_server.rb +0 -140
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server.rb +0 -332
- package/assets/cli-ruby/lib/shopify_cli/theme/development_theme.rb +0 -101
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/app_extension.rb +0 -40
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server/hooks/file_change_hook.rb +0 -76
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server/hot_reload/script_injector.rb +0 -30
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server/hot_reload.rb +0 -13
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server/local_assets.rb +0 -31
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server/proxy_param_builder.rb +0 -94
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server/watcher.rb +0 -49
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server.rb +0 -175
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/host_theme.rb +0 -109
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/ignore_helper.rb +0 -35
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/syncer/extension_serve_job.rb +0 -120
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/syncer/operation.rb +0 -25
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/syncer.rb +0 -100
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/ui/host_theme_progress_bar.rb +0 -35
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/ui/host_theme_raw_progress_bar.rb +0 -40
- package/assets/cli-ruby/lib/shopify_cli/theme/file.rb +0 -133
- package/assets/cli-ruby/lib/shopify_cli/theme/filter/path_matcher.rb +0 -38
- package/assets/cli-ruby/lib/shopify_cli/theme/ignore_filter.rb +0 -112
- package/assets/cli-ruby/lib/shopify_cli/theme/ignore_helper.rb +0 -37
- package/assets/cli-ruby/lib/shopify_cli/theme/include_filter.rb +0 -67
- package/assets/cli-ruby/lib/shopify_cli/theme/mime_type.rb +0 -34
- package/assets/cli-ruby/lib/shopify_cli/theme/notifier.rb +0 -52
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/api.rb +0 -109
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/auth_dev_server.rb +0 -93
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/auth_middleware.rb +0 -97
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/remote_evaluator.rb +0 -166
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/resources/success.html +0 -78
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/resources/template.liquid +0 -15
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/snippet.rb +0 -81
- package/assets/cli-ruby/lib/shopify_cli/theme/repl.rb +0 -88
- package/assets/cli-ruby/lib/shopify_cli/theme/root.rb +0 -62
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/checksums.rb +0 -66
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/downloader.rb +0 -63
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/error_reporter.rb +0 -45
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/merger.rb +0 -53
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/operation.rb +0 -49
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/standard_reporter.rb +0 -32
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/unsupported_script_warning.rb +0 -90
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/bulk.rb +0 -133
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/bulk_item.rb +0 -64
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/bulk_job.rb +0 -139
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/bulk_request.rb +0 -30
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all.rb +0 -41
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb +0 -37
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/forms/base_strategy_form.rb +0 -64
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/forms/select_delete_strategy.rb +0 -29
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/forms/select_update_strategy.rb +0 -30
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/json_delete_handler.rb +0 -49
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/json_update_handler.rb +0 -71
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader.rb +0 -231
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer.rb +0 -391
- package/assets/cli-ruby/lib/shopify_cli/theme/theme.rb +0 -212
- package/assets/cli-ruby/lib/shopify_cli/theme/theme_access_api.rb +0 -89
- package/assets/cli-ruby/lib/shopify_cli/theme/theme_admin_api.rb +0 -101
- package/assets/cli-ruby/lib/shopify_cli/thread_pool/job.rb +0 -35
- package/assets/cli-ruby/lib/shopify_cli/thread_pool.rb +0 -49
- package/assets/cli-ruby/lib/shopify_cli/transform_data_structure.rb +0 -87
- package/assets/cli-ruby/lib/shopify_cli/utilities.rb +0 -21
- package/assets/cli-ruby/lib/shopify_cli/version.rb +0 -3
- package/assets/cli-ruby/lib/shopify_cli.rb +0 -182
- package/assets/cli-ruby/shipit.rubygems.yml +0 -3
- package/assets/cli-ruby/shopify-cli.gemspec +0 -46
- package/assets/cli-ruby/shopify-dev +0 -16
- package/assets/cli-ruby/test/minitest_ext.rb +0 -115
- package/assets/cli-ruby/test/project_types/extension/extension_test_helpers.rb +0 -70
- package/assets/cli-ruby/test/shopify-cli/migrator/migrations/migration_helper.rb +0 -20
- package/assets/cli-ruby/test/test_helpers.rb +0 -16
- package/assets/cli-ruby/utilities/constants.rb +0 -7
- package/assets/cli-ruby/utilities/docker/container.rb +0 -104
- package/assets/cli-ruby/utilities/docker.rb +0 -89
- package/assets/cli-ruby/utilities/utilities.rb +0 -6
- package/assets/cli-ruby/vendor/deps/cli-kit/REVISION +0 -1
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/autocall.rb +0 -21
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/base_command.rb +0 -49
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb +0 -94
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/config.rb +0 -133
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb +0 -123
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/executor.rb +0 -79
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/ini.rb +0 -102
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/levenshtein.rb +0 -82
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/logger.rb +0 -82
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/resolver.rb +0 -60
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/ruby_backports/enumerable.rb +0 -6
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/support/test_helper.rb +0 -244
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/support.rb +0 -9
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/system.rb +0 -243
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/util.rb +0 -193
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/version.rb +0 -5
- package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit.rb +0 -60
- package/assets/cli-ruby/vendor/deps/cli-ui/REVISION +0 -1
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/ansi.rb +0 -157
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/color.rb +0 -84
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/formatter.rb +0 -193
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/frame/frame_stack.rb +0 -98
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style/box.rb +0 -166
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style/bracket.rb +0 -139
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style.rb +0 -120
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/frame.rb +0 -269
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/glyph.rb +0 -84
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/os.rb +0 -73
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/printer.rb +0 -59
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/progress.rb +0 -90
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/progress_plain.rb +0 -50
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb +0 -484
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt/options_handler.rb +0 -29
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt.rb +0 -282
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/spinner/async.rb +0 -40
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/spinner/spin_group.rb +0 -263
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/spinner.rb +0 -66
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb +0 -232
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/terminal.rb +0 -46
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/truncater.rb +0 -102
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/version.rb +0 -5
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/widgets/base.rb +0 -27
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/widgets/status.rb +0 -61
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/widgets.rb +0 -77
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/wrap.rb +0 -56
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui.rb +0 -234
- package/assets/cli-ruby/vendor/deps/ruby2_keywords/LICENSE +0 -22
- package/assets/cli-ruby/vendor/deps/ruby2_keywords/README.md +0 -67
- package/assets/cli-ruby/vendor/deps/ruby2_keywords/Rakefile +0 -54
- package/assets/cli-ruby/vendor/deps/ruby2_keywords/lib/ruby2_keywords.rb +0 -57
- package/assets/cli-ruby/vendor/deps/ruby2_keywords/ruby2_keywords.gemspec +0 -18
- package/assets/cli-ruby/vendor/deps/ruby2_keywords/test/test_keyword.rb +0 -41
- package/assets/cli-ruby/vendor/deps/smart_properties/REVISION +0 -1
- package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties/errors.rb +0 -114
- package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties/property.rb +0 -168
- package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties/property_collection.rb +0 -83
- package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties/validations/ancestor.rb +0 -27
- package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties/validations.rb +0 -8
- package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties/version.rb +0 -3
- package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties.rb +0 -174
- package/assets/cli-ruby/vendor/deps/webrick/Gemfile +0 -3
- package/assets/cli-ruby/vendor/deps/webrick/LICENSE.txt +0 -22
- package/assets/cli-ruby/vendor/deps/webrick/README.md +0 -61
- package/assets/cli-ruby/vendor/deps/webrick/Rakefile +0 -10
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/accesslog.rb +0 -157
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/cgi.rb +0 -313
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/compat.rb +0 -36
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/config.rb +0 -158
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/cookie.rb +0 -172
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/htmlutils.rb +0 -30
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/authenticator.rb +0 -117
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/basicauth.rb +0 -116
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/digestauth.rb +0 -395
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/htdigest.rb +0 -132
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/htgroup.rb +0 -97
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/htpasswd.rb +0 -158
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/userdb.rb +0 -53
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth.rb +0 -96
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpproxy.rb +0 -354
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httprequest.rb +0 -636
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpresponse.rb +0 -564
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/https.rb +0 -152
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpserver.rb +0 -294
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet/abstract.rb +0 -152
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet/cgi_runner.rb +0 -47
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet/cgihandler.rb +0 -126
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet/erbhandler.rb +0 -88
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet/filehandler.rb +0 -552
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet/prochandler.rb +0 -47
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet.rb +0 -23
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpstatus.rb +0 -194
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httputils.rb +0 -512
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpversion.rb +0 -76
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/log.rb +0 -156
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/server.rb +0 -381
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/ssl.rb +0 -215
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/utils.rb +0 -265
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/version.rb +0 -18
- package/assets/cli-ruby/vendor/deps/webrick/lib/webrick.rb +0 -232
- package/assets/cli-ruby/vendor/deps/webrick/webrick.gemspec +0 -74
- package/assets/cli-ruby/vendor/gen/lib/gen/commands/help.rb +0 -20
- package/assets/cli-ruby/vendor/gen/lib/gen/commands/new.rb +0 -21
- package/assets/cli-ruby/vendor/gen/lib/gen/commands.rb +0 -18
- package/assets/cli-ruby/vendor/gen/lib/gen/entry_point.rb +0 -10
- package/assets/cli-ruby/vendor/gen/lib/gen/generator.rb +0 -165
- package/assets/cli-ruby/vendor/gen/lib/gen.rb +0 -39
- package/assets/cli-ruby/vendor/gen/template/Gemfile +0 -10
- package/assets/cli-ruby/vendor/gen/template/README.md +0 -1
- package/assets/cli-ruby/vendor/gen/template/bin/testunit +0 -23
- package/assets/cli-ruby/vendor/gen/template/bin/update-deps +0 -97
- package/assets/cli-ruby/vendor/gen/template/dev-gems.yml +0 -3
- package/assets/cli-ruby/vendor/gen/template/dev-vendor.yml +0 -4
- package/assets/cli-ruby/vendor/gen/template/exe/__app__-gems +0 -17
- package/assets/cli-ruby/vendor/gen/template/exe/__app__-vendor +0 -18
- package/assets/cli-ruby/vendor/gen/template/lib/__app__/commands/example.rb +0 -19
- package/assets/cli-ruby/vendor/gen/template/lib/__app__/commands/help.rb +0 -21
- package/assets/cli-ruby/vendor/gen/template/lib/__app__/commands.rb +0 -18
- package/assets/cli-ruby/vendor/gen/template/lib/__app__/entry_point.rb +0 -10
- package/assets/cli-ruby/vendor/gen/template/lib/__app__.rb +0 -33
- package/assets/cli-ruby/vendor/gen/template/test/example_test.rb +0 -17
- package/assets/cli-ruby/vendor/gen/template/test/test_helper.rb +0 -22
- package/assets/cli-ruby/vendor/lib/semantic/LICENSE +0 -20
- package/assets/cli-ruby/vendor/lib/semantic/semantic.rb +0 -4
- package/assets/cli-ruby/vendor/lib/semantic/version.rb +0 -179
- package/dist/public/node/ruby.d.ts +0 -38
- package/dist/public/node/ruby.js +0 -327
- package/dist/public/node/ruby.js.map +0 -1
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
module CLI
|
|
2
|
-
module UI
|
|
3
|
-
autoload :ANSI, 'cli/ui/ansi'
|
|
4
|
-
autoload :Glyph, 'cli/ui/glyph'
|
|
5
|
-
autoload :Color, 'cli/ui/color'
|
|
6
|
-
autoload :Frame, 'cli/ui/frame'
|
|
7
|
-
autoload :OS, 'cli/ui/os'
|
|
8
|
-
autoload :Printer, 'cli/ui/printer'
|
|
9
|
-
autoload :Progress, 'cli/ui/progress'
|
|
10
|
-
autoload :ProgressPlain, 'cli/ui/progress_plain'
|
|
11
|
-
autoload :Prompt, 'cli/ui/prompt'
|
|
12
|
-
autoload :Terminal, 'cli/ui/terminal'
|
|
13
|
-
autoload :Truncater, 'cli/ui/truncater'
|
|
14
|
-
autoload :Formatter, 'cli/ui/formatter'
|
|
15
|
-
autoload :Spinner, 'cli/ui/spinner'
|
|
16
|
-
autoload :Widgets, 'cli/ui/widgets'
|
|
17
|
-
autoload :Wrap, 'cli/ui/wrap'
|
|
18
|
-
|
|
19
|
-
# Convenience accessor to +CLI::UI::Spinner::SpinGroup+
|
|
20
|
-
SpinGroup = Spinner::SpinGroup
|
|
21
|
-
|
|
22
|
-
# Glyph resolution using +CLI::UI::Glyph.lookup+
|
|
23
|
-
# Look at the method signature for +Glyph.lookup+ for more details
|
|
24
|
-
#
|
|
25
|
-
# ==== Attributes
|
|
26
|
-
#
|
|
27
|
-
# * +handle+ - handle of the glyph to resolve
|
|
28
|
-
#
|
|
29
|
-
def self.glyph(handle)
|
|
30
|
-
CLI::UI::Glyph.lookup(handle)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# Color resolution using +CLI::UI::Color.lookup+
|
|
34
|
-
# Will lookup using +Color.lookup+ unless it's already a CLI::UI::Color (or nil)
|
|
35
|
-
#
|
|
36
|
-
# ==== Attributes
|
|
37
|
-
#
|
|
38
|
-
# * +input+ - color to resolve
|
|
39
|
-
#
|
|
40
|
-
def self.resolve_color(input)
|
|
41
|
-
case input
|
|
42
|
-
when CLI::UI::Color, nil
|
|
43
|
-
input
|
|
44
|
-
else
|
|
45
|
-
CLI::UI::Color.lookup(input)
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
# Frame style resolution using +CLI::UI::Frame::FrameStyle.lookup+.
|
|
50
|
-
# Will lookup using +FrameStyle.lookup+ unless it's already a CLI::UI::Frame::FrameStyle(or nil)
|
|
51
|
-
#
|
|
52
|
-
# ==== Attributes
|
|
53
|
-
#
|
|
54
|
-
# * +input+ - frame style to resolve
|
|
55
|
-
def self.resolve_style(input)
|
|
56
|
-
case input
|
|
57
|
-
when CLI::UI::Frame::FrameStyle, nil
|
|
58
|
-
input
|
|
59
|
-
else
|
|
60
|
-
CLI::UI::Frame::FrameStyle.lookup(input)
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
# Convenience Method for +CLI::UI::Prompt.confirm+
|
|
65
|
-
#
|
|
66
|
-
# ==== Attributes
|
|
67
|
-
#
|
|
68
|
-
# * +question+ - question to confirm
|
|
69
|
-
#
|
|
70
|
-
def self.confirm(question, **kwargs)
|
|
71
|
-
CLI::UI::Prompt.confirm(question, **kwargs)
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
# Convenience Method for +CLI::UI::Prompt.ask+
|
|
75
|
-
#
|
|
76
|
-
# ==== Attributes
|
|
77
|
-
#
|
|
78
|
-
# * +question+ - question to ask
|
|
79
|
-
# * +kwargs+ - arguments for +Prompt.ask+
|
|
80
|
-
#
|
|
81
|
-
def self.ask(question, **kwargs)
|
|
82
|
-
CLI::UI::Prompt.ask(question, **kwargs)
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
# Convenience Method to resolve text using +CLI::UI::Formatter.format+
|
|
86
|
-
# Check +CLI::UI::Formatter::SGR_MAP+ for available formatting options
|
|
87
|
-
#
|
|
88
|
-
# ==== Attributes
|
|
89
|
-
#
|
|
90
|
-
# * +input+ - input to format
|
|
91
|
-
# * +truncate_to+ - number of characters to truncate the string to (or nil)
|
|
92
|
-
#
|
|
93
|
-
def self.resolve_text(input, truncate_to: nil)
|
|
94
|
-
return input if input.nil?
|
|
95
|
-
formatted = CLI::UI::Formatter.new(input).format
|
|
96
|
-
return formatted unless truncate_to
|
|
97
|
-
CLI::UI::Truncater.call(formatted, truncate_to)
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
# Convenience Method to format text using +CLI::UI::Formatter.format+
|
|
101
|
-
# Check +CLI::UI::Formatter::SGR_MAP+ for available formatting options
|
|
102
|
-
#
|
|
103
|
-
# https://user-images.githubusercontent.com/3074765/33799827-6d0721a2-dd01-11e7-9ab5-c3d455264afe.png
|
|
104
|
-
# https://user-images.githubusercontent.com/3074765/33799847-9ec03fd0-dd01-11e7-93f7-5f5cc540e61e.png
|
|
105
|
-
#
|
|
106
|
-
# ==== Attributes
|
|
107
|
-
#
|
|
108
|
-
# * +input+ - input to format
|
|
109
|
-
#
|
|
110
|
-
# ==== Options
|
|
111
|
-
#
|
|
112
|
-
# * +enable_color+ - should color be used? default to true unless output is redirected.
|
|
113
|
-
#
|
|
114
|
-
def self.fmt(input, enable_color: enable_color?)
|
|
115
|
-
CLI::UI::Formatter.new(input).format(enable_color: enable_color)
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
def self.wrap(input)
|
|
119
|
-
CLI::UI::Wrap.new(input).wrap
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
# Convenience Method for +CLI::UI::Printer.puts+
|
|
123
|
-
#
|
|
124
|
-
# ==== Attributes
|
|
125
|
-
#
|
|
126
|
-
# * +msg+ - Message to print
|
|
127
|
-
# * +kwargs+ - keyword arguments for +Printer.puts+
|
|
128
|
-
#
|
|
129
|
-
def self.puts(msg, **kwargs)
|
|
130
|
-
CLI::UI::Printer.puts(msg, **kwargs)
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
# Convenience Method for +CLI::UI::Frame.open+
|
|
134
|
-
#
|
|
135
|
-
# ==== Attributes
|
|
136
|
-
#
|
|
137
|
-
# * +args+ - arguments for +Frame.open+
|
|
138
|
-
# * +block+ - block for +Frame.open+
|
|
139
|
-
#
|
|
140
|
-
def self.frame(*args, **kwargs, &block)
|
|
141
|
-
CLI::UI::Frame.open(*args, **kwargs, &block)
|
|
142
|
-
end
|
|
143
|
-
|
|
144
|
-
# Convenience Method for +CLI::UI::Spinner.spin+
|
|
145
|
-
#
|
|
146
|
-
# ==== Attributes
|
|
147
|
-
#
|
|
148
|
-
# * +args+ - arguments for +Spinner.open+
|
|
149
|
-
# * +block+ - block for +Spinner.open+
|
|
150
|
-
#
|
|
151
|
-
def self.spinner(*args, **kwargs, &block)
|
|
152
|
-
CLI::UI::Spinner.spin(*args, **kwargs, &block)
|
|
153
|
-
end
|
|
154
|
-
|
|
155
|
-
# Convenience Method to override frame color using +CLI::UI::Frame.with_frame_color+
|
|
156
|
-
#
|
|
157
|
-
# ==== Attributes
|
|
158
|
-
#
|
|
159
|
-
# * +color+ - color to override to
|
|
160
|
-
# * +block+ - block for +Frame.with_frame_color_override+
|
|
161
|
-
#
|
|
162
|
-
def self.with_frame_color(color, &block)
|
|
163
|
-
CLI::UI::Frame.with_frame_color_override(color, &block)
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
# Duplicate output to a file path
|
|
167
|
-
#
|
|
168
|
-
# ==== Attributes
|
|
169
|
-
#
|
|
170
|
-
# * +path+ - path to duplicate output to
|
|
171
|
-
#
|
|
172
|
-
def self.log_output_to(path)
|
|
173
|
-
if CLI::UI::StdoutRouter.duplicate_output_to
|
|
174
|
-
raise "multiple logs not allowed"
|
|
175
|
-
end
|
|
176
|
-
CLI::UI::StdoutRouter.duplicate_output_to = File.open(path, 'w')
|
|
177
|
-
yield
|
|
178
|
-
ensure
|
|
179
|
-
if (file_descriptor = CLI::UI::StdoutRouter.duplicate_output_to)
|
|
180
|
-
file_descriptor.close
|
|
181
|
-
CLI::UI::StdoutRouter.duplicate_output_to = nil
|
|
182
|
-
end
|
|
183
|
-
end
|
|
184
|
-
|
|
185
|
-
# Disable all framing within a block
|
|
186
|
-
#
|
|
187
|
-
# ==== Attributes
|
|
188
|
-
#
|
|
189
|
-
# * +block+ - block in which to disable frames
|
|
190
|
-
#
|
|
191
|
-
def self.raw
|
|
192
|
-
prev = Thread.current[:no_cliui_frame_inset]
|
|
193
|
-
Thread.current[:no_cliui_frame_inset] = true
|
|
194
|
-
yield
|
|
195
|
-
ensure
|
|
196
|
-
Thread.current[:no_cliui_frame_inset] = prev
|
|
197
|
-
end
|
|
198
|
-
|
|
199
|
-
# Check whether colour is enabled in Formatter output. By default, colour
|
|
200
|
-
# is enabled when STDOUT is a TTY; that is, when output has not been
|
|
201
|
-
# redirected to another program or to a file.
|
|
202
|
-
#
|
|
203
|
-
def self.enable_color?
|
|
204
|
-
@enable_color
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
# Turn colour output in Formatter on or off.
|
|
208
|
-
#
|
|
209
|
-
# ==== Attributes
|
|
210
|
-
#
|
|
211
|
-
# * +bool+ - true or false; enable or disable colour.
|
|
212
|
-
#
|
|
213
|
-
def self.enable_color=(bool)
|
|
214
|
-
@enable_color = !!bool
|
|
215
|
-
end
|
|
216
|
-
|
|
217
|
-
self.enable_color = $stdout.tty?
|
|
218
|
-
|
|
219
|
-
# Set the default frame style.
|
|
220
|
-
# Convenience method for setting the default frame style with +CLI::UI::Frame.frame_style=+
|
|
221
|
-
#
|
|
222
|
-
# Raises ArgumentError if +frame_style+ is not valid
|
|
223
|
-
#
|
|
224
|
-
# ==== Attributes
|
|
225
|
-
#
|
|
226
|
-
# * +symbol+ - the default frame style to use for frames
|
|
227
|
-
#
|
|
228
|
-
def self.frame_style=(frame_style)
|
|
229
|
-
Frame.frame_style = frame_style.to_sym
|
|
230
|
-
end
|
|
231
|
-
end
|
|
232
|
-
end
|
|
233
|
-
|
|
234
|
-
require 'cli/ui/stdout_router'
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Copyright 2019-2020 Nobuyoshi Nakada, Yusuke Endoh
|
|
2
|
-
|
|
3
|
-
Redistribution and use in source and binary forms, with or without
|
|
4
|
-
modification, are permitted provided that the following conditions are met:
|
|
5
|
-
|
|
6
|
-
1. Redistributions of source code must retain the above copyright notice, this
|
|
7
|
-
list of conditions and the following disclaimer.
|
|
8
|
-
|
|
9
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
-
this list of conditions and the following disclaimer in the documentation
|
|
11
|
-
and/or other materials provided with the distribution.
|
|
12
|
-
|
|
13
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
14
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
15
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
16
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
17
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
18
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
19
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
20
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
21
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
22
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# ruby2_keywords
|
|
2
|
-
|
|
3
|
-
Provides empty `Module#ruby2_keywords` method, for the forward
|
|
4
|
-
source-level compatibility against ruby2.7 and ruby3.
|
|
5
|
-
|
|
6
|
-
## Installation
|
|
7
|
-
|
|
8
|
-
Add this line to your application's Gemfile:
|
|
9
|
-
|
|
10
|
-
```ruby
|
|
11
|
-
gem 'ruby2_keywords'
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
And then execute:
|
|
15
|
-
|
|
16
|
-
$ bundle
|
|
17
|
-
|
|
18
|
-
Or install it yourself as:
|
|
19
|
-
|
|
20
|
-
$ gem install ruby2_keywords
|
|
21
|
-
|
|
22
|
-
## Usage
|
|
23
|
-
|
|
24
|
-
For class/module instance methods:
|
|
25
|
-
|
|
26
|
-
```ruby
|
|
27
|
-
require 'ruby2_keywords'
|
|
28
|
-
|
|
29
|
-
module YourModule
|
|
30
|
-
ruby2_keywords def delegating_method(*args)
|
|
31
|
-
other_method(*args)
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
For global methods:
|
|
37
|
-
|
|
38
|
-
```ruby
|
|
39
|
-
require 'ruby2_keywords'
|
|
40
|
-
|
|
41
|
-
ruby2_keywords def oldstyle_keywords(options = {})
|
|
42
|
-
end
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
You can do the same for a method defined by `Module#define_method`:
|
|
46
|
-
|
|
47
|
-
```ruby
|
|
48
|
-
define_method :delegating_method do |*args, &block|
|
|
49
|
-
other_method(*args, &block)
|
|
50
|
-
end
|
|
51
|
-
ruby2_keywords :delegating_method
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Contributing
|
|
55
|
-
|
|
56
|
-
Bug reports and pull requests are welcome on [GitHub] or
|
|
57
|
-
[Ruby Issue Tracking System].
|
|
58
|
-
|
|
59
|
-
## License
|
|
60
|
-
|
|
61
|
-
The gem is available as open source under the terms of the
|
|
62
|
-
[Ruby License] or the [2-Clause BSD License].
|
|
63
|
-
|
|
64
|
-
[GitHub]: https://github.com/ruby/ruby2_keywords/
|
|
65
|
-
[Ruby Issue Tracking System]: https://bugs.ruby-lang.org
|
|
66
|
-
[Ruby License]: https://www.ruby-lang.org/en/about/license.txt
|
|
67
|
-
[2-Clause BSD License]: https://opensource.org/licenses/BSD-2-Clause
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
require "bundler/gem_tasks"
|
|
2
|
-
require "rake/testtask"
|
|
3
|
-
|
|
4
|
-
helper = Bundler::GemHelper.instance
|
|
5
|
-
|
|
6
|
-
Rake::TestTask.new(:test) do |t|
|
|
7
|
-
t.test_files = FileList["test/**/test_*.rb"]
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
task :default => :test
|
|
11
|
-
|
|
12
|
-
task "build" => "date_epoch"
|
|
13
|
-
|
|
14
|
-
task "date_epoch" do
|
|
15
|
-
ENV["SOURCE_DATE_EPOCH"] = IO.popen(%W[git -C #{__dir__} log -1 --format=%ct], &:read).chomp
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def helper.update_gemspec
|
|
19
|
-
path = "#{__dir__}/#{gemspec.name}.gemspec"
|
|
20
|
-
File.open(path, "r+b") do |f|
|
|
21
|
-
if (d = f.read).sub!(/^(version\s*=\s*)".*"/) {$1 + gemspec.version.to_s.dump}
|
|
22
|
-
f.rewind
|
|
23
|
-
f.truncate(0)
|
|
24
|
-
f.print(d)
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def helper.commit_bump
|
|
30
|
-
sh(%W[git -C #{__dir__} commit -m bump\ up\ to\ #{gemspec.version}
|
|
31
|
-
#{gemspec.name}.gemspec])
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def helper.version=(v)
|
|
35
|
-
gemspec.version = v
|
|
36
|
-
update_gemspec
|
|
37
|
-
commit_bump
|
|
38
|
-
tag_version
|
|
39
|
-
end
|
|
40
|
-
major, minor, teeny = helper.gemspec.version.segments
|
|
41
|
-
|
|
42
|
-
task "bump:teeny" do
|
|
43
|
-
helper.version = Gem::Version.new("#{major}.#{minor}.#{teeny+1}")
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
task "bump:minor" do
|
|
47
|
-
raise "can't bump up minor"
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
task "bump:major" do
|
|
51
|
-
raise "can't bump up major"
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
task "bump" => "bump:teeny"
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
class Module
|
|
2
|
-
unless private_method_defined?(:ruby2_keywords)
|
|
3
|
-
private
|
|
4
|
-
# call-seq:
|
|
5
|
-
# ruby2_keywords(method_name, ...)
|
|
6
|
-
#
|
|
7
|
-
# Does nothing.
|
|
8
|
-
def ruby2_keywords(name, *)
|
|
9
|
-
# nil
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
main = TOPLEVEL_BINDING.receiver
|
|
15
|
-
unless main.respond_to?(:ruby2_keywords, true)
|
|
16
|
-
# call-seq:
|
|
17
|
-
# ruby2_keywords(method_name, ...)
|
|
18
|
-
#
|
|
19
|
-
# Does nothing.
|
|
20
|
-
def main.ruby2_keywords(name, *)
|
|
21
|
-
# nil
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
class Proc
|
|
26
|
-
unless method_defined?(:ruby2_keywords)
|
|
27
|
-
# call-seq:
|
|
28
|
-
# proc.ruby2_keywords -> proc
|
|
29
|
-
#
|
|
30
|
-
# Does nothing and just returns the receiver.
|
|
31
|
-
def ruby2_keywords
|
|
32
|
-
self
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
class << Hash
|
|
38
|
-
unless method_defined?(:ruby2_keywords_hash?)
|
|
39
|
-
# call-seq:
|
|
40
|
-
# Hash.ruby2_keywords_hash?(hash) -> false
|
|
41
|
-
#
|
|
42
|
-
# Returns false.
|
|
43
|
-
def ruby2_keywords_hash?(hash)
|
|
44
|
-
false
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
unless method_defined?(:ruby2_keywords_hash)
|
|
49
|
-
# call-seq:
|
|
50
|
-
# Hash.ruby2_keywords_hash(hash) -> new_hash
|
|
51
|
-
#
|
|
52
|
-
# Duplicates a given hash and returns the new hash.
|
|
53
|
-
def ruby2_keywords_hash(hash)
|
|
54
|
-
hash.dup
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
version = "0.0.4"
|
|
2
|
-
abort "Version must not reach 1" if version[/\d+/].to_i >= 1
|
|
3
|
-
|
|
4
|
-
Gem::Specification.new do |s|
|
|
5
|
-
s.name = "ruby2_keywords"
|
|
6
|
-
s.version = version
|
|
7
|
-
s.summary = "Shim library for Module#ruby2_keywords"
|
|
8
|
-
s.homepage = "https://github.com/ruby/ruby2_keywords"
|
|
9
|
-
s.licenses = ["Ruby", "BSD-2-Clause"]
|
|
10
|
-
s.authors = ["Nobuyoshi Nakada"]
|
|
11
|
-
s.require_paths = ["lib"]
|
|
12
|
-
s.rdoc_options = ["--main", "README.md"]
|
|
13
|
-
s.files = [
|
|
14
|
-
"LICENSE",
|
|
15
|
-
"README.md",
|
|
16
|
-
"lib/ruby2_keywords.rb",
|
|
17
|
-
]
|
|
18
|
-
end
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
require 'test/unit'
|
|
2
|
-
LOADING_RUBY2_KEYWORDS = (RUBY_VERSION.scan(/\d+/).map(&:to_i) <=> [2, 7]) < 0
|
|
3
|
-
if LOADING_RUBY2_KEYWORDS
|
|
4
|
-
require 'ruby2_keywords'
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
class TestKeywordArguments < Test::Unit::TestCase
|
|
8
|
-
def test_loaded_features
|
|
9
|
-
list = $LOADED_FEATURES.grep(%r[/ruby2_keywords\.rb\z])
|
|
10
|
-
if LOADING_RUBY2_KEYWORDS
|
|
11
|
-
assert_not_empty(list)
|
|
12
|
-
assert_not_include($LOADED_FEATURES, "ruby2_keywords.rb")
|
|
13
|
-
else
|
|
14
|
-
assert_empty(list)
|
|
15
|
-
assert_include($LOADED_FEATURES, "ruby2_keywords.rb")
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def test_module_ruby2_keywords
|
|
20
|
-
assert_send([Module, :private_method_defined?, :ruby2_keywords])
|
|
21
|
-
assert_operator(Module.instance_method(:ruby2_keywords).arity, :<, 0)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def test_toplevel_ruby2_keywords
|
|
25
|
-
main = TOPLEVEL_BINDING.receiver
|
|
26
|
-
assert_send([main, :respond_to?, :ruby2_keywords, true])
|
|
27
|
-
assert_operator(main.method(:ruby2_keywords).arity, :<, 0)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def test_proc_ruby2_keywords
|
|
31
|
-
assert_respond_to(Proc.new {}, :ruby2_keywords)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def test_hash_ruby2_keywords_hash?
|
|
35
|
-
assert_false(Hash.ruby2_keywords_hash?({}))
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def test_hash_ruby2_keywords_hash
|
|
39
|
-
assert_equal({}, Hash.ruby2_keywords_hash({}.freeze))
|
|
40
|
-
end
|
|
41
|
-
end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
cfe83ef361e68ba7c471af75144f2b85cf1e1ec6
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
module SmartProperties
|
|
2
|
-
class Error < ::ArgumentError; end
|
|
3
|
-
class ConfigurationError < Error; end
|
|
4
|
-
|
|
5
|
-
class AssignmentError < Error
|
|
6
|
-
attr_accessor :sender
|
|
7
|
-
attr_accessor :property
|
|
8
|
-
|
|
9
|
-
def initialize(sender, property, message)
|
|
10
|
-
@sender = sender
|
|
11
|
-
@property = property
|
|
12
|
-
super(message)
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
class ConstructorArgumentForwardingError < Error
|
|
17
|
-
def initialize(positional_arguments, keyword_arguments)
|
|
18
|
-
argument_description = [
|
|
19
|
-
generate_description("positional", positional_arguments.count),
|
|
20
|
-
generate_description("keyword", keyword_arguments.count)
|
|
21
|
-
].compact
|
|
22
|
-
|
|
23
|
-
arguments = positional_arguments + keyword_arguments.map { |name, value| "#{name}: #{value}" }
|
|
24
|
-
|
|
25
|
-
super "Forwarding the following %s failed: %s" % [
|
|
26
|
-
argument_description.join(" and "),
|
|
27
|
-
arguments.join(", ")
|
|
28
|
-
]
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
private
|
|
32
|
-
|
|
33
|
-
def generate_description(argument_type, argument_number)
|
|
34
|
-
case argument_number
|
|
35
|
-
when 0
|
|
36
|
-
nil
|
|
37
|
-
when 1
|
|
38
|
-
"#{argument_type} argument"
|
|
39
|
-
else
|
|
40
|
-
"#{argument_number} #{argument_type} arguments"
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
class MissingValueError < AssignmentError
|
|
46
|
-
def initialize(sender, property)
|
|
47
|
-
super(
|
|
48
|
-
sender,
|
|
49
|
-
property,
|
|
50
|
-
"%s requires the property %s to be set" % [
|
|
51
|
-
sender.class.name,
|
|
52
|
-
property.name
|
|
53
|
-
]
|
|
54
|
-
)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def to_hash
|
|
58
|
-
Hash[property.name, "must be set"]
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
class InvalidValueError < AssignmentError
|
|
63
|
-
attr_accessor :value
|
|
64
|
-
|
|
65
|
-
def initialize(sender, property, value)
|
|
66
|
-
@value = value
|
|
67
|
-
|
|
68
|
-
super(
|
|
69
|
-
sender,
|
|
70
|
-
property,
|
|
71
|
-
"%s does not accept %s as value for the property %s. Only accepts: %s" % [
|
|
72
|
-
sender.class.name,
|
|
73
|
-
value.inspect,
|
|
74
|
-
property.name,
|
|
75
|
-
accepter_message(sender, property)
|
|
76
|
-
]
|
|
77
|
-
)
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
def to_hash
|
|
81
|
-
Hash[property.name, "does not accept %s as value" % value.inspect]
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
private
|
|
85
|
-
|
|
86
|
-
def accepter_message(sender, property)
|
|
87
|
-
accepter = property.accepter
|
|
88
|
-
if accepter.is_a?(Proc)
|
|
89
|
-
return "Values passing lambda defined in #{accepter.source_location.join(' at line ')}"
|
|
90
|
-
end
|
|
91
|
-
accepter
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
class InitializationError < Error
|
|
96
|
-
attr_accessor :sender
|
|
97
|
-
attr_accessor :properties
|
|
98
|
-
|
|
99
|
-
def initialize(sender, properties)
|
|
100
|
-
@sender = sender
|
|
101
|
-
@properties = properties
|
|
102
|
-
super(
|
|
103
|
-
"%s requires the following properties to be set: %s" % [
|
|
104
|
-
sender.class.name,
|
|
105
|
-
properties.map(&:name).sort.join(', ')
|
|
106
|
-
]
|
|
107
|
-
)
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
def to_hash
|
|
111
|
-
properties.each_with_object({}) { |property, errors| errors[property.name] = "must be set" }
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
end
|