class RBS::Collection::Installer
Attributes
lockfile[R]
stdout[R]
Public Class Methods
new(lockfile_path:, stdout: $stdout)
click to toggle source
# File rbs-2.1.0/lib/rbs/collection/installer.rb, line 7 def initialize(lockfile_path:, stdout: $stdout) @lockfile = Config.from_path(lockfile_path) @stdout = stdout end
Public Instance Methods
install_from_lockfile()
click to toggle source
# File rbs-2.1.0/lib/rbs/collection/installer.rb, line 12 def install_from_lockfile install_to = lockfile.repo_path install_to.mkpath lockfile.gems.each do |config_entry| source_for(config_entry).install(dest: install_to, config_entry: config_entry, stdout: stdout) end stdout.puts "It's done! #{lockfile.gems.size} gems' RBSs now installed." end
Private Instance Methods
source_for(config_entry)
click to toggle source
# File rbs-2.1.0/lib/rbs/collection/installer.rb, line 21 def source_for(config_entry) @source_for ||= {} key = config_entry['source'] or raise @source_for[key] ||= Sources.from_config_entry(key) end