Sha256: ebe36176b12f9036e0480440274b2b642bccf43d12eaa8b2c933459221476850

Contents?: true

Size: 1.06 KB

Versions: 24

Compression:

Stored size: 1.06 KB

Contents

module Steep
  module Drivers
    class Vendor
      attr_reader :stdout
      attr_reader :stderr
      attr_reader :stdin

      attr_accessor :vendor_dir
      attr_accessor :clean_before

      def initialize(stdout:, stderr:, stdin:)
        @stdout = stdout
        @stderr = stderr
        @stdin = stdin

        @clean_before = false
        @vendor_dir = nil
      end

      def run
        stdout.puts "Vendoring into #{vendor_dir}..."

        vendorer = RBS::Vendorer.new(vendor_dir: vendor_dir)

        if clean_before
          stdout.puts "  Cleaning directory..."
          vendorer.clean!
        end

        stdout.puts "  Vendoring standard libraries..."
        vendorer.stdlib!

        if defined?(Bundler)
          Bundler.locked_gems.specs.each do |spec|
            if RBS::EnvironmentLoader.gem_sig_path(spec.name, spec.version.to_s).directory?
              stdout.puts "  Vendoring rubygem: #{spec.full_name}..."
              vendorer.gem! spec.name, spec.version.to_s
            end
          end
        end

        0
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
steep-0.16.2 lib/steep/drivers/vendor.rb
steep-0.16.1 lib/steep/drivers/vendor.rb
steep-0.16.0 lib/steep/drivers/vendor.rb
steep-0.15.0 lib/steep/drivers/vendor.rb