From bedbef764b325f53fafab57ca9d78c6c7ad79ec8 Mon Sep 17 00:00:00 2001 From: pikesley Date: Wed, 26 Mar 2014 15:12:20 +0000 Subject: [PATCH 1/7] Heroku-ready --- .bundle/install.log | 7 +++++++ Gemfile | 8 ++++++++ Gemfile.lock | 19 ++++++++++++++++++ config.ru | 14 +++++++++++++ MIT-LICENSE.txt => public/MIT-LICENSE.txt | 0 README.md => public/README.md | 0 {images => public/images}/favicon.ico | Bin {images => public/images}/favicon.png | Bin {images => public/images}/loading.gif | Bin index.html => public/index.html | 0 sample.json => public/sample.json | 0 {scripts => public/scripts}/main.js | 0 .../scripts}/vendor/zepto.min.js | 0 {scripts => public/scripts}/wtf.js | 0 {styles => public/styles}/main.css | 0 15 files changed, 48 insertions(+) create mode 100644 .bundle/install.log create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 config.ru rename MIT-LICENSE.txt => public/MIT-LICENSE.txt (100%) rename README.md => public/README.md (100%) rename {images => public/images}/favicon.ico (100%) rename {images => public/images}/favicon.png (100%) rename {images => public/images}/loading.gif (100%) rename index.html => public/index.html (100%) rename sample.json => public/sample.json (100%) rename {scripts => public/scripts}/main.js (100%) rename {scripts => public/scripts}/vendor/zepto.min.js (100%) rename {scripts => public/scripts}/wtf.js (100%) rename {styles => public/styles}/main.css (100%) diff --git a/.bundle/install.log b/.bundle/install.log new file mode 100644 index 0000000..9026ac7 --- /dev/null +++ b/.bundle/install.log @@ -0,0 +1,7 @@ +# Logfile created on 2014-03-26 15:10:48 +0000 by logger.rb/44203 +I, [2014-03-26T15:10:48.755507 #39546] INFO -- : 0: rake (10.2.1) from /Users/sam/.rvm/gems/ruby-2.1.0/specifications/rake-10.2.1.gemspec +I, [2014-03-26T15:10:48.755842 #39546] INFO -- : 0: daemons (1.1.9) from /Users/sam/.rvm/gems/ruby-2.1.0/specifications/daemons-1.1.9.gemspec +I, [2014-03-26T15:10:48.756204 #39546] INFO -- : 0: eventmachine (1.0.3) from /Users/sam/.rvm/gems/ruby-2.1.0/specifications/eventmachine-1.0.3.gemspec +I, [2014-03-26T15:10:48.756636 #39546] INFO -- : 0: rack (1.5.2) from /Users/sam/.rvm/gems/ruby-2.1.0/specifications/rack-1.5.2.gemspec +I, [2014-03-26T15:10:50.594703 #39546] INFO -- : 0: thin (1.6.2) from /Users/sam/.rvm/gems/ruby-2.1.0/specifications/thin-1.6.2.gemspec +I, [2014-03-26T15:10:50.595303 #39546] INFO -- : 0: bundler (1.5.0) from /Users/sam/.rvm/gems/ruby-2.1.0@global/specifications/bundler-1.5.0.gemspec diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..824e1ca --- /dev/null +++ b/Gemfile @@ -0,0 +1,8 @@ +source 'https://rubygems.org' + +ruby '2.1.0' +#ruby-gemset=wtfismyopendatastrategy + +gem 'rack' +gem 'thin' +gem 'rake' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..764f518 --- /dev/null +++ b/Gemfile.lock @@ -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 diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..28cf8ac --- /dev/null +++ b/config.ru @@ -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) + ] +} diff --git a/MIT-LICENSE.txt b/public/MIT-LICENSE.txt similarity index 100% rename from MIT-LICENSE.txt rename to public/MIT-LICENSE.txt diff --git a/README.md b/public/README.md similarity index 100% rename from README.md rename to public/README.md diff --git a/images/favicon.ico b/public/images/favicon.ico similarity index 100% rename from images/favicon.ico rename to public/images/favicon.ico diff --git a/images/favicon.png b/public/images/favicon.png similarity index 100% rename from images/favicon.png rename to public/images/favicon.png diff --git a/images/loading.gif b/public/images/loading.gif similarity index 100% rename from images/loading.gif rename to public/images/loading.gif diff --git a/index.html b/public/index.html similarity index 100% rename from index.html rename to public/index.html diff --git a/sample.json b/public/sample.json similarity index 100% rename from sample.json rename to public/sample.json diff --git a/scripts/main.js b/public/scripts/main.js similarity index 100% rename from scripts/main.js rename to public/scripts/main.js diff --git a/scripts/vendor/zepto.min.js b/public/scripts/vendor/zepto.min.js similarity index 100% rename from scripts/vendor/zepto.min.js rename to public/scripts/vendor/zepto.min.js diff --git a/scripts/wtf.js b/public/scripts/wtf.js similarity index 100% rename from scripts/wtf.js rename to public/scripts/wtf.js diff --git a/styles/main.css b/public/styles/main.css similarity index 100% rename from styles/main.css rename to public/styles/main.css From 295e12361e780470f1edd56125d93951f4ab89d3 Mon Sep 17 00:00:00 2001 From: pikesley Date: Wed, 26 Mar 2014 15:25:21 +0000 Subject: [PATCH 2/7] Spreadsheet link --- public/scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/main.js b/public/scripts/main.js index 87c4d3f..e762fc7 100644 --- a/public/scripts/main.js +++ b/public/scripts/main.js @@ -38,4 +38,4 @@ $(function() { // @see https://support.google.com/drive/answer/37579?hl=en WTF.init( '0AvG1Hx204EyydF9ub1M2cVJ3Z1VGdDhTSWg0ZV9LNGc' ); -}); \ No newline at end of file +}); From c552b2698dc9c8f561ba5f747da9ba3d905c6e50 Mon Sep 17 00:00:00 2001 From: pikesley Date: Wed, 26 Mar 2014 15:29:19 +0000 Subject: [PATCH 3/7] Oh I'm an idiot --- public/scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/main.js b/public/scripts/main.js index e762fc7..c5f1d29 100644 --- a/public/scripts/main.js +++ b/public/scripts/main.js @@ -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' ); }); From 1adaf0a0acb2be2e542051449da6f06389c6fb3c Mon Sep 17 00:00:00 2001 From: pikesley Date: Wed, 26 Mar 2014 21:49:23 +0000 Subject: [PATCH 4/7] Heroku-ready --- public/styles/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/styles/main.css b/public/styles/main.css index 36f9e13..8107e00 100644 --- a/public/styles/main.css +++ b/public/styles/main.css @@ -117,4 +117,4 @@ footer a { footer a:hover { text-decoration: underline; -} \ No newline at end of file +} From b61e19c907614fba2df75708f14e1efd813bd250 Mon Sep 17 00:00:00 2001 From: pikesley Date: Wed, 26 Mar 2014 22:33:18 +0000 Subject: [PATCH 5/7] Nope --- .bundle/install.log | 7 ------- .gitignore | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 .bundle/install.log create mode 100644 .gitignore diff --git a/.bundle/install.log b/.bundle/install.log deleted file mode 100644 index 9026ac7..0000000 --- a/.bundle/install.log +++ /dev/null @@ -1,7 +0,0 @@ -# Logfile created on 2014-03-26 15:10:48 +0000 by logger.rb/44203 -I, [2014-03-26T15:10:48.755507 #39546] INFO -- : 0: rake (10.2.1) from /Users/sam/.rvm/gems/ruby-2.1.0/specifications/rake-10.2.1.gemspec -I, [2014-03-26T15:10:48.755842 #39546] INFO -- : 0: daemons (1.1.9) from /Users/sam/.rvm/gems/ruby-2.1.0/specifications/daemons-1.1.9.gemspec -I, [2014-03-26T15:10:48.756204 #39546] INFO -- : 0: eventmachine (1.0.3) from /Users/sam/.rvm/gems/ruby-2.1.0/specifications/eventmachine-1.0.3.gemspec -I, [2014-03-26T15:10:48.756636 #39546] INFO -- : 0: rack (1.5.2) from /Users/sam/.rvm/gems/ruby-2.1.0/specifications/rack-1.5.2.gemspec -I, [2014-03-26T15:10:50.594703 #39546] INFO -- : 0: thin (1.6.2) from /Users/sam/.rvm/gems/ruby-2.1.0/specifications/thin-1.6.2.gemspec -I, [2014-03-26T15:10:50.595303 #39546] INFO -- : 0: bundler (1.5.0) from /Users/sam/.rvm/gems/ruby-2.1.0@global/specifications/bundler-1.5.0.gemspec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..677c465 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.bundle From 7ea7d510e223b987996a885fc19af04470a5b3b9 Mon Sep 17 00:00:00 2001 From: pikesley Date: Wed, 26 Mar 2014 22:34:09 +0000 Subject: [PATCH 6/7] Move into root --- public/MIT-LICENSE.txt => MIT-LICENSE.txt | 0 public/README.md => README.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename public/MIT-LICENSE.txt => MIT-LICENSE.txt (100%) rename public/README.md => README.md (100%) diff --git a/public/MIT-LICENSE.txt b/MIT-LICENSE.txt similarity index 100% rename from public/MIT-LICENSE.txt rename to MIT-LICENSE.txt diff --git a/public/README.md b/README.md similarity index 100% rename from public/README.md rename to README.md From 51eb2ef37e0425bc157683b79901fdb94429fcbb Mon Sep 17 00:00:00 2001 From: pikesley Date: Sun, 30 Mar 2014 20:44:39 +0100 Subject: [PATCH 7/7] Heroku notes --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index d867c71..c79e8aa 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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: