Class: LicenseFinder::CLI::Dependencies

Inherits:
Subcommand show all
Defined in:
lib/license_finder/cli.rb

Instance Method Summary collapse

Methods inherited from Subcommand

banner

Methods inherited from Base

subcommand

Instance Method Details

#add(license, name, version = nil) ⇒ Object



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/license_finder/cli.rb', line 77

def add(license, name, version = nil)
  die_on_error {
    DependencyManager.manually_add(license, name, version)
    DependencyManager.approve!(name, options[:approver], options[:message]) if options[:approve]
  }
  if options[:approve]
    say "The #{name} dependency has been added and approved!", :green
  else
    say "The #{name} dependency has been added!", :green
  end
end

#remove(name) ⇒ Object



90
91
92
93
94
95
96
# File 'lib/license_finder/cli.rb', line 90

def remove(name)
  die_on_error {
    DependencyManager.manually_remove(name)
  }

  say "The #{name} dependency has been removed.", :green
end