From 5496620f4fdd959f0aa8ffc4c6b9beb76880fefd Mon Sep 17 00:00:00 2001 From: Lutz Lengemann Date: Tue, 16 Feb 2016 09:58:59 +0100 Subject: Option without can have multiple value. --- lib/bundler/cli/viz.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/bundler') diff --git a/lib/bundler/cli/viz.rb b/lib/bundler/cli/viz.rb index 7ccd306d..ba30484c 100644 --- a/lib/bundler/cli/viz.rb +++ b/lib/bundler/cli/viz.rb @@ -9,7 +9,8 @@ module Bundler def run require "graphviz" output_file = File.expand_path(options[:file]) - graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format], options[:without]) + without = options[:without].empty? ? [] : options[:without].first.split(',') + graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format], without) graph.viz rescue LoadError => e Bundler.ui.error e.inspect -- cgit v1.2.3 From 902905c8119e3a003075c3673cb1e7bdcf6104fd Mon Sep 17 00:00:00 2001 From: Lutz Lengemann Date: Thu, 18 Feb 2016 09:00:38 +0100 Subject: Change help display for viz --- lib/bundler/cli.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/bundler') diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 1fed1b58..8e4e8e94 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -352,11 +352,11 @@ module Bundler 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", :banner => "The name to use for the generated file. see format option" - method_option :format, :type => :string, :default => "png", :aliases => "-F", :banner => "This is output format option. Supported format is png, jpg, svg, dot ..." - method_option :requirements, :type => :boolean, :default => false, :aliases => "-r", :banner => "Set to show the version of each required dependency." - method_option :version, :type => :boolean, :default => false, :aliases => "-v", :banner => "Set to show each gem version." - method_option :without, :type => :array, :default => [], :banner => "Exclude gems that are part of the specified named group." + 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).run -- cgit v1.2.3 From 3ed2440ed5476da0defe7d3c30fc26a0ffd106df Mon Sep 17 00:00:00 2001 From: Lutz Lengemann Date: Thu, 18 Feb 2016 09:01:34 +0100 Subject: Call viz with dupped options so they can be edited --- lib/bundler/cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/bundler') diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 8e4e8e94..ed87b03e 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -359,7 +359,7 @@ module Bundler 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).run + Viz.new(options.dup).run end desc "gem GEM [OPTIONS]", "Creates a skeleton for creating a rubygem" -- cgit v1.2.3 From a7e417b5eace4f87f55881f6e527112e793f9983 Mon Sep 17 00:00:00 2001 From: Lutz Lengemann Date: Thu, 18 Feb 2016 09:02:37 +0100 Subject: Change `without` handling so `bundle install` way --- lib/bundler/cli/viz.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/bundler') diff --git a/lib/bundler/cli/viz.rb b/lib/bundler/cli/viz.rb index ba30484c..75e6afff 100644 --- a/lib/bundler/cli/viz.rb +++ b/lib/bundler/cli/viz.rb @@ -8,9 +8,11 @@ module Bundler def run require "graphviz" + + options[:without] = options[:without].join(":").tr(" ", ":").split(":") output_file = File.expand_path(options[:file]) - without = options[:without].empty? ? [] : options[:without].first.split(',') - graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format], without) + + graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format], options[:without]) graph.viz rescue LoadError => e Bundler.ui.error e.inspect -- cgit v1.2.3