lib/bundler/cli.rb in bundler-1.3.5 vs lib/bundler/cli.rb in bundler-1.3.6

- old
+ new

@@ -490,11 +490,11 @@ desc "exec", "Run the command in context of the bundle" long_desc <<-D Exec runs a command, providing it access to the gems in the bundle. While using bundle exec you can require and call the bundled gems as if they were installed - into the systemwide Rubygems repository. + into the system wide Rubygems repository. D def exec(*args) Bundler.definition.validate_ruby! Bundler.load.setup_environment @@ -649,27 +649,23 @@ method_option :version, :type => :boolean, :default => false, :aliases => '-v', :banner => "Set to show each gem version." method_option :requirements, :type => :boolean, :default => false, :aliases => '-r', :banner => "Set to show the version of each required dependency." method_option :format, :type => :string, :default => "png", :aliases => '-F', :banner => "This is output format option. Supported format is png, jpg, svg, dot ..." def viz require 'graphviz' - output_file = File.expand_path(options[:file]) graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format]) - - begin - graph.viz - rescue LoadError => e - Bundler.ui.error e.inspect - Bundler.ui.warn "Make sure you have the graphviz ruby gem. You can install it with:" - Bundler.ui.warn "`gem install ruby-graphviz`" - rescue StandardError => e - if e.message =~ /GraphViz not installed or dot not in PATH/ - Bundler.ui.error e.message - Bundler.ui.warn "The ruby graphviz gem requires GraphViz to be installed" - else - raise - end + graph.viz + rescue LoadError => e + Bundler.ui.error e.inspect + Bundler.ui.warn "Make sure you have the graphviz ruby gem. You can install it with:" + Bundler.ui.warn "`gem install ruby-graphviz`" + rescue StandardError => e + if e.message =~ /GraphViz not installed or dot not in PATH/ + Bundler.ui.error e.message + Bundler.ui.warn "Please install GraphViz. On a Mac with homebrew, you can run `brew install graphviz`." + else + raise end end desc "gem GEM", "Creates a skeleton for creating a rubygem" method_option :bin, :type => :boolean, :default => false, :aliases => '-b', :banner => "Generate a binary for your library." @@ -719,10 +715,10 @@ template(File.join("newgem/test/test_newgem.rb.tt"), File.join(target, "test/test_#{namespaced_path}.rb"), opts) end if options[:test] template(File.join("newgem/.travis.yml.tt"), File.join(target, ".travis.yml"), opts) end - Bundler.ui.info "Initializating git repo in #{target}" + Bundler.ui.info "Initializing git repo in #{target}" Dir.chdir(target) { `git init`; `git add .` } if options[:edit] run("#{options["edit"]} \"#{gemspec_dest}\"") # Open gemspec in editor end