From b4879b8f9d1a4e9f3628b2d3d21d535be3b06823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnaro=CC=88k?= Date: Tue, 28 Jan 2014 21:48:59 -0800 Subject: [PATCH 1/8] Simplify and sort Gemfile. --- Gemfile | 47 ++++++----------------------------------------- 1 file changed, 6 insertions(+), 41 deletions(-) diff --git a/Gemfile b/Gemfile index d625f1d..de54d5c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,46 +1,11 @@ source 'https://rubygems.org' -# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '4.0.1' - +gem 'activerecord-session_store' +gem 'coffee-rails', '~> 4.0.0' +gem 'jbuilder', '~> 1.2' +gem 'jquery-rails' gem 'pg' - -# Use SCSS for stylesheets +gem 'rails', '4.0.1' gem 'sass-rails', '~> 4.0.0' - -# Use Uglifier as compressor for JavaScript assets +gem 'sdoc', require: false, group: :doc gem 'uglifier', '>= 1.3.0' - -# Use CoffeeScript for .js.coffee assets and views -gem 'coffee-rails', '~> 4.0.0' - -# See https://github.com/sstephenson/execjs#readme for more supported runtimes -# gem 'therubyracer', platforms: :ruby - -# Use jquery as the JavaScript library -gem 'jquery-rails' - -# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks -#gem 'turbolinks' - -# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -gem 'jbuilder', '~> 1.2' - -gem 'activerecord-session_store' - - -group :doc do - # bundle exec rake doc:rails generates the API under doc/api. - gem 'sdoc', require: false -end -# Use ActiveModel has_secure_password -# gem 'bcrypt-ruby', '~> 3.1.2' - -# Use unicorn as the app server -# gem 'unicorn' - -# Use Capistrano for deployment -# gem 'capistrano', group: :development - -# Use debugger -# gem 'debugger', group: [:development, :test] From 1d86815c4aa3bc3972a53bca5a64e59246d1745a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnaro=CC=88k?= Date: Tue, 28 Jan 2014 22:02:46 -0800 Subject: [PATCH 2/8] Add dotenv-rails gem. --- Gemfile | 1 + Gemfile.lock | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Gemfile b/Gemfile index de54d5c..d2728a1 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,7 @@ source 'https://rubygems.org' gem 'activerecord-session_store' gem 'coffee-rails', '~> 4.0.0' +gem 'dotenv-rails' gem 'jbuilder', '~> 1.2' gem 'jquery-rails' gem 'pg' diff --git a/Gemfile.lock b/Gemfile.lock index 4c9c0df..10bc728 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,6 +39,9 @@ GEM coffee-script-source execjs coffee-script-source (1.6.3) + dotenv (0.9.0) + dotenv-rails (0.9.0) + dotenv (= 0.9.0) erubis (2.7.0) execjs (2.0.2) hike (1.2.3) @@ -112,6 +115,7 @@ PLATFORMS DEPENDENCIES activerecord-session_store coffee-rails (~> 4.0.0) + dotenv-rails jbuilder (~> 1.2) jquery-rails pg From dd7f3d499e9841440d7ee043c6b5c5f676222533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnaro=CC=88k?= Date: Tue, 28 Jan 2014 22:03:18 -0800 Subject: [PATCH 3/8] Add .env to .gitignore. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 6a502e9..4fd0910 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ # Ignore all logfiles and tempfiles. /log/*.log /tmp + +.env From 2415664448491d5f9a165f1fc90e60ea77f01d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnaro=CC=88k?= Date: Wed, 29 Jan 2014 15:04:13 -0800 Subject: [PATCH 4/8] Add initial development documentation. --- docs/development.md | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 docs/development.md diff --git a/docs/development.md b/docs/development.md new file mode 100644 index 0000000..d8c5e2a --- /dev/null +++ b/docs/development.md @@ -0,0 +1,69 @@ +# Development + +CoderDojoSV.com is written in the [Ruby][] programming language using the +[Ruby on Rails][Rails] web application framework. In order to add features or +fix bugs you will need to install Ruby version 2.0 or greater. Right now the +happy development path requires a Mac OS X, Linux, or BSD system but in the +future we hope to welcome our friends running Microsoft Windows as well. + +## Prerequisite Dependencies + +There are two pieces of software you need to install in advance. On Linux or +BSD these can be installed via your package manager. On Mac OS X they can be +installed via [Homebrew][] + +- Ruby version 2.0 or greater +- PostgreSQL version 9.0 or greater +- A text editor such as [Brackets (recommended)][Brackets], [Sublime Text][], or + any [other plain text editor][editor list]. + +## Getting Started + +To start working, use Git to clone the repository: + + $ git clone https://github.com/CoderDojoSV/CoderDojoSV-2.0.git coderdojosv.com + $ cd coderdojosv.com + +Then run the provided bootstrap script to get everything set up. If the script +fails in any way. [Open an issue][issue] to get help. + +Once the bootstrap script has run the first time, you'll need to configure +your local development environment using the `.env` file. + +## Configuration + +Open the `.env` file in your :pencil: text editor. It should contain the +following variables in the format + + export VARIABLE_NAME="variable value" + +### `DATABASE_URL`: The url-formatted location of your database. + +Format: postgres://*user name*:*passphrase*@*host name*/*database name*:*port* + +- *user name*: the username of the database user Rails should connect as. + Can be blank and usually is. +- *passphrase*: The database passphrase used to authenticate the user. Can be + blank and usually is. +- *host name*: The host name of the computer running the database. Usually + `localhost`. +- *database name*: The name of the database on the server. Usually + `coderdojosv_development` for our purposes. +- *port*: The TCP port to use to connect to the database. Leave blank to use + the PostgreSQL default. + +Example: `postgres://psqlTony:secretMonkeyFace77@localhost/coderdojosv_development:11988`. + +Suggested value: `postgres://localhost/coderdojosv_development` + +## Problems + +If you have any issues setting up, [open an issue][issue]! We'll help you out. + +[Ruby]: http://ruby-lang.org +[Rails]: http://rubyonrails.org +[Homebrew]: http://brew.sh/ +[issue]: https://github.com/CoderDojoSV/CoderDojoSV-2.0/issues/new +[Brackets]: http://brackets.io +[Sublime Text]: http://www.sublimetext.com/ +[editor list]: https://en.wikipedia.org/wiki/List_of_text_editors#Free_software_2 From c3d9195d7d1812a780d6bdec95d35dccb70d4f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnaro=CC=88k?= Date: Wed, 29 Jan 2014 15:05:39 -0800 Subject: [PATCH 5/8] markdown > rdoc. --- README.rdoc => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README.rdoc => README.md (100%) diff --git a/README.rdoc b/README.md similarity index 100% rename from README.rdoc rename to README.md From ca0974165dfe70d68e3a0ee9c005d353ff25aefc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnaro=CC=88k?= Date: Wed, 29 Jan 2014 15:08:04 -0800 Subject: [PATCH 6/8] Specify maintainer in docs and readme. --- README.md | 11 +++++++++-- docs/development.md | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 578f7fa..ebb21bd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ -== CoderDojoSV 2.0 Beta +CoderDojoSV 2.0 Beta +==================== -The re-make of coderdojosv.com written in Rails instead of Flask. +The re-make of coderdojosv.com written in [Ruby on Rails][] instead of +[Flask][]. There's also a new design, and we're working on a users system. + +The primary maintainer of CoderDojoSV.com is @iTweak0r. + +[Ruby on Rails]: http://rubyonrails.org +[Flask]: http://flask.pocoo.org/ diff --git a/docs/development.md b/docs/development.md index d8c5e2a..1db5000 100644 --- a/docs/development.md +++ b/docs/development.md @@ -6,6 +6,8 @@ fix bugs you will need to install Ruby version 2.0 or greater. Right now the happy development path requires a Mac OS X, Linux, or BSD system but in the future we hope to welcome our friends running Microsoft Windows as well. +The primary maintainer of CoderDojoSV.com is @iTweak0r. + ## Prerequisite Dependencies There are two pieces of software you need to install in advance. On Linux or From 78991f64cccb5a8ea99b874dbebaaa9c2d09fb34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnaro=CC=88k?= Date: Wed, 29 Jan 2014 17:37:02 -0800 Subject: [PATCH 7/8] Add script/bootstrap. --- .gitignore | 4 ++++ script/bootstrap | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100755 script/bootstrap diff --git a/.gitignore b/.gitignore index 4fd0910..caf2d1d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,9 @@ # Ignore bundler config. /.bundle +# Ignore installed gems. +/vendor/gems/ + # Ignore the default SQLite database. /db/*.sqlite3 /db/*.sqlite3-journal @@ -15,4 +18,5 @@ /log/*.log /tmp +# Ignore local configuration. .env diff --git a/script/bootstrap b/script/bootstrap new file mode 100755 index 0000000..0f3a938 --- /dev/null +++ b/script/bootstrap @@ -0,0 +1,60 @@ +#!/bin/sh +APP_ROOT="`dirname $0`/.." + +echo "Checking out your Ruby.." +which ruby > /dev/null +if [[ $? -ne 0 ]]; then + echo "Hey without Ruby we can't help you much. Install Ruby!" + exit 1 +fi + +echo "Checking out Bundler.." +which bundle > /dev/null +if [[ $? -ne 0 ]]; then + echo "You don't have bundler. It's cool though, I'm installing it for you." + gem install bundler || exit 1 +fi + +echo "Bundlin'.." +bundle install --local --path vendor/gems --without production || exit 1 + +if [[ -f "$APP_ROOT/.env" ]; then + cat <<-MESSAGE +You already have a .env file. + +Make sure it contains all environment variables documented +in docs/development.md +See https://github.com/coderdojosv/CoderDojoSV-2.0/tree/master/docs/development.md + MESSAGE +else + cat <<-MESSAGE +You don't have a .env file yet. This script has just created +one for you. Make sure you check it and fill in all required +fields as documented in docs/development.md + +See https://github.com/coderdojosv/CoderDojoSV-2.0/tree/master/docs/development.md + MESSAGE + + cat <<-DOTENV > "$APP_ROOT/.env" +export DATABASE_URL= + DOTENV +fi + +echo "Running unrun migrations" + +rake db:migrate + +if [[ $? -ne 0 ]]; then + echo "Looks like there's some trouble with the database" + echo "I'm trying to create a new one." + rake db:create || exit 2 + rake db:migrate || exit 2 + rake db:seed || exit 2 +fi + +echo "You're ready to start! Happy hacking!" + + + + + From c60f7bf00bbac597d34ce81904128585c6e5e2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnaro=CC=88k?= Date: Wed, 29 Jan 2014 17:50:40 -0800 Subject: [PATCH 8/8] Clarify formatting and link iTweak0r. --- README.md | 3 ++- docs/development.md | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ebb21bd..dcab0a4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ The re-make of coderdojosv.com written in [Ruby on Rails][] instead of There's also a new design, and we're working on a users system. -The primary maintainer of CoderDojoSV.com is @iTweak0r. +The primary maintainer of CoderDojoSV.com is [@iTweak0r][]. [Ruby on Rails]: http://rubyonrails.org [Flask]: http://flask.pocoo.org/ +[@iTweak0r]: https://github.com/iTweak0r diff --git a/docs/development.md b/docs/development.md index 1db5000..51c1500 100644 --- a/docs/development.md +++ b/docs/development.md @@ -6,7 +6,7 @@ fix bugs you will need to install Ruby version 2.0 or greater. Right now the happy development path requires a Mac OS X, Linux, or BSD system but in the future we hope to welcome our friends running Microsoft Windows as well. -The primary maintainer of CoderDojoSV.com is @iTweak0r. +The primary maintainer of CoderDojoSV.com is [@iTweak0r][]. ## Prerequisite Dependencies @@ -41,7 +41,7 @@ following variables in the format ### `DATABASE_URL`: The url-formatted location of your database. -Format: postgres://*user name*:*passphrase*@*host name*/*database name*:*port* +Format: postgres://*[user name]*:*[passphrase]*@*[host name]*/*[database name]*:*[port]* - *user name*: the username of the database user Rails should connect as. Can be blank and usually is. @@ -65,6 +65,7 @@ If you have any issues setting up, [open an issue][issue]! We'll help you out. [Ruby]: http://ruby-lang.org [Rails]: http://rubyonrails.org [Homebrew]: http://brew.sh/ +[@iTweak0r]: https://github.com/iTweak0r [issue]: https://github.com/CoderDojoSV/CoderDojoSV-2.0/issues/new [Brackets]: http://brackets.io [Sublime Text]: http://www.sublimetext.com/