Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
93 changed files
with
1,394 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.DS_Store | ||
log/* | ||
tmp/* | ||
TAGS | ||
*~ | ||
.#* | ||
schema/schema.rb | ||
schema/*_structure.sql | ||
schema/*.sqlite3 | ||
schema/*.sqlite | ||
schema/*.db | ||
*.sqlite | ||
*.sqlite3 | ||
*.db | ||
src/* | ||
.hgignore | ||
.hg/* | ||
.svn/* | ||
gems/gems/* | ||
gems/specifications/* | ||
merb_profile_results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
require 'rubygems' | ||
require 'rake/rdoctask' | ||
|
||
require 'merb-core' | ||
require 'merb-core/tasks/merb' | ||
|
||
include FileUtils | ||
|
||
# Load the basic runtime dependencies; this will include | ||
# any plugins and therefore plugin rake tasks. | ||
init_env = ENV['MERB_ENV'] || 'rake' | ||
Merb.load_dependencies(:environment => init_env) | ||
|
||
# Get Merb plugins and dependencies | ||
Merb::Plugins.rakefiles.each { |r| require r } | ||
|
||
# Load any app level custom rakefile extensions from lib/tasks | ||
tasks_path = File.join(File.dirname(__FILE__), "lib", "tasks") | ||
rake_files = Dir["#{tasks_path}/*.rake"] | ||
rake_files.each{|rake_file| load rake_file } | ||
|
||
desc "Start runner environment" | ||
task :merb_env do | ||
Merb.start_environment(:environment => init_env, :adapter => 'runner') | ||
end | ||
|
||
require 'spec/rake/spectask' | ||
require 'merb-core/test/tasks/spectasks' | ||
desc 'Default: run spec examples' | ||
task :default => 'spec' | ||
|
||
############################################################################## | ||
# ADD YOUR CUSTOM TASKS IN /lib/tasks | ||
# NAME YOUR RAKE FILES file_name.rake | ||
############################################################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Application < Merb::Controller | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class Exceptions < Merb::Controller | ||
|
||
# handle NotFound exceptions (404) | ||
def not_found | ||
render :format => :html | ||
end | ||
|
||
# handle NotAcceptable exceptions (406) | ||
def not_acceptable | ||
render :format => :html | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class Testing < Application | ||
|
||
def show_form | ||
render | ||
end | ||
|
||
def submit_form | ||
end | ||
|
||
end |
63 changes: 63 additions & 0 deletions
63
spec/integration/merb/app/views/exceptions/not_acceptable.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<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><%= request.exceptions.first.message %></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], "Content-Encoding" => "gzip" | ||
</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 < 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://merbivore.com/"> project page</a>, | ||
feel free to come chat at irc.freenode.net, channel #merb, | ||
or post to <a href="http://groups.google.com/group/merb">merb mailing list</a> | ||
on Google Groups.</p> | ||
|
||
<h3>What if I've found a bug?</h3> | ||
<p>If you want to file a bug or make your own contribution to Merb, | ||
feel free to register and create a ticket at our | ||
<a href="http://merb.lighthouseapp.com/">project development page</a> | ||
on Lighthouse.</p> | ||
|
||
<h3>How do I edit this page?</h3> | ||
<p>You can change what people see when this happens by editing <tt>app/views/exceptions/not_acceptable.html.erb</tt>.</p> | ||
|
||
</div> | ||
|
||
<div id="footer-container"> | ||
<hr /> | ||
<div class="left"></div> | ||
<div class="right">© 2008 the merb dev team</div> | ||
<p> </p> | ||
</div> | ||
</div> |
47 changes: 47 additions & 0 deletions
47
spec/integration/merb/app/views/exceptions/not_found.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<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><%= request.exceptions.first.message %></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://merbivore.com/"> project page</a>, | ||
feel free to come chat at irc.freenode.net, channel #merb, | ||
or post to <a href="http://groups.google.com/group/merb">merb mailing list</a> | ||
on Google Groups.</p> | ||
|
||
<h3>What if I've found a bug?</h3> | ||
<p>If you want to file a bug or make your own contribution to Merb, | ||
feel free to register and create a ticket at our | ||
<a href="http://merb.lighthouseapp.com/">project development page</a> | ||
on Lighthouse.</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">© 2008 the merb dev team</div> | ||
<p> </p> | ||
</div> | ||
</div> |
12 changes: 12 additions & 0 deletions
12
spec/integration/merb/app/views/layout/application.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!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> | ||
<%#= message[:notice] %> | ||
<%= catch_content :for_layout %> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
spec/integration/merb/app/views/testing/show_form.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<h1>Webrat Form</h1> | ||
|
||
<form action="/testing/submit_form" method="post"> | ||
<label> | ||
Text field | ||
<input type="text" name="text_field" /> | ||
</label> | ||
|
||
<label> | ||
TOS <input type="checkbox" name="tos" /> | ||
</label> | ||
|
||
<label> | ||
Month | ||
<select name="month"> | ||
<option>None</option> | ||
<option>January</option> | ||
</select> | ||
</label> | ||
|
||
<input type="submit" value="Test"> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Merb.logger.info("Loaded DEVELOPMENT Environment...") | ||
Merb::Config.use { |c| | ||
c[:exception_details] = true | ||
c[:reload_templates] = true | ||
c[:reload_classes] = true | ||
c[:reload_time] = 0.5 | ||
c[:ignore_tampered_cookies] = true | ||
c[:log_auto_flush ] = true | ||
c[:log_level] = :debug | ||
|
||
c[:log_stream] = STDOUT | ||
c[:log_file] = nil | ||
# Or redirect logging into a file: | ||
# c[:log_file] = Merb.root / "log" / "development.log" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
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_stream] = STDOUT | ||
c[:log_file] = nil | ||
# Or redirect logging into a file: | ||
# c[:log_file] = Merb.root / "log" / "development.log" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Merb.logger.info("Loaded TEST Environment...") | ||
Merb::Config.use { |c| | ||
c[:testing] = true | ||
c[:exception_details] = true | ||
c[:log_auto_flush ] = true | ||
# log less in testing environment | ||
c[:log_level] = :error | ||
|
||
#c[:log_file] = Merb.root / "log" / "test.log" | ||
# or redirect logger using IO handle | ||
c[:log_stream] = STDOUT | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Go to http://wiki.merbivore.com/pages/init-rb | ||
|
||
# Specify a specific version of a dependency | ||
# dependency "RedCloth", "> 3.0" | ||
|
||
# use_orm :none | ||
use_test :rspec | ||
use_template_engine :erb | ||
|
||
Merb::Config.use do |c| | ||
c[:use_mutex] = false | ||
c[:session_store] = 'cookie' # can also be 'memory', 'memcache', 'container', 'datamapper | ||
|
||
# cookie session store configuration | ||
c[:session_secret_key] = 'adb9ea7a0e94b5513503f58623a393c5efe18851' # required for cookie session store | ||
c[:session_id_key] = '_merb_session_id' # cookie session id key, defaults to "_session_id" | ||
end | ||
|
||
Merb::BootLoader.before_app_loads do | ||
# This will get executed after dependencies have been loaded but before your app's classes have loaded. | ||
end | ||
|
||
Merb::BootLoader.after_app_loads do | ||
# This will get executed after your app's classes have been loaded. | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# use PathPrefix Middleware if :path_prefix is set in Merb::Config | ||
if prefix = ::Merb::Config[:path_prefix] | ||
use Merb::Rack::PathPrefix, prefix | ||
end | ||
|
||
# comment this out if you are running merb behind a load balancer | ||
# that serves static files | ||
use Merb::Rack::Static, Merb.dir_for(:public) | ||
|
||
# this is our main merb application | ||
run Merb::Rack::Application.new |
Oops, something went wrong.