Skip to content

Instantly share code, notes, and snippets.

@aycabta
Last active Sep 7, 2017
Embed
What would you like to do?
#!/bin/bash
if [ $# -ne 1 ]; then
echo 'Usage: ./doctest.sh username/repository'
exit -1
fi
GITHUB_REPOSITORY_PATH=$1
GITHUB_USERNAME=`echo $GITHUB_REPOSITORY_PATH | sed -e 's/\/.\+$//'`
if [ ! -d original-rdoc ]; then
git clone -b master --single-branch git@github.com:ruby/rdoc.git original-rdoc
cd original-rdoc
git checkout -q 0c5eb20 # This is HEAD of master as of now
bundle --quiet
cd ..
fi
if [ ! -d ripper-rdoc ]; then
git clone -b use-ripper --single-branch git@github.com:aycabta/rdoc.git ripper-rdoc
cd ripper-rdoc
git checkout -q 23f12c1 # This is HEAD of use-ripper branch as of now
bundle --quiet
cd ..
fi
if [ ! -d $GITHUB_USERNAME ]; then
mkdir $GITHUB_USERNAME
fi
if [ ! -d $GITHUB_REPOSITORY_PATH ]; then
git clone --depth 1 git@github.com:$GITHUB_REPOSITORY_PATH.git $GITHUB_REPOSITORY_PATH
fi
RUBYOPT=-Ioriginal-rdoc/lib ruby original-rdoc/exe/rdoc -o $GITHUB_REPOSITORY_PATH/doc-original $GITHUB_REPOSITORY_PATH
RUBYOPT=-Iripper-rdoc/lib ruby ripper-rdoc/exe/rdoc -o $GITHUB_REPOSITORY_PATH/doc-ripper $GITHUB_REPOSITORY_PATH
diff -ru --exclude=*.js --exclude=*.gz --exclude=*.css --exclude=*.png --exclude=*.gif --exclude=*.ttf --exclude=created.rid $GITHUB_REPOSITORY_PATH/doc-original $GITHUB_REPOSITORY_PATH/doc-ripper | less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment