Sha256: a1ad942ce746e88e6e43fb002e9473af4bb4cbb008cb99de202677f247e7b3ff

Contents?: true

Size: 778 Bytes

Versions: 5

Compression:

Stored size: 778 Bytes

Contents

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

      def initialize(lockfile_path:, stdout: $stdout)
        @lockfile = Config.from_path(lockfile_path)
        @stdout = stdout
      end

      def install_from_lockfile
        install_to = lockfile.repo_path
        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 def source_for(config_entry)
        @source_for ||= {}
        key = config_entry['source'] or raise
        @source_for[key] ||= Sources.from_config_entry(key)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rbs-1.7.0.beta.2 lib/rbs/collection/installer.rb
rbs-1.7.0.beta.1 lib/rbs/collection/installer.rb
rbs-1.6.2 lib/rbs/collection/installer.rb
rbs-1.6.1 lib/rbs/collection/installer.rb
rbs-1.6.0 lib/rbs/collection/installer.rb