diff --git a/Manifest.txt b/Manifest.txt index 1a12196bdb29..b4231cbdfc1f 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -209,11 +209,12 @@ bundler/lib/bundler/templates/Executable bundler/lib/bundler/templates/Executable.standalone bundler/lib/bundler/templates/Gemfile bundler/lib/bundler/templates/newgem/CHANGELOG.md.tt -bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +bundler/lib/bundler/templates/newgem/CONTRIBUTOR_COVENANT_CODE_OF_CONDUCT.md.tt bundler/lib/bundler/templates/newgem/Cargo.toml.tt bundler/lib/bundler/templates/newgem/Gemfile.tt bundler/lib/bundler/templates/newgem/LICENSE.txt.tt bundler/lib/bundler/templates/newgem/README.md.tt +bundler/lib/bundler/templates/newgem/RUBY_SRC_CODE_OF_CONDUCT.md.tt bundler/lib/bundler/templates/newgem/Rakefile.tt bundler/lib/bundler/templates/newgem/bin/console.tt bundler/lib/bundler/templates/newgem/bin/setup.tt diff --git a/bundler/lib/bundler/cli.rb b/bundler/lib/bundler/cli.rb index 1f6a65ca57ae..2ffe9aaddd88 100644 --- a/bundler/lib/bundler/cli.rb +++ b/bundler/lib/bundler/cli.rb @@ -12,6 +12,7 @@ class CLI < Thor AUTO_INSTALL_CMDS = %w[show binstubs outdated exec open console licenses clean].freeze PARSEABLE_COMMANDS = %w[check config help exec platform show version].freeze EXTENSIONS = ["c", "rust", "go"].freeze + COC_OPTIONS = %w[contributor-covenant ruby none].freeze COMMAND_ALIASES = { "check" => "c", @@ -567,7 +568,7 @@ def viz desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem" method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], banner: "Generate a binary executable for your library." - method_option :coc, type: :boolean, banner: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`." + method_option :coc, type: :string, lazy_default: (COC_OPTIONS.include?(Bundler.settings["gem.coc"]) ? Bundler.settings["gem.coc"] : ""), enum: COC_OPTIONS, banner: "Generate a code of conduct file, either Contributor Covenant, Ruby, or none. Set a default with `bundle config set --global gem.coc (contributor-covenant|ruby|none)`" method_option :edit, type: :string, aliases: "-e", required: false, lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, banner: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)" method_option :ext, type: :string, banner: "Generate the boilerplate for C extension code.", enum: EXTENSIONS method_option :git, type: :boolean, default: true, banner: "Initialize a git repo inside your library." diff --git a/bundler/lib/bundler/cli/gem.rb b/bundler/lib/bundler/cli/gem.rb index 236ce530eccb..4a06ed775a0e 100644 --- a/bundler/lib/bundler/cli/gem.rb +++ b/bundler/lib/bundler/cli/gem.rb @@ -176,13 +176,18 @@ def run templates.merge!("LICENSE.txt.tt" => "LICENSE.txt") end - if ask_and_set(:coc, "Do you want to include a code of conduct in gems you generate?", - "Codes of conduct can increase contributions to your project by contributors who " \ - "prefer safe, respectful, productive, and collaborative spaces. \n" \ - "See https://github.com/ruby/rubygems/blob/master/CODE_OF_CONDUCT.md") + coc_template = ask_and_set_coc + case coc_template + when "contributor-covenant" config[:coc] = true - Bundler.ui.info "Code of conduct enabled in config" - templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md") + Bundler.ui.info "Contributor Covenant enabled in config" + templates.merge!("CONTRIBUTOR_COVENANT_CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md") + when "ruby" + config[:coc] = true + Bundler.ui.info "Ruby Community Conduct Guideline enabled in config" + templates.merge!("RUBY_SRC_CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md") + when "none" + config[:coc] = false end if ask_and_set(:changelog, "Do you want to include a changelog?", @@ -387,6 +392,59 @@ def ask_and_set_ci ci_template end + def ask_and_set_coc + return "none" if skip?(:coc) + coc_template = options[:coc] || Bundler.settings["gem.coc"] + + # Handle backwards compatibility: if the old boolean `false` value is set, + # silently migrate to the new `none` value and honor the setting + if coc_template.to_s == "false" + Bundler.settings.set_global("gem.coc", "none") + return "none" + end + + # Handle backwards compatibility: if the old boolean `true` value is set, + # prompt the user to choose a specific code of conduct + if coc_template.to_s == "true" + Bundler.ui.info "\nYour gem.coc setting is configured to `true`, but `bundle gem` now supports " \ + "multiple codes of conduct. Please select which code of conduct you'd like to use:\n" \ + "* Contributor Covenant: https://www.contributor-covenant.org/\n" \ + "* Ruby: https://www.ruby-lang.org/en/conduct/\n" + Bundler.ui.info "Your choice will update the global gem.coc setting." + + coc_template = prompt_coc_selection + Bundler.settings.set_global("gem.coc", coc_template) + elsif coc_template.to_s.empty? + Bundler.ui.info "\nDo you want to include a code of conduct in gems you generate? " \ + "Codes of conduct can increase contributions to your project by contributors who " \ + "prefer safe, respectful, productive, and collaborative spaces.\n" \ + "Supported codes of conduct:\n" \ + "* Contributor Covenant: https://www.contributor-covenant.org/\n" \ + "* Ruby: https://www.ruby-lang.org/en/conduct/\n" + Bundler.ui.info hint_text("coc") + + coc_template = prompt_coc_selection + + if Bundler.settings["gem.coc"].nil? + Bundler.settings.set_global("gem.coc", coc_template) + end + end + + if options[:coc] && !options[:coc].empty? && options[:coc] == Bundler.settings["gem.coc"] + Bundler.ui.info "Using configured code of conduct: #{options[:coc]}" + end + + coc_template + end + + def prompt_coc_selection + result = Bundler.ui.ask "Enter a code of conduct. contributor-covenant/ruby/(none):" + return result if %w[contributor-covenant ruby].include?(result) + + Bundler.ui.info "Unrecognized input, skipping code of conduct" unless result.to_s.empty? || result == "none" + "none" + end + def ask_and_set_linter return if skip?(:linter) linter_template = options[:linter] || Bundler.settings["gem.linter"] diff --git a/bundler/lib/bundler/man/bundle-add.1 b/bundler/lib/bundler/man/bundle-add.1 index 4474969db608..a95b1d2da2ec 100644 --- a/bundler/lib/bundler/man/bundle-add.1 +++ b/bundler/lib/bundler/man/bundle-add.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-ADD" "1" "September 2025" "" +.TH "BUNDLE\-ADD" "1" "January 2026" "" .SH "NAME" \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-binstubs.1 b/bundler/lib/bundler/man/bundle-binstubs.1 index b8c153696bba..8d563c4944ad 100644 --- a/bundler/lib/bundler/man/bundle-binstubs.1 +++ b/bundler/lib/bundler/man/bundle-binstubs.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-BINSTUBS" "1" "September 2025" "" +.TH "BUNDLE\-BINSTUBS" "1" "January 2026" "" .SH "NAME" \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-cache.1 b/bundler/lib/bundler/man/bundle-cache.1 index c1dafbf07052..5eed6c437a9e 100644 --- a/bundler/lib/bundler/man/bundle-cache.1 +++ b/bundler/lib/bundler/man/bundle-cache.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-CACHE" "1" "September 2025" "" +.TH "BUNDLE\-CACHE" "1" "January 2026" "" .SH "NAME" \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-check.1 b/bundler/lib/bundler/man/bundle-check.1 index f83af1eb5577..67cac1baf4a6 100644 --- a/bundler/lib/bundler/man/bundle-check.1 +++ b/bundler/lib/bundler/man/bundle-check.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-CHECK" "1" "September 2025" "" +.TH "BUNDLE\-CHECK" "1" "January 2026" "" .SH "NAME" \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-clean.1 b/bundler/lib/bundler/man/bundle-clean.1 index c4d148c5df83..a42bdc53db5b 100644 --- a/bundler/lib/bundler/man/bundle-clean.1 +++ b/bundler/lib/bundler/man/bundle-clean.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-CLEAN" "1" "September 2025" "" +.TH "BUNDLE\-CLEAN" "1" "January 2026" "" .SH "NAME" \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-config.1 b/bundler/lib/bundler/man/bundle-config.1 index 05c13e2d0f32..bbb838eab4e0 100644 --- a/bundler/lib/bundler/man/bundle-config.1 +++ b/bundler/lib/bundler/man/bundle-config.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-CONFIG" "1" "September 2025" "" +.TH "BUNDLE\-CONFIG" "1" "January 2026" "" .SH "NAME" \fBbundle\-config\fR \- Set bundler configuration options .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-console.1 b/bundler/lib/bundler/man/bundle-console.1 index 5ab15668be7b..6112a5faab32 100644 --- a/bundler/lib/bundler/man/bundle-console.1 +++ b/bundler/lib/bundler/man/bundle-console.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-CONSOLE" "1" "September 2025" "" +.TH "BUNDLE\-CONSOLE" "1" "January 2026" "" .SH "NAME" \fBbundle\-console\fR \- Open an IRB session with the bundle pre\-loaded .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-doctor.1 b/bundler/lib/bundler/man/bundle-doctor.1 index a0329dfc4813..f1b7473688ad 100644 --- a/bundler/lib/bundler/man/bundle-doctor.1 +++ b/bundler/lib/bundler/man/bundle-doctor.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-DOCTOR" "1" "September 2025" "" +.TH "BUNDLE\-DOCTOR" "1" "January 2026" "" .SH "NAME" \fBbundle\-doctor\fR \- Checks the bundle for common problems .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-env.1 b/bundler/lib/bundler/man/bundle-env.1 index eee3ca05d0c6..ed4066fd206c 100644 --- a/bundler/lib/bundler/man/bundle-env.1 +++ b/bundler/lib/bundler/man/bundle-env.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-ENV" "1" "September 2025" "" +.TH "BUNDLE\-ENV" "1" "January 2026" "" .SH "NAME" \fBbundle\-env\fR \- Print information about the environment Bundler is running under .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-exec.1 b/bundler/lib/bundler/man/bundle-exec.1 index 24c84889b5bf..11f2d524a2dc 100644 --- a/bundler/lib/bundler/man/bundle-exec.1 +++ b/bundler/lib/bundler/man/bundle-exec.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-EXEC" "1" "September 2025" "" +.TH "BUNDLE\-EXEC" "1" "January 2026" "" .SH "NAME" \fBbundle\-exec\fR \- Execute a command in the context of the bundle .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-fund.1 b/bundler/lib/bundler/man/bundle-fund.1 index fe24a25ca12c..62d8262fa6ad 100644 --- a/bundler/lib/bundler/man/bundle-fund.1 +++ b/bundler/lib/bundler/man/bundle-fund.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-FUND" "1" "September 2025" "" +.TH "BUNDLE\-FUND" "1" "January 2026" "" .SH "NAME" \fBbundle\-fund\fR \- Lists information about gems seeking funding assistance .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-gem.1 b/bundler/lib/bundler/man/bundle-gem.1 index 85c0f57674a4..a0157e2e2420 100644 --- a/bundler/lib/bundler/man/bundle-gem.1 +++ b/bundler/lib/bundler/man/bundle-gem.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-GEM" "1" "September 2025" "" +.TH "BUNDLE\-GEM" "1" "January 2026" "" .SH "NAME" \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem .SH "SYNOPSIS" @@ -26,8 +26,14 @@ Specify that Bundler should create a binary executable (as \fBexe/GEM_NAME\fR) i \fB\-\-no\-exe\fR Do not create a binary (overrides \fB\-\-exe\fR specified in the global config)\. .TP -\fB\-\-coc\fR -Add a \fBCODE_OF_CONDUCT\.md\fR file to the root of the generated project\. If this option is unspecified, an interactive prompt will be displayed and the answer will be saved in Bundler's global config for future \fBbundle gem\fR use\. +\fB\-\-coc\fR, \fB\-\-coc=contributor\-covenant\fR, \fB\-\-coc=none\fR, \fB\-\-coc=ruby\fR +Specify the code of conduct that Bundler should use when generating the project\. Acceptable values are \fBcontributor\-covenant\fR, \fBruby\fR, and \fBnone\fR\. A \fBCODE_OF_CONDUCT\.md\fR file will be generated in the project directory unless \fBnone\fR is specified\. If no option is specified: +.IP +When Bundler is configured to generate a code of conduct, this defaults to Bundler's global config setting \fBgem\.coc\fR\. +.IP +When Bundler is configured to not generate a code of conduct, an interactive prompt will be displayed and the answer will be used for the current rubygem project\. +.IP +When Bundler is unconfigured, an interactive prompt will be displayed and the answer will be saved in Bundler's global config for future \fBbundle gem\fR use\. .TP \fB\-\-no\-coc\fR Do not create a \fBCODE_OF_CONDUCT\.md\fR (overrides \fB\-\-coc\fR specified in the global config)\. diff --git a/bundler/lib/bundler/man/bundle-gem.1.ronn b/bundler/lib/bundler/man/bundle-gem.1.ronn index 488c8113e4f2..b15c20dd6486 100644 --- a/bundler/lib/bundler/man/bundle-gem.1.ronn +++ b/bundler/lib/bundler/man/bundle-gem.1.ronn @@ -32,10 +32,22 @@ configuration file using the following names: * `--no-exe`: Do not create a binary (overrides `--exe` specified in the global config). -* `--coc`: - Add a `CODE_OF_CONDUCT.md` file to the root of the generated project. If - this option is unspecified, an interactive prompt will be displayed and the - answer will be saved in Bundler's global config for future `bundle gem` use. +* `--coc`, `--coc=contributor-covenant`, `--coc=none`, `--coc=ruby`: + Specify the code of conduct that Bundler should use when generating the + project. Acceptable values are `contributor-covenant`, `ruby`, and `none`. + A `CODE_OF_CONDUCT.md` file will be generated in the project directory + unless `none` is specified. If no option is specified: + + When Bundler is configured to generate a code of conduct, this defaults to + Bundler's global config setting `gem.coc`. + + When Bundler is configured to not generate a code of conduct, an interactive + prompt will be displayed and the answer will be used for the current rubygem + project. + + When Bundler is unconfigured, an interactive prompt will be displayed and + the answer will be saved in Bundler's global config for future `bundle gem` + use. * `--no-coc`: Do not create a `CODE_OF_CONDUCT.md` (overrides `--coc` specified in the diff --git a/bundler/lib/bundler/man/bundle-help.1 b/bundler/lib/bundler/man/bundle-help.1 index 05fd5a7c4844..ae3ebde74ca6 100644 --- a/bundler/lib/bundler/man/bundle-help.1 +++ b/bundler/lib/bundler/man/bundle-help.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-HELP" "1" "September 2025" "" +.TH "BUNDLE\-HELP" "1" "January 2026" "" .SH "NAME" \fBbundle\-help\fR \- Displays detailed help for each subcommand .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-info.1 b/bundler/lib/bundler/man/bundle-info.1 index 96c7d876f64a..275d51ddc119 100644 --- a/bundler/lib/bundler/man/bundle-info.1 +++ b/bundler/lib/bundler/man/bundle-info.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-INFO" "1" "September 2025" "" +.TH "BUNDLE\-INFO" "1" "January 2026" "" .SH "NAME" \fBbundle\-info\fR \- Show information for the given gem in your bundle .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-init.1 b/bundler/lib/bundler/man/bundle-init.1 index 83dad5c050bf..aeee76e23c8a 100644 --- a/bundler/lib/bundler/man/bundle-init.1 +++ b/bundler/lib/bundler/man/bundle-init.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-INIT" "1" "September 2025" "" +.TH "BUNDLE\-INIT" "1" "January 2026" "" .SH "NAME" \fBbundle\-init\fR \- Generates a Gemfile into the current working directory .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-install.1 b/bundler/lib/bundler/man/bundle-install.1 index 68530f3ebb58..3ef4ed71c3b9 100644 --- a/bundler/lib/bundler/man/bundle-install.1 +++ b/bundler/lib/bundler/man/bundle-install.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-INSTALL" "1" "September 2025" "" +.TH "BUNDLE\-INSTALL" "1" "January 2026" "" .SH "NAME" \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-issue.1 b/bundler/lib/bundler/man/bundle-issue.1 index 394d6c546910..81dfa1b34b2b 100644 --- a/bundler/lib/bundler/man/bundle-issue.1 +++ b/bundler/lib/bundler/man/bundle-issue.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-ISSUE" "1" "September 2025" "" +.TH "BUNDLE\-ISSUE" "1" "January 2026" "" .SH "NAME" \fBbundle\-issue\fR \- Get help reporting Bundler issues .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-licenses.1 b/bundler/lib/bundler/man/bundle-licenses.1 index 2931e42dd7e8..61ec53ac13e6 100644 --- a/bundler/lib/bundler/man/bundle-licenses.1 +++ b/bundler/lib/bundler/man/bundle-licenses.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-LICENSES" "1" "September 2025" "" +.TH "BUNDLE\-LICENSES" "1" "January 2026" "" .SH "NAME" \fBbundle\-licenses\fR \- Print the license of all gems in the bundle .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-list.1 b/bundler/lib/bundler/man/bundle-list.1 index d8bcf20585a4..6095e3af96d4 100644 --- a/bundler/lib/bundler/man/bundle-list.1 +++ b/bundler/lib/bundler/man/bundle-list.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-LIST" "1" "September 2025" "" +.TH "BUNDLE\-LIST" "1" "January 2026" "" .SH "NAME" \fBbundle\-list\fR \- List all the gems in the bundle .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-lock.1 b/bundler/lib/bundler/man/bundle-lock.1 index 478d17353507..e00970b8ac6f 100644 --- a/bundler/lib/bundler/man/bundle-lock.1 +++ b/bundler/lib/bundler/man/bundle-lock.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-LOCK" "1" "September 2025" "" +.TH "BUNDLE\-LOCK" "1" "January 2026" "" .SH "NAME" \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-open.1 b/bundler/lib/bundler/man/bundle-open.1 index 2f13b1329fc1..e25014a38a9b 100644 --- a/bundler/lib/bundler/man/bundle-open.1 +++ b/bundler/lib/bundler/man/bundle-open.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-OPEN" "1" "September 2025" "" +.TH "BUNDLE\-OPEN" "1" "January 2026" "" .SH "NAME" \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-outdated.1 b/bundler/lib/bundler/man/bundle-outdated.1 index 7e10d202bedf..4ea9d75e547d 100644 --- a/bundler/lib/bundler/man/bundle-outdated.1 +++ b/bundler/lib/bundler/man/bundle-outdated.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-OUTDATED" "1" "September 2025" "" +.TH "BUNDLE\-OUTDATED" "1" "January 2026" "" .SH "NAME" \fBbundle\-outdated\fR \- List installed gems with newer versions available .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-platform.1 b/bundler/lib/bundler/man/bundle-platform.1 index 6a3a08c3a93a..f72690ef71c3 100644 --- a/bundler/lib/bundler/man/bundle-platform.1 +++ b/bundler/lib/bundler/man/bundle-platform.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-PLATFORM" "1" "September 2025" "" +.TH "BUNDLE\-PLATFORM" "1" "January 2026" "" .SH "NAME" \fBbundle\-platform\fR \- Displays platform compatibility information .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-plugin.1 b/bundler/lib/bundler/man/bundle-plugin.1 index 25da56247598..9d28dd59ed51 100644 --- a/bundler/lib/bundler/man/bundle-plugin.1 +++ b/bundler/lib/bundler/man/bundle-plugin.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-PLUGIN" "1" "September 2025" "" +.TH "BUNDLE\-PLUGIN" "1" "January 2026" "" .SH "NAME" \fBbundle\-plugin\fR \- Manage Bundler plugins .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-pristine.1 b/bundler/lib/bundler/man/bundle-pristine.1 index a8316b5cca1e..96f1daebd4e3 100644 --- a/bundler/lib/bundler/man/bundle-pristine.1 +++ b/bundler/lib/bundler/man/bundle-pristine.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-PRISTINE" "1" "September 2025" "" +.TH "BUNDLE\-PRISTINE" "1" "January 2026" "" .SH "NAME" \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-remove.1 b/bundler/lib/bundler/man/bundle-remove.1 index 4dc7a03b9f5d..46858e139202 100644 --- a/bundler/lib/bundler/man/bundle-remove.1 +++ b/bundler/lib/bundler/man/bundle-remove.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-REMOVE" "1" "September 2025" "" +.TH "BUNDLE\-REMOVE" "1" "January 2026" "" .SH "NAME" \fBbundle\-remove\fR \- Removes gems from the Gemfile .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-show.1 b/bundler/lib/bundler/man/bundle-show.1 index 901460962cfe..4efea5397209 100644 --- a/bundler/lib/bundler/man/bundle-show.1 +++ b/bundler/lib/bundler/man/bundle-show.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-SHOW" "1" "September 2025" "" +.TH "BUNDLE\-SHOW" "1" "January 2026" "" .SH "NAME" \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-update.1 b/bundler/lib/bundler/man/bundle-update.1 index 2f9932dc1e5e..b74e494a1228 100644 --- a/bundler/lib/bundler/man/bundle-update.1 +++ b/bundler/lib/bundler/man/bundle-update.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-UPDATE" "1" "September 2025" "" +.TH "BUNDLE\-UPDATE" "1" "January 2026" "" .SH "NAME" \fBbundle\-update\fR \- Update your gems to the latest available versions .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-version.1 b/bundler/lib/bundler/man/bundle-version.1 index 6462ec795832..1aa60e3b4748 100644 --- a/bundler/lib/bundler/man/bundle-version.1 +++ b/bundler/lib/bundler/man/bundle-version.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-VERSION" "1" "September 2025" "" +.TH "BUNDLE\-VERSION" "1" "January 2026" "" .SH "NAME" \fBbundle\-version\fR \- Prints Bundler version information .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle.1 b/bundler/lib/bundler/man/bundle.1 index 9f7feb4133d7..a7e16f278341 100644 --- a/bundler/lib/bundler/man/bundle.1 +++ b/bundler/lib/bundler/man/bundle.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE" "1" "September 2025" "" +.TH "BUNDLE" "1" "January 2026" "" .SH "NAME" \fBbundle\fR \- Ruby Dependency Management .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/gemfile.5 b/bundler/lib/bundler/man/gemfile.5 index a8c055a0c1a4..19fedb7f14dd 100644 --- a/bundler/lib/bundler/man/gemfile.5 +++ b/bundler/lib/bundler/man/gemfile.5 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "GEMFILE" "5" "September 2025" "" +.TH "GEMFILE" "5" "January 2026" "" .SH "NAME" \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/settings.rb b/bundler/lib/bundler/settings.rb index d00a4bb916f6..9715ad9b75d9 100644 --- a/bundler/lib/bundler/settings.rb +++ b/bundler/lib/bundler/settings.rb @@ -21,7 +21,6 @@ class Settings force_ruby_platform frozen gem.changelog - gem.coc gem.mit gem.bundle git.allow_insecure @@ -60,6 +59,7 @@ class Settings cache_path console gem.ci + gem.coc gem.github_username gem.linter gem.rubocop diff --git a/bundler/lib/bundler/templates/newgem/CONTRIBUTOR_COVENANT_CODE_OF_CONDUCT.md.tt b/bundler/lib/bundler/templates/newgem/CONTRIBUTOR_COVENANT_CODE_OF_CONDUCT.md.tt new file mode 100644 index 000000000000..79c5fd33bcde --- /dev/null +++ b/bundler/lib/bundler/templates/newgem/CONTRIBUTOR_COVENANT_CODE_OF_CONDUCT.md.tt @@ -0,0 +1,88 @@ +# Contributor Covenant 3.0 Code of Conduct + +## Our Pledge + +We pledge to make our community welcoming, safe, and equitable for all. + +We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant. + +## Encouraged Behaviors + +While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language. + +With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including: + +1. Respecting the **purpose of our community**, our activities, and our ways of gathering. +2. Engaging **kindly and honestly** with others. +3. Respecting **different viewpoints** and experiences. +4. **Taking responsibility** for our actions and contributions. +5. Gracefully giving and accepting **constructive feedback**. +6. Committing to **repairing harm** when it occurs. +7. Behaving in other ways that promote and sustain the **well-being of our community**. + + +## Restricted Behaviors + +We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct. + +1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop. +2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people. +3. **Stereotyping or discrimination.** Characterizing anyone's personality or behavior on the basis of immutable identities or traits. +4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community. +5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission. +6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group. +7. Behaving in other ways that **threaten the well-being** of our community. + +### Other Restrictions + +1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions. +2. **Failing to credit sources.** Not properly crediting the sources of content you contribute. +3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community. +4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors. + + +## Reporting an Issue + +Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm. + +When an incident does occur, it is important to report it promptly. To report a possible violation, contact us at [<%= config[:email] %>](mailto:<%= config[:email] %>). + +Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution. + + +## Addressing and Repairing Harm + +If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped. + +1) Warning + 1) Event: A violation involving a single incident or series of incidents. + 2) Consequence: A private, written warning from the Community Moderators. + 3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations. +2) Temporarily Limited Activities + 1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation. + 2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members. + 3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over. +3) Temporary Suspension + 1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation. + 2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions. + 3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted. +4) Permanent Ban + 1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member. + 2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior. + 3) Repair: There is no possible repair in cases of this severity. + +This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community. + + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/). + +Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/) + +For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla's code of conduct team](https://github.com/mozilla/inclusion). diff --git a/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt b/bundler/lib/bundler/templates/newgem/RUBY_SRC_CODE_OF_CONDUCT.md.tt similarity index 100% rename from bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt rename to bundler/lib/bundler/templates/newgem/RUBY_SRC_CODE_OF_CONDUCT.md.tt diff --git a/bundler/spec/commands/newgem_spec.rb b/bundler/spec/commands/newgem_spec.rb index 06c226f9e56a..f67dfdf90566 100644 --- a/bundler/spec/commands/newgem_spec.rb +++ b/bundler/spec/commands/newgem_spec.rb @@ -105,28 +105,44 @@ def installed_go? end end - shared_examples_for "--coc flag" do - it "generates a gem skeleton with MIT license" do - bundle "gem #{gem_name} --coc" + shared_examples_for "--coc=ruby flag" do + it "generates a gem skeleton with Ruby Community Conduct Guideline" do + bundle "gem #{gem_name} --coc=ruby" gem_skeleton_assertions expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md")).to exist + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md").read).to include("Ruby Community Conduct Guideline") end it "generates the README with a section for the Code of Conduct" do - bundle "gem #{gem_name} --coc" + bundle "gem #{gem_name} --coc=ruby" expect(bundled_app("#{gem_name}/README.md").read).to include("## Code of Conduct") expect(bundled_app("#{gem_name}/README.md").read).to match(%r{https://github\.com/bundleuser/#{gem_name}/blob/.*/CODE_OF_CONDUCT.md}) end it "generates the README with a section for the Code of Conduct, respecting the configured git default branch", git: ">= 2.28.0" do git("config --global init.defaultBranch main") - bundle "gem #{gem_name} --coc" + bundle "gem #{gem_name} --coc=ruby" expect(bundled_app("#{gem_name}/README.md").read).to include("## Code of Conduct") expect(bundled_app("#{gem_name}/README.md").read).to include("https://github.com/bundleuser/#{gem_name}/blob/main/CODE_OF_CONDUCT.md") end end + shared_examples_for "--coc=contributor-covenant flag" do + it "generates a gem skeleton with Contributor Covenant" do + bundle "gem #{gem_name} --coc=contributor-covenant" + gem_skeleton_assertions + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md")).to exist + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md").read).to include("Contributor Covenant") + end + + it "generates the README with a section for the Code of Conduct" do + bundle "gem #{gem_name} --coc=contributor-covenant" + expect(bundled_app("#{gem_name}/README.md").read).to include("## Code of Conduct") + expect(bundled_app("#{gem_name}/README.md").read).to match(%r{https://github\.com/bundleuser/#{gem_name}/blob/.*/CODE_OF_CONDUCT.md}) + end + end + shared_examples_for "--no-coc flag" do before do bundle "gem #{gem_name} --no-coc" @@ -1168,6 +1184,185 @@ def create_temporary_dir(dir) end end + context "--coc set to ruby" do + before do + bundle "gem #{gem_name} --coc=ruby" + end + + it "generates a Ruby Community Conduct Guideline" do + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md")).to exist + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md").read).to include("Ruby Community Conduct Guideline") + end + end + + context "--coc set to contributor-covenant" do + before do + bundle "gem #{gem_name} --coc=contributor-covenant" + end + + it "generates a Contributor Covenant" do + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md")).to exist + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md").read).to include("Contributor Covenant") + end + end + + context "--coc set to none" do + before do + bundle "gem #{gem_name} --coc=none" + end + + it "does not generate any Code of Conduct" do + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md")).to_not exist + end + end + + context "--coc parameter set to an invalid value" do + before do + bundle "gem #{gem_name} --coc=foo", raise_on_error: false + end + + it "fails loudly" do + expect(last_command).to be_failure + expect(err).to match(/Expected '--coc' to be one of .*; got foo/) + end + end + + context "gem.coc setting set to ruby" do + it "generates a Ruby Community Conduct Guideline" do + bundle "config set gem.coc ruby" + bundle "gem #{gem_name}" + + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md")).to exist + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md").read).to include("Ruby Community Conduct Guideline") + end + end + + context "gem.coc setting set to contributor-covenant" do + it "generates a Contributor Covenant" do + bundle "config set gem.coc contributor-covenant" + bundle "gem #{gem_name}" + + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md")).to exist + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md").read).to include("Contributor Covenant") + end + end + + context "gem.coc set to ruby and --coc with no arguments" do + before do + bundle "config set gem.coc ruby" + bundle "gem #{gem_name} --coc" + end + + it "generates a Ruby Community Conduct Guideline" do + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md")).to exist + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md").read).to include("Ruby Community Conduct Guideline") + end + + it "shows which code of conduct is being used" do + expect(out).to match("Using configured code of conduct: ruby") + end + end + + context "gem.coc set to none and --coc with no arguments" do + before do + bundle "config set gem.coc none" + bundle "gem #{gem_name} --coc" + end + + it "does not generate any Code of Conduct" do + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md")).to_not exist + end + + it "shows which code of conduct is being used" do + expect(out).to match("Using configured code of conduct: none") + end + end + + context "gem.coc setting set to false and --coc with no arguments", :readline do + before do + bundle "config set gem.coc false" + bundle "gem #{gem_name} --coc" do |input, _, _| + input.puts "ruby" + end + end + + it "asks to setup code of conduct" do + expect(out).to match("Do you want to include a code of conduct in gems you generate?") + end + + it "hints that the choice will only be applied to the current gem" do + expect(out).to match("Your choice will only be applied to this gem.") + end + end + + context "gem.coc setting not set and --coc with no arguments", :readline do + before do + global_config "BUNDLE_GEM__COC" => nil + bundle "gem #{gem_name} --coc" do |input, _, _| + input.puts "contributor-covenant" + end + end + + it "asks to setup code of conduct" do + expect(out).to match("Do you want to include a code of conduct in gems you generate?") + end + + it "hints that the choice will be applied to future bundle gem calls" do + hint = "Future `bundle gem` calls will use your choice. " \ + "This setting can be changed anytime with `bundle config gem.coc`." + expect(out).to match(hint) + end + end + + context "gem.coc setting set to a CoC and --no-coc" do + before do + bundle "config set gem.coc ruby" + bundle "gem #{gem_name} --no-coc" + end + + it "does not generate any Code of Conduct" do + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md")).to_not exist + end + end + + context "gem.coc setting set to true (legacy boolean value)", :readline do + before do + bundle "config set gem.coc true" + bundle "gem #{gem_name}" do |input, _, _| + input.puts "contributor-covenant" + end + end + + it "prompts user to select a specific code of conduct" do + expect(out).to include("Your gem.coc setting is configured to `true`") + expect(out).to include("now supports multiple codes of conduct") + end + + it "generates the selected code of conduct" do + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md")).to exist + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md").read).to include("Contributor Covenant") + end + + it "updates the global config with the new value" do + expect(bundle("config get gem.coc")).to include("contributor-covenant") + end + end + + context "gem.coc setting set to false (legacy boolean value)" do + before do + bundle "config set gem.coc false" + bundle "gem #{gem_name}" + end + + it "does not generate any Code of Conduct" do + expect(bundled_app("#{gem_name}/CODE_OF_CONDUCT.md")).to_not exist + end + + it "silently migrates the global config to 'none'" do + expect(bundle("config get gem.coc")).to include("none") + end + end + context "--linter with no argument" do before do bundle "gem #{gem_name}" @@ -1447,19 +1642,24 @@ def create_temporary_dir(dir) it_behaves_like "--no-mit flag" end - context "with coc option in bundle config settings set to true" do + context "with coc option in bundle config settings set to ruby" do before do - global_config "BUNDLE_GEM__COC" => "true" + global_config "BUNDLE_GEM__COC" => "ruby" end - it_behaves_like "--coc flag" - it_behaves_like "--no-coc flag" + it_behaves_like "--coc=ruby flag" + end + + context "with coc option in bundle config settings set to contributor-covenant" do + before do + global_config "BUNDLE_GEM__COC" => "contributor-covenant" + end + it_behaves_like "--coc=contributor-covenant flag" end context "with coc option in bundle config settings set to false" do before do global_config "BUNDLE_GEM__COC" => "false" end - it_behaves_like "--coc flag" it_behaves_like "--no-coc flag" end @@ -2044,13 +2244,24 @@ def create_temporary_dir(dir) global_config "BUNDLE_GEM__COC" => nil bundle "gem foobar" do |input, _, _| - input.puts "yes" + input.puts "ruby" end expect(bundled_app("foobar/CODE_OF_CONDUCT.md")).to exist expect(out).to include("Codes of conduct can increase contributions to your project").once end + it "generates Contributor Covenant when selected" do + global_config "BUNDLE_GEM__COC" => nil + + bundle "gem foobar" do |input, _, _| + input.puts "contributor-covenant" + end + + expect(bundled_app("foobar/CODE_OF_CONDUCT.md")).to exist + expect(bundled_app("foobar/CODE_OF_CONDUCT.md").read).to include("Contributor Covenant") + end + it "asks about CHANGELOG just once" do global_config "BUNDLE_GEM__CHANGELOG" => nil