Skip to content

Commit

Permalink
Porting Merbivore.com to Jekyll format
Browse files Browse the repository at this point in the history
  • Loading branch information
merbjedi committed Oct 30, 2009
0 parents commit 03a50a3
Show file tree
Hide file tree
Showing 29 changed files with 636 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
_site/*
45 changes: 45 additions & 0 deletions _layouts/default.html
@@ -0,0 +1,45 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>Merb | {{ page.title }}</title>
<meta content='text/html;charset=UTF-8' http-equiv='content-type' />
<meta content='A light and powerful Ruby MVC web framework' name='description' />
<meta content='ruby, web, framework, mvc, fast, performance, scales, uploads' name='keywords' />
<meta content='true' name='mssmarttagspreventparsing' />
<meta content='all' name='robots' />
<meta content='text/html;charset=utf-8' http-equiv='content-type' />
<meta content='no' http-equiv='msthemecompatible' />
<meta content='false' http-equiv='imagetoolbar' />
<link href="stylesheets/merb.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<div id='header'>
<div class='wrap_to_center'>
<div id='logo'>
<img alt='Merb' src='img/header_logo.png' />
</div>
<ul id='nav'>
<li><a href="index.html" {% if page.current == "home" %}id="active"{% endif %}>Home</a></li>
<li><a href="why_merb.html" {% if page.current == "why_merb" %}id="active"{% endif %}>Why Merb?</a></li>
<li><a href="features.html" {% if page.current == "features" %}id="active"{% endif %}>Features</a></li>
<li><a href="contribute.html" {% if page.current == "contribute" %}id="active"{% endif %}>Contribute</a></li>
<li><a href="documentation.html" {% if page.current == "docs" %}id="active"{% endif %}>Docs</a></li>
<li><a href="http://wiki.github.com/merb/merb" {% if page.current == "wiki" %}id="active"{% endif %}>Wiki</a></li>
<li class='last'><a href="get_merb.html" {% if page.current == "get_merb" %}id="active"{% endif %}>Get Merb</a></li>
</ul>
</div>
</div>
<div id='content'>
<div class='wrap_to_center'>
{{ content }}
</div>
<div id='footer'>
<div class='wrap_to_center'>
<p>
&copy; 2008 Merb is released under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>
</p>
</div>
</div>
</div>
</body>
</html>
85 changes: 85 additions & 0 deletions contribute.html
@@ -0,0 +1,85 @@
---
layout: default
title: "Contribute"
current: "contribute"
---

<div class='full_width' id='content_top'>
<div id='content_bottom'>
<div id='content_full'>
<h1>Contributing to Merb</h1>
<h2>Sharing Your Merb Know-How</h2>
<p>
Merb has a fledgling <a href="http://wiki.github.com/merb/merb" title="Merb Wiki">wiki</a> that would love to meet you. The <a href="http://wiki.github.com/merb/merb" title="Merb Wiki">wiki</a> is a great place to garner and contribute up-to-date information on all things Merb.
</p>
<h2>Reporting bugs</h2>
<p>
Found a bug? Ticket it! Go to our <a href="http://merb.lighthouseapp.com/">Lighthouse app</a> and set up a login, then add your ticket. For any tickets that you do add, please try to be as descriptive as possible, the developers well thank you for it.
</p>
<p>
Even if you don&#8217;t feel you contribute code, reporting bugs is a huge help, so please report anything awry you encounter.
</p>
<h2>Contributing Code to Merb</h2>
<p>
Contributing to Merb is as easy as checking the source out from Github, editing it, and creating a patch. <a href="http://gweezlebur.com/2008/2/1/so-you-want-to-contribute-to-merb-core-part-1">Learn all about using git, Github, and making patches.</a>
</p
<pre><code>$ git clone git://github.com/wycats/merb-core.git<br />$ cd merb-core<br />$ vim the_source_file.rb<br />$ git commit -a -m "fix a bug"<br />$ git-format-patch master..</code></pre>
<h2>Code Style Guidelines</h2>
<p>
There are a few guidelines your code should follow.
</p>
<h3>1. Parentheses around parameter lists for methods</h3>
<pre><code># BAD!<br />def my_method param, arg<br /> puts "OH NOEZ!"<br />end<br /><br /># GOOD!<br />def my_method(param, arg)<br /> puts "HOORAYZ!" end</code></pre>
<h3>2. Two space indent</h3>
<pre><code># BAD!<br />def tabby<br /> puts "A fat tab!"<br />end<br /><br /># GOOD!<br />def tabby<br /> puts "Two spaces!"<br />end</code></pre>
<h3>3. Documentation is required</h3>
<p>As of 0.9, Merb has a new documentation system. It will be slightly changing for 1.0; for now, please follow these guidelines.</p>
<p>There are a number of available types:</p>
<ul>
<li>Class (e.g. <code>String</code>)</li>
<li><code>Array[Type]</code> (e.g. <code>Array[String]</code>, an Array of Strings)</li>
<li><code>Array[Type, Type]</code> (e.g. <code>Array[String, Symbol]</code>, an Array of two elements: a String followed by a Symbol)</li>
<li><code>Hash{Type => Type}</code> (e.g. <code>Hash{Symbol => String}</code>, a Hash whose keys are Symbols and values are Strings)</li>
<li><code>Hash{Type => Type, Type => Type}</code> (e.g. <code>Hash{Symbol => String, Class => String}</code>, a Hash with two elements)</li>
<li>Union Types: <code>(String, Symbol)</code>; (e.g. <code>Array[(String, Symbol)]</code>, an Array whose elements are Strings or Symbols)</li>
<li>Duck Typing Types: <code>~to_s</code> (<code>responds_to? :to_s</code>)</li>
</ul><br/>
<p>Certain types of parameters do not require types:</p>
<ul>
<li>Splats: <code>*args</code></li>
<li>Blocks: <code>&blk</code></li>
</ul><br/>
<p>Parameters are defined in parameter blocks:</p>
<pre><code>
==== Parameters
foo&lt;String&gt;:: My foo string
bar&lt;String&gt;:: My bar string
</code></pre>
<p>The return value of a function is required:</p>
<pre><code>
==== Returns
String:: A cool string
</pre></code>
<p>If the method might possibly raise an error (including as a result of calling another method), it must be specified:</p>
<pre><code>
==== Raises
Exception:: A crazy Exception
</pre></code>
<p>If one of the parameters is an options Hash, it must be specified:</p>
<pre><code>
==== Options (opts)
:foo&lt;String&gt;:: The foo option
:bar&lt;Symbol&gt;:: The bar option
</pre></code>

<h3>4. Be wary of clever code!</h3>
<p>
Cleverness for cleverness sake is not our friend; if something is only slightly more handy but infinitely more complex, then please reconsider your implementation.
</p>
<h3>5. Column width</h3>
<p>
80 column line width except in exceptional situations
</p>
</div>
</div>
</div>
83 changes: 83 additions & 0 deletions features.html
@@ -0,0 +1,83 @@
---
layout: default
title: "Features"
current: "features"
---

<div class='full_width' id='content_top'>
<div id='content_bottom'>
<div id='content_full'>
<h1>Features</h1>
<div class='quicklinks_top'>
<ul class='quicklinks_bottom'>
<li><a href="">Plugins</a></li>
<li><a href="">Controllers</a></li>
<li><a href="">Mailers</a></li>
<li><a href="">Parts</a></li>
<li><a href="">Exceptions</a></li>
<li><a href="">Tests</a></li>
<li><a href="">Generators</a></li>
</ul>
</div>
<h2>Young, But With So Much Promise</h2>
<p>
Even though it&#8217;s a very young framework, Merb already has a comprehensive set of features.
</p>
<h2 id='plugins'>Plugins</h2>
<p>
Plugins in Merb are implemented as simple gems, which are distributed in the <a href="http://github.com/wycats/merb-plugins/tree/master">merb-plugins</a> Git repository, by third parties, or via the Merb Plugin Nursery on RubyForge. That means that plugins can take advantage, out of the box, for Rubygems’ versioning and dependency control. Plugins can either be installed to the system’s repository or bundled into the gems directory in an application’s distribution; Merb applications simply add the <code>/gems</code> folder as an alternate repository.
</p>
<p>
Plugins for Merb already include support for ActiveRecord, DataMapper, and Sequel, with support for <span class="caps">SQL</span> sessions, model generation, and database.yml baked in to all three. Merb-plugins Git repository also includes a helpers plugin (to add support for Rails-style form helpers).
</p>
<h2 id='controllers'>Controllers</h2>
<p>
Merb’s controllers are made up of two components. First, an <code>AbstractController</code>, which handles layout- and template-finding, instance variable assignment, and before/after filters. Second, a <code>Merb::Controller</code>, which handles request/response semantics. Because the components are separate, it is possible to inherit from <code>AbstractController</code>, which Merb does for Mailers and Parts (again, more on that later).
</p>
<p>
Controllers also support excellent content-type negotiation. You can specify in your controllers, or in individual actions, what <span class="caps">MIME</span>-types should be supported via <code>provides :xml, :html.</code> Once that information is provided, the controller has a number of ways to automatically render the appropriate content. If a template called <code>foo.html.erb</code> exists, it will automatically be rendered for all content-type <code>text/html</code>, and so on.
</p>
<p>
Additionally, calling <code>render @object</code>, will call <code>@object.to_mime_type</code> (for instance, <code>@object.to_xml</code>). The mime-type chosen in both cases is based upon either the file extension (<code>foo.html</code> maps to the <code>:html</code> type), or the <code>Accepts</code> header (the first acceptable content-type that’s also in the <code>provides</code> list). If the object doesn’t have the appropriate method, render will fall-back to rendering a template (so if the user requests, say, <span class="caps">HTML</span>, the lack of <code>#to_html</code> on the object will cause the <code>foo.html.erb</code> template to be loaded).
</p>
<h2 id='mailers'>Mailers</h2>
<p>
Merb’s Mailers are implemented on top of <code>AbstractController</code>, so you get all the default controller behavior (including templates, assigns, and before/after filters) for free in the Mailer. But instead of calling <code>render</code>, you call <code>render_mail</code>, which takes options like: <code>render_mail :html =&gt; :foo, :text =&gt; :bar.</code>
</p>
<p>
A number of options are supported, including attachments via an <code>#attach</code> method, so you can build up your multi-part mails with attachments and site-wide layouts fairly trivially.
</p>
<p>
Mailers have their own root directory, which contains controller classes inside it, as well as a views directory (which contains layouts, just like a regular controller), and an optional helpers directory. Because <code>AbstractController</code> can specify its layout root trivially, it’s easy to create new controller types and drop them in.
</p>
<p>
Mailers are called from a regular controller via <code>send_mail Klass, :action, options</code>, where options is a hash of options such as <code>from, to, subject, and cc.</code>
</p>
<h2 id='parts'>Parts</h2>
<p>
Like Mailers, parts take advantage of the flexibility of the <code>AbstractController</code> to allow simple Controller/View delegation. Parts have a directory structure that’s identical to the Mailer structure, and you can use them to separate out logic about partials that are used throughout your app.
</p>
<p>
For instance, you might have a tag-cloud that appears app-wide. You could create a <code>TagCloud</code> part, and have actions in the part set up the controller logic for the template. Like controllers and Mailers, parts can have layouts, templates, and before/after filters. Parts are called via part <code>TagCloud =&gt; :show</code>. Parts can also be used just to segment out the logic for sections of partials, so you have discrete components instead of one massive controller.
</p>
<h2 id='exceptions'>Exceptions</h2>
<p>
Merb also handles exceptions interestingly. Instead of exception raising throwing an error in your application, Merb catches certain types of exceptions and allows you to handle them in a controller/view fashion. For instance, raising <code>NotFound</code> will call the <code>Exception#not_found</code> action, which you can customizeas appropriate. Raising an error in this way will also send the appropriate error-code back to the browser.
</p>
<p>
All <span class="caps">HTTP</span> error codes are defined in Merb as Exception classes, so you can raise <code>NotAcceptable</code>, which will call <code>Exception#not_acceptable</code>, and return a 406 error to the client.
</p>
<h2 id='tests'>Tests and Specs</h2>
<p>
Merb is testing-framework-agnostic: you can use Test::Unit, Rspec, or test/spec. All three testing frameworks have built-in support for mock objects that allow you to micro-target your tests exactly as you like. And because Merb is so modular, it’s easy to test your controller without a request object at all, if you’d want to.
</p>
<h2 id='generators'>Generators</h2>
<p>
Merb has a series of generators that allow you get up and running quickly. The Merb application generator is started via <code>merb-gen app application-name</code>. It’ll build a skeleton app that includes folders for controllers, parts, and Mailers. Building a plugin is easy as well, <code>merb-gen plugin merb_plugin_name</code> will produce a very simple plugin skeleton with a few rake tasks to help you deploy the plugin (such as <code>rake package</code> and <code>rake install</code>).
</p>
<p>
In addition, Merb has controller generators, which create an empty controller file, a view directory with an empty <code>index.html.erb</code>, an empty helper file, and a test file in your chosen spec framework. Merb also has model generators, which are implemented by the <span class="caps">ORM</span> plugins, and support a special syntax: <code>merb-gen Product name:string price_in_cents:integer</code> will generate a new model that implements those attributes using its own syntax. For instance, ActiveRecord would generate a migration, while DataMapper would generate new model using its property syntax.
</p>
</div>
</div>
</div>
23 changes: 23 additions & 0 deletions get_merb.html
@@ -0,0 +1,23 @@
---
layout: default
title: "Get Merb"
current: "get_merb"
---

<div class='full_width' id='content_top'>
<div id='content_bottom'>
<div id='content_full'>
<h1>Get Merb</h1>
<h2 id='stable'>Install the gem</h2>
<pre><code>$ sudo gem install merb</code></pre>
<p>If you're using a version of rubygems prior to 1.2, update:</p>
<pre><code>$ sudo gem update --system</code></pre>
<p>We are aware of some issues installing Merb 1.0 RC1 on Windows. RC2, to be released later this week, will be fully compatible with Windows</p>
<h2 id='trunk'>Or install from source</h2>
<p>
If you feel like living on the edge, or you want to contribute with some code or documentation.
</p>
<p>You can find the updated documentation for working with edge at <a href="http://wiki.github.com/merb/merb/merb-edge">http://wiki.github.com/merb/merb/merb-edge</a></p>
</div>
</div>
</div>
Binary file added img/body.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/content_bottom.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/content_top.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/feature_light.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/feature_power.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/feature_speed.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/header_arrow.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/header_hover.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/header_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/header_waves.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/icon_light.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/icon_power.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/icon_speed.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/icons_bottom.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/icons_top.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/li.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/quicklinks_bottom.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/quicklinks_top.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/rss.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/sidebar_bottom.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/sidebar_top.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 104 additions & 0 deletions index.html
@@ -0,0 +1,104 @@
---
layout: default
title: "Looking for a hacker's framework?"
current: "home"
---

<h1 class='home'>All you need... nil you don't.</h1>
<div id='icons_top'>
<div id='icons_bottom'>
<dl id='speed'>
<dt>Built for speed.</dt>
<dd>
Enjoy the performance of a framework that was engineered from the ground up to run at blazing speeds. <a href="why_merb.html#speed">Read More</a>
</dd>
</dl>
<dl id='light'>
<dt>Lightweight.</dt>
<dd>
Too much unnecessary code wearing you down? Discover the advantages of a leaner, meaner codebase. <a href="why_merb.html#light">Read More</a>
</dd>
</dl>
<dl id='power'>
<dt>Powerful.</dt>
<dd>
Despite its small footprint, Merb's flexibility empowers developers to build and choose their own tools. <a href="why_merb.html#power">Read More</a>
</dd>
</dl>
</div>
</div>
<div id='content_top'>
<!--
<div id='content_bottom'>
<div id='content_main'>
<br/><br/>
<h2><a href="http://yehudakatz.com/2008/12/23/rails-and-merb-merge">Breaking news: Merb and Rails working together on the next version of their frameworks</a></h2>
<br/><br/>
<h2>Faster, Lighter, More Agile.</h2>
<p>
Merb is an MVC framework that is ORM-agnostic, JavaScript library agnostic, and template language agnostic, preferring plugins that add in support for a particular feature rather than trying to produce a monolithic library with everything in the core. In fact, this is a guiding principle of the project, which has led to third-party support for the <a href="http://ar.rubyonrails.org/">ActiveRecord</a>, <a href="http://datamapper.org/">DataMapper</a>, and <a href="http://sequel.rubyforge.org/">Sequel</a> ORMs.
</p>
<p>
In addition, it means that the core code in Merb is kept simple and well organized. This has multiple benefits. It means it’s faster for one thing. It’s also easier to understand, maintain and extend.
</p>
<p>
Merb is already packed with good stuff; flexible routing, gem plugins, the provides API, part and mail controllers etc. To get a better idea check out the features.
</p>
<p>
Or if you’re feeling impatient, just get to it and install Merb!
</p>
<h2>Install it</h2>
<pre>$ sudo gem install merb</pre>
<h2>Generate &amp; Run</h2>
<pre>$ merb-gen app my_application <br />$ cd my_application<br />$ merb</pre>
</div>
<div id='content_sidebar'>
<div class='sidebar_top'>
<dl class='sidebar_bottom'>
<dt>Merb Training</dt>
<dd><a href="http://merbclass.com"><img id="merb-class" alt="Merb Training Class" src="http://merbclass.com/badges/badge_phx_training_200.gif" /></a></dd>
</dl>
</div>
<div class='sidebar_top'>
<dl class='sidebar_bottom'>
<dt>Download Merb</dt>
<dd><a href="get_merb.html#stable">Stable</a></dd>
<dd><a href="get_merb.html#trunk">Trunk</a></dd>
</dl>
</div>
<div class='sidebar_top'>
<dl class='sidebar_bottom'>
<dt>Get Help</dt>
<dd><a href="http://groups.google.com/group/merb">Merb Google Group</a></dd>
</dl>
</div>
<div class='sidebar_top'>
<dl class='sidebar_bottom'>
<dt>Get Up to Speed</dt>
<dd>
<a href="documentation.html">Official API</a>
</dd>
<dd>Tutorials (Coming Soon)</dd>
</dl>
</div>
<div class='sidebar_top'>
<dl class='sidebar_bottom'>
<dt>Get Involved</dt>
<dd>
<a href="contribute.html">Contribution Guidelines</a>
</dd>
<dd>
<a href="http://github.com/wycats/merb">Merb Development</a>
</dd>
<dd>Chat on irc.freenode.net/<strong>#merb</strong></dd>
</dl>
</div>
</div>
</div>
-->
</div>

0 comments on commit 03a50a3

Please sign in to comment.