Skip to content

Instantly share code, notes, and snippets.

@evanworley
Created December 9, 2009 18:11
Show Gist options
  • Save evanworley/252643 to your computer and use it in GitHub Desktop.
Save evanworley/252643 to your computer and use it in GitHub Desktop.
#! /bin/bash
if [ $# -lt 2 ]; then
echo "Usage testFastPath.sh CONSUMER_KEY CONSUMER_SECRET"
exit
fi
# Create a fresh rails project
rails testFastPath
cd testFastPath
# Get the fastpath ruby library
wget http://getsatisfaction.com/fastpass/ruby.tar.gz
tar xvf ruby.tar.gz
mv ruby/fastpass.rb lib
# Clean up
rm -rf ruby
rm ruby.tar.gz
# Install OAuth
sudo gem install oauth
# Create the fastpath initializer
echo "require 'fastpass'" > config/initializers/fastpath.rb
echo "CONSUMER_KEY = \"$1\"" >> config/initializers/fastpath.rb
echo "CONSUMER_SECRET = \"$2\"" >> config/initializers/fastpath.rb
# Create a view which makes the fastpath script request
rm public/index.html
script/generate controller root
echo "Making a request for the fastpath script.." > app/views/root/index.html.erb
echo "<%= FastPass.script(CONSUMER_KEY, CONSUMER_SECRET, 'fake@email.org', 'username', 1) %>" >> app/views/root/index.html.erb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment