Skip to content

Commit d7fe845

Browse files
committed
describe how to install the gems
1 parent 9e6d19f commit d7fe845

File tree

1 file changed

+17
-3
lines changed
  • crates/rv/src/commands

1 file changed

+17
-3
lines changed

crates/rv/src/commands/ci.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,21 @@ async fn ci_inner(
5353
) -> Result<()> {
5454
let lockfile_contents = std::fs::read_to_string(lockfile_path)?;
5555
let lockfile = rv_lockfile::parse(&lockfile_contents)?;
56-
download_gems(lockfile, cache, max_concurrent_requests).await?;
56+
let gems = download_gems(lockfile, cache, max_concurrent_requests).await?;
57+
install_gems(gems);
58+
Ok(())
59+
}
60+
61+
fn install_gems(gems: Vec<Vec<Downloaded>>) -> Result<()> {
62+
// 1. Get the path where we want to put the gems from Bundler
63+
// ruby -rbundler -e 'puts Bundler.bundle_path'
64+
// 2. Unpack all the tarballs into DIR/gems/
65+
// each inner tarball inside a .gem goes into a directory that uses
66+
// the gem's name tuple of NAME-VERSION(-PLATFORM), like this:
67+
// nokogiri-1.18.10-arm64-darwin racc-1.8.1 rack-3.2.3 rake-13.3.0
68+
// 3. Generate binstubs into DIR/bin/
69+
// 4. Handle compiling native extensions for gems with native extensions
70+
// 5. Copy the .gem files and the .gemspec files into cache and specificatiosn?
5771
Ok(())
5872
}
5973

@@ -79,14 +93,14 @@ async fn download_gems<'i>(
7993
lockfile: GemfileDotLock<'i>,
8094
cache: &rv_cache::Cache,
8195
max_concurrent_requests: usize,
82-
) -> Result<()> {
96+
) -> Result<Vec<Vec<Downloaded>>> {
8397
let all_sources = futures_util::stream::iter(lockfile.gem);
8498
let downloaded: Vec<_> = all_sources
8599
.map(|gem_source| download_gem_source(gem_source, cache, max_concurrent_requests))
86100
.buffered(10)
87101
.try_collect()
88102
.await?;
89-
Ok(())
103+
Ok(downloaded)
90104
}
91105

92106
struct Downloaded {

0 commit comments

Comments
 (0)