Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku-ready #9

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.bundle
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

ruby '2.1.0'
#ruby-gemset=wtfismyopendatastrategy

gem 'rack'
gem 'thin'
gem 'rake'
19 changes: 19 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
GEM
remote: https://rubygems.org/
specs:
daemons (1.1.9)
eventmachine (1.0.3)
rack (1.5.2)
rake (10.2.1)
thin (1.6.2)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
rack (>= 1.0.0)

PLATFORMS
ruby

DEPENDENCIES
rack
rake
thin
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Inspired by [WhatTheFuckShouldIMakeForDinner.com](http://whatthefuckshouldimakef

It's very simple to use and now allows you to populate it using either vanilla JavaScript objects, JSON files or direct feeds from Google spreadsheets.

This fork is designed to deploy very easily onto Heroku, see below.

## How to use it

To make your own, simply [clone](github-mac://openRepo/https://github.com/soulwire/WTFEngine) or [download](https://github.com/soulwire/WTFEngine/archive/master.zip) this repository and start populating the engine with your content.
Expand Down Expand Up @@ -34,6 +36,17 @@ For example, here is a basic corpus

As you can see, in a template you use the __@__ symbol, followed by the type of word you wish to use to tell the WTF Engine to pick a random word of that type from the corpus and insert it at that point.

## Deploying it

This fork is designed to deploy directly onto Heroku. It _should_ be as simple as

* Create (or more likely copy) the Google spreadsheet
* Put the spreadsheet ID into _public/scripts/main.js_
* Commit the changes
* `heroku apps:create --region eu`
* `git push heroku master`
* `heroku open`

## Showcase

I've been pleasantly surprised to find several people using this template to create their own sites. Among them are:
Expand Down
14 changes: 14 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use Rack::Static,
:urls => ['/styles', '/scripts'],
:root => 'public'

run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('public/index.html', File::RDONLY)
]
}
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/main.js → public/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ $(function() {

// Populate using a Google spreadsheet ID (you must publish it first!)
// @see https://support.google.com/drive/answer/37579?hl=en
WTF.init( '0AvG1Hx204EyydF9ub1M2cVJ3Z1VGdDhTSWg0ZV9LNGc' );
WTF.init( '0AvyECrEnW-a1dHp5TFg4T1RielRfZ1lSTDhWOFhlM0E' );

});
});
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion styles/main.css → public/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ footer a {

footer a:hover {
text-decoration: underline;
}
}