Sha256: f2bc8be1a4db094aa4d216f6f2c4f1c815e3657bc2264bca41bccab472948440

Contents?: true

Size: 940 Bytes

Versions: 17

Compression:

Stored size: 940 Bytes

Contents

# frozen_string_literal: true

module LicenseFinder
  module CLI
    class Blacklist < Base
      extend Subcommand
      include MakesDecisions

      desc 'list', 'List all the blacklisted licenses'
      def list
        say 'Blacklisted Licenses:', :blue
        say_each(decisions.blacklisted, &:name)
      end

      auditable
      desc 'add LICENSE...', 'Add one or more licenses to the blacklist'
      def add(*licenses)
        assert_some licenses
        modifying { licenses.each { |l| decisions.blacklist(l, txn) } }
        say "Added #{licenses.join(', ')} to the license blacklist"
      end

      auditable
      desc 'remove LICENSE...', 'Remove one or more licenses from the blacklist'
      def remove(*licenses)
        assert_some licenses
        modifying { licenses.each { |l| decisions.unblacklist(l, txn) } }
        say "Removed #{licenses.join(', ')} from the license blacklist"
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
license_finder-5.11.1 lib/license_finder/cli/blacklist.rb
license_finder-5.11.0 lib/license_finder/cli/blacklist.rb
license_finder-5.10.2 lib/license_finder/cli/blacklist.rb
license_finder-5.10.1 lib/license_finder/cli/blacklist.rb
license_finder-5.10.0 lib/license_finder/cli/blacklist.rb
license_finder-5.9.2 lib/license_finder/cli/blacklist.rb
license_finder-5.9.1 lib/license_finder/cli/blacklist.rb
license_finder-5.9.0 lib/license_finder/cli/blacklist.rb
license_finder-5.8.0 lib/license_finder/cli/blacklist.rb
license_finder-5.7.1 lib/license_finder/cli/blacklist.rb
license_finder-5.7.0 lib/license_finder/cli/blacklist.rb
license_finder-5.6.2 lib/license_finder/cli/blacklist.rb
license_finder-5.6.1 lib/license_finder/cli/blacklist.rb
license_finder-5.6.0 lib/license_finder/cli/blacklist.rb
license_finder-5.5.2 lib/license_finder/cli/blacklist.rb
license_finder-5.5.1 lib/license_finder/cli/blacklist.rb
license_finder-5.5.0 lib/license_finder/cli/blacklist.rb