Created
January 6, 2010 11:37
-
-
Save mikiobraun/270216 to your computer and use it in GitHub Desktop.
script to compile a rails app with jrubyc and bundle
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/bash | |
# | |
# Script to bundle this rails app with compiled ruby files. | |
# The main problem is that rails very much assumes that files | |
# end in ".rb", although jruby is also fine with loading | |
# ".class" files. | |
# | |
# The "solution" is to replace each ".rb" file with a file | |
# which loads the associated ".class" file. | |
rm -rf bundle | |
mkdir bundle | |
for i in app bin config db lib public script Rakefile vendor | |
do | |
cp -a $i bundle/ | |
done | |
jrubyc -t bundle app lib | |
cd bundle | |
for fn in $(find {app,lib} -name "*.rb") | |
do | |
cn=$(dirname $fn)/$(basename $fn .rb).class | |
echo >$fn "load '$cn'" | |
done | |
cd .. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment