Skip to content

Commit

Permalink
resurrected website
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Oct 8, 2008
1 parent 2a3a524 commit b321d9c
Show file tree
Hide file tree
Showing 81 changed files with 12,480 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -13,3 +13,4 @@ example_rails_app/vendor
*.ipr
*.iws
*~
website/output
27 changes: 27 additions & 0 deletions website/README
@@ -0,0 +1,27 @@
The RSpec website is built with webby-0.9.2. You should be able to build and
see it with these simple steps (standing in the same directory as this
README):

== Build the site

webby build

== Rebuild the site

webby rebuild

== Start the webserver

webby heel:start

== Stop the webserver

webby heel:stop

== Learn about other tasks

webby -T

== Learn about the webby command

webby -h
7 changes: 7 additions & 0 deletions website/Sitefile
@@ -0,0 +1,7 @@

task :default => :build

desc 'deploy the site to the webserver'
task :deploy => [:build, 'deploy:rsync']

# EOF
64 changes: 64 additions & 0 deletions website/layouts/default.rhtml
@@ -0,0 +1,64 @@
---
extension: html
filter: erb
---
<?xml version="1.0" encoding="UTF-8"?>
<!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="{lang:}">
<head>
<title>RSpec-<%= rspec_version %>: <%= @page.title %></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="RSpec, {title: }, BDD, behaviour driven development, behavior driven development, TDD, test driven development, Ruby, Rails, testing, watir, selenium"/>

<!-- CodeRay syntax highlighting CSS -->
<link rel="stylesheet" href="/css/coderay.css" type="text/css" />

<!-- Homepage CSS -->
<link rel="stylesheet" href="/css/breadcrumbs.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="/css/default.css" type="text/css" media="screen, projection" />

<style><!--
div.breadcrumbs ul li {
background-image: url(/images/arrow.gif);
}
--></style>
</head>
<body>

<div id="container">
<div id="header">
<h1><a href='/'>RSpec <%= rspec_version %></a></h1>
</div>

<%= breadcrumb_menu(@page) %>

<div id="content">
<%= @content %>

<div id="footer">
Webdesign by <a href="http://www.oswd.org/user/profile/id/9462">JM</a>
<div style="float:right;align">
<table border="0" padding="2">
<tr>
<td valign="top" align="right">
<a href="http://engineyard.com">Hosted by our<br/>good friends at<br/>Engine Yard</a>
</td>
<td>
<a href="http://engineyard.com"><img src="/images/eylogo.gif" border="0"></a>
</td>
</tr>
</table>
</div>
<SCRIPT type='text/javascript' language='JavaScript' src='http://www.ohloh.net/projects/4386;badge_js'></SCRIPT>
</div>
</div>
</div>

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1889510-1";
urchinTracker();
</script>
</body>
</html>
28 changes: 28 additions & 0 deletions website/lib/breadcrumbs.rb
@@ -0,0 +1,28 @@
# breadcrumbs.rb

module BreadcrumbsHelper
# call-seq:
# breadcrumbs( page ) => html
#
# Create breadcrumb links for the current page. This will return an HTML
# <ul></ul> object.
#
def breadcrumbs( page )
list = ["<li>#{h(page.title)}</li>"]
loop do
page = @pages.parent_of(page)
break if page.nil?
list << "<li>#{link_to_page(page)}</li>"
end
list.reverse!

html = "<ul class=\"breadcrumbs\">\n"
html << list.join("\n")
html << "\n</ul>\n"
html
end
end # module Breadcrumbs

Webby::Helpers.register(BreadcrumbsHelper)

# EOF
131 changes: 131 additions & 0 deletions website/lib/rspec_extras.rb
@@ -0,0 +1,131 @@
module Webby
module Resources
class DB
def immediate_children( page, opts = {} )
root = page.dir == "" ? "" : "#{page.dir}/"
rgxp = Regexp.new "\\A#{root}[^/]+$"
keys = @db.keys.find_all {|k| rgxp =~ k}

ary = keys.map {|k| @db[k]}
ary.flatten!

return ary unless opts.has_key? :sort_by

m = opts[:sort_by]
ary.sort! {|a,b| a.__send__(m) <=> b.__send__(m)}
ary.reverse! if opts[:reverse]
ary
end
end

class Resource
def link
"<a href=\"#{url}\">#{title}</a>"
end

def order
(@_meta_data['order'] || 10000).to_i
end

def path_from_root
resources = []
resource = self
while(resource)
resources << resource
resource = Webby::Resources.pages.parent_of(resource)
end
resources.reverse
end

def siblings
Webby::Resources.pages.siblings(self).reject{|p| p.title.nil?}
end

def immediate_children
Webby::Resources.pages.immediate_children(self).reject{|p| p.title.nil?}.select{|p| p.filename == 'index'}
end
end
end

require File.dirname(__FILE__) + '/../../example_rails_app/vendor/plugins/rspec/lib/spec/version'

class Renderer
def rspec_version
Spec::VERSION::STRING
end

def svn_tag
Spec::VERSION::TAG
end

def breadcrumb_menu(page)
'<div class="breadcrumb-menu">' + breadcrumbs(page) + menu(page) + '</div>'
end

def breadcrumbs(page)
b = binding
ERB.new(<<-EOF, nil, '-').result(b)
<div class="breadcrumbs">
<ul>
<% page.path_from_root.each do |p| %>
<% if p != page %>
<li><%= p.link %></li>
<% else %>
<li class="current"><%= p.link %></li>
<% end %>
<% end %>
</ul>
</div>
EOF
end

def menu(page)
pages = if page.filename == 'index'
(page.siblings + page.immediate_children).sort{|a,b| a.order <=> b.order}
else
[]
end

b = binding
ERB.new(<<-EOF, nil, '-').result(b)
<div class="menu">
<ul>
<% pages.each do |p| %>
<li>
<%= p.link %>
</li>
<% end %>
<% if page.url == '/' %>
<li>
<a href="/rdoc/">RDoc</a>
</li>
<li>
<a href="/rdoc-rails/">RDoc-Rails</a>
</li>
<% end %>
<% if page.url == '/documentation/rails' -%>
<li>
<a href="http://github.com/dchelimsky/rspec-rails/wikis/home">Install</a>
</li>
<% end -%>
</ul>
</div>
EOF
end

end
end

# This patches a bug in webby-0.8.2 in which the coderay method fails to add a
# newline resulting in webby formatting problems.
module Webby::Helpers::CodeRayHelper
alias :orig_coderay :coderay

def coderay( *args, &block )
orig_coderay *args, &block
buffer = eval('_erbout', block.binding)
pos = buffer.length
buffer[pos..-1] = "\n"
return
end
end
30 changes: 30 additions & 0 deletions website/src/404.html
@@ -0,0 +1,30 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>The page you were looking for doesn't exist (404)</title>
<style type="text/css">
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
</style>
</head>

<body>
<!-- This file lives in public/404.html -->
<div class="dialog">
<h1>The page you were looking for doesn't exist.</h1>
<p>You may have mistyped the address or the page may have moved.</p>
</div>
</body>
</html>
30 changes: 30 additions & 0 deletions website/src/422.html
@@ -0,0 +1,30 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>The change you wanted was rejected (422)</title>
<style type="text/css">
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
</style>
</head>

<body>
<!-- This file lives in public/422.html -->
<div class="dialog">
<h1>The change you wanted was rejected.</h1>
<p>Maybe you tried to change something you didn't have access to.</p>
</div>
</body>
</html>
30 changes: 30 additions & 0 deletions website/src/500.html
@@ -0,0 +1,30 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>We're sorry, but something went wrong (500)</title>
<style type="text/css">
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
</style>
</head>

<body>
<!-- This file lives in public/500.html -->
<div class="dialog">
<h1>We're sorry, but something went wrong.</h1>
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
</div>
</body>
</html>
16 changes: 16 additions & 0 deletions website/src/archive.page
@@ -0,0 +1,16 @@
---
title: Archive
order: 8
filter:
- erb
- textile
---

h2. <%= @page.title %>

Here are docs for previous versions.

<p>
<a href="http://rspec.rubyforge.org/REL_1_0_8" target="_blank">1.0.8</a><br/>
<a href="http://rspec.rubyforge.org/REL_0_9_4" target="_blank">0.9.4</a>
</p>
8 changes: 8 additions & 0 deletions website/src/changes.page
@@ -0,0 +1,8 @@
---
title: CHANGES
order: 3
filter:
- erb
- textile
---
<pre><%= IO.read '../example_rails_app/vendor/plugins/rspec/History.txt' %></pre>

0 comments on commit b321d9c

Please sign in to comment.