Permalink
Browse files

Enable assets-pipeline with compass-rails.

  • Loading branch information...
kentaro committed Jun 9, 2012
1 parent 5f3a25b commit a34665d02125bcd5ee225b519d962caaac3d0bb8
Showing with 96 additions and 232 deletions.
  1. +2 −1 .gitignore
  2. +7 −1 Gemfile
  3. +12 −0 Gemfile.lock
  4. BIN {public → app/assets}/images/layout/background.png
  5. BIN {public → app/assets}/images/layout/background_bottom.gif
  6. BIN {public → app/assets}/images/layout/background_content.gif
  7. BIN {public → app/assets}/images/layout/background_top.gif
  8. BIN {public → app/assets}/images/peritor_theme/arrow_content.gif
  9. BIN {public → app/assets}/images/peritor_theme/arrow_content_big.gif
  10. BIN {public → app/assets}/images/peritor_theme/arrow_menu_down.gif
  11. BIN {public → app/assets}/images/peritor_theme/arrow_menu_right.gif
  12. BIN {public → app/assets}/images/peritor_theme/background.gif
  13. BIN {public → app/assets}/images/peritor_theme/background_app.png
  14. BIN {public → app/assets}/images/peritor_theme/box_deployments.gif
  15. BIN {public → app/assets}/images/peritor_theme/box_flash.gif
  16. BIN {public → app/assets}/images/peritor_theme/box_flash_ie.gif
  17. BIN {public → app/assets}/images/peritor_theme/box_grey.gif
  18. BIN {public → app/assets}/images/peritor_theme/box_host.gif
  19. BIN {public → app/assets}/images/peritor_theme/box_light.gif
  20. BIN {public → app/assets}/images/peritor_theme/box_recipe.gif
  21. BIN {public → app/assets}/images/peritor_theme/box_small.gif
  22. BIN {public → app/assets}/images/peritor_theme/box_stages.gif
  23. BIN {public → app/assets}/images/peritor_theme/box_status.gif
  24. BIN {public → app/assets}/images/peritor_theme/box_user.gif
  25. BIN {public → app/assets}/images/peritor_theme/checkbox_disabled.gif
  26. BIN {public → app/assets}/images/peritor_theme/checkbox_disabled_on.gif
  27. BIN {public → app/assets}/images/peritor_theme/checkbox_off.gif
  28. BIN {public → app/assets}/images/peritor_theme/checkbox_on.gif
  29. BIN {public → app/assets}/images/peritor_theme/code_grid.gif
  30. BIN {public → app/assets}/images/peritor_theme/deployment_block.gif
  31. BIN {public → app/assets}/images/peritor_theme/host_off.png
  32. BIN {public → app/assets}/images/peritor_theme/host_on.png
  33. BIN {public → app/assets}/images/peritor_theme/info.gif
  34. BIN {public → app/assets}/images/peritor_theme/locked.gif
  35. BIN {public → app/assets}/images/peritor_theme/menu_arrow_down.gif
  36. BIN {public → app/assets}/images/peritor_theme/menu_arrow_right.gif
  37. BIN {public → app/assets}/images/peritor_theme/menu_bottom.gif
  38. BIN {public → app/assets}/images/peritor_theme/menu_top.gif
  39. BIN {public → app/assets}/images/peritor_theme/pixel_grey.gif
  40. BIN {public → app/assets}/images/peritor_theme/pixel_transparent.gif
  41. BIN {public → app/assets}/images/peritor_theme/status_canceled.gif
  42. BIN {public → app/assets}/images/peritor_theme/status_canceled_small.gif
  43. BIN {public → app/assets}/images/peritor_theme/status_failed.gif
  44. BIN {public → app/assets}/images/peritor_theme/status_failed_small.gif
  45. BIN {public → app/assets}/images/peritor_theme/status_running.gif
  46. BIN {public → app/assets}/images/peritor_theme/status_running_small.gif
  47. BIN {public → app/assets}/images/peritor_theme/status_success.gif
  48. BIN {public → app/assets}/images/peritor_theme/status_success_small.gif
  49. BIN {public → app/assets}/images/peritor_theme/warning.gif
  50. BIN {public → app/assets}/images/peritor_theme/webistrano_logo.gif
  51. BIN {public → app/assets}/images/peritor_theme/webistrano_logo_large.png
  52. BIN {public → app/assets}/images/peritor_theme/webistrano_screenshot.png
  53. BIN {public → app/assets}/images/rails.png
  54. BIN {public → app/assets}/images/spinner.gif
  55. +45 −29 {public → app/assets}/javascripts/application.js
  56. +13 −0 app/assets/stylesheets/application.css
  57. +2 −0 app/{stylesheets/_base.scss → assets/stylesheets/base.css.scss}
  58. 0 app/{stylesheets/ie.scss → assets/stylesheets/ie.css.scss}
  59. 0 app/{stylesheets/print.scss → assets/stylesheets/print.css.scss}
  60. +0 −2 app/{stylesheets/screen.scss → assets/stylesheets/screen.css.scss}
  61. +2 −6 app/views/layouts/application.html.erb
  62. +7 −4 config/application.rb
  63. +0 −10 config/compass.rb
  64. +6 −1 config/environments/development.rb
  65. +0 −3 config/initializers/compass.rb
  66. +0 −167 public/javascripts/jquery.min.js
  67. 0 public/stylesheets/.gitkeep
  68. +0 −5 public/stylesheets/ie.css
  69. +0 −3 public/stylesheets/print.css
View
@@ -7,4 +7,5 @@ config/webistrano_config.rb
.DS_Store
.rake_tasks~
public/stylesheets/*.css
-vendor/bundler
+vendor/bundler
+.sass-cache/
View
@@ -2,6 +2,7 @@ source 'http://rubygems.org'
gem 'rails', '3.2.5'
+gem 'jquery-rails'
gem 'prototype-rails'
gem 'exception_notification'
@@ -11,7 +12,6 @@ gem 'syntax', '1.0.0'
gem 'version_fu', :github => 'jmckible/version_fu'
gem 'devise'
gem 'devise-encryptable'
-gem 'compass'
gem 'haml'
group :development do
@@ -28,3 +28,9 @@ end
group :production do
gem 'mysql'
end
+
+group :assets do
+ gem 'compass'
+ gem 'compass-rails'
+ gem 'sass-rails'
+end
View
@@ -48,6 +48,8 @@ GEM
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
+ compass-rails (1.0.2)
+ compass (>= 0.12.0, < 0.14)
devise (2.1.0)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.7)
@@ -69,6 +71,9 @@ GEM
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
+ jquery-rails (2.0.2)
+ railties (>= 3.2.0, < 5.0)
+ thor (~> 0.14)
json (1.7.3)
mail (2.4.4)
i18n (>= 0.4.0)
@@ -118,6 +123,10 @@ GEM
rdoc (3.12)
json (~> 1.4)
sass (3.1.19)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
@@ -142,16 +151,19 @@ PLATFORMS
DEPENDENCIES
capistrano
compass
+ compass-rails
devise
devise-encryptable
exception_notification
factory_girl_rails
haml
+ jquery-rails
mocha
mysql
open4 (= 0.9.3)
prototype-rails
rails (= 3.2.5)
+ sass-rails
sqlite3-ruby
syntax (= 1.0.0)
test-unit (= 2.0.9)
@@ -1,6 +1,22 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_self
+//= require_tree .
$(function(){
-
+
// ============
// = Menu Box =
// ============
@@ -9,30 +25,30 @@ $(function(){
, open
, closed
;
-
+
menu_box = $(this).closest('.menu_box');
open = $('.menu_box_body .open, .menu_box_arrow .open', menu_box);
closed = $('.menu_box_body .closed, .menu_box_arrow .closed', menu_box);
-
+
open.hide();
closed.show();
});
-
+
$('.menu_box .menu_box_arrow .closed, .menu_box .menu_box_body .closed').click(function(){
var menu_box
, open
, closed
;
-
+
menu_box = $(this).closest('.menu_box');
open = $('.menu_box_body .open, .menu_box_arrow .open', menu_box);
closed = $('.menu_box_body .closed, .menu_box_arrow .closed', menu_box);
-
+
open.show();
closed.hide();
});
-
-
+
+
// ====================================
// = Override deployment lock trigger =
// ====================================
@@ -43,8 +59,8 @@ $(function(){
$('deployment_override_locking').val(0);
}
});
-
-
+
+
// ====================
// = Effective Config =
// ====================
@@ -53,65 +69,65 @@ $(function(){
$('#h_e_c, #effective_config').show();
$('#s_e_c').hide();
});
-
+
$('#h_e_c').click(function(e){
e.preventDefault();
$('#h_e_c, #effective_config').hide();
$('#s_e_c').show();
});
-
-
+
+
// ====================================
// = En/disable role specifier inputs =
// ====================================
$('#role_name').change(function(){
var name
, custom_name
;
-
+
name = $('#role_name');
custom_name = $('#role_custom_name');
-
+
if(name.val() == ''){
custom_name.removeAttr("disabled");
} else {
custom_name.attr("disabled","disabled");
}
});
-
+
$('#role_custom_name').change(function(){
var name
, custom_name
;
-
+
name = $('#role_name');
custom_name = $('#role_custom_name');
-
+
if(custom_name.val() == ''){
name.removeAttr("disabled");
} else {
name.attr("disabled","disabled");
}
});
-
+
$('#role_name').change();
-
-
+
+
// =========================
// = Project Template Info =
// =========================
$('#project_template').change(function(){
var selection
;
-
+
selection = $('#project_template').val();
-
+
$('.template_info').hide();
$('#'+selection+'_desc').show();
});
-
+
$('#project_template').change();
-
+
});
@@ -121,16 +137,16 @@ function open_menu(dom_id){
// arrow images
$(dom_id + "_arrow_right").hide();
$(dom_id + "_arrow_down").show();
-
- // stages
+
+ // stages
$(dom_id + "_stages").show();
}
function close_menu(dom_id){
// arrow images
$(dom_id + "_arrow_right").show();
$(dom_id + "_arrow_down").hide();
-
- // stages
+
+ // stages
$(dom_id + "_stages").hide();
}
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * 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_tree .
+*/
@@ -1,3 +1,5 @@
+@import "compass";
+
$margin: 25px;
$menu_width: 170px;
$red: #A40008;
File renamed without changes.
File renamed without changes.
@@ -4,5 +4,3 @@
* <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */
@import "compass/reset";
-@import "compass";
-@import "base";
@@ -7,12 +7,8 @@
<title>Peritor Webistrano - <%= @page_title %></title>
<link rel="shortcut icon" href="/favicon.ico" />
- <%= javascript_include_tag 'jquery.min', 'application' %>
- <%= stylesheet_link_tag 'screen.css', :media => 'screen, projection' %>
- <%= stylesheet_link_tag 'print.css', :media => 'print' %>
- <!--[if IE]>
- <%= stylesheet_link_tag 'ie.css', :media => 'screen, projection' %>
- <![endif]-->
+ <%= javascript_include_tag 'application' %>
+ <%= stylesheet_link_tag 'application' %>
<%= yield :page_scripts %>
</head>
View
@@ -4,12 +4,10 @@
# 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 Webistrano
class Application < Rails::Application
-
-
# Make Active Record use UTC-base instead of local time
config.time_zone = 'UTC'
config.encoding = "utf-8"
@@ -24,6 +22,11 @@ class Application < Rails::Application
config.secret_token = WebistranoConfig[:session_secret]
end
+ # Enable the asset pipeline
+ config.assets.enabled = true
+
+ # Version of your assets, change this if you want to expire all your assets
+ config.assets.version = '1.0'
end
end
@@ -37,4 +40,4 @@ class Application < Rails::Application
# set default time_zone to UTC
# TODO - is this needed? -- fd
ENV['TZ'] = 'UTC'
-Time.zone = 'UTC'
+Time.zone = 'UTC'
View
@@ -1,12 +1,2 @@
-# This configuration file works with both the Compass command line tool and within Rails.
# Require any additional compass plugins here.
project_type = :rails
-project_path = Compass::AppIntegration::Rails.root
-# Set this to the root of your project when deployed:
-http_path = "/"
-css_dir = "public/stylesheets"
-images_dir = "public/images"
-sass_dir = "app/stylesheets"
-environment = Compass::AppIntegration::Rails.env
-# To enable relative paths to assets via compass helper functions. Uncomment:
-# relative_assets = true
@@ -22,5 +22,10 @@
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
-end
+ # Do not compress assets
+ config.assets.compress = false
+
+ # Expands the lines which load the assets
+ config.assets.debug = true
+end
@@ -1,3 +0,0 @@
-require 'compass'
-require 'compass/app_integration/rails'
-#Compass::AppIntegration::Rails.initialize!
Oops, something went wrong.

0 comments on commit a34665d

Please sign in to comment.