Sha256: 57227e2a5407042ee328e9ea32736af947ec14d8a6ce6b749dd20dcd744bd3ab

Contents?: true

Size: 423 Bytes

Versions: 2

Compression:

Stored size: 423 Bytes

Contents

# frozen_string_literal: true

module CobraCommander
  module Dependencies
    class Yarn::Package
      attr_reader :path, :name, :dependencies

      def initialize(path:, dependencies:, name: nil)
        @path = path
        @name = untag(name)
        @dependencies = dependencies.map { |dep| untag(dep) }
      end

    private

      def untag(name)
        name&.gsub(%r{^@[\w-]+/}, "")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cobra_commander-0.15.1 lib/cobra_commander/dependencies/yarn/package.rb
cobra_commander-0.15.0 lib/cobra_commander/dependencies/yarn/package.rb