Permalink
Browse files

Port to use asset pipeline in Rails 3.1

  • Loading branch information...
1 parent a69098c commit f5c85878636814e6f2b6f0b86b3adda09e3ed1e2 @huerlisi committed Aug 1, 2011
Showing with 65 additions and 440 deletions.
  1. +1 −3 .gitignore
  2. +13 −6 Gemfile
  3. +28 −7 Gemfile.lock
  4. BIN {public → app/assets}/images/16x16/add.png
  5. 0 {public → app/assets}/images/16x16/alert.png
  6. 0 {public → app/assets}/images/16x16/copy.png
  7. BIN {public → app/assets}/images/16x16/delete.png
  8. BIN {public → app/assets}/images/16x16/edit.png
  9. 0 {public → app/assets}/images/16x16/filter.png
  10. BIN {public → app/assets}/images/16x16/index.png
  11. 0 {public → app/assets}/images/16x16/notice.png
  12. 0 {public → app/assets}/images/16x16/pdf.png
  13. 0 {public → app/assets}/images/16x16/show.png
  14. BIN {public → app/assets}/images/22x22/arrow-right.png
  15. BIN {public → app/assets}/images/22x22/edit.png
  16. BIN {public → app/assets}/images/22x22/insert_booking.png
  17. BIN {public → app/assets}/images/22x22/remove.png
  18. BIN {public → app/assets}/images/32x32/edit.png
  19. BIN {public → app/assets}/images/32x32/remove.png
  20. 0 {public → app/assets}/images/48x48/accounting.png
  21. BIN {public → app/assets}/images/48x48/basic_claims_data.png
  22. 0 {public → app/assets}/images/48x48/invoicing.png
  23. 0 {public → app/assets}/images/48x48/nav_users.png
  24. BIN {public → app/assets}/images/48x48/settings.png
  25. 0 {public → app/assets}/images/48x48/store.png
  26. BIN {public → app/assets}/images/button_bg.png
  27. BIN {public → app/assets}/images/crystal-icons/16x16/filter.png
  28. BIN {public → app/assets}/images/down.png
  29. BIN {public → app/assets}/images/favicon.ico
  30. BIN {public → app/assets}/images/flavour-extended/48x48/invoice.png
  31. BIN {public → app/assets}/images/free-business-desktop-icons/48x48/business.png
  32. BIN {public → app/assets}/images/gnome-web-icons/48x48/Gnome-X-Office-Address-Book-48.png
  33. BIN {public → app/assets}/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png
  34. BIN {public → app/assets}/images/jquery-ui/ui-bg_flat_55_fbec88_40x100.png
  35. BIN {public → app/assets}/images/jquery-ui/ui-bg_glass_75_759fcf_1x400.png
  36. BIN {public → app/assets}/images/jquery-ui/ui-bg_glass_85_aeb9cf_1x400.png
  37. BIN {public → app/assets}/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png
  38. BIN {public → app/assets}/images/jquery-ui/ui-bg_gloss-wave_55_aeb9cf_500x100.png
  39. BIN {public → app/assets}/images/jquery-ui/ui-bg_inset-hard_100_759fcf_1x100.png
  40. BIN {public → app/assets}/images/jquery-ui/ui-bg_inset-hard_100_f6f6f6_1x100.png
  41. BIN {public → app/assets}/images/jquery-ui/ui-icons_217bc0_256x240.png
  42. BIN {public → app/assets}/images/jquery-ui/ui-icons_2e83ff_256x240.png
  43. BIN {public → app/assets}/images/jquery-ui/ui-icons_469bdd_256x240.png
  44. BIN {public → app/assets}/images/jquery-ui/ui-icons_6da8d5_256x240.png
  45. BIN {public → app/assets}/images/jquery-ui/ui-icons_cd0a0a_256x240.png
  46. BIN {public → app/assets}/images/jquery-ui/ui-icons_d8e7f3_256x240.png
  47. BIN {public → app/assets}/images/jquery-ui/ui-icons_f9bd01_256x240.png
  48. BIN {public → app/assets}/images/jquery/tooltip/black_arrow.png
  49. BIN {public → app/assets}/images/loading.gif
  50. BIN {public → app/assets}/images/logo.png
  51. BIN {public → app/assets}/images/oxygen-icons/16x16/application-pdf.png
  52. BIN {public → app/assets}/images/oxygen-icons/16x16/document-preview.png
  53. BIN {public → app/assets}/images/oxygen-icons/16x16/edit-copy.png
  54. BIN {public → app/assets}/images/oxygen-icons/16x16/mail-mark-notjunk.png
  55. BIN {public → app/assets}/images/oxygen-icons/16x16/status_unknown.png
  56. BIN {public → app/assets}/images/oxygen-icons/48x48/system-users.png
  57. BIN {public → app/assets}/images/rails.png
  58. BIN {public → app/assets}/images/up.png
  59. +10 −0 {public → app/assets}/javascripts/application.js
  60. 0 {public → app/assets}/javascripts/cyt.js
  61. 0 {public → app/assets}/javascripts/jquery-ui.js
  62. 0 {public → app/assets}/javascripts/jquery.form.js
  63. 0 {public → app/assets}/javascripts/jquery.js
  64. 0 {public → app/assets}/javascripts/jquery.remotipart.js
  65. 0 {public → app/assets}/javascripts/jquery_ujs.js
  66. 0 {public → app/assets}/javascripts/tooltip.js
  67. 0 {public → app/assets}/stylesheets/.gitkeep
  68. 0 app/{ → assets}/stylesheets/ie.scss
  69. 0 app/{ → assets}/stylesheets/ie6.scss
  70. 0 app/{ → assets}/stylesheets/partials/_base.sass
  71. 0 app/{ → assets}/stylesheets/partials/_content.sass
  72. 0 app/{ → assets}/stylesheets/partials/_jquery.sass
  73. 0 app/{ → assets}/stylesheets/partials/_layout.sass
  74. 0 app/{ → assets}/stylesheets/partials/_sidebar.sass
  75. 0 app/{ → assets}/stylesheets/partials/content/_accounting.sass
  76. 0 app/{ → assets}/stylesheets/partials/content/_ajax_indicator.sass
  77. 0 app/{ → assets}/stylesheets/partials/content/_application.sass
  78. 0 app/{ → assets}/stylesheets/partials/content/_cyt.sass
  79. 0 app/{ → assets}/stylesheets/partials/content/_day.sass
  80. 0 app/{ → assets}/stylesheets/partials/content/_fancy_buttons.sass
  81. 0 app/{ → assets}/stylesheets/partials/content/_flash_errors.sass
  82. +1 −1 app/{ → assets}/stylesheets/partials/content/_icons.sass
  83. 0 app/{ → assets}/stylesheets/partials/content/_invoice.sass
  84. 0 app/{ → assets}/stylesheets/partials/content/_overview.sass
  85. 0 app/{ → assets}/stylesheets/partials/content/_pagination.sass
  86. 0 app/{ → assets}/stylesheets/partials/content/_scaffold.sass
  87. 0 app/{ → assets}/stylesheets/partials/content/_table_list.sass
  88. 0 app/{ → assets}/stylesheets/partials/content/formtastic/_formtastic.sass
  89. 0 app/{ → assets}/stylesheets/partials/content/formtastic/_formtastic_cyt.sass
  90. 0 app/{ → assets}/stylesheets/partials/formtastic/_formtastic_base.sass
  91. 0 app/{ → assets}/stylesheets/partials/jquery/_jquery_ui.sass
  92. 0 app/{ → assets}/stylesheets/partials/jquery/_tooltip.sass
  93. 0 app/{ → assets}/stylesheets/partials/layout/_header.sass
  94. 0 app/{ → assets}/stylesheets/partials/layout/_navigation.sass
  95. 0 app/{ → assets}/stylesheets/partials/layout/navigation/_main.sass
  96. 0 app/{ → assets}/stylesheets/partials/layout/navigation/_sidebar.sass
  97. 0 app/{ → assets}/stylesheets/partials/print/_application.sass
  98. 0 app/{ → assets}/stylesheets/partials/print/_layout.sass
  99. 0 app/{ → assets}/stylesheets/print.scss
  100. 0 app/{stylesheets/screen.scss → assets/stylesheets/screen.css.scss}
  101. +5 −5 app/views/layouts/application.html.haml
  102. +4 −1 config/application.rb
  103. +3 −0 config/compass.rb
  104. +0 −399 public/javascripts/jquery-ui.min.js
  105. +0 −18 public/javascripts/jquery.min.js
View
@@ -16,6 +16,7 @@ vendor/bundle
doc/api
doc/app
public/stylesheets/all.css
+app/assets/stylesheets/compiled
# Backup
db/backup
@@ -25,9 +26,6 @@ config/database.yml
# Plugins
# =======
-# compass
-public/stylesheets/compiled
-
# Capistrano
config/deploy/*.rb
View
19 Gemfile
@@ -10,6 +10,19 @@ gem 'rails', '~> 3.1.0.rc'
gem 'mysql2'
gem 'sqlite3'
+# Gems used only for assets and not required
+# in production environments by default.
+group :assets do
+ gem 'sass-rails', "~> 3.1.0.rc"
+ # gem 'coffee-rails', "~> 3.1.0.rc"
+ gem 'therubyracer'
+ gem 'uglifier'
+ gem 'compass', :git => 'git://github.com/chriseppstein/compass.git', :branch => 'rails31'
+ gem 'fancy-buttons'
+end
+
+gem 'jquery-rails'
+
# Test
# ===
group :test do
@@ -52,9 +65,6 @@ end
# Standard helpers
# ================
gem 'haml'
-gem 'sass'
-gem 'compass'
-gem 'fancy-buttons'
# Navigation
gem 'simple-navigation'
@@ -71,9 +81,6 @@ gem 'inherited_resources'
gem 'has_scope'
gem 'i18n_rails_helpers'
-# Javascript
-gem 'jquery-rails'
-
# Access Control
gem 'devise'
gem 'cancan'
View
@@ -1,4 +1,14 @@
GIT
+ remote: git://github.com/chriseppstein/compass.git
+ revision: 91a748a916360057b5caf6ea85cd38441d3b257a
+ branch: rails31
+ specs:
+ compass (0.12.0.alpha.0.91a748a)
+ chunky_png (~> 1.2)
+ fssm (>= 0.2.7)
+ sass (~> 3.1)
+
+GIT
remote: git://github.com/mislav/will_paginate.git
revision: a2648e77294806e0e46395e0d3076adf9bee00a0
branch: rails3
@@ -68,10 +78,6 @@ GEM
ffi (~> 1.0.6)
chunky_png (1.2.0)
cocaine (0.1.0)
- compass (0.11.5)
- chunky_png (~> 1.2)
- fssm (>= 0.2.7)
- sass (~> 3.1)
csv-mapper (0.5.1)
fastercsv
devise (1.4.2)
@@ -80,7 +86,9 @@ GEM
warden (~> 1.0.3)
diff-lcs (1.1.2)
erubis (2.7.0)
- factory_girl (2.0.1)
+ execjs (1.2.0)
+ multi_json (~> 1.0)
+ factory_girl (2.0.2)
factory_girl_rails (1.1.0)
factory_girl (~> 2.0.0)
railties (>= 3.0.0)
@@ -115,6 +123,7 @@ GEM
railties (~> 3.0)
thor (~> 0.14)
json_pure (1.5.3)
+ libv8 (3.3.10.2)
lyb_sidebar (0.1.0)
mail (2.3.0)
i18n (>= 0.4.0)
@@ -190,6 +199,11 @@ GEM
rspec (~> 2.6.0)
rubyzip (0.9.4)
sass (3.1.5)
+ sass-rails (3.1.0.rc.5)
+ actionpack (~> 3.1.0.rc1)
+ railties (~> 3.1.0.rc1)
+ sass (>= 3.1.4)
+ sprockets (>= 2.0.0.beta.9)
selenium-webdriver (0.2.2)
childprocess (>= 0.1.9)
ffi (>= 1.0.7)
@@ -204,6 +218,8 @@ GEM
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.4)
+ therubyracer (0.9.2)
+ libv8 (~> 3.3.10)
thor (0.14.6)
tilt (1.3.2)
timeliness (0.3.4)
@@ -212,6 +228,9 @@ GEM
polyglot (>= 0.3.1)
ttfunk (1.0.1)
tzinfo (0.3.29)
+ uglifier (1.0.0)
+ execjs (>= 0.3.0)
+ multi_json (>= 1.0.2)
validates_timeliness (3.0.6)
timeliness (~> 0.3.3)
warden (1.0.4)
@@ -236,7 +255,7 @@ DEPENDENCIES
capistrano
capybara
carrierwave
- compass
+ compass!
csv-mapper
devise
factory_girl_rails (~> 1.1)
@@ -262,11 +281,13 @@ DEPENDENCIES
remotipart
rspec
rspec-rails
- sass
+ sass-rails (~> 3.1.0.rc)
shoulda
show_for
simple-navigation
sqlite3
+ therubyracer
+ uglifier
validates_timeliness
webrat
wkhtmltopdf-binary
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.
Diff not rendered.
Diff not rendered.
@@ -1,3 +1,13 @@
+// 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 .
+
// Autocompletion
// Loads functions after DOM is ready
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -7,7 +7,7 @@
float: left
=icon($ident, $size: 16)
- background-image: url("/images/#{$size}x#{$size}/#{$ident}.png")
+ background-image: url("/assets/#{$size}x#{$size}/#{$ident}.png")
=icon-class($ident, $icon: $ident, $size: 16)
.icon-#{$ident}
File renamed without changes.
@@ -6,12 +6,12 @@
%link{:rel => "shortcut icon", :href => image_path('favicon.ico')}/
- = stylesheet_link_tag 'compiled/screen.css', :media => 'screen, projection, print'
- = stylesheet_link_tag 'compiled/print.css', :media => 'print'
+ = stylesheet_link_tag 'screen', :media => 'screen, projection, print'
+ = stylesheet_link_tag 'print', :media => 'print'
/[if lt IE 8]
- = stylesheet_link_tag 'compiled/ie.css', :media => 'screen, projection'
+ = stylesheet_link_tag 'ie', :media => 'screen, projection'
/[if lt IE 7]
- = stylesheet_link_tag 'compiled/ie6.css', :media => 'screen, projection'
+ = stylesheet_link_tag 'ie6', :media => 'screen, projection'
= csrf_meta_tag
%title
@@ -42,4 +42,4 @@
#alert.flash.alert= alert
= yield
- = javascript_include_tag :defaults
+ = javascript_include_tag "application"
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 *Rails.groups(:assets) if defined?(Bundler)
module Bookyt
class Application < Rails::Application
@@ -51,6 +51,9 @@ 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.middleware.use PDFKit::Middleware, {}, :except => %r[letter]
end
end
View
@@ -14,6 +14,9 @@
# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false
+# this fixes the generated path to the sprite image
+http_images_path = '/assets'
+
# Use compiled for CSS output
css_dir = "public/stylesheets/compiled"
Oops, something went wrong.

0 comments on commit f5c8587

Please sign in to comment.