Name: gemstash
Owner: Stembolt
Description: null
Created: 2015-12-03 23:13:29.0
Updated: 2015-12-03 23:13:30.0
Pushed: 2015-12-03 23:13:37.0
Homepage: null
Size: 368
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Gemstash is both a cache for remote servers such as https://www.rubygems.org, and a private gem source.
If you are using bundler across many machines that have access to a server within your control, you might want to use Gemstash.
If you produce gems that you don't want everyone in the world to have access to, you might want to use Gemstash.
If you frequently bundle the same set of gems across multiple projects, you might want to use Gemstash.
Are you only using gems from https://www.rubygems.org, and don't bundle the same gems frequently? Well, maybe you don't need Gemstash… yet.
Gemstash is designed to be quick and painless to get set up. By the end of this Quickstart Guide, you will be able to bundle stashed gems from public sources against a Gemstash server running on your machine.
Install Gemstash to get started:
m install gemstash
After it is installed, starting Gemstash requires no additional steps. Simply
start the Gemstash server with the gemstash
command:
mstash start
You may have noticed that the command finished quickly. This is because Gemstash will run the server in the background by default. The server runs on port 9292.
With the server running, you can bundle against it. Tell Bundler that you want to use Gemstash to find gems from RubyGems.org:
ndle config mirror.https://rubygems.org http://localhost:9292
Now you can create a Gemfile and install gems through Gemstash:
Gemfile
ce "https://rubygems.org"
"rubywarrior"
The gems you include should be gems you don't yet have installed, otherwise Gemstash will have nothing to stash. Now bundle:
ndle install --path .bundle
Your Gemstash server has fetched the gems from https://www.rubygems.org and cached them for you! To prove this, you can disable your Internet connection and try again. The gem dependencies from https://www.rubygems.org are cached for 30 minutes, so if you bundle again before that, you can successfully bundle without an Internet connection:
Disable your Internet first!
-rf Gemfile.lock .bundle
ndle
Once you've finish using your Gemstash server, you can stop it just as easily as you started it:
mstash stop
You'll also want to tell Bundler that it can go back to getting gems from RubyGems.org directly, instead of going through Gemstash:
ndle config --delete mirror.https://rubygems.org
You might wonder where the gems are stored. After running the commands above,
you will find a new directory at ~/.gemstash
. This directory holds all the
cached and private gems. It also has a server log, the database, and
configuration for Gemstash. If you prefer, you can point to a different directory.
Gemstash uses SQLite to store details about private
gems. The database will be located in ~/.gemstash
, however you won't see the
database appear until you start using private gems. If you prefer, you can use a different database.
Gemstash temporarily caches things like gem dependencies in memory. Anything
cached in memory will last for 30 minutes before being retrieved again. You can
use memcached instead of caching in memory. Gem files
are always cached permanently, so bundling with a Gemfile.lock
with all gems
cached will never call out to https://www.rubygems.org.
The server you ran is provided via Puma and Rack, however they are not customizable at this point.
For a deep dive into the following subjects, follow the links:
For an anatomy of various configuration and commands, follow the links:
After checking out the repo, run bin/setup
to install dependencies. Then, run
rake
to run RuboCop and the tests. While developing, you can run
bin/gemstash
to run Gemstash. You can also run bin/console
for an
interactive prompt that will allow you to experiment.
Bug reports and pull requests are welcome on GitHub at https://github.com/bundler/gemstash. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.