Skip to content
Browse files

First stab at the asset pipeline in the engine.

  • Loading branch information...
1 parent f5fcc9c commit 1cf85c4420690cfcd530f0e1ab2fe8ed8fcf52ca pivotal committed
View
13 Gemfile.lock
@@ -2,8 +2,9 @@ PATH
remote: engines/teaser
specs:
teaser (0.0.1)
- haml
+ haml-rails
rails (~> 3.2.8)
+ sass-rails
GEM
remote: https://rubygems.org/
@@ -51,6 +52,11 @@ GEM
erubis (2.7.0)
ffi (1.1.5)
haml (3.1.7)
+ haml-rails (0.3.5)
+ actionpack (>= 3.1, < 4.1)
+ activesupport (>= 3.1, < 4.1)
+ haml (~> 3.1)
+ railties (>= 3.1, < 4.1)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
@@ -104,6 +110,11 @@ GEM
railties (>= 3.0)
rspec (~> 2.11.0)
rubyzip (0.9.9)
+ sass (3.2.1)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
selenium-webdriver (2.25.0)
childprocess (>= 0.2.5)
libwebsocket (~> 0.1.3)
View
4 bundle_all.sh
@@ -0,0 +1,4 @@
+source ~/.rvm/scripts/rvm
+bundle
+cd engines/teaser
+bundle
View
11 config/application.rb
@@ -5,8 +5,8 @@
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
-# require "sprockets/railtie"
-# require "rails/test_unit/railtie"
+require "sprockets/railtie"
+#require "rails/test_unit/railtie"
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
@@ -59,5 +59,12 @@ class Application < Rails::Application
# parameters by using an attr_accessible or attr_protected declaration.
# config.active_record.whitelist_attributes = true
+ # 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'
+
+ #config.assets.initialize_on_precompile = false
end
end
View
13 engines/teaser/Gemfile.lock
@@ -2,8 +2,9 @@ PATH
remote: .
specs:
teaser (0.0.1)
- haml
+ haml-rails
rails (~> 3.2.8)
+ sass-rails
GEM
remote: http://rubygems.org/
@@ -40,6 +41,11 @@ GEM
diff-lcs (1.1.3)
erubis (2.7.0)
haml (3.1.7)
+ haml-rails (0.3.5)
+ actionpack (>= 3.1, < 4.1)
+ activesupport (>= 3.1, < 4.1)
+ haml (~> 3.1)
+ railties (>= 3.1, < 4.1)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
@@ -93,6 +99,11 @@ GEM
activesupport (>= 3.0)
railties (>= 3.0)
rspec (~> 2.11.0)
+ sass (3.2.1)
+ 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)
View
48 engines/teaser/app/assets/stylesheets/teaser/teaser.css.scss
@@ -0,0 +1,48 @@
+/*
+ * Colors from http://design-seeds.com/index.php/home/entry/a-door-green1
+ *
+ * Thanks to design seeds!
+ */
+
+$lightgreen: #e4e8ae;
+$browngreen: #786f27;
+$gray: #b5acad;
+$midgreen: #cfcb65;
+$darkgreen: #758559;
+
+/*
+ * You are allowed to do whatever you want with this layout. Though I would be pleased if you placed a link on your site to csseasy.com or to profit42.com (best "blog about hacking" ever). Donations are also welcome: paypal@profit42.com (or follow the donation button on csseasy.com)
+ *
+ * Thanks to css easy!
+ */
+
+body {
+ background-color: #dc8;
+ font-size: 16px;
+ margin: 0;
+ padding: 0;
+}
+
+#header {
+ background-color: #333;
+ height: 150px;
+}
+
+#top {
+ width: 100%;
+ background-color: #dc8;
+ height: 50px;
+}
+
+#center {
+ background-color: #eec;
+ min-height: 600px; /* for modern browsers */
+ height: auto !important; /* for modern browsers */
+ height: 600px; /* for IE5.x and IE6 */
+}
+
+#footer {
+ clear: both;
+ background-color: #333;
+ height: 100px;
+}
View
2 engines/teaser/app/controllers/teaser/tease_controller.rb
@@ -1,5 +1,5 @@
module Teaser
- class TeaseController < ActionController::Base
+ class TeaseController < Teaser::ApplicationController
def index
end
end
View
23 engines/teaser/app/views/layouts/teaser/application.html.erb
@@ -1,14 +1,23 @@
-<!DOCTYPE html>
-<html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Teaser</title>
- <%= stylesheet_link_tag "teaser/application", :media => "all" %>
+ <%= stylesheet_link_tag "teaser/application", :media => "all" %>
<%= javascript_include_tag "teaser/application" %>
<%= csrf_meta_tags %>
</head>
<body>
-
-<%= yield %>
-
+<div id="header">
+ <%= content_for :header %>
+</div>
+<div id="top">
+ <%= content_for :top %>
+</div>
+<div id="center">
+ <%= yield %>
+</div>
+<div id="footer">
+ <%= content_for :footer %>
+</div>
</body>
-</html>
+</html>
View
3 engines/teaser/app/views/teaser/tease/index.html.haml
@@ -1,3 +1,4 @@
-%h1 The next big Thing
+-content_for :header do
+ The next big Thing
%p Find nothing out about it right here!
View
6 engines/teaser/teaser.gemspec
@@ -1,6 +1,6 @@
$:.push File.expand_path("../lib", __FILE__)
-# Maintain your gem's version:
+# Maintain your gem"s version:
require "teaser/version"
# Describe your gem and declare its dependencies:
@@ -16,7 +16,9 @@ Gem::Specification.new do |s|
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
s.add_dependency "rails", "~> 3.2.8"
- s.add_dependency "haml"
+
+ s.add_dependency "haml-rails"
+ s.add_dependency "sass-rails"
s.add_development_dependency "pg"
end

0 comments on commit 1cf85c4

Please sign in to comment.
Something went wrong with that request. Please try again.