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

deprecate the bundle viz command #5964

Merged
merged 1 commit into from
Sep 6, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 17 additions & 14 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -482,20 +482,23 @@ def licenses
end
end

desc "viz [OPTIONS]", "Generates a visual dependency graph", :hide => true
long_desc <<-D
Viz generates a PNG file of the current Gemfile as a dependency graph.
Viz requires the ruby-graphviz gem (and its dependencies).
The associated gems must also be installed via 'bundle install'.
D
method_option :file, :type => :string, :default => "gem_graph", :aliases => "-f", :desc => "The name to use for the generated file. see format option"
method_option :format, :type => :string, :default => "png", :aliases => "-F", :desc => "This is output format option. Supported format is png, jpg, svg, dot ..."
method_option :requirements, :type => :boolean, :default => false, :aliases => "-R", :desc => "Set to show the version of each required dependency."
method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
def viz
require "bundler/cli/viz"
Viz.new(options.dup).run
if Bundler.feature_flag.viz_command?
desc "viz [OPTIONS]", "Generates a visual dependency graph", :hide => true
long_desc <<-D
Viz generates a PNG file of the current Gemfile as a dependency graph.
Viz requires the ruby-graphviz gem (and its dependencies).
The associated gems must also be installed via 'bundle install'.
D
method_option :file, :type => :string, :default => "gem_graph", :aliases => "-f", :desc => "The name to use for the generated file. see format option"
method_option :format, :type => :string, :default => "png", :aliases => "-F", :desc => "This is output format option. Supported format is png, jpg, svg, dot ..."
method_option :requirements, :type => :boolean, :default => false, :aliases => "-R", :desc => "Set to show the version of each required dependency."
method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
def viz
SharedHelpers.major_deprecation 2, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/bundler/bundler-viz"
require "bundler/cli/viz"
Viz.new(options.dup).run
end
end

old_gem = instance_method(:gem)
Expand Down
1 change: 1 addition & 0 deletions lib/bundler/feature_flag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def self.settings_method(name, key, &default)
settings_flag(:unlock_source_unlocks_spec) { !bundler_2_mode? }
settings_flag(:update_requires_all_flag) { bundler_2_mode? }
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_2_mode? }
settings_flag(:viz_command) { !bundler_2_mode? }

settings_option(:default_cli_command) { bundler_2_mode? ? :cli_help : :install }

Expand Down
1 change: 1 addition & 0 deletions lib/bundler/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class Settings
unlock_source_unlocks_spec
update_requires_all_flag
use_gem_version_promoter_for_major_updates
viz_command
].freeze

NUMBER_KEYS = %w[
Expand Down
2 changes: 1 addition & 1 deletion spec/commands/viz_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

RSpec.describe "bundle viz", :ruby => "1.9.3", :if => Bundler.which("dot") do
RSpec.describe "bundle viz", :ruby => "1.9.3", :bundler => "< 2", :if => Bundler.which("dot") do
let(:ruby_graphviz) do
graphviz_glob = base_system_gems.join("cache/ruby-graphviz*")
Pathname.glob(graphviz_glob).first
Expand Down
1 change: 1 addition & 0 deletions spec/quality_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def check_for_specific_pronouns(filename)
lockfile_uses_separate_rubygems_sources
use_gem_version_promoter_for_major_updates
warned_version
viz_command
]

all_settings = Hash.new {|h, k| h[k] = [] }
Expand Down