diff options
Diffstat (limited to 'lib/bundler/cli.rb')
-rw-r--r-- | lib/bundler/cli.rb | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index cb930e6f..cdccdf8e 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -1,5 +1,5 @@ -require 'bundler' -require 'bundler/vendored_thor' +require "bundler" +require "bundler/vendored_thor" module Bundler class CLI < Thor @@ -17,7 +17,7 @@ module Bundler super custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile] - ENV['BUNDLE_GEMFILE'] = File.expand_path(custom_gemfile) if custom_gemfile + ENV["BUNDLE_GEMFILE"] = File.expand_path(custom_gemfile) if custom_gemfile Bundler.settings[:retry] = options[:retry] if options[:retry] @@ -84,7 +84,7 @@ module Bundler D method_option "gemspec", :type => :string, :banner => "Use the specified .gemspec to create the Gemfile" def init - require 'bundler/cli/init' + require "bundler/cli/init" Init.new(options.dup).run end @@ -102,7 +102,7 @@ module Bundler "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine" map "c" => "check" def check - require 'bundler/cli/check' + require "bundler/cli/check" Check.new(options).run end @@ -151,14 +151,14 @@ module Bundler "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application" method_option "trust-policy", :alias => "P", :type => :string, :banner => "Gem trust policy (like gem install -P). Must be one of " + - Bundler.rubygems.security_policy_keys.join('|') + Bundler.rubygems.security_policy_keys.join("|") method_option "without", :type => :array, :banner => "Exclude gems that are part of the specified named group." method_option "with", :type => :array, :banner => "Include gems that are part of the specified named group." map "i" => "install" def install - require 'bundler/cli/install' + require "bundler/cli/install" Install.new(options.dup).run end @@ -183,7 +183,7 @@ module Bundler method_option "force", :type => :boolean, :banner => "Force downloading every gem." def update(*gems) - require 'bundler/cli/update' + require "bundler/cli/update" Update.new(options, gems).run end @@ -197,7 +197,7 @@ module Bundler method_option "outdated", :type => :boolean, :banner => "Show verbose output including whether gems are outdated." def show(gem_name = nil) - require 'bundler/cli/show' + require "bundler/cli/show" Show.new(options, gem_name).run end map %w(list) => "show" @@ -212,7 +212,7 @@ module Bundler method_option "path", :type => :string, :lazy_default => "bin", :banner => "Binstub destination directory (default bin)" def binstubs(*gems) - require 'bundler/cli/binstubs' + require "bundler/cli/binstubs" Binstubs.new(options, gems).run end @@ -230,7 +230,7 @@ module Bundler method_option "strict", :type => :boolean, :banner => "Only list newer versions allowed by your Gemfile requirements" def outdated(*gems) - require 'bundler/cli/outdated' + require "bundler/cli/outdated" Outdated.new(options, gems).run end @@ -239,7 +239,7 @@ module Bundler method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms, not just the current one" method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache." def cache - require 'bundler/cli/cache' + require "bundler/cli/cache" Cache.new(options).run end @@ -261,7 +261,7 @@ module Bundler bundle without having to download any additional gems. D def package - require 'bundler/cli/package' + require "bundler/cli/package" Package.new(options).run end map %w(pack) => :package @@ -275,7 +275,7 @@ module Bundler D map "e" => "exec" def exec(*args) - require 'bundler/cli/exec' + require "bundler/cli/exec" Exec.new(options, args).run end @@ -292,19 +292,19 @@ module Bundler where they were specified. D def config(*args) - require 'bundler/cli/config' + require "bundler/cli/config" Config.new(options, args, self).run end desc "open GEM", "Opens the source directory of the given bundled gem" def open(name) - require 'bundler/cli/open' + require "bundler/cli/open" Open.new(options, name).run end desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded" def console(group = nil) - require 'bundler/cli/console' + require "bundler/cli/console" Console.new(options, group).run end @@ -328,39 +328,39 @@ module Bundler end end - desc 'viz [OPTIONS]', "Generates a visual dependency graph" + desc "viz [OPTIONS]", "Generates a visual dependency graph" 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', :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 :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." def viz - require 'bundler/cli/viz' + require "bundler/cli/viz" Viz.new(options).run end desc "gem GEM [OPTIONS]", "Creates a skeleton for creating a rubygem" - method_option :bin, :type => :boolean, :default => false, :aliases => '-b', :desc => "Generate a binary for your library." + method_option :bin, :type => :boolean, :default => false, :aliases => "-b", :desc => "Generate a binary for your library." method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config gem.coc true`." method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR", - :lazy_default => [ENV['BUNDLER_EDITOR'], ENV['VISUAL'], ENV['EDITOR']].find{|e| !e.nil? && !e.empty? }, + :lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find{|e| !e.nil? && !e.empty? }, :desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)" method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code" method_option :mit, :type => :boolean, :desc => "Generate an MIT license file" - method_option :test, :type => :string, :lazy_default => 'rspec', :aliases => '-t', :banner => "rspec", + method_option :test, :type => :string, :lazy_default => "rspec", :aliases => "-t", :banner => "rspec", :desc => "Generate a test directory for your library, either rspec or minitest. Set a default with `bundle config gem.test rspec`." def gem(name) - require 'bundler/cli/gem' + require "bundler/cli/gem" Gem.new(options, name, self).run end def self.source_root - File.expand_path(File.join(File.dirname(__FILE__), 'templates')) + File.expand_path(File.join(File.dirname(__FILE__), "templates")) end desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory" @@ -369,7 +369,7 @@ module Bundler method_option "force", :type => :boolean, :default => false, :banner => "Forces clean even if --path is not set" def clean - require 'bundler/cli/clean' + require "bundler/cli/clean" Clean.new(options.dup).run end @@ -377,13 +377,13 @@ module Bundler method_option "ruby", :type => :boolean, :default => false, :banner => "only display ruby related platform information" def platform - require 'bundler/cli/platform' + require "bundler/cli/platform" Platform.new(options).run end desc "inject GEM VERSION ...", "Add the named gem(s), with version requirements, to the resolved Gemfile" def inject(name, version, *gems) - require 'bundler/cli/inject' + require "bundler/cli/inject" Inject.new(options, name, version, gems).run end @@ -397,7 +397,7 @@ module Bundler method_option "lockfile", :type => :string, :default => nil, :banner => "the path the lockfile should be written to" def lock - require 'bundler/cli/lock' + require "bundler/cli/lock" Lock.new(options).run end |