Project

rhinestone

0.0
No commit activity in last 3 years
No release in over 3 years
Proxy to rubygems that returns the latest cached version of the requested url and updates the cache in the background
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Rhinestone

Has it ever bothered you how long bundle install command takes to run?

It has bothered me, so I wrote Rhinestone: a simple proxy caches both the gems and the gem metadata. It updates the cache after returning the response, so you get data that might be a little stale, but you get it very quickly. You should deploy it somewhere in your local network (so that more people use the same cache).

Installation

Just install it from RubyGems:

gem install rhinestone

Below is the upstart script I used to make it run on Ubuntu:

# File: /etc/init/rhinestone.conf

# Rhinestone - a RubyGems.org proxy

description "rhinestone proxy server"

start on runlevel [23]
stop on shutdown

exec sudo rhinestone -p 80 -e prod -l /var/log/rhinestone.log -P /var/run/rhinestone.pid -C /var/rhinestone/cache

respawn

Running

It's as simple as running:

rhinestone

Rhinestone uses Goliath underneath, so there are some switches you can use:

Server options:
    -e, --environment NAME           Set the execution environment (prod, dev or test) (default: development)
    -a, --address HOST               Bind to HOST address (default: 0.0.0.0)
    -p, --port PORT                  Use PORT (default: 9000)
    -S, --socket FILE                Bind to unix domain socket

Daemon options:
    -u, --user USER                  Run as specified user
    -c, --config FILE                Config file (default: ./config/<server>.rb)
    -d, --daemonize                  Run daemonized in the background (default: false)
    -l, --log FILE                   Log to file (default: off)
    -s, --stdout                     Log to stdout (default: false)
    -P, --pid FILE                   Pid file (default: off)

SSL options:
        --ssl                        Enables SSL (default: off)
        --ssl-key FILE               Path to private key
        --ssl-cert FILE              Path to certificate
        --ssl-verify                 Enables SSL certificate verification

Common options:
    -v, --verbose                    Enable verbose logging (default: false)
    -h, --help                       Display help message

Rhinestone-specific options:
    -C, --cache-path DIRECTORY       The directory where cache files will be stored

Usage

Assuming you have Rhinestone running somewhere in your local network, add this to your Gemfile:

source :rubygems
source "http://rhinestone.local" # the address of rhinestone

This will speed up bundle install about 5-6x times, and even more if you remove the rubygems part completely (but I don't recommend that). Note that the Rhinestone line is beneath rubygems one. Otherwise bundler would download most of the gems directly from Rubygems and not from the proxy.

You can also add it to your .gemrc file:

gem: --no-ri --no-rdoc
:sources:
- http://rhinestone.local

Author

Adam Pohorecki

License

MIT, see the MIT-LICENSE file.