bundler 2.2.29 → 2.5.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1129 -4
- data/README.md +4 -8
- data/bundler.gemspec +11 -11
- data/exe/bundle +5 -26
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +4 -4
- data/lib/bundler/capistrano.rb +1 -1
- data/lib/bundler/checksum.rb +254 -0
- data/lib/bundler/ci_detector.rb +75 -0
- data/lib/bundler/cli/add.rb +4 -4
- data/lib/bundler/cli/binstubs.rb +10 -6
- data/lib/bundler/cli/cache.rb +1 -1
- data/lib/bundler/cli/check.rb +3 -3
- data/lib/bundler/cli/common.rb +13 -3
- data/lib/bundler/cli/config.rb +18 -8
- data/lib/bundler/cli/console.rb +5 -4
- data/lib/bundler/cli/doctor.rb +12 -5
- data/lib/bundler/cli/exec.rb +1 -1
- data/lib/bundler/cli/fund.rb +1 -1
- data/lib/bundler/cli/gem.rb +141 -48
- data/lib/bundler/cli/info.rb +27 -17
- data/lib/bundler/cli/init.rb +6 -2
- data/lib/bundler/cli/install.rb +22 -39
- data/lib/bundler/cli/issue.rb +5 -4
- data/lib/bundler/cli/lock.rb +36 -29
- data/lib/bundler/cli/open.rb +9 -9
- data/lib/bundler/cli/outdated.rb +19 -12
- data/lib/bundler/cli/platform.rb +8 -6
- data/lib/bundler/cli/plugin.rb +9 -15
- data/lib/bundler/cli/pristine.rb +38 -30
- data/lib/bundler/cli/show.rb +3 -3
- data/lib/bundler/cli/update.rb +12 -7
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/cli.rb +266 -285
- data/lib/bundler/compact_index_client/cache.rb +53 -67
- data/lib/bundler/compact_index_client/cache_file.rb +153 -0
- data/lib/bundler/compact_index_client/gem_parser.rb +7 -3
- data/lib/bundler/compact_index_client/parser.rb +84 -0
- data/lib/bundler/compact_index_client/updater.rb +83 -76
- data/lib/bundler/compact_index_client.rb +59 -87
- data/lib/bundler/constants.rb +9 -2
- data/lib/bundler/current_ruby.rb +12 -16
- data/lib/bundler/definition.rb +509 -319
- data/lib/bundler/dependency.rb +33 -71
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +88 -69
- data/lib/bundler/endpoint_specification.rb +32 -15
- data/lib/bundler/env.rb +5 -7
- data/lib/bundler/environment_preserver.rb +8 -22
- data/lib/bundler/errors.rb +101 -13
- data/lib/bundler/feature_flag.rb +0 -2
- data/lib/bundler/fetcher/base.rb +11 -11
- data/lib/bundler/fetcher/compact_index.rb +32 -52
- data/lib/bundler/fetcher/dependency.rb +3 -7
- data/lib/bundler/fetcher/downloader.rb +17 -16
- data/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- data/lib/bundler/fetcher/index.rb +2 -29
- data/lib/bundler/fetcher.rb +87 -79
- data/lib/bundler/force_platform.rb +18 -0
- data/lib/bundler/friendly_errors.rb +29 -40
- data/lib/bundler/gem_helper.rb +11 -23
- data/lib/bundler/gem_helpers.rb +30 -6
- data/lib/bundler/gem_version_promoter.rb +68 -109
- data/lib/bundler/graph.rb +9 -9
- data/lib/bundler/index.rb +71 -79
- data/lib/bundler/injector.rb +23 -11
- data/lib/bundler/inline.rb +11 -23
- data/lib/bundler/installer/gem_installer.rb +18 -11
- data/lib/bundler/installer/parallel_installer.rb +17 -65
- data/lib/bundler/installer/standalone.rb +56 -15
- data/lib/bundler/installer.rb +35 -61
- data/lib/bundler/lazy_specification.rb +92 -61
- data/lib/bundler/lockfile_generator.rb +12 -3
- data/lib/bundler/lockfile_parser.rb +137 -70
- data/lib/bundler/man/bundle-add.1 +19 -26
- data/lib/bundler/man/bundle-add.1.ronn +16 -4
- data/lib/bundler/man/bundle-binstubs.1 +4 -16
- data/lib/bundler/man/bundle-cache.1 +9 -24
- data/lib/bundler/man/bundle-cache.1.ronn +9 -2
- data/lib/bundler/man/bundle-check.1 +5 -12
- data/lib/bundler/man/bundle-check.1.ronn +3 -0
- data/lib/bundler/man/bundle-clean.1 +4 -11
- data/lib/bundler/man/bundle-clean.1.ronn +1 -1
- data/lib/bundler/man/bundle-config.1 +47 -224
- data/lib/bundler/man/bundle-config.1.ronn +40 -28
- data/lib/bundler/man/bundle-console.1 +35 -0
- data/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/lib/bundler/man/bundle-doctor.1 +4 -18
- data/lib/bundler/man/bundle-exec.1 +16 -77
- data/lib/bundler/man/bundle-exec.1.ronn +8 -9
- data/lib/bundler/man/bundle-gem.1 +45 -72
- data/lib/bundler/man/bundle-gem.1.ronn +32 -5
- data/lib/bundler/man/bundle-help.1 +9 -0
- data/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/lib/bundler/man/bundle-info.1 +5 -11
- data/lib/bundler/man/bundle-info.1.ronn +3 -3
- data/lib/bundler/man/bundle-init.1 +6 -11
- data/lib/bundler/man/bundle-init.1.ronn +2 -0
- data/lib/bundler/man/bundle-inject.1 +8 -18
- data/lib/bundler/man/bundle-inject.1.ronn +3 -1
- data/lib/bundler/man/bundle-install.1 +32 -155
- data/lib/bundler/man/bundle-install.1.ronn +11 -33
- data/lib/bundler/man/bundle-list.1 +4 -19
- data/lib/bundler/man/bundle-lock.1 +5 -29
- data/lib/bundler/man/bundle-open.1 +18 -18
- data/lib/bundler/man/bundle-open.1.ronn +9 -1
- data/lib/bundler/man/bundle-outdated.1 +17 -72
- data/lib/bundler/man/bundle-outdated.1.ronn +13 -18
- data/lib/bundler/man/bundle-platform.1 +16 -28
- data/lib/bundler/man/bundle-platform.1.ronn +14 -7
- data/lib/bundler/man/bundle-plugin.1 +58 -0
- data/lib/bundler/man/bundle-plugin.1.ronn +63 -0
- data/lib/bundler/man/bundle-pristine.1 +5 -16
- data/lib/bundler/man/bundle-remove.1 +4 -14
- data/lib/bundler/man/bundle-show.1 +3 -10
- data/lib/bundler/man/bundle-update.1 +19 -138
- data/lib/bundler/man/bundle-update.1.ronn +2 -1
- data/lib/bundler/man/bundle-version.1 +22 -0
- data/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/lib/bundler/man/bundle-viz.1 +6 -15
- data/lib/bundler/man/bundle-viz.1.ronn +2 -0
- data/lib/bundler/man/bundle.1 +17 -51
- data/lib/bundler/man/bundle.1.ronn +12 -7
- data/lib/bundler/man/gemfile.5 +130 -346
- data/lib/bundler/man/gemfile.5.ronn +121 -86
- data/lib/bundler/man/index.txt +4 -0
- data/lib/bundler/match_metadata.rb +17 -0
- data/lib/bundler/match_platform.rb +1 -2
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/mirror.rb +8 -10
- data/lib/bundler/plugin/api/source.rb +9 -13
- data/lib/bundler/plugin/index.rb +13 -5
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/path.rb +18 -0
- data/lib/bundler/plugin/installer/rubygems.rb +0 -8
- data/lib/bundler/plugin/installer.rb +42 -19
- data/lib/bundler/plugin/source_list.rb +4 -4
- data/lib/bundler/plugin.rb +16 -7
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +11 -5
- data/lib/bundler/resolver/base.rb +111 -0
- data/lib/bundler/resolver/candidate.rb +82 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +81 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +53 -66
- data/lib/bundler/resolver.rb +419 -307
- data/lib/bundler/retry.rb +1 -1
- data/lib/bundler/ruby_dsl.rb +42 -7
- data/lib/bundler/ruby_version.rb +16 -22
- data/lib/bundler/rubygems_ext.rb +250 -64
- data/lib/bundler/rubygems_gem_installer.rb +90 -64
- data/lib/bundler/rubygems_integration.rb +81 -190
- data/lib/bundler/runtime.rb +8 -13
- data/lib/bundler/safe_marshal.rb +31 -0
- data/lib/bundler/self_manager.rb +206 -0
- data/lib/bundler/settings.rb +139 -57
- data/lib/bundler/setup.rb +13 -1
- data/lib/bundler/shared_helpers.rb +67 -36
- data/lib/bundler/source/git/git_proxy.rb +285 -82
- data/lib/bundler/source/git.rb +81 -41
- data/lib/bundler/source/metadata.rb +17 -16
- data/lib/bundler/source/path/installer.rb +1 -22
- data/lib/bundler/source/path.rb +13 -25
- data/lib/bundler/source/rubygems/remote.rb +1 -1
- data/lib/bundler/source/rubygems.rb +164 -234
- data/lib/bundler/source/rubygems_aggregate.rb +1 -1
- data/lib/bundler/source.rb +7 -6
- data/lib/bundler/source_list.rb +40 -32
- data/lib/bundler/source_map.rb +15 -2
- data/lib/bundler/spec_set.rb +156 -46
- data/lib/bundler/stub_specification.rb +18 -5
- data/lib/bundler/templates/Executable +3 -5
- data/lib/bundler/templates/Executable.bundler +7 -12
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
- data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +8 -2
- data/lib/bundler/templates/newgem/README.md.tt +7 -11
- data/lib/bundler/templates/newgem/Rakefile.tt +28 -4
- data/lib/bundler/templates/newgem/bin/console.tt +0 -4
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +1 -1
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +13 -3
- data/lib/bundler/templates/newgem/gitignore.tt +3 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +13 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +25 -17
- data/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
- data/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
- data/lib/bundler/ui/rg_proxy.rb +1 -1
- data/lib/bundler/ui/shell.rb +38 -15
- data/lib/bundler/ui/silent.rb +21 -5
- data/lib/bundler/uri_credentials_filter.rb +2 -2
- data/lib/bundler/uri_normalizer.rb +23 -0
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/.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 +92 -78
- data/lib/bundler/vendor/fileutils/.document +1 -0
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1340 -410
- data/lib/bundler/vendor/net-http-persistent/.document +1 -0
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +4 -3
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +23 -11
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +1 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +57 -57
- data/lib/bundler/vendor/pub_grub/.document +1 -0
- 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 +150 -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 +61 -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 +129 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +411 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +248 -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/.document +1 -0
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +12 -14
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +16 -6
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +21 -17
- data/lib/bundler/vendor/thor/lib/thor/base.rb +140 -14
- data/lib/bundler/vendor/thor/lib/thor/command.rb +13 -4
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +10 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +16 -20
- data/lib/bundler/vendor/thor/lib/thor/group.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +20 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +33 -17
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +27 -8
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +63 -7
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +40 -30
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +48 -154
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +1 -46
- data/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +0 -45
- data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +134 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/util.rb +9 -8
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +155 -8
- data/lib/bundler/vendor/tsort/.document +1 -0
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +455 -0
- data/lib/bundler/vendor/uri/.document +1 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +316 -207
- 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 +33 -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 +16 -23
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +105 -47
- 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_net_http.rb +23 -0
- data/lib/bundler/vendored_persistent.rb +0 -36
- data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
- data/lib/bundler/vendored_timeout.rb +12 -0
- data/lib/bundler/{vendored_tmpdir.rb → vendored_tsort.rb} +1 -1
- data/lib/bundler/vendored_uri.rb +18 -1
- data/lib/bundler/version.rb +5 -1
- data/lib/bundler/vlad.rb +1 -1
- data/lib/bundler/worker.rb +7 -9
- data/lib/bundler/yaml_serializer.rb +21 -12
- data/lib/bundler.rb +114 -121
- metadata +87 -41
- data/lib/bundler/dep_proxy.rb +0 -55
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -22
- data/lib/bundler/templates/gems.rb +0 -8
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +0 -5
- 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/delegates/resolution_state.rb +0 -57
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
- 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 -164
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -255
- 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 -112
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -839
- 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 -11
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +0 -154
- data/lib/bundler/version_ranges.rb +0 -122
@@ -2,83 +2,131 @@
|
|
2
2
|
|
3
3
|
## Our Pledge
|
4
4
|
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
10
|
+
identity and orientation.
|
6
11
|
|
7
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
+
diverse, inclusive, and healthy community.
|
8
14
|
|
9
15
|
## Our Standards
|
10
16
|
|
11
|
-
Examples of behavior that contributes to a positive environment for our
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
18
|
+
community include:
|
12
19
|
|
13
20
|
* Demonstrating empathy and kindness toward other people
|
14
21
|
* Being respectful of differing opinions, viewpoints, and experiences
|
15
22
|
* Giving and gracefully accepting constructive feedback
|
16
|
-
* Accepting responsibility and apologizing to those affected by our mistakes,
|
17
|
-
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
24
|
+
and learning from the experience
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
26
|
+
community
|
18
27
|
|
19
28
|
Examples of unacceptable behavior include:
|
20
29
|
|
21
|
-
* The use of sexualized language or imagery, and sexual attention or
|
22
|
-
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
31
|
+
any kind
|
23
32
|
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
33
|
* Public or private harassment
|
25
|
-
* Publishing others' private information, such as a physical or email
|
26
|
-
|
34
|
+
* Publishing others' private information, such as a physical or email address,
|
35
|
+
without their explicit permission
|
27
36
|
* Other conduct which could reasonably be considered inappropriate in a
|
28
37
|
professional setting
|
29
38
|
|
30
39
|
## Enforcement Responsibilities
|
31
40
|
|
32
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
44
|
+
or harmful.
|
33
45
|
|
34
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
49
|
+
decisions when appropriate.
|
35
50
|
|
36
51
|
## Scope
|
37
52
|
|
38
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
+
an individual is officially representing the community in public spaces.
|
55
|
+
Examples of representing our community include using an official email address,
|
56
|
+
posting via an official social media account, or acting as an appointed
|
57
|
+
representative at an online or offline event.
|
39
58
|
|
40
59
|
## Enforcement
|
41
60
|
|
42
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
62
|
+
reported to the community leaders responsible for enforcement at
|
63
|
+
[INSERT CONTACT METHOD].
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
43
65
|
|
44
|
-
All community leaders are obligated to respect the privacy and security of the
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
67
|
+
reporter of any incident.
|
45
68
|
|
46
69
|
## Enforcement Guidelines
|
47
70
|
|
48
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
49
73
|
|
50
74
|
### 1. Correction
|
51
75
|
|
52
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
+
unprofessional or unwelcome in the community.
|
53
78
|
|
54
|
-
**Consequence**: A private, written warning from community leaders, providing
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
55
82
|
|
56
83
|
### 2. Warning
|
57
84
|
|
58
|
-
**Community Impact**: A violation through a single incident or series of
|
85
|
+
**Community Impact**: A violation through a single incident or series of
|
86
|
+
actions.
|
59
87
|
|
60
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
92
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
93
|
+
ban.
|
61
94
|
|
62
95
|
### 3. Temporary Ban
|
63
96
|
|
64
|
-
**Community Impact**: A serious violation of community standards, including
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
98
|
+
sustained inappropriate behavior.
|
65
99
|
|
66
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
+
communication with the community for a specified period of time. No public or
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
104
|
+
Violating these terms may lead to a permanent ban.
|
67
105
|
|
68
106
|
### 4. Permanent Ban
|
69
107
|
|
70
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
71
111
|
|
72
|
-
**Consequence**: A permanent ban from any sort of public interaction within the
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
113
|
+
community.
|
73
114
|
|
74
115
|
## Attribution
|
75
116
|
|
76
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
77
|
-
available at
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
118
|
+
version 2.1, available at
|
119
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
78
120
|
|
79
|
-
Community Impact Guidelines were inspired by
|
80
|
-
|
81
|
-
[homepage]: https://www.contributor-covenant.org
|
121
|
+
Community Impact Guidelines were inspired by
|
122
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
82
123
|
|
83
124
|
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
-
https://www.contributor-covenant.org/faq. Translations are available at
|
125
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
126
|
+
[https://www.contributor-covenant.org/translations][translations].
|
127
|
+
|
128
|
+
[homepage]: https://www.contributor-covenant.org
|
129
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
130
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
131
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
132
|
+
[translations]: https://www.contributor-covenant.org/translations
|
@@ -9,12 +9,18 @@ gem "rake", "~> 13.0"
|
|
9
9
|
<%- if config[:ext] -%>
|
10
10
|
|
11
11
|
gem "rake-compiler"
|
12
|
+
<%- if config[:ext] == 'rust' -%>
|
13
|
+
gem "rb_sys", "~> 0.9.63"
|
14
|
+
<%- end -%>
|
12
15
|
<%- end -%>
|
13
16
|
<%- if config[:test] -%>
|
14
17
|
|
15
18
|
gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
|
16
19
|
<%- end -%>
|
17
|
-
<%- if config[:
|
20
|
+
<%- if config[:linter] == "rubocop" -%>
|
21
|
+
|
22
|
+
gem "rubocop", "~> <%= config[:linter_version] %>"
|
23
|
+
<%- elsif config[:linter] == "standard" -%>
|
18
24
|
|
19
|
-
gem "
|
25
|
+
gem "standard", "~> <%= config[:linter_version] %>"
|
20
26
|
<%- end -%>
|
@@ -1,24 +1,20 @@
|
|
1
1
|
# <%= config[:constant_name] %>
|
2
2
|
|
3
|
-
|
3
|
+
TODO: Delete this and the text below, and describe your gem
|
4
4
|
|
5
|
-
|
5
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/<%= config[:namespaced_path] %>`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem '<%= config[:name] %>'
|
13
|
-
```
|
9
|
+
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
14
10
|
|
15
|
-
|
11
|
+
Install the gem and add to the application's Gemfile by executing:
|
16
12
|
|
17
|
-
$ bundle
|
13
|
+
$ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
|
18
14
|
|
19
|
-
|
15
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
20
16
|
|
21
|
-
$ gem install
|
17
|
+
$ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
|
22
18
|
|
23
19
|
## Usage
|
24
20
|
|
@@ -3,7 +3,12 @@
|
|
3
3
|
require "bundler/gem_tasks"
|
4
4
|
<% default_task_names = [config[:test_task]].compact -%>
|
5
5
|
<% case config[:test] -%>
|
6
|
-
<% when "minitest"
|
6
|
+
<% when "minitest" -%>
|
7
|
+
require "minitest/test_task"
|
8
|
+
|
9
|
+
Minitest::TestTask.create
|
10
|
+
|
11
|
+
<% when "test-unit" -%>
|
7
12
|
require "rake/testtask"
|
8
13
|
|
9
14
|
Rake::TestTask.new(:test) do |t|
|
@@ -18,22 +23,41 @@ require "rspec/core/rake_task"
|
|
18
23
|
RSpec::Core::RakeTask.new(:spec)
|
19
24
|
|
20
25
|
<% end -%>
|
21
|
-
<% if config[:
|
26
|
+
<% if config[:linter] == "rubocop" -%>
|
22
27
|
<% default_task_names << :rubocop -%>
|
23
28
|
require "rubocop/rake_task"
|
24
29
|
|
25
30
|
RuboCop::RakeTask.new
|
26
31
|
|
32
|
+
<% elsif config[:linter] == "standard" -%>
|
33
|
+
<% default_task_names << :standard -%>
|
34
|
+
require "standard/rake"
|
35
|
+
|
27
36
|
<% end -%>
|
28
37
|
<% if config[:ext] -%>
|
29
|
-
<% default_task_names.unshift(:
|
38
|
+
<% default_task_names.unshift(:compile) -%>
|
39
|
+
<% default_task_names.unshift(:clobber) unless config[:ext] == 'rust' -%>
|
40
|
+
<% if config[:ext] == 'rust' -%>
|
41
|
+
require "rb_sys/extensiontask"
|
42
|
+
|
43
|
+
task build: :compile
|
44
|
+
|
45
|
+
GEMSPEC = Gem::Specification.load("<%= config[:underscored_name] %>.gemspec")
|
46
|
+
|
47
|
+
RbSys::ExtensionTask.new(<%= config[:name].inspect %>, GEMSPEC) do |ext|
|
48
|
+
ext.lib_dir = "lib/<%= config[:namespaced_path] %>"
|
49
|
+
end
|
50
|
+
<% else -%>
|
30
51
|
require "rake/extensiontask"
|
31
52
|
|
32
53
|
task build: :compile
|
33
54
|
|
34
|
-
|
55
|
+
GEMSPEC = Gem::Specification.load("<%= config[:underscored_name] %>.gemspec")
|
56
|
+
|
57
|
+
Rake::ExtensionTask.new("<%= config[:underscored_name] %>", GEMSPEC) do |ext|
|
35
58
|
ext.lib_dir = "lib/<%= config[:namespaced_path] %>"
|
36
59
|
end
|
60
|
+
<% end -%>
|
37
61
|
|
38
62
|
<% end -%>
|
39
63
|
<% if default_task_names.size == 1 -%>
|
@@ -7,9 +7,5 @@ require "<%= config[:namespaced_path] %>"
|
|
7
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
8
8
|
# with your gem easier. You can also use a different console, if you like.
|
9
9
|
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
-
# require "pry"
|
12
|
-
# Pry.start
|
13
|
-
|
14
10
|
require "irb"
|
15
11
|
IRB.start(__FILE__)
|
@@ -3,8 +3,20 @@ jobs:
|
|
3
3
|
build:
|
4
4
|
docker:
|
5
5
|
- image: ruby:<%= RUBY_VERSION %>
|
6
|
+
<%- if config[:ext] == 'rust' -%>
|
7
|
+
environment:
|
8
|
+
RB_SYS_FORCE_INSTALL_RUST_TOOLCHAIN: 'true'
|
9
|
+
<%- end -%>
|
6
10
|
steps:
|
7
11
|
- checkout
|
12
|
+
<%- if config[:ext] == 'rust' -%>
|
13
|
+
- run:
|
14
|
+
name: Install Rust/Cargo dependencies
|
15
|
+
command: apt-get update && apt-get install -y clang
|
16
|
+
- run:
|
17
|
+
name: Install a RubyGems version that can compile rust extensions
|
18
|
+
command: gem update --system '<%= ::Gem.rubygems_version %>'
|
19
|
+
<%- end -%>
|
8
20
|
- run:
|
9
21
|
name: Run the default task
|
10
22
|
command: |
|
@@ -0,0 +1,15 @@
|
|
1
|
+
[package]
|
2
|
+
name = <%= config[:name].inspect %>
|
3
|
+
version = "0.1.0"
|
4
|
+
edition = "2021"
|
5
|
+
authors = ["<%= config[:author] %> <<%= config[:email] %>>"]
|
6
|
+
<%- if config[:mit] -%>
|
7
|
+
license = "MIT"
|
8
|
+
<%- end -%>
|
9
|
+
publish = false
|
10
|
+
|
11
|
+
[lib]
|
12
|
+
crate-type = ["cdylib"]
|
13
|
+
|
14
|
+
[dependencies]
|
15
|
+
magnus = { version = "0.6.2" }
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "mkmf"
|
4
|
+
|
5
|
+
# Makes all symbols private by default to avoid unintended conflict
|
6
|
+
# with other gems. To explicitly export symbols you can use RUBY_FUNC_EXPORTED
|
7
|
+
# selectively, or entirely remove this flag.
|
8
|
+
append_cflags("-fvisibility=hidden")
|
9
|
+
|
10
|
+
create_makefile(<%= config[:makefile_path].inspect %>)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
use magnus::{function, prelude::*, Error, Ruby};
|
2
|
+
|
3
|
+
fn hello(subject: String) -> String {
|
4
|
+
format!("Hello from Rust, {subject}!")
|
5
|
+
}
|
6
|
+
|
7
|
+
#[magnus::init]
|
8
|
+
fn init(ruby: &Ruby) -> Result<(), Error> {
|
9
|
+
let module = ruby.<%= config[:constant_array].map {|c| "define_module(#{c.dump})?"}.join(".") %>;
|
10
|
+
module.define_singleton_method("hello", function!(hello, 1))?;
|
11
|
+
Ok(())
|
12
|
+
}
|
@@ -10,18 +10,28 @@ on:
|
|
10
10
|
jobs:
|
11
11
|
build:
|
12
12
|
runs-on: ubuntu-latest
|
13
|
-
|
13
|
+
name: Ruby ${{ matrix.ruby }}
|
14
14
|
strategy:
|
15
15
|
matrix:
|
16
16
|
ruby:
|
17
|
-
- <%= RUBY_VERSION %>
|
17
|
+
- '<%= RUBY_VERSION %>'
|
18
18
|
|
19
19
|
steps:
|
20
|
-
- uses: actions/checkout@
|
20
|
+
- uses: actions/checkout@v4
|
21
|
+
<%- if config[:ext] == 'rust' -%>
|
22
|
+
- name: Set up Ruby & Rust
|
23
|
+
uses: oxidize-rb/actions/setup-ruby-and-rust@v1
|
24
|
+
with:
|
25
|
+
ruby-version: ${{ matrix.ruby }}
|
26
|
+
bundler-cache: true
|
27
|
+
cargo-cache: true
|
28
|
+
rubygems: '<%= ::Gem.rubygems_version %>'
|
29
|
+
<%- else -%>
|
21
30
|
- name: Set up Ruby
|
22
31
|
uses: ruby/setup-ruby@v1
|
23
32
|
with:
|
24
33
|
ruby-version: ${{ matrix.ruby }}
|
25
34
|
bundler-cache: true
|
35
|
+
<%- end -%>
|
26
36
|
- name: Run the default task
|
27
37
|
run: bundle exec rake
|
@@ -1,9 +1,18 @@
|
|
1
|
-
|
1
|
+
default:
|
2
|
+
image: ruby:<%= RUBY_VERSION %>
|
2
3
|
|
3
|
-
before_script:
|
4
|
-
|
5
|
-
|
4
|
+
before_script:
|
5
|
+
<%- if config[:ext] == 'rust' -%>
|
6
|
+
- apt-get update && apt-get install -y clang
|
7
|
+
- gem update --system '<%= ::Gem.rubygems_version %>'
|
8
|
+
<%- end -%>
|
9
|
+
- gem install bundler -v <%= Bundler::VERSION %>
|
10
|
+
- bundle install
|
6
11
|
|
7
12
|
example_job:
|
13
|
+
<%- if config[:ext] == 'rust' -%>
|
14
|
+
variables:
|
15
|
+
RB_SYS_FORCE_INSTALL_RUST_TOOLCHAIN: 'true'
|
16
|
+
<%- end -%>
|
8
17
|
script:
|
9
18
|
- bundle exec rake
|
@@ -3,18 +3,21 @@
|
|
3
3
|
require_relative "lib/<%=config[:namespaced_path]%>/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name
|
7
|
-
spec.version
|
8
|
-
spec.authors
|
9
|
-
spec.email
|
10
|
-
|
11
|
-
spec.summary
|
12
|
-
spec.description
|
13
|
-
spec.homepage
|
6
|
+
spec.name = <%= config[:name].inspect %>
|
7
|
+
spec.version = <%= config[:constant_name] %>::VERSION
|
8
|
+
spec.authors = [<%= config[:author].inspect %>]
|
9
|
+
spec.email = [<%= config[:email].inspect %>]
|
10
|
+
|
11
|
+
spec.summary = "TODO: Write a short summary, because RubyGems requires one."
|
12
|
+
spec.description = "TODO: Write a longer description or delete this line."
|
13
|
+
spec.homepage = "TODO: Put your gem's website or public repo URL here."
|
14
14
|
<%- if config[:mit] -%>
|
15
|
-
spec.license
|
15
|
+
spec.license = "MIT"
|
16
16
|
<%- end -%>
|
17
17
|
spec.required_ruby_version = ">= <%= config[:required_ruby_version] %>"
|
18
|
+
<%- if config[:ext] == 'rust' -%>
|
19
|
+
spec.required_rubygems_version = ">= <%= config[:rust_builder_required_rubygems_version] %>"
|
20
|
+
<%- end -%>
|
18
21
|
|
19
22
|
spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
20
23
|
|
@@ -24,21 +27,26 @@ Gem::Specification.new do |spec|
|
|
24
27
|
|
25
28
|
# Specify which files should be added to the gem when it is released.
|
26
29
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
+
gemspec = File.basename(__FILE__)
|
31
|
+
spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
|
32
|
+
ls.readlines("\x0", chomp: true).reject do |f|
|
33
|
+
(f == gemspec) ||
|
34
|
+
f.start_with?(*%w[bin/ test/ spec/ features/ .git <%= config[:ci_config_path] %>appveyor Gemfile])
|
30
35
|
end
|
31
36
|
end
|
32
|
-
spec.bindir
|
33
|
-
spec.executables
|
37
|
+
spec.bindir = "exe"
|
38
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
34
39
|
spec.require_paths = ["lib"]
|
35
|
-
<%- if config[:ext] -%>
|
36
|
-
spec.extensions
|
40
|
+
<%- if config[:ext] == 'c' -%>
|
41
|
+
spec.extensions = ["ext/<%= config[:underscored_name] %>/extconf.rb"]
|
42
|
+
<%- end -%>
|
43
|
+
<%- if config[:ext] == 'rust' -%>
|
44
|
+
spec.extensions = ["ext/<%= config[:underscored_name] %>/Cargo.toml"]
|
37
45
|
<%- end -%>
|
38
46
|
|
39
47
|
# Uncomment to register a new dependency of your gem
|
40
48
|
# spec.add_dependency "example-gem", "~> 1.0"
|
41
49
|
|
42
|
-
# For more information and examples about making a new gem,
|
50
|
+
# For more information and examples about making a new gem, check out our
|
43
51
|
# guide at: https://bundler.io/guides/creating_gem.html
|
44
52
|
end
|
@@ -2,12 +2,7 @@ AllCops:
|
|
2
2
|
TargetRubyVersion: <%= ::Gem::Version.new(config[:required_ruby_version]).segments[0..1].join(".") %>
|
3
3
|
|
4
4
|
Style/StringLiterals:
|
5
|
-
Enabled: true
|
6
5
|
EnforcedStyle: double_quotes
|
7
6
|
|
8
7
|
Style/StringLiteralsInInterpolation:
|
9
|
-
Enabled: true
|
10
8
|
EnforcedStyle: double_quotes
|
11
|
-
|
12
|
-
Layout/LineLength:
|
13
|
-
Max: 120
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%- config[:constant_array].each_with_index do |c, i| -%>
|
2
|
+
<%= " " * i %>module <%= c %>
|
3
|
+
<%- end -%>
|
4
|
+
<%= " " * config[:constant_array].size %>VERSION: String
|
5
|
+
<%= " " * config[:constant_array].size %># See the writing guide of rbs: https://github.com/ruby/rbs#guides
|
6
|
+
<%- (config[:constant_array].size-1).downto(0) do |i| -%>
|
7
|
+
<%= " " * i %>end
|
8
|
+
<%- end -%>
|
data/lib/bundler/ui/rg_proxy.rb
CHANGED
data/lib/bundler/ui/shell.rb
CHANGED
@@ -20,29 +20,52 @@ module Bundler
|
|
20
20
|
@shell.set_color(string, *color)
|
21
21
|
end
|
22
22
|
|
23
|
-
def info(msg, newline = nil)
|
24
|
-
|
23
|
+
def info(msg = nil, newline = nil)
|
24
|
+
return unless info?
|
25
|
+
|
26
|
+
tell_me(msg || yield, nil, newline)
|
25
27
|
end
|
26
28
|
|
27
|
-
def confirm(msg, newline = nil)
|
28
|
-
|
29
|
+
def confirm(msg = nil, newline = nil)
|
30
|
+
return unless confirm?
|
31
|
+
|
32
|
+
tell_me(msg || yield, :green, newline)
|
29
33
|
end
|
30
34
|
|
31
|
-
def warn(msg, newline = nil, color = :yellow)
|
32
|
-
return unless
|
35
|
+
def warn(msg = nil, newline = nil, color = :yellow)
|
36
|
+
return unless warn?
|
33
37
|
return if @warning_history.include? msg
|
34
38
|
@warning_history << msg
|
35
39
|
|
36
|
-
tell_err(msg, color, newline)
|
40
|
+
tell_err(msg || yield, color, newline)
|
41
|
+
end
|
42
|
+
|
43
|
+
def error(msg = nil, newline = nil, color = :red)
|
44
|
+
return unless error?
|
45
|
+
|
46
|
+
tell_err(msg || yield, color, newline)
|
47
|
+
end
|
48
|
+
|
49
|
+
def debug(msg = nil, newline = nil)
|
50
|
+
return unless debug?
|
51
|
+
|
52
|
+
tell_me(msg || yield, nil, newline)
|
53
|
+
end
|
54
|
+
|
55
|
+
def info?
|
56
|
+
level("info")
|
57
|
+
end
|
58
|
+
|
59
|
+
def confirm?
|
60
|
+
level("confirm")
|
37
61
|
end
|
38
62
|
|
39
|
-
def
|
40
|
-
|
41
|
-
tell_err(msg, color, newline)
|
63
|
+
def warn?
|
64
|
+
level("warn")
|
42
65
|
end
|
43
66
|
|
44
|
-
def
|
45
|
-
|
67
|
+
def error?
|
68
|
+
level("error")
|
46
69
|
end
|
47
70
|
|
48
71
|
def debug?
|
@@ -81,7 +104,7 @@ module Bundler
|
|
81
104
|
def trace(e, newline = nil, force = false)
|
82
105
|
return unless debug? || force
|
83
106
|
msg = "#{e.class}: #{e.message}\n#{e.backtrace.join("\n ")}"
|
84
|
-
|
107
|
+
tell_err(msg, nil, newline)
|
85
108
|
end
|
86
109
|
|
87
110
|
def silence(&blk)
|
@@ -107,7 +130,7 @@ module Bundler
|
|
107
130
|
def tell_err(message, color = nil, newline = nil)
|
108
131
|
return if @shell.send(:stderr).closed?
|
109
132
|
|
110
|
-
newline ||= message.to_s
|
133
|
+
newline ||= !message.to_s.match?(/( |\t)\Z/)
|
111
134
|
message = word_wrap(message) if newline.is_a?(Hash) && newline[:wrap]
|
112
135
|
|
113
136
|
color = nil if color && !$stderr.tty?
|
@@ -124,7 +147,7 @@ module Bundler
|
|
124
147
|
spaces ? text.gsub(/#{spaces}/, "") : text
|
125
148
|
end
|
126
149
|
|
127
|
-
def word_wrap(text, line_width =
|
150
|
+
def word_wrap(text, line_width = Thor::Terminal.terminal_width)
|
128
151
|
strip_leading_spaces(text).split("\n").collect do |line|
|
129
152
|
line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n").strip : line
|
130
153
|
end * "\n"
|