The central place to discover openFrameworks addons.
Clone the repository:
$ git clone https://github.com/atduskgreg/ofxaddons.com
Change directories in to the cloned repository:
$ cd ofxaddons.com
Install the gems dependencies
$ bundle install
Set up the database.
You have two basic options: start with an empty database, or grab a backup.
$ rake db:setup
Create a dotenv file:
WARNING: Never check in the .env
file. It will screw up the production environment.
$ touch .env
Open up .env and add the following lines:
PORT=5000
WEB_CONCURRENCY=1
Launch the server:
$ bundle exec unicorn
You should now be able to navigate to load the web site at http://localhost:3000
If you want to avoid rate limiting (hint: you do) with the Github API then you need to register a new application and get some API keys.
API keys are strictly optional. If you don't use them, the app will run fine, but you'll be subject to rate limiting. After you make a few thousand requests Github will start rejecting your requests.
Once you've got your API keys, there are several ways to set up your environment, but here's one way using Foreman.
If needed, create a .env
file in the repository root
$ touch .env
WARNING: Never check in the .env
file. It will screw up the production environment.
Add your API key and secret to the file:
GITHUB_CLIENT_ID=xxxxxxxxxxxxxxxxxxxx
GITHUB_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Restart Foreman
Further reading on using foreman for config vars.
Crawling and updating is run through the script runner:
$ rails r 'Importer.new.run'
The importer currently logs into the rails log for whatever env you're running (e.g. log/devlopment.log). A simple way to monitor is to tail the log file:
$ tail -f log/development.log
By default the importer uses caching in the development environment. This helps speed up development when you're working on the importer since you skip all the HTTP request overhead and just read the responses off of the local disk. You can blow away the caches with rake tmp:cache:clear
. Or you can manually delete individual caches files in tmp/caches/importer
.
You can force caching behaiour by passing an options hash to run:
$ rails r 'Importer.new.run(cache: false)'
If you pass cache: true
, the importer will use cached responses from the github API (if available).