Permalink
Browse files

Use Rails 3.1 asset pipeline

  • Loading branch information...
1 parent 55255b3 commit 7427272b821ca40e46e06cc4267533a6f6f5b39d @rwdaigle committed Mar 12, 2012
Showing with 111 additions and 17,434 deletions.
  1. +3 −5 Gemfile
  2. +1 −15 Gemfile.lock
  3. BIN {public → app/assets}/images/callout_star.png
  4. BIN {public → app/assets}/images/defer.png
  5. BIN {public → app/assets}/images/delete.png
  6. BIN {public → app/assets}/images/delete_faded.png
  7. BIN {public → app/assets}/images/flag_error.png
  8. BIN {public → app/assets}/images/flag_instructions.png
  9. BIN {public → app/assets}/images/gotit.png
  10. BIN {public → app/assets}/images/hide.png
  11. BIN {public → app/assets}/images/hint.png
  12. BIN {public → app/assets}/images/hr_horizontal.png
  13. BIN {public → app/assets}/images/learn_button.png
  14. BIN {public → app/assets}/images/learn_button_done.png
  15. BIN {public → app/assets}/images/missedit.png
  16. BIN {public → app/assets}/images/next.png
  17. BIN app/assets/images/rails.png
  18. BIN {public → app/assets}/images/review_button.png
  19. BIN {public → app/assets}/images/review_button_done.png
  20. BIN {public → app/assets}/images/set_hint.png
  21. BIN {public → app/assets}/images/show.png
  22. BIN {public → app/assets}/images/subject_action_break.png
  23. +4 −7 app/assets/javascripts/application.js
  24. 0 {public → app/assets}/javascripts/hints.js
  25. 0 {public → app/assets}/javascripts/hooks.js
  26. 0 {public → app/assets}/javascripts/hotkeys.js
  27. +2 −0 app/assets/stylesheets/application.css
  28. +4 −4 public/stylesheets/sass/layout.sass → app/assets/stylesheets/layout.sass.erb
  29. 0 {public → app/assets}/stylesheets/reset.css
  30. +68 −0 app/assets/stylesheets/subject.sass.erb
  31. 0 {public/stylesheets/sass → app/assets/stylesheets}/unit.sass
  32. +4 −4 app/helpers/subjects_helper.rb
  33. +0 −14 app/views/layouts/application.html.erb
  34. +2 −3 app/views/layouts/subject.html.haml
  35. +3 −1 config/application.rb
  36. +1 −1 config/environments/development.rb
  37. +19 −0 config/newrelic.yml
  38. +0 −10 public/dispatch.cgi
  39. +0 −24 public/dispatch.fcgi
  40. +0 −10 public/dispatch.rb
  41. +0 −2 public/javascripts/application.js
  42. +0 −963 public/javascripts/controls.js
  43. +0 −972 public/javascripts/dragdrop.js
  44. +0 −1,120 public/javascripts/effects.js
  45. +0 −9,266 public/javascripts/jquery.js
  46. +0 −4 public/javascripts/jquery.min.js
  47. +0 −373 public/javascripts/jquery_ujs.js
  48. +0 −4,225 public/javascripts/prototype.js
  49. +0 −131 public/stylesheets/layout.css
  50. +0 −22 public/stylesheets/main.css
  51. +0 −34 public/stylesheets/sass/main.sass
  52. +0 −65 public/stylesheets/subject.css
  53. +0 −159 public/stylesheets/unit.css
View
@@ -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
View
@@ -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)
@@ -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)
@@ -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)
@@ -150,8 +139,8 @@ PLATFORMS
ruby
DEPENDENCIES
- coffee-rails
dynamic_form
+ execjs
foreman
haml
heroku
@@ -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
View
Deleted file not rendered
File renamed without changes
File renamed without changes
@@ -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.
@@ -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 .
*/
@@ -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
@@ -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
@@ -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
File renamed without changes.
@@ -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
@@ -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
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Ptls</title>
- <%= stylesheet_link_tag "application" %>
- <%= javascript_include_tag "application" %>
- <%= csrf_meta_tags %>
-</head>
-<body>
-
-<%= yield %>
-
-</body>
-</html>
@@ -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
View
@@ -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'
@@ -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
View
@@ -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
View
@@ -1,10 +0,0 @@
-#!/opt/local/bin/ruby
-
-require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
-
-# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
-# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
-require "dispatcher"
-
-ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
-Dispatcher.dispatch
View
@@ -1,24 +0,0 @@
-#!/opt/local/bin/ruby
-#
-# You may specify the path to the FastCGI crash log (a log of unhandled
-# exceptions which forced the FastCGI instance to exit, great for debugging)
-# and the number of requests to process before running garbage collection.
-#
-# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
-# and the GC period is nil (turned off). A reasonable number of requests
-# could range from 10-100 depending on the memory footprint of your app.
-#
-# Example:
-# # Default log path, normal GC behavior.
-# RailsFCGIHandler.process!
-#
-# # Default log path, 50 requests between GC.
-# RailsFCGIHandler.process! nil, 50
-#
-# # Custom log path, normal GC behavior.
-# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
-#
-require File.dirname(__FILE__) + "/../config/environment"
-require 'fcgi_handler'
-
-RailsFCGIHandler.process!
View
@@ -1,10 +0,0 @@
-#!/opt/local/bin/ruby
-
-require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
-
-# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
-# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
-require "dispatcher"
-
-ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
-Dispatcher.dispatch
@@ -1,2 +0,0 @@
-// Place your application-specific JavaScript functions and classes here
-// This file is automatically included by javascript_include_tag :defaults
Oops, something went wrong.

0 comments on commit 7427272

Please sign in to comment.