require "rubygems" require "ruby-debug" gem 'test-unit' require "test/unit" require 'active_support' require 'active_support/test_case' require 'active_record' require 'active_record/fixtures' require 'shoulda' require 'shoulda/active_record' require 'acts-as-joinable' this = File.expand_path(File.dirname(__FILE__)) require this + '/lib/database' require File.expand_path(File.join(File.dirname(__FILE__), '/../lib/acts-as-layoutable')) require File.dirname(__FILE__) + '/lib/link' require File.dirname(__FILE__) + '/lib/page' ActiveRecord::Base.class_eval do def self.detonate all.map(&:destroy) end end ActiveSupport::TestCase.class_eval do def load_layouts Layoutable do templates do contact error overview pages large_portfolio "portfolio/large" medium_portfolio "portfolio/medium" small_portfolio "portfolio/small" posts end layouts do full do description "A full width layout, mainly for text" areas :top, :bottom, :left, :right, :header, :footer, :body template :pages end left do description "Side bar on the right, content on the left" template :pages areas :top, :bottom, :right, :header, :footer, :body end right do description "Side bar on the left, content on the right" template :pages areas :top, :bottom, :left, :header, :footer, :body end blog do description "Blog Layout" template :posts areas :right, :top, :bottom, :header, :footer, :body end page do description "Page Layout" template :pages areas :right, :top, :bottom, :header, :footer, :body end contact do description "Contact Layout" template :contact areas :top, :bottom, :header, :footer, :body end overview do description "Overview Layout" template :overview areas :top, :bottom, :header, :footer, :body end large_portfolio do description "Large Portfolio Layout" template :large_portfolio areas :top, :bottom, :header, :footer, :body end medium_portfolio do description "Medium Portfolio Layout" template :medium_portfolio areas :top, :bottom, :header, :footer, :body end small_portfolio do description "Small Portfolio Layout" template :small_portfolio areas :top, :bottom, :header, :footer, :body end end widgets do connect do title :string facebook :string twitter :string my_space :string linked_in :string stack_overflow :string github :string email :string end image do title :string url :string alt_text :string image_title :string description :string image_align :string link_url :string end links do title "Blog Roll" end login do title "Login" google true facebook true twitter true open_id true end meta do title "Meta" end search do title "Search" end social do title "Social" end tag_cloud do title "Tag Cloud" end text do title "Random Text" body :string end end end end def detonate ActsAsLayoutable::Layout.detonate ActsAsLayoutable::Area.detonate ActsAsLayoutable::Widget.detonate Page.detonate Link.detonate end end