Created
November 24, 2009 05:30
-
-
Save jpr5/241667 to your computer and use it in GitHub Desktop.
RubyGems Defanger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Populate $BASE with symlinks to what you want, and put the rubygems.rb file at its root. | |
function rubylib { | |
if [ -n "$1" ]; then BASE="$1/"; else BASE="/proj/work/rubylib"; fi | |
export BASE | |
echo RUBYLIB will use base: $BASE | |
export RUBYLIB=$BASE:`ruby -e 'puts Dir["#{ENV["BASE"]}/*/**/lib"].join(":")'`:$RUBYLIB | |
} | |
alias rl=rubylib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RubyGem Defanger | |
# | |
# This basically disables the version-enforcing part of rubygems. | |
# | |
# Ideal for for people who want rubygems to stop fucking with their shit, and for gem | |
# developers to stop being assholes by forcing people to use it. | |
# | |
# Make sure this file is hit first in $: / $LOADPATH. See the .bashrc piece. | |
$:.delete(File.dirname(__FILE__)) | |
load 'rubygems.rb' | |
module Kernel | |
def gem(*args) | |
raise LoadError if args.first == 'mongrel_experimental' | |
end | |
end | |
class Gem::Specification | |
def add_development_dependency(*args) | |
end | |
def add_dependency(*args) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jpr5@finesse(~)$ rubylib | |
RUBYLIB will use base: /proj/work/rubylib | |
jpr5@finesse(~)$ cd /proj/work/dm-core.git | |
jpr5@finesse(dm-core.git)$ ADAPTERS=mysql rake spec | |
(in /Projects/work/dm-core.git) | |
All dependencies seem to be installed. | |
# 0h gn0z! legg0 my rubyg3mz! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment