diff --git a/.gitignore b/.gitignore index d3e30e44..c3fe29c0 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,11 @@ # Ignore ruby version files .ruby-version .rvmrc + +# Ignore VMs and disc images +*.iso +*.box +.vagrant/ + +# Precompiled assets +/public/assets diff --git a/Gemfile.lock b/Gemfile.lock index 74f3a098..0750f3ee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,18 +14,17 @@ GEM rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) - activeadmin (0.6.0) - arbre (>= 1.0.1) - bourbon (>= 1.0.0) - devise (>= 1.1.2) - fastercsv - formtastic (>= 2.0.0) - inherited_resources (>= 1.3.1) - jquery-rails (>= 1.0.0) - kaminari (>= 0.13.0) - meta_search (>= 0.9.2) - rails (>= 3.0.0) - sass (>= 3.1.0) + activeadmin (0.6.3) + arbre (~> 1.0) + bourbon (>= 1.0.0, < 4) + devise (>= 1.5.4, < 4, != 2.2.2, != 2.2.1, != 2.2.0, != 2.1.2, != 2.1.1, != 2.1.0, != 2.0.4, != 2.0.3, != 2.0.2, != 2.0.1, != 2.0.0) + formtastic (~> 2.0) + inherited_resources (~> 1.3) + jquery-rails (>= 1.0.0, < 3) + kaminari (~> 0.13, != 0.15.0) + meta_search (~> 1.0) + rails (>= 3.0.0, < 4) + sass (~> 3.1) activemodel (3.2.17) activesupport (= 3.2.17) builder (~> 3.0.0) @@ -45,24 +44,24 @@ GEM arbre (1.0.1) activesupport (>= 3.0.0) arel (3.0.3) - aws-sdk (1.36.1) + aws-sdk (1.37.0) json (~> 1.4) nokogiri (>= 1.4.4) uuidtools (~> 2.1) bcrypt (3.1.7) bcrypt-ruby (3.1.5) bcrypt (>= 3.1.3) - bourbon (3.1.3) + bourbon (3.1.8) sass (>= 3.2.0) thor builder (3.0.4) - capybara (2.2.0) + capybara (2.2.1) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - chunky_png (1.2.8) + chunky_png (1.3.0) climate_control (0.0.3) activesupport (>= 3.0) cocaine (0.5.3) @@ -73,48 +72,48 @@ GEM coffee-script (2.2.0) coffee-script-source execjs - coffee-script-source (1.6.2) - compass (0.12.2) + coffee-script-source (1.7.0) + compass (0.12.4) chunky_png (~> 1.2) fssm (>= 0.2.7) - sass (~> 3.1) - compass-rails (1.0.3) - compass (>= 0.12.2, < 0.14) + sass (~> 3.2.17) + compass-rails (1.1.7) + compass (>= 0.12.2) + sprockets (<= 2.11.0) devise (2.2.8) bcrypt-ruby (~> 3.0) orm_adapter (~> 0.1) railties (~> 3.1) warden (~> 1.2.1) - diff-lcs (1.2.3) + diff-lcs (1.2.5) erubis (2.7.0) - execjs (1.4.0) - multi_json (~> 1.0) - faraday (0.8.7) - multipart-post (~> 1.1) - fastercsv (1.5.5) + execjs (2.0.2) + faraday (0.9.0) + multipart-post (>= 1.2, < 3) formtastic (2.2.1) actionpack (>= 3.0) friendly_id (4.0.10.1) activerecord (>= 3.0, < 4.0) fssm (0.2.10) - geocoder (1.1.8) - gmaps4rails (1.5.6) - has_scope (0.5.1) - hashie (2.0.3) + geocoder (1.1.9) + gmaps4rails (2.1.2) + has_scope (0.6.0.rc) + actionpack (>= 3.2, < 5) + activesupport (>= 3.2, < 5) + hashie (2.0.5) hike (1.2.3) - httpauth (0.2.0) i18n (0.6.9) - inherited_resources (1.4.0) - has_scope (~> 0.5.0) - responders (~> 0.9) + inherited_resources (1.4.1) + has_scope (~> 0.6.0.rc) + responders (~> 1.0.0.rc) journey (1.0.4) - jquery-rails (2.2.1) + jquery-rails (2.3.0) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.8.1) - jwt (0.1.8) + jwt (0.1.11) multi_json (>= 1.5) - kaminari (0.14.1) + kaminari (0.15.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) mail (2.5.4) @@ -127,28 +126,31 @@ GEM polyamorous (~> 0.5.0) mime-types (1.25.1) mini_portile (0.5.2) - multi_json (1.9.0) - multipart-post (1.2.0) - newrelic_rpm (3.7.1.182) + multi_json (1.9.2) + multi_xml (0.5.5) + multipart-post (2.0.0) + newrelic_rpm (3.7.1.188) nokogiri (1.6.1) mini_portile (~> 0.5.0) - oauth2 (0.8.1) - faraday (~> 0.8) - httpauth (~> 0.1) - jwt (~> 0.1.4) - multi_json (~> 1.0) + oauth2 (0.9.3) + faraday (>= 0.8, < 0.10) + jwt (~> 0.1.8) + multi_json (~> 1.3) + multi_xml (~> 0.5) rack (~> 1.2) - omniauth (1.1.4) + omniauth (1.2.1) hashie (>= 1.2, < 3) - rack - omniauth-github (1.1.0) + rack (~> 1.0) + omniauth-github (1.1.1) omniauth (~> 1.0) omniauth-oauth2 (~> 1.1) - omniauth-oauth2 (1.1.1) - oauth2 (~> 0.8.0) - omniauth (~> 1.0) + omniauth-oauth2 (1.1.2) + faraday (>= 0.8, < 0.10) + multi_json (~> 1.3) + oauth2 (~> 0.9.3) + omniauth (~> 1.2) orm_adapter (0.5.0) - paperclip (3.5.2) + paperclip (3.5.4) activemodel (>= 3.0.0) activesupport (>= 3.0.0) cocaine (~> 0.5.3) @@ -157,13 +159,13 @@ GEM polyamorous (0.5.0) activerecord (~> 3.0) polyglot (0.3.4) - psych (1.3.4) + psych (2.0.4) quiet_assets (1.0.2) railties (>= 3.1, < 5.0) rack (1.4.5) rack-cache (1.2) rack (>= 0.4) - rack-ssl (1.3.3) + rack-ssl (1.3.4) rack rack-test (0.6.2) rack (>= 1.0) @@ -185,27 +187,28 @@ GEM rake (10.1.1) rdoc (3.12.2) json (~> 1.4) - responders (0.9.3) - railties (~> 3.1) - rspec-core (2.13.1) - rspec-expectations (2.13.0) + responders (1.0.0) + railties (>= 3.2, < 5) + rspec-core (2.14.8) + rspec-expectations (2.14.5) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.13.1) - rspec-rails (2.13.0) + rspec-mocks (2.14.6) + rspec-rails (2.14.2) actionpack (>= 3.0) + activemodel (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec-core (~> 2.13.0) - rspec-expectations (~> 2.13.0) - rspec-mocks (~> 2.13.0) - sass (3.2.13) + rspec-core (~> 2.14.0) + rspec-expectations (~> 2.14.0) + rspec-mocks (~> 2.14.0) + sass (3.2.18) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - shoulda-matchers (2.0.0) + shoulda-matchers (2.5.0) activesupport (>= 3.0.0) - simple_form (2.1.0) + simple_form (2.1.1) actionpack (~> 3.0) activemodel (~> 3.0) sprockets (2.2.2) @@ -213,15 +216,15 @@ GEM multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - thor (0.18.1) + thor (0.19.0) tilt (1.4.1) treetop (1.4.15) polyglot polyglot (>= 0.3.1) tzinfo (0.3.39) - uglifier (2.0.1) + uglifier (2.5.0) execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) + json (>= 1.8.0) uuidtools (2.1.4) warden (1.2.3) rack (>= 1.0) @@ -256,7 +259,7 @@ DEPENDENCIES quiet_assets rails (= 3.2.17) rspec-rails - sass-rails (~> 3.2.3) + sass-rails (= 3.2.6) shoulda-matchers simple_form uglifier (>= 1.0.3) diff --git a/README.md b/README.md index e7a65e10..dd2687b7 100644 --- a/README.md +++ b/README.md @@ -18,48 +18,45 @@ Join our mission to create superhero coders! You can get involved by taking any ###Development Environment Setup These setup instructions have been tested on Mac OS X, Microsoft Windows 7 with and without Cygwin, and Linux (Ubuntu 10.8.) Installing and running the site -under Windows with or without Cygwin may be possible with enough environmental modifications, but doing so is outside the scope of this document. +under Windows with or without Cygwin may be possible with enough environmental modifications, but doing so is outside the scope of this document. To develop for CodeMontage on Windows, see "Using Vagrant" below. -CodeMontage currently uses Ruby on Rails 3.2.17 and Postgres 9.2.2. The Gemfile specifies Ruby 2.0.0, but the site also runs in development under 1.9.3 and 2.1.1 (tested in Ubuntu.) +CodeMontage currently uses Ruby on Rails 3.2.13 and Postgres 9.2.2. The Gemfile specifies Ruby 2.0.0, but the site also runs in development under 1.9.3 and +2.1.1 (tested in Ubuntu.) To get started, * Install Rails. If you're using a Mac, we recommend [Rails Installer](http://railsinstaller.org). Under Ubuntu, follow the instructions [here](https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm). * Install Postgres. For the Mac, we recommend [Postgres App](http://postgresapp.com). (If you're using Mac OS X Lion, you may need [this fix for Postgres](http://stackoverflow.com/questions/9354122/how-to-install-postgresql-9-1-on-osx-lion).) Under Ubuntu, follow the instructions [here](http://stackoverflow.com/questions/11092807/installing-postgresql-on-ubuntu-for-ruby-on-rails). -* Clone the CodeMontage Repo: - `git clone https://github.com/CodeMontageHQ/codemontage.git` - -* Install dependencies: - ```sh - cd codemontage - bundle install - ``` - -* Configure the app for your local database by copying database.yml.sample to database.yml and adding a valid username and password. Make any changes needed for your database setup ( and possibly `rake db:create`). - `cp config/database.yml.sample config/database.yml` - -* Create database: - `rake db:create` - -* Run migrations: - `rake db:migrate` - -* Load helpful example data into your local database: - `rake db:seed` - +* Clone the CodeMontage Repo: `git clone https://github.com/CodeMontageHQ/codemontage.git` +* Install dependencies: `cd codemontage`, `bundle install` +* Configure the app for your local database by copying *database.yml.sample* to *database.yml* and adding a valid username and password. Make any changes needed for your database setup ( and possibly `rake db:create`). +* Once your database is created, run `rake db:migrate`. +* Load helpful example data into your local database by running `rake db:seed`. * If you'll be developing GitHub-related functionality, [register a GitHub API Application](https://github.com/settings/applications/new) using *Homepage URL* http://localhost:3000 and *Authorization callback URL* http://localhost:3000/auth/github/callback. Next, set your GitHub-related environment variables when you start your server. e.g. `GITHUB_KEY=client_id GITHUB_SECRET=client_secret rails server`. You can find the *Client ID* and *Client Secret* for your application from the [Applications page](http://github.com/settings/applications). +* On the Mac, you will usually have a JavaScript runtime already installed. If you don't have one on Ubuntu, you can get one by running `sudo apt-get install nodejs`. -* If you don't have a JavaScript runtime installed, install `nodejs`: +Once you've installed these dependencies, test your setup by running `rails server` and visiting your site at [http://localhost:3000](http://localhost:3000) - Linux - `sudo apt-get install nodejs` - - Mac - `brew install nodejs` +Congratulations, you're ready to help build CodeMontage! + + +###Using Vagrant +While it's frequently possible to run CodeMontage directly on your development machine, it's also possible to run the site on a VM managed by [Vagrant](http://www.vagrantup.com/). Vagrant is a virtual environment manager that works on top of virtualization tools like Oracle Virtual Box and Amazon EC2. + +These instructions have been tested on Windows 7 using Oracle VirtualBox, but should ultimately work on any OS running VirtualBox. Vagrant support is currently a work in progress and may not operate correctly on all platforms due to a confict with the current version of sass-rails. + +* If you don't already have one, install a VM host. This was tested using [Oracle VirtualBox](https://www.virtualbox.org/). +* [Install Vagrant](http://www.vagrantup.com/downloads). This was tested on version 1.5.0. If you have an older version of it intalled using RubyGems, uninstall the older version first. +* From the home directory of CodeMontage, execute `vagrant up`. This will launch the virtual machine. +* Once the VM is running, execute `vagrant ssh` to shell into the VM. +* Our VM is missing one crucial tool that CodeMontage requires. Execute `sudo apt-get install libyaml-dev`. +* In the VM, switch to the /vagrant directory. + +* From this point forward, it's a lot like any regular rails installation. Execute `bundle install` `rake db:create:all` `rake db:migrate` and `rake db:seed`. Then +execute `rails server`. +* Open a browser to localhost:4567 to see CodeMontage running on your VM. -* Once you've installed these dependencies, test your setup by running `rails server` and visiting your site at [http://localhost:3000](http://localhost:3000) -Congratulations, you're ready to help build CodeMontage! ## License diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 00000000..7a856a9c --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,5 @@ +Vagrant::Config.run do |config| + config.vm.box = "heroku" + config.vm.box_url = "https://dl.dropboxusercontent.com/s/rnc0p8zl91borei/heroku.box" + config.vm.forward_port 3000, 4567 +end diff --git a/db/schema.rb b/db/schema.rb index 95862b1d..8d7aa25c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -103,11 +103,11 @@ t.datetime "updated_at", :null => false t.string "image_url" t.string "twitter", :limit => 15 - t.string "slug" t.string "logo_file_name" t.string "logo_content_type" t.integer "logo_file_size" t.datetime "logo_updated_at" + t.string "slug" end add_index "organizations", ["slug"], :name => "index_organizations_on_slug", :unique => true