Permalink
Browse files

Start using the Rails Asset Pipeline.

  • Loading branch information...
1 parent 6b8a12a commit 999aba35cf7d8b2cb2d2ae6aa71d7469d993d407 Alex Burkhart committed Apr 12, 2012
View
@@ -4,4 +4,5 @@
tmp/
log/
*.sqlite3
-.idea/
+.idea/
+.sass-cache/
View
16 Gemfile
@@ -1,17 +1,25 @@
source 'http://rubygems.org'
-gem 'rake', '< 0.9'
+gem 'rake'
+gem 'heroku'
+
gem 'rails'
gem 'haml-rails'
-gem 'heroku'
gem 'jquery-rails'
+
gem 'elo'
+
+group :assets do
+ gem 'sass-rails'
+ gem 'uglifier'
+end
+
group :test, :development do
gem 'sqlite3'
- gem 'rspec-rails', '~> 2.4'
+ gem 'rspec-rails'
gem 'awesome_print'
- gem 'ruby-debug19', "~> 0.11.6"
+ gem 'ruby-debug19'
end
group :production do
View
@@ -1,114 +1,115 @@
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.1.1)
- actionpack (= 3.1.1)
- mail (~> 2.3.0)
- actionpack (3.1.1)
- activemodel (= 3.1.1)
- activesupport (= 3.1.1)
+ actionmailer (3.2.3)
+ actionpack (= 3.2.3)
+ mail (~> 2.4.4)
+ actionpack (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
builder (~> 3.0.0)
erubis (~> 2.7.0)
- i18n (~> 0.6)
- rack (~> 1.3.2)
- rack-cache (~> 1.1)
- rack-mount (~> 0.8.2)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
rack-test (~> 0.6.1)
- sprockets (~> 2.0.2)
- activemodel (3.1.1)
- activesupport (= 3.1.1)
+ sprockets (~> 2.1.2)
+ activemodel (3.2.3)
+ activesupport (= 3.2.3)
builder (~> 3.0.0)
- i18n (~> 0.6)
- activerecord (3.1.1)
- activemodel (= 3.1.1)
- activesupport (= 3.1.1)
- arel (~> 2.2.1)
+ activerecord (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ arel (~> 3.0.2)
tzinfo (~> 0.3.29)
- activeresource (3.1.1)
- activemodel (= 3.1.1)
- activesupport (= 3.1.1)
- activesupport (3.1.1)
+ activeresource (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ activesupport (3.2.3)
+ i18n (~> 0.6)
multi_json (~> 1.0)
- addressable (2.2.6)
+ addressable (2.2.7)
archive-tar-minitar (0.5.2)
- arel (2.2.1)
+ arel (3.0.2)
awesome_print (1.0.2)
builder (3.0.0)
columnize (0.3.6)
diff-lcs (1.1.3)
elo (0.1.0)
erubis (2.7.0)
- haml (3.1.3)
+ execjs (1.3.0)
+ multi_json (~> 1.0)
+ haml (3.1.4)
haml-rails (0.3.4)
actionpack (~> 3.0)
activesupport (~> 3.0)
haml (~> 3.0)
railties (~> 3.0)
- heroku (2.11.0)
+ heroku (2.24.1)
launchy (>= 0.3.2)
+ netrc (~> 0.7.1)
rest-client (~> 1.6.1)
rubyzip
- term-ansicolor (~> 1.0.5)
hike (1.2.1)
i18n (0.6.0)
- jquery-rails (1.0.16)
- railties (~> 3.0)
+ journey (1.0.3)
+ jquery-rails (2.0.2)
+ railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
- json (1.6.1)
- launchy (2.0.5)
+ json (1.6.6)
+ launchy (2.1.0)
addressable (~> 2.2.6)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
- mail (2.3.0)
+ mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.17.2)
- multi_json (1.0.3)
- pg (0.11.0)
- polyglot (0.3.2)
- rack (1.3.5)
- rack-cache (1.1)
+ mime-types (1.18)
+ multi_json (1.2.0)
+ netrc (0.7.1)
+ pg (0.13.2)
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.2)
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.1)
- actionmailer (= 3.1.1)
- actionpack (= 3.1.1)
- activerecord (= 3.1.1)
- activeresource (= 3.1.1)
- activesupport (= 3.1.1)
+ rails (3.2.3)
+ actionmailer (= 3.2.3)
+ actionpack (= 3.2.3)
+ activerecord (= 3.2.3)
+ activeresource (= 3.2.3)
+ activesupport (= 3.2.3)
bundler (~> 1.0)
- railties (= 3.1.1)
- railties (3.1.1)
- actionpack (= 3.1.1)
- activesupport (= 3.1.1)
+ railties (= 3.2.3)
+ railties (3.2.3)
+ actionpack (= 3.2.3)
+ activesupport (= 3.2.3)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
- rake (0.8.7)
- rdoc (3.11)
+ 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)
+ rspec (2.9.0)
+ rspec-core (~> 2.9.0)
+ rspec-expectations (~> 2.9.0)
+ rspec-mocks (~> 2.9.0)
+ rspec-core (2.9.0)
+ rspec-expectations (2.9.1)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.9.0)
+ rspec-rails (2.9.0)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ railties (>= 3.0)
+ rspec (~> 2.9.0)
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
@@ -119,19 +120,26 @@ GEM
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
- rubyzip (0.9.4)
- sprockets (2.0.3)
+ rubyzip (0.9.7)
+ sass (3.1.15)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- sqlite3 (1.3.4)
- term-ansicolor (1.0.7)
+ sqlite3 (1.3.5)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.30)
+ tzinfo (0.3.33)
+ uglifier (1.2.4)
+ execjs (>= 0.3.0)
+ multi_json (>= 1.0.2)
PLATFORMS
ruby
@@ -144,7 +152,9 @@ DEPENDENCIES
jquery-rails
pg
rails
- rake (< 0.9)
- rspec-rails (~> 2.4)
- ruby-debug19 (~> 0.11.6)
+ rake
+ rspec-rails
+ ruby-debug19
+ sass-rails
sqlite3
+ uglifier
File renamed without changes.
@@ -1,3 +1,7 @@
+//= require jquery
+//= require jquery.tabs
+//= require_self
+
$(document).ready( function(){
$('.tab-bar').tabs();
@@ -0,0 +1,4 @@
+/*
+ *= require reset
+ *= require pong
+ */
File renamed without changes.
File renamed without changes.
@@ -2,9 +2,8 @@
%html
%head
%title Paddle Battle - #{yield :title}
- = stylesheet_link_tag 'reset', 'pong', 'jquery.autocomplete'
- = javascript_include_tag :defaults
- = javascript_include_tag 'jquery.tabs'
+ = stylesheet_link_tag 'application'
+ = javascript_include_tag 'application'
= favicon_link_tag
= csrf_meta_tag
View
@@ -4,7 +4,7 @@
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
-Bundler.require(:default, Rails.env) if defined?(Bundler)
+Bundler.require(:default, :assets, Rails.env) if defined?(Bundler)
module Pong
class Application < Rails::Application
@@ -40,6 +40,10 @@ class Application < Rails::Application
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
+
+ # Enable the asset pipeline
+ config.assets.enabled = true
+ config.assets.version = '1.0'
Elo.configure do |config|
# Every player starts with a rating of 1000
@@ -21,5 +21,8 @@
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
+
+ config.assets.compress = false
+ config.assets.debug = true
end
@@ -29,7 +29,11 @@
# Disable Rails's static asset server
# In production, Apache or nginx will already do this
- config.serve_static_assets = false
+ config.serve_static_assets = true
+
+ config.assets.compress = true
+ config.assets.compile = false
+ config.assets.digest = true
# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
@@ -32,4 +32,8 @@
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
+
+ config.serve_static_assets = true
+ config.static_cache_control = "public, max-age=3600"
+
end
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 999aba3

Please sign in to comment.