Created
August 2, 2011 23:49
-
-
Save stefanpenner/1121538 to your computer and use it in GitHub Desktop.
Ruby Turbo
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
# snip.. | |
#unstable for prod but fine for development | |
# credit to @burkelibbey | |
function turbo(){ | |
if [[ $RUBY_HEAP_MIN_SLOTS != 1000000 ]] | |
then | |
export RUBY_HEAP_MIN_SLOTS=1000000 | |
export RUBY_HEAP_SLOTS_INCREMENT=1000000 | |
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 | |
export RUBY_HEAP_FREE_MIN=500000 | |
export RUBY_GC_MALLOC_LIMIT=1000000000 | |
export turbo_tag="⚡" | |
else | |
unset RUBY_HEAP_MIN_SLOTS | |
unset RUBY_HEAP_SLOTS_INCREMENT | |
unset RUBY_HEAP_SLOTS_GROWTH_FACTOR | |
unset RUBY_HEAP_FREE_MIN | |
unset RUBY_GC_MALLOC_LIMIT | |
unset turbo_tag | |
fi | |
build_ps1 | |
} | |
# snip.. |
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
# haxor rails/bundler to boot off specific load_paths, | |
# not the super massive one supplied by bundler | |
begin | |
require File.expand_path('../../.bundle/environment', __FILE__) | |
rescue LoadError | |
$:.reject! {|path| path =~ /gem/} | |
$:.unshift "/tmp/crap/" | |
require 'pathname' | |
root = Pathname.new("").expand_path.to_s | |
$:.unshift root | |
$:.unshift root + "vendor/plugins/country_select" | |
require 'rubygems' | |
require 'bundler' | |
end | |
module Bundler | |
class Runtime < Environment | |
include SharedHelpers | |
def setup(*args) | |
self | |
end | |
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
#!/bin/sh | |
# brittle prototype | |
mkdir -p /tmp/crap | |
for file in `bundle exec rails runner "puts $:" | grep -e '/lib$' ` | |
do | |
echo "$file/"* /tmp/crap | |
cp -R "$file/"* /tmp/crap | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment