Sha256: 1df655f448e1cf341888e3f2855b6ac565375649fe9ebd469c96c5086336f97a

Contents?: true

Size: 928 Bytes

Versions: 21

Compression:

Stored size: 928 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) { |license| license.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

21 entries across 21 versions & 1 rubygems

Version Path
license_finder-3.0.4 lib/license_finder/cli/whitelist.rb
license_finder-3.0.2 lib/license_finder/cli/whitelist.rb
license_finder-3.0.1 lib/license_finder/cli/whitelist.rb
license_finder-3.0.0 lib/license_finder/cli/whitelist.rb
license_finder-2.1.2 lib/license_finder/cli/whitelist.rb
license_finder-2.1.1 lib/license_finder/cli/whitelist.rb
license_finder-2.1.0 lib/license_finder/cli/whitelist.rb
license_finder-2.1.0.rc9 lib/license_finder/cli/whitelist.rb
license_finder-2.1.0.rc8 lib/license_finder/cli/whitelist.rb
license_finder-2.1.0.rc7 lib/license_finder/cli/whitelist.rb
license_finder-2.1.0.rc6 lib/license_finder/cli/whitelist.rb
license_finder-2.1.0.rc5 lib/license_finder/cli/whitelist.rb
license_finder-2.1.0.rc4 lib/license_finder/cli/whitelist.rb
license_finder-2.1.0.rc3 lib/license_finder/cli/whitelist.rb
license_finder-2.1.0.rc2 lib/license_finder/cli/whitelist.rb
license_finder-2.1.0.rc1 lib/license_finder/cli/whitelist.rb
license_finder-2.0.4 lib/license_finder/cli/whitelist.rb
license_finder-2.0.3 lib/license_finder/cli/whitelist.rb
license_finder-2.0.2 lib/license_finder/cli/whitelist.rb
license_finder-2.0.1 lib/license_finder/cli/whitelist.rb