Skip to content

Commit

Permalink
Use Rails 3.1 asset pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
rwdaigle committed Mar 12, 2012
1 parent 55255b3 commit 7427272
Show file tree
Hide file tree
Showing 53 changed files with 111 additions and 17,434 deletions.
8 changes: 3 additions & 5 deletions Gemfile
Expand Up @@ -10,30 +10,28 @@ gem 'make_resourceful'
gem 'dynamic_form'

gem 'haml'
gem 'sass'
gem 'jquery-rails'

gem 'unicorn'

group :produciton do
group :production do
gem 'newrelic_rpm'
end

group :development do
gem 'rspec-rails'
gem 'heroku'
gem 'foreman'
gem 'execjs'
end

group :test do
gem 'turn', '0.8.2', :require => false
gem 'scenarios'
gem 'rspec-rails'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
end
16 changes: 1 addition & 15 deletions Gemfile.lock
Expand Up @@ -29,16 +29,8 @@ GEM
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.2.7)
ansi (1.4.2)
arel (3.0.2)
builder (3.0.0)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
diff-lcs (1.1.3)
dynamic_form (1.1.4)
erubis (2.7.0)
Expand Down Expand Up @@ -123,7 +115,6 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
scenarios (0.1.1)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
Expand All @@ -134,8 +125,6 @@ GEM
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
turn (0.8.2)
ansi (>= 1.2.2)
tzinfo (0.3.32)
uglifier (1.2.3)
execjs (>= 0.3.0)
Expand All @@ -150,8 +139,8 @@ PLATFORMS
ruby

DEPENDENCIES
coffee-rails
dynamic_form
execjs
foreman
haml
heroku
Expand All @@ -163,10 +152,7 @@ DEPENDENCIES
rails (~> 3.2)
rails_log_stdout
rspec-rails
sass
sass-rails
scenarios
turn (= 0.8.2)
uglifier
unicorn
will_paginate
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file removed app/assets/images/rails.png
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
11 changes: 4 additions & 7 deletions app/assets/javascripts/application.js
@@ -1,9 +1,6 @@
// 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.
//
// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

//= require jquery
//= require jquery_ujs
//= require_tree .
//= require_tree .
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions app/assets/stylesheets/application.css
Expand Up @@ -3,5 +3,7 @@
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require reset
*= require layout
*= require_tree .
*/
Expand Up @@ -32,7 +32,7 @@ input.field
padding-bottom: 10px
padding-left: 1em
margin-top: 25px
background: url('/images/hr_horizontal.png') bottom left repeat-x
background: url(<%= asset_path 'hr_horizontal.png' %>) bottom left repeat-x

#header h1 > a
float: left
Expand Down Expand Up @@ -85,7 +85,7 @@ input.field
margin-bottom: 1em
padding-top: 2em
padding-left: 1em
background: url('/images/hr_horizontal.png') top left repeat-x
background: url(<%= asset_path 'hr_horizontal.png' %>) top left repeat-x

#footer_links
width: 26em
Expand Down Expand Up @@ -121,15 +121,15 @@ input.field

.notice
color: #6BC65F
background: url('/images/flag_instructions.png') top left no-repeat
background: url(<%= asset_path 'flag_instructions.png' %>) top left no-repeat
a
color: #B3A485
text-decoration: none
font-weight: bold

.error
color: #CC3333
background: url('/images/flag_error.png') top left no-repeat
background: url(<%= asset_path 'flag_error.png' %>) top left no-repeat
a
color: #B3A485
text-decoration: none
Expand Down
File renamed without changes.
68 changes: 68 additions & 0 deletions app/assets/stylesheets/subject.sass.erb
@@ -0,0 +1,68 @@
#subject_actions
p
width: 16em
height: 5em
text-align: center
margin-bottom: 1.2em
p.first
margin-top: 1em
p.break
height: 2em
font-family: Georgia
font-size: 1.1em
color: #9B9687
background-image: url(<%= asset_path 'subject_action_break.png' %>)
background-repeat: no-repeat
background-attachment:fixed
background-position: 3.6em .7em
margin-bottom: 1em

#instructions_wrapper, #callout_wrapper
width: 22em
margin-top: 3em
margin-left: 8em
padding-right: 3em
padding-left: 3em
padding-bottom: 1em
float: left
font-family: "Lucida Grande",Verdana,Geneva,Arial,Helvetica,sans-serif
font-size: .8em
color: #837D6B
letter-spacing: .1em
line-height: 1.5em

#instructions_wrapper, #instructions_wrapper *
background-color: #F8F3F0

#callout_wrapper, #callout_wrapper *
background-color: #F4F3F2

#instructions, #callout
margin-top: 2em
min-height: 18em
p
margin-left: 1em
padding-left: 2em
padding-bottom: 2em
a
text-decoration: underline
color: #C5B9A1

#instructions
background: url(<%= asset_path 'flag_instructions.png' %>) top left no-repeat

#callout
h3
font-size: 1.2em
font-weight: normal
padding-bottom: 1em
p.highlight
background: url(<%= asset_path 'callout_star.png' %>) top left no-repeat
em
font-style: normal
color: #48453C
a.swap
text-decoration: none
clear: both
float: right
font-size: .9em
File renamed without changes.
8 changes: 4 additions & 4 deletions app/helpers/subjects_helper.rb
Expand Up @@ -2,17 +2,17 @@ module SubjectsHelper

def review_button(subject)
if not current_user.review?(subject)
image_tag('/images/review_button_done.png')
image_tag('review_button_done.png')
else
link_to(image_tag('/images/review_button.png'), review_subject_path(subject))
link_to(image_tag('review_button.png'), review_subject_path(subject))
end
end

def learn_button(subject)
if not current_user.learn?(subject)
image_tag('/images/learn_button_done.png')
image_tag('learn_button_done.png')
else
link_to(image_tag('/images/learn_button.png'), learn_subject_path(subject))
link_to(image_tag('learn_button.png'), learn_subject_path(subject))
end
end

Expand Down
14 changes: 0 additions & 14 deletions app/views/layouts/application.html.erb

This file was deleted.

5 changes: 2 additions & 3 deletions app/views/layouts/subject.html.haml
Expand Up @@ -3,9 +3,8 @@
%head
%meta{:content=>"text/html; charset=utf-8", "http-equiv"=>"Content-Type"}/
%title= yield(:title) || "PTLS Learning System"
= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"
= javascript_include_tag "jquery_ujs", "hotkeys", "hooks", "hints", :cache => "cache/all"
= stylesheet_link_tag "reset", "layout", "subject", "unit", :cache => "cache/all"
= javascript_include_tag "application"
= stylesheet_link_tag "application"
= csrf_meta_tag
%body
#page_wrapper
Expand Down
4 changes: 3 additions & 1 deletion config/application.rb
Expand Up @@ -40,7 +40,9 @@ class Application < Rails::Application
config.filter_parameters += [:password]

# Enable the asset pipeline
config.assets.enabled = false
config.assets.enabled = true
config.assets.initialize_on_precompile = false # Avoid loading whole env.
config.assets.js_compressor = :uglifier

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
Expand Down
2 changes: 1 addition & 1 deletion config/environments/development.rb
Expand Up @@ -26,7 +26,7 @@
config.assets.compress = false

# Expands the lines which load the assets
config.assets.debug = true
config.assets.debug = false

# Rails 3.2
config.active_record.mass_assignment_sanitizer = :strict
Expand Down
19 changes: 19 additions & 0 deletions config/newrelic.yml
@@ -0,0 +1,19 @@
---
<%= ENV["RAILS_ENV"] %>:
error_collector:
capture_source: true
enabled: true
ignore_errors: ActionController::RoutingError
apdex_t: 0.5
ssl: false
monitor_mode: true
license_key: <%= ENV["NEW_RELIC_LICENSE_KEY"] %>
developer_mode: false
app_name: <%= ENV["NEW_RELIC_APP_NAME"] %>
transaction_tracer:
record_sql: obfuscated
enabled: true
stack_trace_threshold: 0.5
transaction_threshold: apdex_f
capture_params: false
log_level: info
10 changes: 0 additions & 10 deletions public/dispatch.cgi

This file was deleted.

24 changes: 0 additions & 24 deletions public/dispatch.fcgi

This file was deleted.

10 changes: 0 additions & 10 deletions public/dispatch.rb

This file was deleted.

2 changes: 0 additions & 2 deletions public/javascripts/application.js

This file was deleted.

0 comments on commit 7427272

Please sign in to comment.