summaryrefslogtreecommitdiff
path: root/lib/bundler/cli/viz.rb
diff options
context:
space:
mode:
authorFletcher Nichol <fnichol@nichol.ca>2014-05-28 10:16:16 -0600
committerFletcher Nichol <fnichol@nichol.ca>2014-05-28 10:16:16 -0600
commitfd5eee9fd82dffc3062fef91ace251cfc0ba5211 (patch)
tree2ae35937294dbe2282a25d1ae1c5daf453a85a4b /lib/bundler/cli/viz.rb
parentb2c2c267309ff6d8b4ab497e4c38277b9263c7cf (diff)
downloadbundler-fd5eee9fd82dffc3062fef91ace251cfc0ba5211.tar.gz
Add `bundle viz --without` to exclude gem groups from resulting graph.
This commit introduces a `--without` flag (similar to the flag on the `install` subcommand) which will drop the inclusion of these gems from the graph. The ability to exclude gem groups from the graph is very useful when trying to visualize or understand the runtime dependencies of a particular RubyGem or project, minus any development or test related libraries. Previously the process of reproducing this behavior was a manual process: * Inspect the project's Gemfile and comment/remove any gems that are not runtime dependencies. Typically these gems would be in `:test` or `:development` groups. * Inspect the project's gemspec (if it exists) and comment/remove any gems that are not runtime dependencies. Now it is as simple as: bundle viz --without=test development
Diffstat (limited to 'lib/bundler/cli/viz.rb')
-rw-r--r--lib/bundler/cli/viz.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/cli/viz.rb b/lib/bundler/cli/viz.rb
index c404ddbbc5..09557e599c 100644
--- a/lib/bundler/cli/viz.rb
+++ b/lib/bundler/cli/viz.rb
@@ -8,7 +8,7 @@ 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])
+ 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