Sha256: 1c239eef7e3a3ea1d7e60fc1c3d7ee3e6112cc9dc440edf51f5b7ddc183fa4b1

Contents?: true

Size: 772 Bytes

Versions: 1

Compression:

Stored size: 772 Bytes

Contents

# typed: strict
# frozen_string_literal: true

require "spring/commands"
require "sorbet-runtime"

module Packwerk
  class SpringCommand
    extend T::Sig

    sig { params(args: T.untyped).returns(String) }
    def env(args)
      # Packwerk needs to run in a test environment, which has a set of autoload paths that are
      # often a superset of the dev/prod paths (for example, test/support/helpers)
      "test"
    end

    sig { returns(String) }
    def exec_name
      "packwerk"
    end

    sig { returns(String) }
    def gem_name
      "packwerk"
    end

    sig { returns(T::Boolean) }
    def call
      load(Gem.bin_path(gem_name, exec_name))
    end
  end

  Spring.register_command("packwerk", SpringCommand.new)
end

require "packwerk/disable_sorbet"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
packwerk-3.0.0 lib/packwerk/spring_command.rb