Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Add bundle issue command that prints instructions for reporting issues #5505

Merged
merged 4 commits into from
Apr 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,12 @@ def doctor
Doctor.new(options).run
end

desc "issue", "Learn how to report an issue in Bundler"
def issue
require "bundler/cli/issue"
Issue.new.run
end

if Bundler.feature_flag.plugins?
require "bundler/cli/plugin"
desc "plugin SUBCOMMAND ...ARGS", "manage the bundler plugins"
Expand Down
40 changes: 40 additions & 0 deletions lib/bundler/cli/issue.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: true

require "rbconfig"

module Bundler
class CLI::Issue
def run
Bundler.ui.info <<-EOS.gsub(/^ {8}/, "")
Did you find an issue with Bundler? Before filing a new issue,
be sure to check out these resources:

1. Check out our troubleshooting guide for quick fixes to common issues:
https://github.com/bundler/bundler/blob/master/doc/TROUBLESHOOTING.md

2. Instructions for common Bundler uses can be found on the documentation
site: http://bundler.io/

3. Information about each Bundler command can be found in the Bundler
man pages: http://bundler.io/man/bundle.1.html

Hopefully the troubleshooting steps above resolved your problem! If things
still aren't working the way you expect them to, please let us know so
that we can diagnose and help fix the problem you're having. Please
view the Filing Issues guide for more information:
https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md

EOS

Bundler.ui.info Bundler::Env.new.report(:print_gemfile => true)

Bundler.ui.info "\n## Bundle Doctor"
doctor
end

def doctor
require "bundler/cli/doctor"
Bundler::CLI::Doctor.new({}).run
end
end
end
17 changes: 17 additions & 0 deletions spec/commands/issue_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true
require "spec_helper"

RSpec.describe "bundle issue" do
it "exits with a message" do
install_gemfile <<-G
source "file://#{gem_repo1}"
gem "rails"
G

bundle "issue"
expect(out).to include "Did you find an issue with Bundler?"
expect(out).to include "## Environment"
expect(out).to include "## Gemfile"
expect(out).to include "## Bundle Doctor"
end
end