bundler 2.1.4 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2468 -1430
- data/README.md +8 -10
- data/bundler.gemspec +10 -13
- data/exe/bundle +7 -8
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +3 -11
- data/lib/bundler/cli/add.rb +2 -2
- data/lib/bundler/cli/binstubs.rb +6 -2
- data/lib/bundler/cli/cache.rb +3 -8
- data/lib/bundler/cli/check.rb +5 -3
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +32 -3
- data/lib/bundler/cli/config.rb +10 -1
- data/lib/bundler/cli/console.rb +3 -3
- data/lib/bundler/cli/doctor.rb +23 -6
- data/lib/bundler/cli/exec.rb +5 -10
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +258 -45
- data/lib/bundler/cli/info.rb +38 -6
- data/lib/bundler/cli/init.rb +7 -3
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +27 -57
- data/lib/bundler/cli/issue.rb +5 -4
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +11 -4
- data/lib/bundler/cli/open.rb +1 -2
- data/lib/bundler/cli/outdated.rb +106 -79
- data/lib/bundler/cli/platform.rb +2 -2
- data/lib/bundler/cli/plugin.rb +10 -0
- data/lib/bundler/cli/pristine.rb +5 -0
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli/update.rb +20 -9
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/cli.rb +149 -85
- data/lib/bundler/compact_index_client/cache.rb +7 -24
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +56 -51
- data/lib/bundler/compact_index_client.rb +3 -9
- data/lib/bundler/constants.rb +1 -1
- data/lib/bundler/current_ruby.rb +17 -6
- data/lib/bundler/definition.rb +343 -440
- data/lib/bundler/dependency.rb +23 -77
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +77 -85
- data/lib/bundler/endpoint_specification.rb +20 -14
- data/lib/bundler/env.rb +3 -3
- data/lib/bundler/environment_preserver.rb +30 -2
- data/lib/bundler/errors.rb +31 -14
- data/lib/bundler/feature_flag.rb +0 -9
- data/lib/bundler/fetcher/base.rb +7 -9
- data/lib/bundler/fetcher/compact_index.rb +20 -27
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +11 -11
- data/lib/bundler/fetcher/index.rb +2 -30
- data/lib/bundler/fetcher.rb +24 -29
- data/lib/bundler/force_platform.rb +18 -0
- data/lib/bundler/friendly_errors.rb +45 -49
- data/lib/bundler/gem_helper.rb +53 -31
- data/lib/bundler/gem_helpers.rb +42 -24
- data/lib/bundler/gem_version_promoter.rb +54 -99
- data/lib/bundler/graph.rb +4 -4
- data/lib/bundler/index.rb +14 -52
- data/lib/bundler/injector.rb +40 -8
- data/lib/bundler/inline.rb +6 -15
- data/lib/bundler/installer/gem_installer.rb +19 -24
- data/lib/bundler/installer/parallel_installer.rb +32 -42
- data/lib/bundler/installer/standalone.rb +58 -11
- data/lib/bundler/installer.rb +47 -87
- data/lib/bundler/lazy_specification.rb +76 -35
- data/lib/bundler/lockfile_generator.rb +3 -3
- data/lib/bundler/lockfile_parser.rb +24 -49
- data/lib/bundler/man/.document +1 -0
- data/{man → lib/bundler/man}/bundle-add.1 +21 -5
- data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +16 -4
- data/{man → lib/bundler/man}/bundle-binstubs.1 +5 -3
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
- data/{man → lib/bundler/man}/bundle-cache.1 +7 -1
- data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +7 -0
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/{man → lib/bundler/man}/bundle-clean.1 +2 -2
- data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-config.1 +65 -47
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +74 -65
- data/lib/bundler/man/bundle-console.1 +53 -0
- data/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man → lib/bundler/man}/bundle-exec.1 +2 -2
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +1 -1
- data/lib/bundler/man/bundle-gem.1 +105 -0
- data/lib/bundler/man/bundle-gem.1.ronn +117 -0
- data/lib/bundler/man/bundle-help.1 +13 -0
- data/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/{man → lib/bundler/man}/bundle-init.1 +1 -1
- data/{man → lib/bundler/man}/bundle-inject.1 +5 -2
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +3 -1
- data/{man → lib/bundler/man}/bundle-install.1 +35 -33
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +33 -34
- data/{man → lib/bundler/man}/bundle-list.1 +7 -7
- data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +3 -10
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +1 -10
- data/{man → lib/bundler/man}/bundle-platform.1 +16 -6
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +14 -7
- data/lib/bundler/man/bundle-plugin.1 +81 -0
- data/lib/bundler/man/bundle-plugin.1.ronn +59 -0
- data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man → lib/bundler/man}/bundle-update.1 +5 -5
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +5 -4
- data/lib/bundler/man/bundle-version.1 +35 -0
- data/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/{man → lib/bundler/man}/bundle-viz.1 +4 -1
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +2 -0
- data/{man → lib/bundler/man}/bundle.1 +15 -10
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +12 -7
- data/{man → lib/bundler/man}/gemfile.5 +120 -83
- data/{man → lib/bundler/man}/gemfile.5.ronn +109 -88
- data/{man → lib/bundler/man}/index.txt +4 -0
- data/lib/bundler/match_metadata.rb +13 -0
- data/lib/bundler/match_platform.rb +0 -1
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/mirror.rb +7 -9
- data/lib/bundler/plugin/api/source.rb +25 -9
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/index.rb +17 -5
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/rubygems.rb +1 -9
- data/lib/bundler/plugin/installer.rb +11 -11
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +58 -11
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +15 -6
- data/lib/bundler/resolver/base.rb +46 -0
- data/lib/bundler/resolver/candidate.rb +92 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +63 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +49 -74
- data/lib/bundler/resolver.rb +320 -344
- data/lib/bundler/retry.rb +2 -2
- data/lib/bundler/ruby_dsl.rb +1 -1
- data/lib/bundler/ruby_version.rb +6 -19
- data/lib/bundler/rubygems_ext.rb +231 -32
- data/lib/bundler/rubygems_gem_installer.rb +89 -16
- data/lib/bundler/rubygems_integration.rb +72 -162
- data/lib/bundler/runtime.rb +23 -31
- data/lib/bundler/self_manager.rb +168 -0
- data/lib/bundler/settings.rb +145 -72
- data/lib/bundler/setup.rb +2 -2
- data/lib/bundler/shared_helpers.rb +19 -34
- data/lib/bundler/similarity_detector.rb +1 -1
- data/lib/bundler/source/git/git_proxy.rb +244 -114
- data/lib/bundler/source/git.rb +62 -46
- data/lib/bundler/source/metadata.rb +3 -8
- data/lib/bundler/source/path/installer.rb +11 -32
- data/lib/bundler/source/path.rb +15 -9
- data/lib/bundler/source/rubygems/remote.rb +1 -1
- data/lib/bundler/source/rubygems.rb +167 -199
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +25 -5
- data/lib/bundler/source_list.rb +112 -64
- data/lib/bundler/source_map.rb +71 -0
- data/lib/bundler/spec_set.rb +64 -61
- data/lib/bundler/stub_specification.rb +30 -10
- data/lib/bundler/templates/Executable +3 -5
- data/lib/bundler/templates/Executable.bundler +10 -15
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/gems.rb +0 -3
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
- data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +15 -1
- data/lib/bundler/templates/newgem/README.md.tt +13 -16
- data/lib/bundler/templates/newgem/Rakefile.tt +33 -5
- data/lib/bundler/templates/newgem/bin/console.tt +1 -0
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +25 -0
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- data/lib/bundler/templates/newgem/ext/newgem/{extconf.rb.tt → extconf-c.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +37 -0
- data/lib/bundler/templates/newgem/gitignore.tt +3 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +18 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +34 -18
- data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
- data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
- data/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/test_newgem.rb.tt} +3 -1
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/ui/shell.rb +37 -14
- data/lib/bundler/ui/silent.rb +21 -5
- data/lib/bundler/uri_credentials_filter.rb +3 -1
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +41 -74
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1350 -408
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +82 -189
- data/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +151 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +53 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +124 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +409 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +240 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +9 -7
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +10 -5
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +28 -9
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +28 -7
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +5 -13
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +452 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +76 -91
- data/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +32 -13
- data/lib/bundler/vendor/uri/lib/uri/http.rb +40 -3
- data/lib/bundler/vendor/uri/lib/uri/https.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -3
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +14 -21
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +11 -17
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +3 -3
- data/lib/bundler/vendored_persistent.rb +1 -40
- data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/version.rb +5 -1
- data/lib/bundler/worker.rb +25 -12
- data/lib/bundler/yaml_serializer.rb +1 -1
- data/lib/bundler.rb +95 -108
- metadata +132 -118
- data/lib/bundler/dep_proxy.rb +0 -48
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -37
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -6
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -81
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -158
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -223
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -143
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -101
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -837
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -12
- data/lib/bundler/version_ranges.rb +0 -122
- data/man/bundle-add.1.txt +0 -58
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-cache.1.txt +0 -78
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -528
- data/man/bundle-doctor.1.txt +0 -44
- data/man/bundle-exec.1.txt +0 -178
- data/man/bundle-gem.1 +0 -80
- data/man/bundle-gem.1.txt +0 -91
- data/man/bundle-gem.ronn +0 -78
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-init.1.txt +0 -34
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -401
- data/man/bundle-list.1.txt +0 -43
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -131
- data/man/bundle-platform.1.txt +0 -57
- data/man/bundle-pristine.1.txt +0 -44
- data/man/bundle-remove.1.txt +0 -34
- data/man/bundle-show.1.txt +0 -27
- data/man/bundle-update.1.txt +0 -390
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -116
- data/man/gemfile.5.txt +0 -649
- /data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- /data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- /data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- /data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
- /data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- /data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
- /data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- /data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- /data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
@@ -0,0 +1,178 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler::PubGrub
|
4
|
+
class VersionUnion
|
5
|
+
attr_reader :ranges
|
6
|
+
|
7
|
+
def self.normalize_ranges(ranges)
|
8
|
+
ranges = ranges.flat_map do |range|
|
9
|
+
range.ranges
|
10
|
+
end
|
11
|
+
|
12
|
+
ranges.reject!(&:empty?)
|
13
|
+
|
14
|
+
return [] if ranges.empty?
|
15
|
+
|
16
|
+
mins, ranges = ranges.partition { |r| !r.min }
|
17
|
+
original_ranges = mins + ranges.sort_by { |r| [r.min, r.include_min ? 0 : 1] }
|
18
|
+
ranges = [original_ranges.shift]
|
19
|
+
original_ranges.each do |range|
|
20
|
+
if ranges.last.contiguous_to?(range)
|
21
|
+
ranges << ranges.pop.span(range)
|
22
|
+
else
|
23
|
+
ranges << range
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
ranges
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.union(ranges, normalize: true)
|
31
|
+
ranges = normalize_ranges(ranges) if normalize
|
32
|
+
|
33
|
+
if ranges.size == 0
|
34
|
+
VersionRange.empty
|
35
|
+
elsif ranges.size == 1
|
36
|
+
ranges[0]
|
37
|
+
else
|
38
|
+
new(ranges)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def initialize(ranges)
|
43
|
+
raise ArgumentError unless ranges.all? { |r| r.instance_of?(VersionRange) }
|
44
|
+
@ranges = ranges
|
45
|
+
end
|
46
|
+
|
47
|
+
def hash
|
48
|
+
ranges.hash
|
49
|
+
end
|
50
|
+
|
51
|
+
def eql?(other)
|
52
|
+
ranges.eql?(other.ranges)
|
53
|
+
end
|
54
|
+
|
55
|
+
def include?(version)
|
56
|
+
!!ranges.bsearch {|r| r.compare_version(version) }
|
57
|
+
end
|
58
|
+
|
59
|
+
def select_versions(all_versions)
|
60
|
+
versions = []
|
61
|
+
ranges.inject(all_versions) do |acc, range|
|
62
|
+
_, matching, higher = range.partition_versions(acc)
|
63
|
+
versions.concat matching
|
64
|
+
higher
|
65
|
+
end
|
66
|
+
versions
|
67
|
+
end
|
68
|
+
|
69
|
+
def intersects?(other)
|
70
|
+
my_ranges = ranges.dup
|
71
|
+
other_ranges = other.ranges.dup
|
72
|
+
|
73
|
+
my_range = my_ranges.shift
|
74
|
+
other_range = other_ranges.shift
|
75
|
+
while my_range && other_range
|
76
|
+
if my_range.intersects?(other_range)
|
77
|
+
return true
|
78
|
+
end
|
79
|
+
|
80
|
+
if !my_range.max || other_range.empty? || (other_range.max && other_range.max < my_range.max)
|
81
|
+
other_range = other_ranges.shift
|
82
|
+
else
|
83
|
+
my_range = my_ranges.shift
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
alias_method :allows_any?, :intersects?
|
88
|
+
|
89
|
+
def allows_all?(other)
|
90
|
+
my_ranges = ranges.dup
|
91
|
+
|
92
|
+
my_range = my_ranges.shift
|
93
|
+
|
94
|
+
other.ranges.all? do |other_range|
|
95
|
+
while my_range
|
96
|
+
break if my_range.allows_all?(other_range)
|
97
|
+
my_range = my_ranges.shift
|
98
|
+
end
|
99
|
+
|
100
|
+
!!my_range
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def empty?
|
105
|
+
false
|
106
|
+
end
|
107
|
+
|
108
|
+
def any?
|
109
|
+
false
|
110
|
+
end
|
111
|
+
|
112
|
+
def intersect(other)
|
113
|
+
my_ranges = ranges.dup
|
114
|
+
other_ranges = other.ranges.dup
|
115
|
+
new_ranges = []
|
116
|
+
|
117
|
+
my_range = my_ranges.shift
|
118
|
+
other_range = other_ranges.shift
|
119
|
+
while my_range && other_range
|
120
|
+
new_ranges << my_range.intersect(other_range)
|
121
|
+
|
122
|
+
if !my_range.max || other_range.empty? || (other_range.max && other_range.max < my_range.max)
|
123
|
+
other_range = other_ranges.shift
|
124
|
+
else
|
125
|
+
my_range = my_ranges.shift
|
126
|
+
end
|
127
|
+
end
|
128
|
+
new_ranges.reject!(&:empty?)
|
129
|
+
VersionUnion.union(new_ranges, normalize: false)
|
130
|
+
end
|
131
|
+
|
132
|
+
def upper_invert
|
133
|
+
ranges.last.upper_invert
|
134
|
+
end
|
135
|
+
|
136
|
+
def invert
|
137
|
+
ranges.map(&:invert).inject(:intersect)
|
138
|
+
end
|
139
|
+
|
140
|
+
def union(other)
|
141
|
+
VersionUnion.union([self, other])
|
142
|
+
end
|
143
|
+
|
144
|
+
def to_s
|
145
|
+
output = []
|
146
|
+
|
147
|
+
ranges = self.ranges.dup
|
148
|
+
while !ranges.empty?
|
149
|
+
ne = []
|
150
|
+
range = ranges.shift
|
151
|
+
while !ranges.empty? && ranges[0].min == range.max
|
152
|
+
ne << range.max
|
153
|
+
range = range.span(ranges.shift)
|
154
|
+
end
|
155
|
+
|
156
|
+
ne.map! {|x| "!= #{x}" }
|
157
|
+
if ne.empty?
|
158
|
+
output << range.to_s
|
159
|
+
elsif range.any?
|
160
|
+
output << ne.join(', ')
|
161
|
+
else
|
162
|
+
output << "#{range}, #{ne.join(', ')}"
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
output.join(" OR ")
|
167
|
+
end
|
168
|
+
|
169
|
+
def inspect
|
170
|
+
"#<#{self.class} #{to_s}>"
|
171
|
+
end
|
172
|
+
|
173
|
+
def ==(other)
|
174
|
+
self.class == other.class &&
|
175
|
+
self.ranges == other.ranges
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative "pub_grub/package"
|
2
|
+
require_relative "pub_grub/static_package_source"
|
3
|
+
require_relative "pub_grub/term"
|
4
|
+
require_relative "pub_grub/version_range"
|
5
|
+
require_relative "pub_grub/version_constraint"
|
6
|
+
require_relative "pub_grub/version_union"
|
7
|
+
require_relative "pub_grub/version_solver"
|
8
|
+
require_relative "pub_grub/incompatibility"
|
9
|
+
require_relative 'pub_grub/solve_failure'
|
10
|
+
require_relative 'pub_grub/failure_writer'
|
11
|
+
require_relative 'pub_grub/version'
|
12
|
+
|
13
|
+
module Bundler::PubGrub
|
14
|
+
class << self
|
15
|
+
attr_writer :logger
|
16
|
+
|
17
|
+
def logger
|
18
|
+
@logger || default_logger
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def default_logger
|
24
|
+
require "logger"
|
25
|
+
|
26
|
+
logger = ::Logger.new(STDERR)
|
27
|
+
logger.level = $DEBUG ? ::Logger::DEBUG : ::Logger::WARN
|
28
|
+
@logger = logger
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008 Yehuda Katz, Eric Hodel, et al.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -33,7 +33,8 @@ class Bundler::Thor
|
|
33
33
|
# Boolean:: true if it is identical, false otherwise.
|
34
34
|
#
|
35
35
|
def identical?
|
36
|
-
|
36
|
+
source = File.expand_path(render, File.dirname(destination))
|
37
|
+
exists? && File.identical?(source, destination)
|
37
38
|
end
|
38
39
|
|
39
40
|
def invoke!
|
@@ -210,9 +210,9 @@ class Bundler::Thor
|
|
210
210
|
#
|
211
211
|
# ==== Examples
|
212
212
|
#
|
213
|
-
# inject_into_class "app/controllers/application_controller.rb", ApplicationController, " filter_parameter :password\n"
|
213
|
+
# inject_into_class "app/controllers/application_controller.rb", "ApplicationController", " filter_parameter :password\n"
|
214
214
|
#
|
215
|
-
# inject_into_class "app/controllers/application_controller.rb", ApplicationController do
|
215
|
+
# inject_into_class "app/controllers/application_controller.rb", "ApplicationController" do
|
216
216
|
# " filter_parameter :password\n"
|
217
217
|
# end
|
218
218
|
#
|
@@ -233,9 +233,9 @@ class Bundler::Thor
|
|
233
233
|
#
|
234
234
|
# ==== Examples
|
235
235
|
#
|
236
|
-
# inject_into_module "app/helpers/application_helper.rb", ApplicationHelper, " def help; 'help'; end\n"
|
236
|
+
# inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper", " def help; 'help'; end\n"
|
237
237
|
#
|
238
|
-
# inject_into_module "app/helpers/application_helper.rb", ApplicationHelper do
|
238
|
+
# inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper" do
|
239
239
|
# " def help; 'help'; end\n"
|
240
240
|
# end
|
241
241
|
#
|
@@ -251,7 +251,8 @@ class Bundler::Thor
|
|
251
251
|
# path<String>:: path of the file to be changed
|
252
252
|
# flag<Regexp|String>:: the regexp or string to be replaced
|
253
253
|
# replacement<String>:: the replacement, can be also given as a block
|
254
|
-
# config<Hash>:: give :verbose => false to not log the status
|
254
|
+
# config<Hash>:: give :verbose => false to not log the status, and
|
255
|
+
# :force => true, to force the replacement regardles of runner behavior.
|
255
256
|
#
|
256
257
|
# ==== Example
|
257
258
|
#
|
@@ -262,9 +263,10 @@ class Bundler::Thor
|
|
262
263
|
# end
|
263
264
|
#
|
264
265
|
def gsub_file(path, flag, *args, &block)
|
265
|
-
return unless behavior == :invoke
|
266
266
|
config = args.last.is_a?(Hash) ? args.pop : {}
|
267
267
|
|
268
|
+
return unless behavior == :invoke || config.fetch(:force, false)
|
269
|
+
|
268
270
|
path = File.expand_path(path, destination_root)
|
269
271
|
say_status :gsub, relative_to_original_destination_root(path), config.fetch(:verbose, true)
|
270
272
|
|
@@ -329,7 +331,7 @@ class Bundler::Thor
|
|
329
331
|
path = File.expand_path(path, destination_root)
|
330
332
|
|
331
333
|
say_status :remove, relative_to_original_destination_root(path), config.fetch(:verbose, true)
|
332
|
-
if !options[:pretend] && File.exist?(path)
|
334
|
+
if !options[:pretend] && (File.exist?(path) || File.symlink?(path))
|
333
335
|
require "fileutils"
|
334
336
|
::FileUtils.rm_rf(path)
|
335
337
|
end
|
@@ -106,12 +106,11 @@ class Bundler::Thor
|
|
106
106
|
# Adds the content to the file.
|
107
107
|
#
|
108
108
|
def replace!(regexp, string, force)
|
109
|
-
return if pretend?
|
110
109
|
content = File.read(destination)
|
111
110
|
if force || !content.include?(replacement)
|
112
111
|
success = content.gsub!(regexp, string)
|
113
112
|
|
114
|
-
File.open(destination, "wb") { |file| file.write(content) }
|
113
|
+
File.open(destination, "wb") { |file| file.write(content) } unless pretend?
|
115
114
|
success
|
116
115
|
end
|
117
116
|
end
|
@@ -161,6 +161,8 @@ class Bundler::Thor
|
|
161
161
|
# to the block you provide. The path is set back to the previous path when
|
162
162
|
# the method exits.
|
163
163
|
#
|
164
|
+
# Returns the value yielded by the block.
|
165
|
+
#
|
164
166
|
# ==== Parameters
|
165
167
|
# dir<String>:: the directory to move to.
|
166
168
|
# config<Hash>:: give :verbose => true to log and use padding.
|
@@ -179,16 +181,18 @@ class Bundler::Thor
|
|
179
181
|
FileUtils.mkdir_p(destination_root)
|
180
182
|
end
|
181
183
|
|
184
|
+
result = nil
|
182
185
|
if pretend
|
183
186
|
# In pretend mode, just yield down to the block
|
184
|
-
block.arity == 1 ? yield(destination_root) : yield
|
187
|
+
result = block.arity == 1 ? yield(destination_root) : yield
|
185
188
|
else
|
186
189
|
require "fileutils"
|
187
|
-
FileUtils.cd(destination_root) { block.arity == 1 ? yield(destination_root) : yield }
|
190
|
+
FileUtils.cd(destination_root) { result = block.arity == 1 ? yield(destination_root) : yield }
|
188
191
|
end
|
189
192
|
|
190
193
|
@destination_stack.pop
|
191
194
|
shell.padding -= 1 if verbose
|
195
|
+
result
|
192
196
|
end
|
193
197
|
|
194
198
|
# Goes to the root and execute the given block.
|
@@ -219,7 +223,7 @@ class Bundler::Thor
|
|
219
223
|
|
220
224
|
contents = if is_uri
|
221
225
|
require "open-uri"
|
222
|
-
open(path, "Accept" => "application/x-thor-template", &:read)
|
226
|
+
URI.open(path, "Accept" => "application/x-thor-template", &:read)
|
223
227
|
else
|
224
228
|
open(path, &:read)
|
225
229
|
end
|
@@ -22,6 +22,15 @@ class Bundler::Thor
|
|
22
22
|
|
23
23
|
TEMPLATE_EXTNAME = ".tt"
|
24
24
|
|
25
|
+
class << self
|
26
|
+
def deprecation_warning(message) #:nodoc:
|
27
|
+
unless ENV['THOR_SILENCE_DEPRECATION']
|
28
|
+
warn "Deprecation warning: #{message}\n" +
|
29
|
+
'You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
25
34
|
module Base
|
26
35
|
attr_accessor :options, :parent_options, :args
|
27
36
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class Bundler::Thor
|
2
|
-
Correctable = if defined?(DidYouMean::SpellChecker) && defined?(DidYouMean::Correctable)
|
2
|
+
Correctable = if defined?(DidYouMean::SpellChecker) && defined?(DidYouMean::Correctable) # rubocop:disable Naming/ConstantName
|
3
3
|
# In order to support versions of Ruby that don't have keyword
|
4
4
|
# arguments, we need our own spell checker class that doesn't take key
|
5
5
|
# words. Even though this code wouldn't be hit because of the check
|
@@ -102,9 +102,14 @@ class Bundler::Thor
|
|
102
102
|
end
|
103
103
|
|
104
104
|
if Correctable
|
105
|
-
DidYouMean
|
106
|
-
|
107
|
-
|
108
|
-
|
105
|
+
if DidYouMean.respond_to?(:correct_error)
|
106
|
+
DidYouMean.correct_error(Bundler::Thor::UndefinedCommandError, UndefinedCommandError::SpellChecker)
|
107
|
+
DidYouMean.correct_error(Bundler::Thor::UnknownArgumentError, UnknownArgumentError::SpellChecker)
|
108
|
+
else
|
109
|
+
DidYouMean::SPELL_CHECKERS.merge!(
|
110
|
+
'Bundler::Thor::UndefinedCommandError' => UndefinedCommandError::SpellChecker,
|
111
|
+
'Bundler::Thor::UnknownArgumentError' => UnknownArgumentError::SpellChecker
|
112
|
+
)
|
113
|
+
end
|
109
114
|
end
|
110
115
|
end
|
@@ -30,7 +30,11 @@ class Bundler::Thor
|
|
30
30
|
|
31
31
|
arguments.each do |argument|
|
32
32
|
if !argument.default.nil?
|
33
|
-
|
33
|
+
begin
|
34
|
+
@assigns[argument.human_name] = argument.default.dup
|
35
|
+
rescue TypeError # Compatibility shim for un-dup-able Fixnum in Ruby < 2.4
|
36
|
+
@assigns[argument.human_name] = argument.default
|
37
|
+
end
|
34
38
|
elsif argument.required?
|
35
39
|
@non_assigned_required << argument
|
36
40
|
end
|
@@ -45,6 +45,7 @@ class Bundler::Thor
|
|
45
45
|
@switches = {}
|
46
46
|
@extra = []
|
47
47
|
@stopped_parsing_after_extra_index = nil
|
48
|
+
@is_treated_as_value = false
|
48
49
|
|
49
50
|
options.each do |option|
|
50
51
|
@switches[option.switch_name] = option
|
@@ -74,8 +75,19 @@ class Bundler::Thor
|
|
74
75
|
end
|
75
76
|
end
|
76
77
|
|
78
|
+
def shift
|
79
|
+
@is_treated_as_value = false
|
80
|
+
super
|
81
|
+
end
|
82
|
+
|
83
|
+
def unshift(arg, is_value: false)
|
84
|
+
@is_treated_as_value = is_value
|
85
|
+
super(arg)
|
86
|
+
end
|
87
|
+
|
77
88
|
def parse(args) # rubocop:disable MethodLength
|
78
89
|
@pile = args.dup
|
90
|
+
@is_treated_as_value = false
|
79
91
|
@parsing_options = true
|
80
92
|
|
81
93
|
while peek
|
@@ -88,7 +100,10 @@ class Bundler::Thor
|
|
88
100
|
when SHORT_SQ_RE
|
89
101
|
unshift($1.split("").map { |f| "-#{f}" })
|
90
102
|
next
|
91
|
-
when EQ_RE
|
103
|
+
when EQ_RE
|
104
|
+
unshift($2, is_value: true)
|
105
|
+
switch = $1
|
106
|
+
when SHORT_NUM
|
92
107
|
unshift($2)
|
93
108
|
switch = $1
|
94
109
|
when LONG_RE, SHORT_RE
|
@@ -133,20 +148,22 @@ class Bundler::Thor
|
|
133
148
|
|
134
149
|
protected
|
135
150
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
151
|
+
def assign_result!(option, result)
|
152
|
+
if option.repeatable && option.type == :hash
|
153
|
+
(@assigns[option.human_name] ||= {}).merge!(result)
|
154
|
+
elsif option.repeatable
|
155
|
+
(@assigns[option.human_name] ||= []) << result
|
156
|
+
else
|
157
|
+
@assigns[option.human_name] = result
|
158
|
+
end
|
143
159
|
end
|
144
|
-
|
160
|
+
|
145
161
|
# Check if the current value in peek is a registered switch.
|
146
162
|
#
|
147
163
|
# Two booleans are returned. The first is true if the current value
|
148
164
|
# starts with a hyphen; the second is true if it is a registered switch.
|
149
165
|
def current_is_switch?
|
166
|
+
return [false, false] if @is_treated_as_value
|
150
167
|
case peek
|
151
168
|
when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM
|
152
169
|
[true, switch?($1)]
|
@@ -158,6 +175,7 @@ class Bundler::Thor
|
|
158
175
|
end
|
159
176
|
|
160
177
|
def current_is_switch_formatted?
|
178
|
+
return false if @is_treated_as_value
|
161
179
|
case peek
|
162
180
|
when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM, SHORT_SQ_RE
|
163
181
|
true
|
@@ -167,6 +185,7 @@ class Bundler::Thor
|
|
167
185
|
end
|
168
186
|
|
169
187
|
def current_is_value?
|
188
|
+
return true if @is_treated_as_value
|
170
189
|
peek && (!parsing_options? || super)
|
171
190
|
end
|
172
191
|
|
@@ -94,6 +94,8 @@ class Bundler::Thor
|
|
94
94
|
# say("I know you knew that.")
|
95
95
|
#
|
96
96
|
def say(message = "", color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
|
97
|
+
return if quiet?
|
98
|
+
|
97
99
|
buffer = prepare_message(message, *color)
|
98
100
|
buffer << "\n" if force_new_line && !message.to_s.end_with?("\n")
|
99
101
|
|
@@ -101,6 +103,23 @@ class Bundler::Thor
|
|
101
103
|
stdout.flush
|
102
104
|
end
|
103
105
|
|
106
|
+
# Say (print) an error to the user. If the sentence ends with a whitespace
|
107
|
+
# or tab character, a new line is not appended (print + flush). Otherwise
|
108
|
+
# are passed straight to puts (behavior got from Highline).
|
109
|
+
#
|
110
|
+
# ==== Example
|
111
|
+
# say_error("error: something went wrong")
|
112
|
+
#
|
113
|
+
def say_error(message = "", color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
|
114
|
+
return if quiet?
|
115
|
+
|
116
|
+
buffer = prepare_message(message, *color)
|
117
|
+
buffer << "\n" if force_new_line && !message.to_s.end_with?("\n")
|
118
|
+
|
119
|
+
stderr.print(buffer)
|
120
|
+
stderr.flush
|
121
|
+
end
|
122
|
+
|
104
123
|
# Say a status with the given color and appends the message. Since this
|
105
124
|
# method is used frequently by actions, it allows nil or false to be given
|
106
125
|
# in log_status, avoiding the message from being shown. If a Symbol is
|
@@ -109,13 +128,14 @@ class Bundler::Thor
|
|
109
128
|
def say_status(status, message, log_status = true)
|
110
129
|
return if quiet? || log_status == false
|
111
130
|
spaces = " " * (padding + 1)
|
112
|
-
color = log_status.is_a?(Symbol) ? log_status : :green
|
113
|
-
|
114
131
|
status = status.to_s.rjust(12)
|
132
|
+
margin = " " * status.length + spaces
|
133
|
+
|
134
|
+
color = log_status.is_a?(Symbol) ? log_status : :green
|
115
135
|
status = set_color status, color, true if color
|
116
136
|
|
117
|
-
|
118
|
-
buffer = "#{
|
137
|
+
message = message.to_s.chomp.gsub(/(?<!\A)^/, margin)
|
138
|
+
buffer = "#{status}#{spaces}#{message}\n"
|
119
139
|
|
120
140
|
stdout.print(buffer)
|
121
141
|
stdout.flush
|
@@ -230,8 +250,9 @@ class Bundler::Thor
|
|
230
250
|
paras = message.split("\n\n")
|
231
251
|
|
232
252
|
paras.map! do |unwrapped|
|
233
|
-
|
234
|
-
|
253
|
+
words = unwrapped.split(" ")
|
254
|
+
counter = words.first.length
|
255
|
+
words.inject do |memo, word|
|
235
256
|
word = word.gsub(/\n\005/, "\n").gsub(/\005/, "\n")
|
236
257
|
counter = 0 if word.include? "\n"
|
237
258
|
if (counter + word.length + 1) < width
|
@@ -404,7 +425,7 @@ class Bundler::Thor
|
|
404
425
|
end
|
405
426
|
|
406
427
|
def unix?
|
407
|
-
RUBY_PLATFORM =~ /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris
|
428
|
+
RUBY_PLATFORM =~ /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris)/i
|
408
429
|
end
|
409
430
|
|
410
431
|
def truncate(string, width)
|
@@ -97,7 +97,11 @@ class Bundler::Thor
|
|
97
97
|
protected
|
98
98
|
|
99
99
|
def can_display_colors?
|
100
|
-
|
100
|
+
are_colors_supported? && !are_colors_disabled?
|
101
|
+
end
|
102
|
+
|
103
|
+
def are_colors_supported?
|
104
|
+
stdout.tty? && ENV["TERM"] != "dumb"
|
101
105
|
end
|
102
106
|
|
103
107
|
def are_colors_disabled?
|
@@ -21,7 +21,7 @@ class Bundler::Thor
|
|
21
21
|
end
|
22
22
|
|
23
23
|
module Shell
|
24
|
-
SHELL_DELEGATED_METHODS = [:ask, :error, :set_color, :yes?, :no?, :say, :say_status, :print_in_columns, :print_table, :print_wrapped, :file_collision, :terminal_width]
|
24
|
+
SHELL_DELEGATED_METHODS = [:ask, :error, :set_color, :yes?, :no?, :say, :say_error, :say_status, :print_in_columns, :print_table, :print_wrapped, :file_collision, :terminal_width]
|
25
25
|
attr_writer :shell
|
26
26
|
|
27
27
|
autoload :Basic, File.expand_path("shell/basic", __dir__)
|
@@ -211,7 +211,7 @@ class Bundler::Thor
|
|
211
211
|
#
|
212
212
|
def globs_for(path)
|
213
213
|
path = escape_globs(path)
|
214
|
-
["#{path}/Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks
|
214
|
+
["#{path}/Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks/**/*.thor"]
|
215
215
|
end
|
216
216
|
|
217
217
|
# Return the path to the ruby interpreter taking into account multiple
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require "set"
|
2
1
|
require_relative "thor/base"
|
3
2
|
|
4
3
|
class Bundler::Thor
|
4
|
+
$thor_runner ||= false
|
5
5
|
class << self
|
6
6
|
# Allows for custom "Command" package naming.
|
7
7
|
#
|
@@ -323,7 +323,7 @@ class Bundler::Thor
|
|
323
323
|
# ==== Parameters
|
324
324
|
# Symbol ...:: A list of commands that should be affected.
|
325
325
|
def stop_on_unknown_option!(*command_names)
|
326
|
-
stop_on_unknown_option
|
326
|
+
@stop_on_unknown_option = stop_on_unknown_option | command_names
|
327
327
|
end
|
328
328
|
|
329
329
|
def stop_on_unknown_option?(command) #:nodoc:
|
@@ -337,29 +337,22 @@ class Bundler::Thor
|
|
337
337
|
# ==== Parameters
|
338
338
|
# Symbol ...:: A list of commands that should be affected.
|
339
339
|
def disable_required_check!(*command_names)
|
340
|
-
disable_required_check
|
340
|
+
@disable_required_check = disable_required_check | command_names
|
341
341
|
end
|
342
342
|
|
343
343
|
def disable_required_check?(command) #:nodoc:
|
344
344
|
command && disable_required_check.include?(command.name.to_sym)
|
345
345
|
end
|
346
346
|
|
347
|
-
def deprecation_warning(message) #:nodoc:
|
348
|
-
unless ENV['THOR_SILENCE_DEPRECATION']
|
349
|
-
warn "Deprecation warning: #{message}\n" +
|
350
|
-
'You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.'
|
351
|
-
end
|
352
|
-
end
|
353
|
-
|
354
347
|
protected
|
355
348
|
|
356
349
|
def stop_on_unknown_option #:nodoc:
|
357
|
-
@stop_on_unknown_option ||=
|
350
|
+
@stop_on_unknown_option ||= []
|
358
351
|
end
|
359
352
|
|
360
353
|
# help command has the required check disabled by default.
|
361
354
|
def disable_required_check #:nodoc:
|
362
|
-
@disable_required_check ||=
|
355
|
+
@disable_required_check ||= [:help]
|
363
356
|
end
|
364
357
|
|
365
358
|
# The method responsible for dispatching given the args.
|
@@ -405,7 +398,6 @@ class Bundler::Thor
|
|
405
398
|
# the namespace should be displayed as arguments.
|
406
399
|
#
|
407
400
|
def banner(command, namespace = nil, subcommand = false)
|
408
|
-
$thor_runner ||= false
|
409
401
|
command.formatted_usage(self, $thor_runner, subcommand).split("\n").map do |formatted_usage|
|
410
402
|
"#{basename} #{formatted_usage}"
|
411
403
|
end.join("\n")
|