Permalink
Browse files

Nuke Merb because it's too irritating to use

  • Loading branch information...
1 parent 57b1acd commit 173c156191d625f84ff3db9a1dfbc421206dfeff @paulcbetts committed Jun 2, 2008
View
6 Rakefile
@@ -1,17 +1,11 @@
$:.unshift File.dirname(__FILE__)
-Gem.path.unshift(File.join(File.dirname(__FILE__), "web", "gems"))
require 'rubygems'
require 'rake/clean'
require 'rake/testtask'
require 'spec/rake/spectask'
require 'pallet'
-# Merb Includes
-require 'fileutils'
-require 'rubigen'
-include FileUtils
-
# Load other build files
Dir.glob("build/*.rake").each {|x| load x}
View
1 _autotest/discover.rb
@@ -1 +0,0 @@
-Autotest.add_discovery { "merb" }
View
149 _autotest/merb.rb
@@ -1,149 +0,0 @@
-# Adapted from Autotest::Rails
-require 'autotest'
-
-class Autotest::Merb < Autotest
-
- # +model_tests_dir+:: the directory to find model-centric tests
- # +controller_tests_dir+:: the directory to find controller-centric tests
- # +view_tests_dir+:: the directory to find view-centric tests
- # +fixtures_dir+:: the directory to find fixtures in
- attr_accessor :model_tests_dir, :controller_tests_dir, :view_tests_dir, :fixtures_dir
-
- def initialize # :nodoc:
- super
-
- initialize_test_layout
-
- # Ignore any happenings in these directories
- add_exception %r%^\./(?:doc|log|public|tmp)%
-
- # Ignore any mappings that Autotest may have already set up
- clear_mappings
-
- # Any changes to a file in the root of the 'lib' directory will run any
- # model test with a corresponding name.
- add_mapping %r%^lib\/.*\.rb% do |filename, _|
- files_matching Regexp.new(["^#{model_test_for(filename)}$"])
- end
-
- # Any changes to a fixture will run corresponding view, controller and
- # model tests
- add_mapping %r%^#{fixtures_dir}/(.*)s.yml% do |_, m|
- [
- model_test_for(m[1]),
- controller_test_for(m[1]),
- view_test_for(m[1])
- ]
- end
-
- # Any change to a test or test will cause it to be run
- add_mapping %r%^test/(unit|models|integration|controllers|views|functional)/.*rb$% do |filename, _|
- filename
- end
-
- # Any change to a model will cause it's corresponding test to be run
- add_mapping %r%^app/models/(.*)\.rb$% do |_, m|
- model_test_for(m[1])
- end
-
- # Any change to the global helper will result in all view and controller
- # tests being run
- add_mapping %r%^app/helpers/global_helpers.rb% do
- files_matching %r%^test/(views|functional|controllers)/.*_test\.rb$%
- end
-
- # Any change to a helper will run it's corresponding view and controller
- # tests, unless the helper is the global helper. Changes to the global
- # helper run all view and controller tests.
- add_mapping %r%^app/helpers/(.*)_helper(s)?.rb% do |_, m|
- if m[1] == "global" then
- files_matching %r%^test/(views|functional|controllers)/.*_test\.rb$%
- else
- [
- view_test_for(m[1]),
- controller_test_for(m[1])
- ]
- end
- end
-
- # Changes to views result in their corresponding view and controller test
- # being run
- add_mapping %r%^app/views/(.*)/% do |_, m|
- [
- view_test_for(m[1]),
- controller_test_for(m[1])
- ]
- end
-
- # Changes to a controller result in its corresponding test being run. If
- # the controller is the exception or application controller, all
- # controller tests are run.
- add_mapping %r%^app/controllers/(.*)\.rb$% do |_, m|
- if ["application", "exception"].include?(m[1])
- files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
- else
- controller_test_for(m[1])
- end
- end
-
- # If a change is made to the router, run all controller and view tests
- add_mapping %r%^config/router.rb$% do # FIX
- files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
- end
-
- # If any of the major files governing the environment are altered, run
- # everything
- add_mapping %r%^test/test_helper.rb|config/(init|rack|environments/test.rb|database.yml)% do # FIX
- files_matching %r%^test/(unit|models|controllers|views|functional)/.*_test\.rb$%
- end
- end
-
-private
-
- # Determines the paths we can expect tests or specs to reside, as well as
- # corresponding fixtures.
- def initialize_test_layout
- self.model_tests_dir = "test/unit"
- self.controller_tests_dir = "test/functional"
- self.view_tests_dir = "test/views"
- self.fixtures_dir = "test/fixtures"
- end
-
- # Given a filename and the test type, this method will return the
- # corresponding test's or spec's name.
- #
- # ==== Arguments
- # +filename+<String>:: the file name of the model, view, or controller
- # +kind_of_test+<Symbol>:: the type of test we that we should run
- #
- # ==== Returns
- # String:: the name of the corresponding test or spec
- #
- # ==== Example
- #
- # > test_for("user", :model)
- # => "user_test.rb"
- # > test_for("login", :controller)
- # => "login_controller_test.rb"
- # > test_for("form", :view)
- # => "form_view_spec.rb" # If you're running a RSpec-like suite
- def test_for(filename, kind_of_test) # :nodoc:
- name = [filename]
- name << kind_of_test.to_s if kind_of_test == :view
- name << "test"
- return name.join("_") + ".rb"
- end
-
- def model_test_for(filename)
- [model_tests_dir, test_for(filename, :model)].join("/")
- end
-
- def controller_test_for(filename)
- [controller_tests_dir, test_for(filename, :controller)].join("/")
- end
-
- def view_test_for(filename)
- [view_tests_dir, test_for(filename, :view)].join("/")
- end
-
-end
View
202 _autotest/merb_rspec.rb
@@ -1,202 +0,0 @@
-# Adapted from Autotest::Rails
-require 'autotest'
-
-class Autotest::MerbRspec < Autotest
-
- # +model_tests_dir+:: the directory to find model-centric tests
- # +controller_tests_dir+:: the directory to find controller-centric tests
- # +view_tests_dir+:: the directory to find view-centric tests
- # +fixtures_dir+:: the directory to find fixtures in
- attr_accessor :model_tests_dir, :controller_tests_dir, :view_tests_dir, :fixtures_dir
-
- def initialize # :nodoc:
- super
-
- initialize_test_layout
-
- # Ignore any happenings in these directories
- add_exception %r%^\./(?:doc|log|public|tmp)%
-
- # Ignore any mappings that Autotest may have already set up
- clear_mappings
-
- # Any changes to a file in the root of the 'lib' directory will run any
- # model test with a corresponding name.
- add_mapping %r%^lib\/.*\.rb% do |filename, _|
- files_matching Regexp.new("^#{model_test_for(filename)}$")
- end
-
- add_mapping %r%^spec/(spec_helper|shared/.*)\.rb$% do
- files_matching %r%^spec/.*_spec\.rb$%
- end
-
- # Any changes to a fixture will run corresponding view, controller and
- # model tests
- add_mapping %r%^#{fixtures_dir}/(.*)s.yml% do |_, m|
- [
- model_test_for(m[1]),
- controller_test_for(m[1]),
- view_test_for(m[1])
- ]
- end
-
- # Any change to a test or spec will cause it to be run
- add_mapping %r%^spec/(unit|models|integration|controllers|views|functional)/.*rb$% do |filename, _|
- filename
- end
-
- # Any change to a model will cause it's corresponding test to be run
- add_mapping %r%^app/models/(.*)\.rb$% do |_, m|
- model_test_for(m[1])
- end
-
- # Any change to the global helper will result in all view and controller
- # tests being run
- add_mapping %r%^app/helpers/global_helpers.rb% do
- files_matching %r%^spec/(views|functional|controllers)/.*_spec\.rb$%
- end
-
- # Any change to a helper will run it's corresponding view and controller
- # tests, unless the helper is the global helper. Changes to the global
- # helper run all view and controller tests.
- add_mapping %r%^app/helpers/(.*)_helper(s)?.rb% do |_, m|
- if m[1] == "global" then
- files_matching %r%^spec/(views|functional|controllers)/.*_spec\.rb$%
- else
- [
- view_test_for(m[1]),
- controller_test_for(m[1])
- ]
- end
- end
-
- # Changes to views result in their corresponding view and controller test
- # being run
- add_mapping %r%^app/views/(.*)/% do |_, m|
- [
- view_test_for(m[1]),
- controller_test_for(m[1])
- ]
- end
-
- # Changes to a controller result in its corresponding test being run. If
- # the controller is the exception or application controller, all
- # controller tests are run.
- add_mapping %r%^app/controllers/(.*)\.rb$% do |_, m|
- if ["application", "exception"].include?(m[1])
- files_matching %r%^spec/(controllers|views|functional)/.*_spec\.rb$%
- else
- controller_test_for(m[1])
- end
- end
-
- # If a change is made to the router, run all controller and view tests
- add_mapping %r%^config/router.rb$% do # FIX
- files_matching %r%^spec/(controllers|views|functional)/.*_spec\.rb$%
- end
-
- # If any of the major files governing the environment are altered, run
- # everything
- add_mapping %r%^spec/spec_helper.rb|config/(init|rack|environments/test.rb|database.yml)% do # FIX
- files_matching %r%^spec/(unit|models|controllers|views|functional)/.*_spec\.rb$%
- end
- end
-
- ##
- # Methods below this point are adapted from Auotest::Rspec
-
- def consolidate_failures(failed)
- filters = Hash.new { |h,k| h[k] = [] }
- failed.each do |spec, failed_trace|
- if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } then
- filters[f] << spec
- break
- end
- end
- return filters
- end
-
- def make_test_cmd(files_to_test)
- return "#{ruby} -S #{spec_command} #{add_options_if_present} #{files_to_test.keys.flatten.join(' ')}"
- end
-
- def add_options_if_present
- File.exist?("spec/spec.opts") ? "-O spec/spec.opts " : ""
- end
-
- # Finds the proper spec command to use. Precendence is set in the
- # lazily-evaluated method spec_commands. Alias + Override that in
- # ~/.autotest to provide a different spec command then the default
- # paths provided.
- def spec_command(separator=File::ALT_SEPARATOR)
- unless defined? @spec_command then
- @spec_command = spec_commands.find { |cmd| File.exists? cmd }
-
- raise RspecCommandError, "No spec command could be found!" unless @spec_command
-
- @spec_command.gsub! File::SEPARATOR, separator if separator
- end
- @spec_command
- end
-
- # Autotest will look for spec commands in the following
- # locations, in this order:
- #
- # * bin/spec
- # * default spec bin/loader installed in Rubygems
- def spec_commands
- [
- File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'spec')),
- File.join(Config::CONFIG['bindir'], 'spec')
- ]
- end
-
-private
-
- # Determines the paths we can expect tests or specs to reside, as well as
- # corresponding fixtures.
- def initialize_test_layout
- self.model_tests_dir = "spec/models"
- self.controller_tests_dir = "spec/controllers"
- self.view_tests_dir = "spec/views"
- self.fixtures_dir = "spec/fixtures"
- end
-
- # Given a filename and the test type, this method will return the
- # corresponding test's or spec's name.
- #
- # ==== Arguments
- # +filename+<String>:: the file name of the model, view, or controller
- # +kind_of_test+<Symbol>:: the type of test we that we should run
- #
- # ==== Returns
- # String:: the name of the corresponding test or spec
- #
- # ==== Example
- #
- # > test_for("user", :model)
- # => "user_test.rb"
- # > test_for("login", :controller)
- # => "login_controller_test.rb"
- # > test_for("form", :view)
- # => "form_view_spec.rb" # If you're running a RSpec-like suite
- def test_for(filename, kind_of_test) # :nodoc:
- name = [filename]
- name << kind_of_test.to_s unless kind_of_test == :view
- name << "spec"
- return name.join("_") + ".rb"
- end
-
- def model_test_for(filename)
- [model_tests_dir, test_for(filename, :model)].join("/")
- end
-
- def controller_test_for(filename)
- [controller_tests_dir, test_for(filename, :controller)].join("/")
- end
-
- def view_test_for(filename)
- [view_tests_dir, test_for(filename, :view)].join("/")
- end
-
-end
View
2 app/controllers/application.rb
@@ -1,2 +0,0 @@
-class Application < Merb::Controller
-end
View
13 app/controllers/exceptions.rb
@@ -1,13 +0,0 @@
-class Exceptions < Application
-
- # handle NotFound exceptions (404)
- def not_found
- render :format => :html
- end
-
- # handle NotAcceptable exceptions (406)
- def not_acceptable
- render :format => :html
- end
-
-end
View
60 app/controllers/podcast.rb
@@ -1,60 +0,0 @@
-require 'builder'
-require 'builder/xmlmarkup'
-
-class Podcast < Application
- def index
- render podcast_xml, :layout => false
- end
-
- def send_file
- target = Yikes.instance.state.target
- p = Pathname.new(File.join(target, params["path"]))
- return p.to_s
- begin
- return nil unless p.realpath.to_s.index(target) == 0
- rescue
- return nil
- end
- p.to_s
- #send_file(File.open(p.to_s, 'r'))
- end
-
-private
- def podcast_xml
- app = Yikes.instance.state
-
- xml = Builder::XmlMarkup.new
- xml.instruct!
-
- xml.rss("xmlns:itunes" => "http://www.itunes.com/dtds/podcast-1.0.dtd", "xmlns:media" => "http://search.yahoo.com/mrss/", "version" => "2.0") do
-
- xml.channel do
- xml.title "Yikes video feed of #{Pathname.new(app.library).basename.to_s}"
- xml.link url_base
- xml.language "en-us"
- xml.copyright "Copyright 2008 Paul Betts"
- xml.tag! "itunes:summary", "Converted videos, from #{app.library}"
- xml.description "Converted videos, from #{app.library}"
- xml.tag! "itunes:image", "#{url_base}/FILLMEIN.png"
- xml.tag! "itunes:category", "Videos"
-
- app.get_finished_items.each do |x|
- xml.item do
- next unless x.succeeded
- xml.title x.subpath
- xml.tag! "itunes:subtitle", x.source_path
- xml.enclosure(:url => "#{url_base}/files/#{x.subpath}", :length => "100000", :type => "video/mp4")
- xml.guid "#{url_base}/#{Platform.hostname}.local/files/#{x.subpath}"
- xml.pubDate x.finished_at.to_s
- xml.tag! "itunes:duration", "3:00"
- end
- end
- end ; end
-
- xml.target!
- end
-
- def url_base
- "http://#{Platform.hostname}.local:4000"
- end
-end
View
12 app/controllers/welcome.rb
@@ -1,12 +0,0 @@
-class Welcome < Application
- provides :html, :xml
-
- def index
- render
- end
-
- def quit
- $do_quit = true
- render
- end
-end
View
5 app/helpers/global_helpers.rb
@@ -1,5 +0,0 @@
-module Merb
- module GlobalHelpers
- # helpers defined here available to all views.
- end
-end
View
5 app/helpers/podcast_helper.rb
@@ -1,5 +0,0 @@
-module Merb
- module PodcastHelper
-
- end
-end
View
5 app/helpers/welcome_helper.rb
@@ -1,5 +0,0 @@
-module Merb
- module WelcomeHelper
-
- end
-end
View
216 app/views/exceptions/internal_server_error.html.erb
@@ -1,216 +0,0 @@
-<html>
-<head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <title><%= @exception_name %></title>
- <style type="text/css" media="screen">
- body {
- font-family:arial;
- font-size:11px;
- }
- h1 {
- font-size:48px;
- letter-spacing:-4px;
- margin:0;
- line-height:36px;
- color:#333;
- }
- h1 sup {
- font-size: 0.5em;
- }
- h1 sup.error_500, h1 sup.error_400 {
- color:#990E05;
- }
- h1 sup.error_100, h1 sup.error_200 {
- color:#00BF10;
- }
- h1 sup.error_300 {
- /* pretty sure you cant 'see' status 300
- errors but if you could I think they
- would be blue */
- color:#1B2099;
- }
- h2 {
- font-size:36px;
- letter-spacing:-3px;
- margin:0;
- line-height:28px;
- color:#444;
- }
- a, a:visited {
- color:#00BF10;
- }
- .internalError {
- width:800px;
- margin:50px auto;
- }
- .header {
- border-bottom:10px solid #333;
- margin-bottom:1px;
- background-image: url("data:image/gif;base64,R0lGODlhAwADAIAAAP///8zMzCH5BAAAAAAALAAAAAADAAMAAAIEBHIJBQA7");
- padding:20px;
- }
- table.trace {
- width:100%;
- font-family:courier, monospace;
- letter-spacing:-1px;
- border-collapse: collapse;
- border-spacing:0;
- }
- table.trace tr td{
- padding:0;
- height:26px;
- font-size:13px;
- vertical-align:middle;
- }
- table.trace tr.file{
- border-top:2px solid #fff;
- background-color:#F3F3F3;
- }
- table.trace tr.source {
- background-color:#F8F8F8;
- display:none;
- }
- table.trace .open tr.source {
- display:table-row;
- }
- table.trace tr.file td.expand {
- width:23px;
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAXCAIAAABvSEP3AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAdVJREFUeNqMVL+TwUAYxaRIOlEhlZHGDAUzzOQ61+AqXMV1lJSU7q/QRqm8KFUcJTNn5qJkaPyoKKVz7y4mF8na5Kt29tt9+/Z97/u81+vVQ4r9frdarS6Xi7ETDIZisRjxMGPfmk4niNPpZE+xLAugbPaZ53nzvtfMBe/3+/3dbuehBrAKhZdUKkVAWa9Xsiybv0CPZDJZLr/qa5/BwgwRjYqOKIvFYjQa/aNommZh0Ww2K5UqzwfoQOPxaLPZ3FAmk0+7lplMpt1u53J5OpBOR0eZEE9wHJfP5zud93g88QhluwWbjW+5VOmKBgKBer3eaDTDYeGBQF8+x7rqIYoiPgixWJazpA6HA+MSxRArkUgMh0M409g8Ho8+9wYxxCqVSq1W26EDHGM2m4HOHQrEc38f/Yn7cLmlIRhBENzcx8cVRZnPZ/YUep2BWkjTIfA+PKVpZAXR5QxsjiqCKvGEqqp443w+0dvy17swqD0HB3S73V5PpkNg1qBqt8kwGCjmPkinM0QJbIoEa7U6UG6ToVgs4V9G2g0ESoP5Aoi7KYX5oCgf8IKbkvn9/mr1LRQKESamzgJy0g0tSZIuB3nuGqRU9Vv9C4sKkUhEkp4soxvxI8AAhWrrtXa3X8EAAAAASUVORK5CYII=);
- background-position:top left;
- background-repeat:no-repeat;
- }
- table.trace .open tr.file td.expand {
- width:19px;
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAB1CAIAAAAqdO2mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAXZJREFUeNrslK1ywkAUhcMOBomEOiSdqLxEBJX0NaijOsjyHGGmCGyQQYaiiiw4gktkcOmZbpsuuzQ/M5XnqJ2d3S/n3nM3rTzPLUP7/Tt0+pLcGQwG3W53OLyHzPMtjYL7q9UqSRLrD4E1Gj1orCvKYuFHUWTVkOM44/HjDcp8/lL4r6NerzeZPMm1KFw0QkDn83m5fP2lHA4fNQvRtNvtjsfDd0WzmSfb2e/fdTqdOvdh/HLJZLOn0+d2HJ+KRGzbdl23EpFlmed5cp2maRzHQq1lvQ5KMi6EUZBGfup6E1pTfd+vrGW7jbQ2C9hTt9BpqNyIWaAwAy6xg2eBz5iRC/NomiZhGN5sqmnkauo0BUGgVQoBjQ80oCACgNQdZHfTYBkF2mxCtWWAqunWpahxIDUt3QYUxIFQpJHyIWpXjinabKbbwItMHT+NyjchrP8QKaSQQgoppJBCCimkkEIKKaSQQgoppJBCCimkkEIKKaSo+hRgAEFD17X08O2NAAAAAElFTkSuQmCC);
- background-position:top left;
- background-repeat:no-repeat;
- }
- table.trace tr.source td.collapse {
- width:19px;
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAB1CAIAAAAqdO2mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAVxJREFUeNrs0zFygkAUBmBlUkgJHdABlQwVkVJKKUxBYWbkALTxMJwhltyDFkss03IF8pudIcwaDaDl/6pd2P327b7d+eHwMXs4lNkzggoVKlSoUKFChQoVKlSoUKFChQoVKlSoUKFChQqVEYqm6ft9+qiSJEkYho7jTlcw2fd9NOI4nq4gEdFwXXe1Cqco63VkWVbXRTqLhTpOwQRpF7quR1E0TgGhqvLKUFCyoQqG/rks3O6kZKW/eRFpevOCoGTXVTcMQ5EyxyDEkML1c5RzuZOICIyXqn7JBVez6282MWrx731HOv2qB8Hri2lamNk0DfpVVdV1Peodappmmua8bdvzuc7zfNprzrLMth1FnGh/X8MjCAIQv/cFz/+65PcDh7rbvYv2ZUfdj+PxsyzLgVl0hKwgTqeqKApx2LeOc7t98zyv/1FWOgvx9RPii23bmL9cetJ8Ed8CDAC6aFW8bCzFhwAAAABJRU5ErkJggg==);
- background-position:bottom left;
- background-repeat:no-repeat;
- background-color:#6F706F;
- }
- table.trace tr td.path {
- padding-left:10px;
- }
- table.trace tr td.code {
- padding-left:35px;
- white-space: pre;
- line-height:9px;
- padding-bottom:10px;
- }
- table.trace tr td.code em {
- font-weight:bold;
- color:#00BF10;
- }
- table.trace tr td.code a {
- width: 20px;
- float: left;
- }
- table.trace tr td.code .more {
- color:#666;
- }
- table.trace tr td.line {
- width:30px;
- text-align:right;
- padding-right:4px;
- }
- .footer {
- margin-top:5px;
- font-size:11px;
- color:#444;
- text-align:right;
- }
- </style>
-</head>
-<body>
- <div class="internalError">
-
- <div class="header">
- <h1><%= @exception_name %> <sup class="error_<%= @exception.class::STATUS %>"><%= @exception.class::STATUS %></sup></h1>
- <% if show_details = ::Merb::Config[:exception_details] -%>
- <h2><%= @exception.message %></h2>
- <% else -%>
- <h2>Sorry about that...</h2>
- <% end -%>
- <h3>Parameters</h3>
- <ul>
- <% params[:original_params].each do |param, value| %>
- <li><strong><%= param %>:</strong> <%= value.inspect %></li>
- <% end %>
- <%= "<li>None</li>" if params[:original_params].empty? %>
- </ul>
-
- <h3>Session</h3>
- <ul>
- <% params[:original_session].each do |param, value| %>
- <li><strong><%= param %>:</strong> <%= value.inspect %></li>
- <% end %>
- <%= "<li>None</li>" if params[:original_session].empty? %>
- </ul>
-
- <h3>Cookies</h3>
- <ul>
- <% params[:original_cookies].each do |param, value| %>
- <li><strong><%= param %>:</strong> <%= value.inspect %></li>
- <% end %>
- <%= "<li>None</li>" if params[:original_cookies].empty? %>
- </ul>
- </div>
-
- <% if show_details %>
- <table class="trace">
- <% @exception.backtrace.each_with_index do |line, index| %>
- <tbody class="close">
- <tr class="file">
- <td class="expand">
- </td>
- <td class="path">
- <%= (line.match(/^([^:]+)/)[1] rescue 'unknown').sub(/\/((opt|usr)\/local\/lib\/(ruby\/)?(gems\/)?(1.8\/)?(gems\/)?|.+\/app\/)/, '') %>
- <% unless line.match(/\.erb:/) %>
- in "<strong><%= line.match(/:in `(.+)'$/)[1] rescue '?' %></strong>"
- <% else %>
- (<strong>ERB Template</strong>)
- <% end %>
- </td>
- <td class="line">
- <a href="txmt://open?url=file://<%=file = (line.match(/^([^:]+)/)[1] rescue 'unknown')%>&amp;line=<%= lineno = line.match(/:([0-9]+):/)[1] rescue '?' %>"><%=lineno%></a>&nbsp;
- </td>
- </tr>
- <tr class="source">
- <td class="collapse">
- </td>
- <td class="code" colspan="2"><% (__caller_lines__(file, lineno, 5) rescue []).each do |llineno, lcode, lcurrent| %>
-<a href="txmt://open?url=file://<%=file%>&amp;line=<%=llineno%>"><%= llineno %></a><%='<em>' if llineno==lineno.to_i %><%= lcode.size > 90 ? CGI.escapeHTML(lcode[0..90])+'<span class="more">......</span>' : CGI.escapeHTML(lcode) %><%='</em>' if llineno==lineno.to_i %>
-<% end %>
-
-</td>
- </tr>
- </tbody>
- <% end %>
- </table>
- <script type="text/javascript" charset="utf-8">
- // swop the open & closed classes
- els = document.getElementsByTagName('td');
- for(i=0; i<els.length; i++){
- if(els[i].className=='expand' || els[i].className=='collapse'){
- els[i].onclick = function(e){
- tbody = this.parentNode.parentNode;
- if(tbody.className=='open'){
- tbody.className='closed';
- }else{
- tbody.className='open';
- }
- }
- }
- }
- </script>
- <% end %>
- <div class="footer">
- lots of love, from <a href="#">merb</a>
- </div>
- </div>
-</body>
-</html>
View
55 app/views/exceptions/not_acceptable.html.erb
@@ -1,55 +0,0 @@
-<div id="container">
- <div id="header-container">
- <img src="/images/merb.jpg" />
- <!-- <h1>Mongrel + Erb</h1> -->
- <h2>pocket rocket web framework</h2>
- <hr />
- </div>
-
- <div id="left-container">
- <h3>Exception:</h3>
- <p><%= params[:exception] %></p>
- </div>
-
- <div id="main-container">
- <h3>Why am I seeing this page?</h3>
- <p>Merb couldn't find an appropriate content_type to return,
- based on what you said was available via provides() and
- what the client requested.</p>
-
- <h3>How to add a mime-type</h3>
- <pre><code>
- Merb.add_mime_type :pdf, :to_pdf, %w[application/pdf], &quot;Content-Encoding&quot; =&gt; &quot;gzip&quot;
- </code></pre>
- <h3>What this means is:</h3>
- <ul>
- <li>Add a mime-type for :pdf</li>
- <li>Register the method for converting objects to PDF as <code>#to_pdf</code>.</li>
- <li>Register the incoming mime-type "Accept" header as <code>application/pdf</code>.</li>
- <li>Specify a new header for PDF types so it will set <code>Content-Encoding</code> to gzip.</li>
- </ul>
-
- <h3>You can then do:</h3>
- <pre><code>
- class Foo &lt; Application
- provides :pdf
- end
- </code></pre>
-
- <h3>Where can I find help?</h3>
- <p>If you have any questions or if you can't figure something out, please take a
- look at our <a href="http://merb.devjavu.com/"> project development page</a> or,
- feel free to come chat at irc.freenode.net, channel #merb.</p>
-
- <h3>How do I edit this page?</h3>
- <p>You can change what people see when this happens byy editing <tt>app/views/exceptions/not_found.html.erb</tt>.</p>
-
- </div>
-
- <div id="footer-container">
- <hr />
- <div class="left"></div>
- <div class="right">&copy; 2007 the merb dev team</div>
- <p>&nbsp;</p>
- </div>
-</div>
View
39 app/views/exceptions/not_found.html.erb
@@ -1,39 +0,0 @@
-<div id="container">
- <div id="header-container">
- <img src="/images/merb.jpg" />
- <!-- <h1>Mongrel + Erb</h1> -->
- <h2>pocket rocket web framework</h2>
- <hr />
- </div>
-
- <div id="left-container">
- <h3>Exception:</h3>
- <p><%= params[:exception] %></p>
- </div>
-
- <div id="main-container">
- <h3>Welcome to Merb!</h3>
- <p>Merb is a light-weight MVC framework written in Ruby. We hope you enjoy it.</p>
-
- <h3>Where can I find help?</h3>
- <p>If you have any questions or if you can't figure something out, please take a
- look at our <a href="http://merb.devjavu.com/"> project development page</a> or,
- feel free to come chat at irc.freenode.net, channel #merb.</p>
-
- <h3>How do I edit this page?</h3>
- <p>You're seeing this page because you need to edit the following files:
- <ul>
- <li>config/router.rb <strong><em>(recommended)</em></strong></li>
- <li>app/views/exceptions/not_found.html.erb <strong><em>(recommended)</em></strong></li>
- <li>app/views/layout/application.html.erb <strong><em>(change this layout)</em></strong></li>
- </ul>
- </p>
- </div>
-
- <div id="footer-container">
- <hr />
- <div class="left"></div>
- <div class="right">&copy; 2007 the merb dev team</div>
- <p>&nbsp;</p>
- </div>
-</div>
View
11 app/views/layout/application.html.erb
@@ -1,11 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
- <head>
- <title>Fresh Merb App</title>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" href="/stylesheets/master.css" type="text/css" media="screen" charset="utf-8" />
- </head>
- <body>
- <%= catch_content :for_layout %>
- </body>
-</html>
View
1 app/views/welcome/index.html.erb
@@ -1 +0,0 @@
-You're in index of the Welcome
View
1 app/views/welcome/quit.html.erb
@@ -1 +0,0 @@
-<p>
View
6 config/environments/development.rb
@@ -1,6 +0,0 @@
-Merb.logger.info("Loaded DEVELOPMENT Environment...")
-Merb::Config.use { |c|
- c[:exception_details] = true
- c[:reload_classes] = true
- c[:reload_time] = 0.5
-}
View
5 config/environments/production.rb
@@ -1,5 +0,0 @@
-Merb.logger.info("Loaded PRODUCTION Environment...")
-Merb::Config.use { |c|
- c[:exception_details] = false
- c[:reload_classes] = false
-}
View
7 config/environments/rake.rb
@@ -1,7 +0,0 @@
-Merb.logger.info("Loaded RAKE Environment...")
-Merb::Config.use { |c|
- c[:exception_details] = true
- c[:reload_classes] = false
- c[:log_auto_flush ] = true
- c[:log_file] = Merb.log_path / 'merb_rake.log'
-}
View
5 config/environments/test.rb
@@ -1,5 +0,0 @@
-Merb.logger.info("Loaded TEST Environment...")
-Merb::Config.use { |c|
- c[:testing] = true
- c[:exception_details] = true
-}
View
62 config/init.rb
@@ -1,62 +0,0 @@
-# Make the app's "gems" directory a place where gems are loaded from
-Gem.clear_paths
-Gem.path.unshift(Merb.root / "gems")
-
-# Make the app's "lib" directory a place where ruby files get "require"d from
-$LOAD_PATH.unshift(Merb.root / "lib")
-
-# FIXME: Why doesn't this work
-#Merb.logger = Yikes.instance.logger
-
-Merb::Config.use do |c|
-
- ### Sets up a custom session id key, if you want to piggyback sessions of other applications
- ### with the cookie session store. If not specified, defaults to '_session_id'.
- # c[:session_id_key] = '_session_id'
-
- c[:session_secret_key] = 'c1da8bd3bd28d6fbdf2b85206230f78f4f422bf6'
- c[:session_store] = 'cookie'
-end
-
-### Merb doesn't come with database support by default. You need
-### an ORM plugin. Install one, and uncomment one of the following lines,
-### if you need a database.
-
-### Uncomment for DataMapper ORM
-# use_orm :datamapper
-
-### Uncomment for ActiveRecord ORM
-# use_orm :activerecord
-
-### Uncomment for Sequel ORM
-# use_orm :sequel
-
-
-### This defines which test framework the generators will use
-### rspec is turned on by default
-###
-### Note that you need to install the merb_rspec if you want to ue
-### rspec and merb_test_unit if you want to use test_unit.
-### merb_rspec is installed by default if you did gem install
-### merb.
-###
-# use_test :test_unit
-# use_test :rspec
-
-### Add your other dependencies here
-
-# These are some examples of how you might specify dependencies.
-#
-# dependencies "RedCloth", "merb_helpers"
-# OR
-# dependency "RedCloth", "> 3.0"
-# OR
-# dependencies "RedCloth" => "> 3.0", "ruby-aes-cext" => "= 1.0"
-
-require 'merb-builder'
-
-Merb::BootLoader.after_app_loads do
- ### Add dependencies here that must load after the application loads:
-
- # dependency "magic_admin" # this gem uses the app's model classes
-end
View
1 config/rack.rb
@@ -1 +0,0 @@
-run Merb::Rack::Application.new
View
34 config/router.rb
@@ -1,34 +0,0 @@
-# Merb::Router is the request routing mapper for the merb framework.
-#
-# You can route a specific URL to a controller / action pair:
-#
-# r.match("/contact").
-# to(:controller => "info", :action => "contact")
-#
-# You can define placeholder parts of the url with the :symbol notation. These
-# placeholders will be available in the params hash of your controllers. For example:
-#
-# r.match("/books/:book_id/:action").
-# to(:controller => "books")
-#
-# Or, use placeholders in the "to" results for more complicated routing, e.g.:
-#
-# r.match("/admin/:module/:controller/:action/:id").
-# to(:controller => ":module/:controller")
-#
-# You can also use regular expressions, deferred routes, and many other options.
-# See merb/specs/merb/router.rb for a fairly complete usage sample.
-
-Merb.logger.info("Compiling routes...")
-Merb::Router.prepare do |r|
- # RESTful routes
- # r.resources :posts
-
- r.match('/podcast').to(:controller => 'podcast', :action => 'index')
-
- # Change this for your home page to be available at /
- # r.match('/').to(:controller => 'whatever', :action =>'index')
- r.match('/:action.:format').to(:controller => 'welcome')
- r.match(/\/files\/(.*)/).to(:controller => "podcast", :action => "send_file", :path => "[1]")
- r.match('/').to(:controller => 'welcome', :action =>'index')
-end
View
BIN public/images/merb.jpg
Deleted file not rendered
View
22 public/merb.fcgi
@@ -1,22 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'rubygems'
-require 'merb-core'
-
-# this is Merb.root, change this if you have some funky setup.
-merb_root = File.expand_path(File.dirname(__FILE__) / '../')
-
-# If the fcgi process runs as apache, make sure
-# we have an inlinedir set for Rubyinline action-args to work
-unless ENV["INLINEDIR"] || ENV["HOME"]
- tmpdir = merb_root / "tmp"
- unless File.directory?(tmpdir)
- Dir.mkdir(tmpdir)
- end
- ENV["INLINEDIR"] = tmpdir
-end
-
-# start merb with the fcgi adapter, add options or change the log dir here
-Merb.start(:adapter => 'fcgi',
- :merb_root => merb_root,
- :log_file => merb_root /'log'/'merb.log')
View
119 public/stylesheets/master.css
@@ -1,119 +0,0 @@
-body {
- font-family: Arial, Verdana, sans-serif;
- font-size: 12px;
- background-color: #fff;
-}
-* {
- margin: 0px;
- padding: 0px;
- text-decoration: none;
-}
-html {
- height: 100%;
- margin-bottom: 1px;
-}
-#container {
- width: 80%;
- text-align: left;
- background-color: #fff;
- margin-right: auto;
- margin-left: auto;
-}
-#header-container {
- width: 100%;
- padding-top: 15px;
-}
-#header-container h1, #header-container h2 {
- margin-left: 6px;
- margin-bottom: 6px;
-}
-.spacer {
- width: 100%;
- height: 15px;
-}
-hr {
- border: 0px;
- color: #ccc;
- background-color: #cdcdcd;
- height: 1px;
- width: 100%;
- text-align: left;
-}
-h1 {
- font-size: 28px;
- color: #c55;
- background-color: #fff;
- font-family: Arial, Verdana, sans-serif;
- font-weight: 300;
-}
-h2 {
- font-size: 15px;
- color: #999;
- font-family: Arial, Verdana, sans-serif;
- font-weight: 300;
- background-color: #fff;
-}
-h3 {
- color: #4d9b12;
- font-size: 15px;
- text-align: left;
- font-weight: 300;
- padding: 5px;
- margin-top: 5px;
-}
-
-#left-container {
- float: left;
- width: 250px;
- background-color: #FFFFFF;
- color: black;
-}
-
-#left-container h3 {
- color: #c55;
-}
-
-#main-container {
- margin: 5px 5px 5px 260px;
- padding: 15px;
- border-left: 1px solid silver;
- min-height: 400px;
-}
-p {
- color: #000;
- background-color: #fff;
- line-height: 20px;
- padding: 5px;
-}
-a {
- color: #4d9b12;
- background-color: #fff;
- text-decoration: none;
-}
-a:hover {
- color: #4d9b12;
- background-color: #fff;
- text-decoration: underline;
-}
-#footer-container {
- clear: both;
- font-size: 12px;
- font-family: Verdana, Arial, sans-serif;
-}
-.right {
- float: right;
- font-size: 100%;
- margin-top: 5px;
- color: #999;
- background-color: #fff;
-}
-.left {
- float: left;
- font-size: 100%;
- margin-top: 5px;
- color: #999;
- background-color: #fff;
-}
-#main-container ul {
- margin-left: 3.0em;
-}

0 comments on commit 173c156

Please sign in to comment.