class RBS::Collection::Installer
Attributes
lockfile
[R]
Config::Lockfile
stdout
[R]
CLI::_IO
Public Class Methods
(lockfile_path: Pathname, ?stdout: CLI::_IO) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/collection/installer.rb, line 9 def initialize(lockfile_path:, stdout: $stdout) @lockfile = Config::Lockfile.from_lockfile(lockfile_path: lockfile_path, data: YAML.load_file(lockfile_path)) @stdout = stdout end
Public Instance Methods
() → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/collection/installer.rb, line 14 def install_from_lockfile install_to = lockfile.fullpath install_to.mkpath selected = lockfile.gems.select do |name, gem| gem[:source].has?(name, gem[:version]) end selected.each_value do |gem| gem[:source].install( dest: install_to, name: gem[:name], version: gem[:version], stdout: stdout ) end CLI::ColoredIO.new(stdout: stdout).puts_green("It's done! #{selected.size} gems' RBSs now installed.") end
(Config::gem_entry) → Sources::_Source
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/sig/collection/installer.rbs, line 14
def source_for: (Config::gem_entry) -> Sources::_Source