Class: Bundler::Dependencies::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/bundler/dependencies/cli.rb,
lib/bundler/dependencies/cli/find.rb,
lib/bundler/dependencies/cli/count.rb,
lib/bundler/dependencies/cli/graph.rb,
lib/bundler/dependencies/cli/command.rb,
lib/bundler/dependencies/cli/with_gem.rb

Defined Under Namespace

Modules: WithGem Classes: Command, Count, Find, Graph

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.basenameObject



25
26
27
# File 'lib/bundler/dependencies/cli.rb', line 25

def self.basename
  'bundle dependencies'
end

.exit_on_failure?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/bundler/dependencies/cli.rb', line 21

def self.exit_on_failure?
  true
end

.shared_optionsObject



14
15
16
17
18
19
# File 'lib/bundler/dependencies/cli.rb', line 14

def self.shared_options
  method_option :path, type: :string, desc: 'Path to Gemfile.lock to scan'
  method_option :without, type: :array, desc: 'Gems to ignore', aliases: ['-W']
  method_option :without_rails, type: :boolean, default: false, desc: 'Ignore all Rails gems', aliases: ['-R']
  method_option :color, type: :boolean, default: true, desc: 'Colorize output'
end

Instance Method Details

#count(*args) ⇒ Object



46
47
48
49
50
# File 'lib/bundler/dependencies/cli.rb', line 46

def count(*args)
  return help(:count) if args.first == 'help'

  Count.new(options).output
end

#find(gem = nil) ⇒ Object



67
68
69
70
71
# File 'lib/bundler/dependencies/cli.rb', line 67

def find(gem = nil)
  return help(:find) if gem.nil? || gem == 'help'

  Find.new(gem, options).output
end

#graph(gem = nil) ⇒ Object



55
56
57
58
59
# File 'lib/bundler/dependencies/cli.rb', line 55

def graph(gem = nil)
  return help(:graph) if gem == 'help'

  Graph.new(gem, options).output
end

#versionObject



36
37
38
# File 'lib/bundler/dependencies/cli.rb', line 36

def version
  puts "#{File.basename($PROGRAM_NAME)} #{VERSION}"
end