Sha256: ec659889d2d292352ee1c047dccac5cf061ca8de003a96fbbb791cd24f1eb625

Contents?: true

Size: 804 Bytes

Versions: 14

Compression:

Stored size: 804 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
        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 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

14 entries across 14 versions & 1 rubygems

Version Path
rbs-2.2.2 lib/rbs/collection/installer.rb
rbs-2.2.1 lib/rbs/collection/installer.rb
rbs-2.2.0 lib/rbs/collection/installer.rb
rbs-2.1.0 lib/rbs/collection/installer.rb
rbs-2.0.0 lib/rbs/collection/installer.rb
rbs-2.0.0.pre2 lib/rbs/collection/installer.rb
rbs-2.0.0.pre1 lib/rbs/collection/installer.rb
rbs-1.8.1 lib/rbs/collection/installer.rb
rbs-1.8.0 lib/rbs/collection/installer.rb
rbs-1.7.1 lib/rbs/collection/installer.rb
rbs-1.7.0 lib/rbs/collection/installer.rb
rbs-1.7.0.beta.5 lib/rbs/collection/installer.rb
rbs-1.7.0.beta.4 lib/rbs/collection/installer.rb
rbs-1.7.0.beta.3 lib/rbs/collection/installer.rb