Sha256: 328c7afa5ce2b403c285e7fa513b3046605edd11d95ca28efcf311c75484121e

Contents?: true

Size: 729 Bytes

Versions: 14

Compression:

Stored size: 729 Bytes

Contents

module LicenseFinder
  module Activation
    # An Activation reports that a license has been activated for a package, and
    # tracks the source of that information
    Basic = Struct.new(:package, :license)

    class FromDecision < Basic
      def sources
        ['from decision']
      end
    end

    class FromSpec < Basic
      def sources
        ['from spec']
      end
    end

    class FromFiles < Basic
      def initialize(package, license, files)
        super(package, license)
        @files = files
      end

      attr_reader :files

      def sources
        files.map { |file| "from file '#{file.path}'" }
      end
    end

    class None < Basic
      def sources
        []
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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