Sha256: 375391e028a3c449e26c9a7a6eac0a7df693f196a5b2a32a1096aec8708af4ee

Contents?: true

Size: 737 Bytes

Versions: 5

Compression:

Stored size: 737 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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
packwerk-3.2.2 lib/packwerk/spring_command.rb
packwerk-3.2.1 lib/packwerk/spring_command.rb
packwerk-3.2.0 lib/packwerk/spring_command.rb
packwerk-3.1.0 lib/packwerk/spring_command.rb
packwerk-3.0.1 lib/packwerk/spring_command.rb