Sha256: 3c5591843a3006b0f73a35abcc65ebb0641bde099bb4fdee9efcdc6e1cbc860b

Contents?: true

Size: 688 Bytes

Versions: 2

Compression:

Stored size: 688 Bytes

Contents

# frozen_string_literal: true

module Licensed
  module Sources
    module Yarn
      module ClassMethods
        def type
          "yarn"
        end
      end

      def self.included(klass)
        klass.extend ClassMethods
      end

      def enabled?
        return unless Licensed::Shell.tool_available?("yarn")
        return unless self.class.version_requirement.satisfied_by?(yarn_version)

        config.pwd.join("package.json").exist? && config.pwd.join("yarn.lock").exist?
      end

      def yarn_version
        Gem::Version.new(Licensed::Shell.execute("yarn", "-v"))
      end
    end
  end
end

require "licensed/sources/yarn/v1"
require "licensed/sources/yarn/berry"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
licensed-3.4.1 lib/licensed/sources/yarn.rb
licensed-3.4.0 lib/licensed/sources/yarn.rb