Sha256: 91a14e48c31282745a2906c621d01669bba40d7dfaa7c2e8b541d07b671dc6c9

Contents?: true

Size: 909 Bytes

Versions: 14

Compression:

Stored size: 909 Bytes

Contents

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

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

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

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
license_finder-5.4.1 lib/license_finder/cli/whitelist.rb
license_finder-5.4.0 lib/license_finder/cli/whitelist.rb
license_finder-5.3.0 lib/license_finder/cli/whitelist.rb
license_finder-5.2.3 lib/license_finder/cli/whitelist.rb
license_finder-5.2.1 lib/license_finder/cli/whitelist.rb
license_finder-5.2.0 lib/license_finder/cli/whitelist.rb
license_finder-5.1.1 lib/license_finder/cli/whitelist.rb
license_finder-5.1.0 lib/license_finder/cli/whitelist.rb
license_finder-5.0.3 lib/license_finder/cli/whitelist.rb
license_finder-5.0.2 lib/license_finder/cli/whitelist.rb
license_finder-5.0.0 lib/license_finder/cli/whitelist.rb
license_finder-4.0.2 lib/license_finder/cli/whitelist.rb
license_finder-4.0.1 lib/license_finder/cli/whitelist.rb
license_finder-3.1.1 lib/license_finder/cli/whitelist.rb