Last active
December 19, 2015 17:08
-
-
Save JorgenEvens/5988835 to your computer and use it in GitHub Desktop.
Create a jar which allows the usage of sass and compass through jruby (JVM). This allows you to use sass without having to install Ruby on your system.
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 | |
# Download a copy of the jruby-complete jar [here](http://www.jruby.org/download), | |
# and pass it as the first parameter to the script. | |
JRUBY="$1" | |
JAVA="java" | |
# Install compass / sass gems. | |
$JAVA -jar "$JRUBY" -S gem install compass -i ./tmp/gems | |
$JAVA -jar "$JRUBY" -S gem install --version '~> 0.9' rb-inotify -i ./tmp/gems | |
# Create a copy to which we will be adding compass / sass | |
cp $JRUBY ./tmp/sass.jar | |
# Cleanup and reorganize structure | |
rm -R ./tmp/gems/cache | |
rm -R ./tmp/gems/doc | |
mkdir -p ./tmp/gems/META-INF/jruby.home | |
mv ./tmp/gems/bin ./tmp/gems/META-INF/jruby.home/bin | |
# Bundle gems into jar | |
jar uf ./tmp/sass.jar -C ./tmp/gems . | |
# Cleanup | |
mv ./tmp/sass.jar . | |
rm -R ./tmp | |
echo "done. You can now use the jar as follows:" | |
echo "java -jar sass.jar -S sass --help" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment