Created
June 13, 2013 02:56
-
-
Save keithrbennett/5770915 to your computer and use it in GitHub Desktop.
Shows a strategy for creating both MRI and JRuby versions of a gem.
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
# Builds the gem for the current rvm ruby/platform. | |
# Run this once for MRI and once for JRuby, as in: | |
# | |
# rvm 1.9 | |
# ./build_gem.sh | |
# rvm jruby | |
# ./build_gem.sh | |
GEM_NAME=my_gem | |
GEM_SPEC=${GEM_NAME}.gemspec | |
RUBY_VERSION=`rvm current` | |
GEMFILE_LOCK_VERSION_SAVE_NAME=Gemfile.lock.${RUBY_VERSION} | |
echo Building gem $GEM_NAME from $GEM_SPEC for Ruby version $RUBY_VERSION. | |
echo The Gemfile.lock for this version will be copied to $GEMFILE_LOCK_VERSION_SAVE_NAME. | |
mv Gemfile.lock Gemfile.sav 2> /dev/null | |
echo Running bundle install... | |
bundle install | |
cp Gemfile.lock $GEMFILE_LOCK_VERSION_SAVE_NAME | |
echo Building gem from $GEM_SPEC... | |
gem build $GEM_SPEC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment