Gemfile Syntax Comparison
Compare Bundler's Gemfile syntax with Rad's enhanced format and understand the compatibility between them.
Basic Compatibility
Rad is fully compatible with Bundler's Gemfile format. Any valid Bundler Gemfile will work with Rad without modifications. This guarantees a smooth transition between the two tools.
Standard Gemfile Features
Below are the standard Gemfile features supported by both Bundler and Rad:
Rad's Enhanced Features
Rad offers several enhancements to the standard Gemfile format that provide better performance and more precise dependency management:
Advanced Feature Comparison
Feature | Bundler Syntax | Rad Enhanced Syntax | Benefits |
---|---|---|---|
Source Priority | source "https://example.com" | source "https://example.com", priority: :highest | Better control over gem source resolution |
Version Constraints | gem "rails", "~> 7.1.0" | gem "rails", "~> 7.1.0", exact_minor: true | More precise version pinning |
Platform Handling | platforms :ruby do | gem "pg", platforms: [:ruby, :native] | Finer-grained platform control |
Git Integration | gem "rails", git: "..." | gem "rails", git: "...", sparse: true | Faster git operations with sparse checkout |
Parallel Installation | Not available in Gemfile | install_options parallel: true, jobs: 4 | Faster installation with parallelism |
Gemfile.rad Lockfile
Rad generates a Gemfile.rad
lockfile alongside Bundler's Gemfile.lock
. Both files can coexist in the same project:
Key Differences in Lockfiles
While the format is compatible, Rad's lockfile includes additional metadata for faster resolution:
- Enhanced checksum algorithms for better integrity verification
- Optimized dependency graph representation for faster loading
- Platform-specific metadata for improved cross-platform compatibility
- Performance statistics and benchmarks (optional)
Migrating Between Formats
Converting Bundler's Lockfile to Rad
Rad can automatically convert a Bundler lockfile to its own format:
Using Rad's Enhanced Features
To take advantage of Rad's enhanced features while maintaining Bundler compatibility:
- Start with your existing Bundler Gemfile
- Add Rad-specific enhancements as needed
- Run
rad install
to generate both lockfiles - Commit both lockfiles to your repository
Best Practices
- Maintain compatibility with both Bundler and Rad during team transitions
- Use Rad's enhanced features for performance-critical projects
- Document your Gemfile's special features for team awareness
- Leverage Rad's advanced platform support for cross-platform development
- Consider using CI matrix builds with both Bundler and Rad for thorough testing