Last active
December 16, 2015 22:09
-
-
Save dgsuarez/5504512 to your computer and use it in GitHub Desktop.
Use mercurial instead of git in a gem generated by bundle 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
#! /bin/sh | |
set -e | |
bundle gem $1 | |
cd $1 | |
rm -rf .git | |
mv .gitignore .hgignore | |
sed -i -e "1s/^/syntax: glob\n/" .hgignore | |
sed -i 's|git ls-files -z.*|hg manifest -q\`.split("\\n")|' $1.gemspec | |
sed -i "s/end$/ spec.add_development_dependency 'rspec', '~> 1.3'\nend/" $1.gemspec | |
sed -i -e "/MIT/d" $1.gemspec | |
sed -i -e "/description/d" $1.gemspec | |
sed -i "s/TODO:.*\}/$1}/" $1.gemspec | |
mkdir -p "spec/$1" | |
cat > spec/spec_helper.rb <<EOF | |
require '$1' | |
EOF | |
hg init | |
hg addremove |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is not possible to make a Pull Request for a Gist, so here is mine, where the files inside the
test|spec|features
folders are automatically removed from the*.gemspec
file.