Project

mirrorfile

0.0
No release in over 3 years
Mirrorfile provides a DSL similar to Bundler's Gemfile for managing local mirrors of git repositories. Clone and keep repositories updated with simple commands. Includes Rails/Zeitwerk integration for autoloading mirrored code.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 5.0
~> 13.0
~> 1.21
~> 0.9
 Project Readme

Mirrorfile

Clone git repositories into a local mirrors/ folder and keep them updated. Uses a Mirrorfile with Bundler-like syntax.

Why use this

  • You want to vendor gems or libraries without git submodules
  • You need local copies of repos for reference or offline work
  • You want Zeitwerk to autoload code from external repos in Rails

Why not use this

  • Git submodules already work fine for you
  • You need pinned versions or tags (this just pulls HEAD)
  • You want proper dependency management (use Bundler)

Install

gem install mirrorfile

Usage

mirror init      # creates Mirrorfile, .gitignore entry, zeitwerk initializer
mirror install   # clones missing repos
mirror update    # pulls existing repos
mirror list      # shows defined mirrors

Example Mirrorfile

You can change sources mid-file:

# frozen_string_literal: true

# Rails ecosystem
source "https://github.com"

mirror "rails/rails", as: "rails-source"
mirror "hotwired/turbo-rails"
mirror "hotwired/stimulus-rails"

# Internal gems
source "https://git.company.com"

mirror "platform/shared-models", as: "shared-models"
mirror "platform/api-client"

# One-off from different host
mirror "https://gitlab.com/someorg/special-gem"

Contributing

Bug reports and pull requests are welcome on GitHub.

Development

After checking out the repo:

bin/setup
bundle exec rake test

Generate documentation:

bundle exec yard doc
bundle exec yard server  # Browse at http://localhost:8808

License

The gem is available as open source under the terms of the MIT License.