Skip to content

Commit

Permalink
Upgrade to Rails 3
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemelia committed Jan 7, 2012
1 parent b65e4a4 commit 099f4d5
Show file tree
Hide file tree
Showing 2,992 changed files with 1,193 additions and 356,223 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ log
tmp
.DS_Store
config/settings.yml
config/initializers/secret_token.rb
config/initializers/smtp_settings.rb
config/default_body.erb
config/deploy/production.rb
db/production_data.sql
public/images/happy-new-year-201*
public/images/happy-new-year-201*
app/assets/images/happy-new-year-201*
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--colour
3 changes: 0 additions & 3 deletions Capfile

This file was deleted.

46 changes: 46 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
source 'http://rubygems.org'

gem 'rails', '3.1.3'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'pg'
gem 'jquery-rails'
gem 'oauth2' # Interacting with Facebook OAuth2
gem 'thin'
gem 'haml'
gem 'formtastic'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end

group :staging, :production do
gem 'heroku'
gem 'therubyracer', '0.9.3beta1'
end

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
group :test, :development do
gem 'ruby-debug19', :require => 'ruby-debug'
end

group :test do
# Pretty printed test output
gem 'turn', '0.8.2', :require => false
gem 'rspec-rails'
end
186 changes: 186 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.3)
actionpack (= 3.1.3)
mail (~> 2.3.0)
actionpack (3.1.3)
activemodel (= 3.1.3)
activesupport (= 3.1.3)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.5)
rack-cache (~> 1.1)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.3)
activemodel (3.1.3)
activesupport (= 3.1.3)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.3)
activemodel (= 3.1.3)
activesupport (= 3.1.3)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
activeresource (3.1.3)
activemodel (= 3.1.3)
activesupport (= 3.1.3)
activesupport (3.1.3)
multi_json (~> 1.0)
addressable (2.2.6)
ansi (1.4.1)
archive-tar-minitar (0.5.2)
arel (2.2.1)
builder (3.0.0)
coffee-rails (3.1.1)
coffee-script (>= 2.2.0)
railties (~> 3.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
columnize (0.3.6)
daemons (1.1.5)
diff-lcs (1.1.3)
erubis (2.7.0)
eventmachine (0.12.10)
execjs (1.2.13)
multi_json (~> 1.0)
faraday (0.7.5)
addressable (~> 2.2.6)
multipart-post (~> 1.1.3)
rack (>= 1.1.0, < 2)
formtastic (2.0.2)
rails (~> 3.0)
haml (3.1.4)
heroku (2.14.0)
launchy (>= 0.3.2)
rest-client (~> 1.6.1)
rubyzip
term-ansicolor (~> 1.0.5)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.19)
railties (~> 3.0)
thor (~> 0.14)
json (1.6.4)
launchy (2.0.5)
addressable (~> 2.2.6)
libv8 (3.3.10.2)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.17.2)
multi_json (1.0.4)
multipart-post (1.1.3)
oauth2 (0.5.1)
faraday (~> 0.7.4)
multi_json (~> 1.0.3)
pg (0.12.2)
polyglot (0.3.3)
rack (1.3.6)
rack-cache (1.1)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.3)
actionmailer (= 3.1.3)
actionpack (= 3.1.3)
activerecord (= 3.1.3)
activeresource (= 3.1.3)
activesupport (= 3.1.3)
bundler (~> 1.0)
railties (= 3.1.3)
railties (3.1.3)
actionpack (= 3.1.3)
activesupport (= 3.1.3)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.7.0)
rspec-core (~> 2.7.0)
rspec-expectations (~> 2.7.0)
rspec-mocks (~> 2.7.0)
rspec-core (2.7.1)
rspec-expectations (2.7.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.7.0)
rspec-rails (2.7.0)
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.7.0)
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby_core_source (>= 0.1.4)
ruby-debug19 (0.11.6)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
rubyzip (0.9.4)
sass (3.1.12)
sass-rails (3.1.5)
actionpack (~> 3.1.0)
railties (~> 3.1.0)
sass (~> 3.1.10)
tilt (~> 1.3.2)
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
term-ansicolor (1.0.7)
therubyracer (0.9.3beta1)
libv8 (~> 3.3.10)
thin (1.2.11)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
turn (0.8.2)
ansi (>= 1.2.2)
tzinfo (0.3.31)
uglifier (1.2.1)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)

PLATFORMS
ruby

DEPENDENCIES
coffee-rails (~> 3.1.1)
formtastic
haml
heroku
jquery-rails
oauth2
pg
rails (= 3.1.3)
rspec-rails
ruby-debug19
sass-rails (~> 3.1.5)
therubyracer (= 0.9.3beta1)
thin
turn (= 0.8.2)
uglifier (>= 1.0.3)
22 changes: 12 additions & 10 deletions README.textile → README
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
h1. Holiday Mailer
Holiday Mailer
==============

Holiday Mailer is an app to create your own electronic alternative to the snail-mail photo holiday card written by "Luke Melia":http://www.lukemelia.com. It's not designed for easy re-use (yet), but feel free to fork do you own thing.
Holiday Mailer is an app to create your own electronic alternative to the snail-mail photo holiday card written by "Luke Melia":http://www.lukemelia.com. It is not designed for easy re-use (yet), but feel free to fork and do your own thing.

h2. Install
Install
-------

* Update the secret token in config/initializers/secret_token.rb
* Create a Facebook app at facebook.com/developers and set the HOLIDAY_MAILER_FACEBOOK_APP_ID and HOLIDAY_MAILER_FACEBOOK_APP_SECRET environment variables
* Copy config/settings.yml-example to config/settings.yml and edit
* Copy config/default_body.erb-example to config/default_body.erb and edit
* Copy config/initializers/smtp_settings.rb-example to config/initializers/smtp_settings.rb and edit
Expand All @@ -13,16 +17,14 @@ h2. Install
* Edit the REST_AUTH_SITE_KEY in each of the environment files
* rake db:create
* rake db:migrate
* Copy config/deploy/prodution.rb-example to config/deploy/prodution.rb and edit

h2. Credits
Credits
-------

* Got a jumpstart via "Bort":http://github.com/fudgestudios/bort/tree/master
* Background from CC-licensed image by "Sarah Parrott":http://www.flickr.com/photos/thingsarebetterwithaparrott/1434120935/
* Powered by open source from ruby to rails to haml to jquery and much more
* Powered by opensource... Thanks to all who make it possible!

Thanks to all!

h2. And of course....
And of course....
=================

Happy Holidays!
9 changes: 3 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require File.expand_path('../config/application', __FILE__)

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

require 'tasks/rails'
HolidayMailer::Application.load_tasks
File renamed without changes
File renamed without changes
9 changes: 9 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
8 changes: 8 additions & 0 deletions app/assets/javascripts/auth.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$(->
$('.login-button').click ->
HMFacebook.login()
false
$('.logout-button').click ->
HMFacebook.logout()
false
)
60 changes: 60 additions & 0 deletions app/assets/javascripts/facebook.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
window.HMFacebook =
init: (initializedCallback)->
if window.FB?
initializedCallback?()
else
window.fbAsyncInit = (->
FB.init
appId : window.FACEBOOK_APP_ID
channelUrl : '//' + window.location.hostname + '/channel.html'
status : false
cookie : false
oauth : true
xfbml : false

initializedCallback?()
)

((d)->
id = 'facebook-jssdk'
if (d.getElementById(id)) then return
js = d.createElement('script')
js.id = id
js.async = true
js.src = "//connect.facebook.net/en_US/all.js"
d.getElementsByTagName('head')[0].appendChild(js)
)(document)

login: (appId, successCallback)->
HMFacebook.init ->
FB.login( (response)->
if response.authResponse
$.ajax('/sessions/facebook_oauth_token_update',
type: 'PUT'
dataType: 'json'
xhrFields:
withCredentials: true
data:
access_token: response.authResponse.accessToken
expires_in: response.authResponse.expiresIn
app_id: appId
).done (data)->
if successCallback?
successCallback()
else
window.location = data.location
else
console.log('User cancelled login or did not fully authorize.')
, { scope: 'email' })

logout: (successCallback)->
$.ajax('/sessions/logout',
type: 'DELETE'
dataType: 'json'
xhrFields:
withCredentials: true
).done (data)->
if successCallback?
successCallback()
else
window.location.reload()
11 changes: 11 additions & 0 deletions app/assets/javascripts/flash.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$(function(){
setTimeout(fadeOutFlash, 1000);
});

function fadeOutFlash() {
$('div.flash').fadeOut(2000);
}

function addFlashMessage(text) {
$('#content').prepend("<div class='flash'>" + text + "</div>");
}
Loading

0 comments on commit 099f4d5

Please sign in to comment.