Sha256: 915c2b388f2b29d808f15423bed81bf6fddb8891f92cf38e259bb6ea82d44b69

Contents?: true

Size: 772 Bytes

Versions: 12

Compression:

Stored size: 772 Bytes

Contents

# frozen_string_literal: true

module RBS
  module Collection
    class Installer
      attr_reader :lockfile
      attr_reader :stdout

      def initialize(lockfile_path:, stdout: $stdout)
        @lockfile = Config::Lockfile.from_lockfile(lockfile_path: lockfile_path, data: YAML.load_file(lockfile_path))
        @stdout = stdout
      end

      def install_from_lockfile
        install_to = lockfile.fullpath
        install_to.mkpath
        lockfile.gems.each_value do |gem|
          gem[:source].install(
            dest: install_to,
            name: gem[:name],
            version: gem[:version],
            stdout: stdout
          )
        end
        stdout.puts "It's done! #{lockfile.gems.size} gems' RBSs now installed."
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rbs-3.1.3 lib/rbs/collection/installer.rb
rbs-3.1.2 lib/rbs/collection/installer.rb
rbs-3.1.1 lib/rbs/collection/installer.rb
rbs-3.1.0 lib/rbs/collection/installer.rb
rbs-3.0.4 lib/rbs/collection/installer.rb
rbs-3.0.3 lib/rbs/collection/installer.rb
rbs-3.0.2 lib/rbs/collection/installer.rb
rbs-3.0.1 lib/rbs/collection/installer.rb
rbs-3.0.0 lib/rbs/collection/installer.rb
rbs-3.0.0.dev.3 lib/rbs/collection/installer.rb
rbs-3.0.0.dev.2 lib/rbs/collection/installer.rb
rbs-3.0.0.dev.1 lib/rbs/collection/installer.rb