Class: LicenseFinder::CLI::Main
- Defined in:
- lib/license_finder/cli.rb
Instance Method Summary collapse
- #action_items ⇒ Object
- #approve(name, *other_names) ⇒ Object
- #license(license, name) ⇒ Object
- #move ⇒ Object
- #rescan ⇒ Object
- #show_results ⇒ Object
Methods inherited from Base
Instance Method Details
#action_items ⇒ Object
260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/license_finder/cli.rb', line 260 def action_items unapproved = Dependency.unapproved if unapproved.empty? say "All dependencies are approved for use", :green else say "Dependencies that need approval:", :red say TextReport.new(unapproved) exit 1 end end |
#approve(name, *other_names) ⇒ Object
235 236 237 238 239 240 241 242 |
# File 'lib/license_finder/cli.rb', line 235 def approve(name, *other_names) names = other_names.unshift name die_on_error { names.each { |name| DependencyManager.approve!(name, [:approver], [:message]) } } say "The #{names.join(", ")} dependency has been approved!", :green end |
#license(license, name) ⇒ Object
245 246 247 248 249 250 251 |
# File 'lib/license_finder/cli.rb', line 245 def license(license, name) die_on_error { DependencyManager.license!(name, license) } say "The #{name} dependency has been marked as using #{license} license!", :green end |
#move ⇒ Object
254 255 256 257 |
# File 'lib/license_finder/cli.rb', line 254 def move Configuration.move! say "Congratulations, you have cleaned up your root directory!'", :green end |
#rescan ⇒ Object
219 220 221 222 |
# File 'lib/license_finder/cli.rb', line 219 def rescan sync_with_spinner show_results end |
#show_results ⇒ Object
225 226 227 228 |
# File 'lib/license_finder/cli.rb', line 225 def show_results IgnoredDependencies.new.list action_items end |