Permalink
Browse files

Use boof's website design for sequel.rubyforge.org

Instead of just hosting the RDoc at sequel.rubyforge.org, have an
actual website, based on boof's design for www.ruby-sequel.org.
However, drop the Rails project and instead create a plain html site
generated with a simple script, a single template, and ERB.

Also, add a fifth main feature to the README, showing off the
improvements coming in 2.4.0.
  • Loading branch information...
1 parent 7aeea22 commit 189fe30158496a103a8a3a13eafe728717db95be @jeremyevans committed Aug 5, 2008
View
@@ -2,3 +2,4 @@ spec/spec_config.rb
rdoc
pkg
coverage
+www/public/*.html
View
@@ -6,17 +6,20 @@ Sequel is a lightweight database access toolkit for Ruby.
for constructing database queries and table schemas.
* Sequel also includes a lightweight but comprehensive ORM layer for
mapping records to Ruby objects and handling associated records.
+* Sequel supports advanced database features such as prepared statements,
+ bound variables, master/slave configurations, and database sharding.
* Sequel makes it easy to deal with multiple records without having
to break your teeth on SQL.
* Sequel currently has adapters for ADO, DB2, DBI, Informix, JDBC,
MySQL, ODBC, OpenBase, Oracle, PostgreSQL and SQLite3.
== Resources
+* {Website}[http://sequel.rubyforge.org]
* {Source code}[http://github.com/jeremyevans/sequel]
* {Bug tracking}[http://code.google.com/p/ruby-sequel/issues/list]
* {Google group}[http://groups.google.com/group/sequel-talk]
-* {RDoc}[http://sequel.rubyforge.org]
+* {RDoc}[http://sequel.rubyforge.org/rdoc]
To check out the source code:
View
@@ -13,9 +13,8 @@ CLEAN.include ["**/.*.sw?", "pkg", ".config", "rdoc", "coverage"]
RDOC_OPTS = ["--quiet", "--line-numbers", "--inline-source", '--title', \
'Sequel: The Database Toolkit for Ruby', '--main', 'README']
-##############################################################################
-# gem packaging and release
-##############################################################################
+# Gem Packaging and Release
+
desc "Packages sequel"
task :package=>[:clean]
spec = Gem::Specification.new do |s|
@@ -64,25 +63,26 @@ task :release=>[:package] do
sh %{rubyforge add_file sequel #{NAME} #{VERS} pkg/#{NAME}-#{VERS}.gem}
end
-##############################################################################
-# rdoc
-##############################################################################
+### RDoc
+
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = "rdoc"
rdoc.options += RDOC_OPTS
rdoc.rdoc_files.add %w"README CHANGELOG COPYING lib/**/*.rb doc/*.rdoc"
end
-desc "Update docs and upload to rubyforge.org"
-task :doc_rforge => [:rdoc]
-task :doc_rforge do
- sh %{chmod -R g+w rdoc/*}
- sh %{scp -rp rdoc/* rubyforge.org:/var/www/gforge-projects/sequel}
+### Website
+
+desc "Update sequel.rubyforge.org"
+task :website => [:rdoc]
+task :website do
+ sh %{www/make_www.rb}
+ sh %{scp -r www/public/* rubyforge.org:/var/www/gforge-projects/sequel/}
+ sh %{scp -r rdoc/* rubyforge.org:/var/www/gforge-projects/sequel/rdoc/}
end
-##############################################################################
-# specs
-##############################################################################
+### Specs
+
lib_dir = File.join(File.dirname(__FILE__), 'lib')
fixRUBYLIB = Proc.new{ENV['RUBYLIB'] ? (ENV['RUBYLIB'] += ":#{lib_dir}") : (ENV['RUBYLIB'] = lib_dir)}
sequel_core_specs = "spec/sequel_core/*_spec.rb"
@@ -141,9 +141,7 @@ task :dcov do
sh %{find lib -name '*.rb' | xargs dcov}
end
-##############################################################################
-# Statistics
-##############################################################################
+### Statistics
STATS_DIRECTORIES = [
%w(Code lib/),
View
@@ -0,0 +1,46 @@
+<!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">
+<head>
+ <title>Sequel: The Database Toolkit for Ruby<%= " - #{title.capitalize}" unless title == 'index' %></title>
+
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <meta content="text/html; charset=utf-8" http-equiv="content-type" />
+ <meta content="en" name="content-language" />
+
+ <meta name="keywords" content="ruby, sequel, sql, toolkit, orm, plugins, activerecord, documentation, howto, news" />
+ <meta name="description" content="Ruby Sequel is a lightweight database toolkit for Ruby." />
+
+ <link href="/css/application.css" media="screen" rel="stylesheet" type="text/css" />
+ <link href="/css/ruby.css" media="screen" rel="stylesheet" type="text/css" />
+</head>
+<body>
+ <div id="header">
+ <a href="/" id="logo"><img src="/images/ruby-sequel.png" alt="Ruby Sequel Logo" /></a>
+ <h1>The Database Toolkit for Ruby</h1>
+ <div id="navigation">
+ <ul>
+ <li><a href="/development.html">Development</a></li>
+ <li><a href="/documentation.html">Documentation</a></li>
+ <li><a href="/press.html">Press</a></li>
+ </ul>
+ </div>
+ <br style="clear: both;" />
+ </div>
+
+ <hr />
+
+ <div id="content">
+ <br style="clear: both;" />
+ <%= content %>
+ <br style="clear: both;" />
+ </div>
+
+ <div id="footer">
+ <p>
+ </p>
+ </div>
+</body>
+</html>
View
@@ -0,0 +1,10 @@
+#!/usr/bin/env ruby
+require 'erb'
+Dir.chdir(File.dirname(__FILE__))
+erb = ERB.new(File.read('layout.html.erb'))
+Dir['pages/*'].each do |page|
+ public_loc = "#{page.gsub(/\Apages\//, 'public/')}.html"
+ content = File.read(page)
+ title = File.basename(page)
+ File.open(public_loc, 'wb'){|f| f.write(erb.result(binding))}
+end
View
@@ -0,0 +1,19 @@
+<h2>Development</h2>
+
+<p>Sequel is being actively developed! You can join in on the discussions, ask questions, suggest features, and discuss Sequel in general by joining our Google Group - <a href='http://groups.google.com/group/sequel-talk'>Sequel Talk</a> or our <a href='irc://irc.freenode.net/sequel'>IRC channel</a>.</p>
+
+<h3>Reporting Bugs</h3>
+
+<p>To report a bug in Sequel, use our <a href="http://code.google.com/p/ruby-sequel/issues/list">bug tracker</a>. If you aren't sure if something is a bug, post a question on the <a href='http://groups.google.com/group/sequel-talk'>Google Group</a> or ask on <a href='irc://irc.freenode.net/sequel'>IRC</a>.</p>
+
+<h3>Source Code</h3>
+
+<p>The master source code repository is <a href="http://github.com/jeremyevans/sequel/">jeremyevans/sequel on github</a>. The latest release version also has a git clone at RubyForge.</p>
+
+<h3>Submitting Patches</h3>
+
+<p>The easiest way to contribute is to use git, post the changes to a public repository, and send a pull request, either via github, the google group, or IRC. Posting patches to the bug tracker or the Google Group works fine as well.</p>
+
+<h3>License</h3>
+
+<p>Sequel is distributed under the <a href="/rdoc/files/COPYING.html">MIT License</a>. Patches are assumed to be submitted under the same license as Sequel.</p>
@@ -0,0 +1,18 @@
+<h2>Documentation</h2>
+
+<h3>General Info, Guides, Examples, and Tutorials</h3>
+
+<ul>
+<li><a href="/rdoc/files/README.html">README</a></li>
+<li><a href="/rdoc/files/doc/cheat_sheet_rdoc.html">Cheat Sheet</a></li>
+<li><a href="/rdoc/files/doc/dataset_filtering_rdoc.html">Dataset Filtering</a></li>
+<li><a href="/rdoc/files/doc/advanced_associations_rdoc.html">Advanced Associations</a></li>
+<li><a href="/rdoc/files/doc/prepared_statements_rdoc.html">Prepared Statements/Bound Variables</a></li>
+<li><a href="/rdoc/files/doc/sharding_rdoc.html">Master/Slave Databases and Sharding</a></li>
+</ul>
+
+<h3><a href="/rdoc/">API RDoc</a></h3>
+
+<h3><a href="/rdoc/files/CHANGELOG.html">Change Log</a></h3>
+
+<h3><a href="/rdoc/files/COPYING.html">License</a></h3>
View
@@ -0,0 +1,39 @@
+<h2>Sequel: The Database Toolkit for Ruby</h2>
+
+<ul>
+<li>Sequel provides thread safety, connection pooling and a concise DSL for constructing database queries and table schemas.</li>
+<li>Sequel also includes a lightweight but comprehensive ORM layer for mapping records to Ruby objects and handling associated records.</li>
+<li>Sequel makes it easy to deal with multiple records without having to break your teeth on SQL.</li>
+<li>Sequel currently has adapters for ADO, DB2, DBI, Informix, JDBC, MySQL, ODBC, OpenBase, Oracle, PostgreSQL and SQLite3.</li>
+</ul>
+
+<h3 id='a_short_example'>A short example:</h3>
+
+<pre><code class='ruby' lang='ruby'><span class='comment'># connect to an in-memory database</span>
+<span class='constant'>DB</span> <span class='punct'>=</span> <span class='constant'>Sequel</span><span class='punct'>.</span><span class='ident'>sqlite</span>
+
+<span class='comment'># create an items table</span>
+<span class='constant'>DB</span><span class='punct'>.</span><span class='ident'>create_table</span> <span class='symbol'>:items</span> <span class='keyword'>do</span>
+
+ <span class='ident'>column</span> <span class='symbol'>:name</span><span class='punct'>,</span> <span class='symbol'>:text</span>
+ <span class='ident'>column</span> <span class='symbol'>:price</span><span class='punct'>,</span> <span class='symbol'>:float</span>
+<span class='keyword'>end</span>
+
+<span class='comment'># create a dataset from the items table</span>
+<span class='ident'>items</span> <span class='punct'>=</span> <span class='constant'>DB</span><span class='punct'>[</span><span class='symbol'>:items</span><span class='punct'>]</span>
+
+<span class='comment'># populate the table</span>
+<span class='ident'>items</span> <span class='punct'>&lt;&lt;</span> <span class='punct'>{</span><span class='symbol'>:name</span> <span class='punct'>=&gt;</span> <span class='punct'>&#39;</span><span class='string'>abc</span><span class='punct'>&#39;,</span> <span class='symbol'>:price</span> <span class='punct'>=&gt;</span> <span class='ident'>rand</span> <span class='punct'>*</span> <span class='number'>100</span><span class='punct'>}</span>
+<span class='ident'>items</span> <span class='punct'>&lt;&lt;</span> <span class='punct'>{</span><span class='symbol'>:name</span> <span class='punct'>=&gt;</span> <span class='punct'>&#39;</span><span class='string'>def</span><span class='punct'>&#39;,</span> <span class='symbol'>:price</span> <span class='punct'>=&gt;</span> <span class='ident'>rand</span> <span class='punct'>*</span> <span class='number'>100</span><span class='punct'>}</span>
+<span class='ident'>items</span> <span class='punct'>&lt;&lt;</span> <span class='punct'>{</span><span class='symbol'>:name</span> <span class='punct'>=&gt;</span> <span class='punct'>&#39;</span><span class='string'>ghi</span><span class='punct'>&#39;,</span> <span class='symbol'>:price</span> <span class='punct'>=&gt;</span> <span class='ident'>rand</span> <span class='punct'>*</span> <span class='number'>100</span><span class='punct'>}</span>
+
+<span class='comment'># print out the number of records</span>
+<span class='ident'>puts</span> <span class='punct'>&quot;</span><span class='string'>Item count: <span class='expr'>#{ items.count }</span></span><span class='punct'>&quot;</span>
+
+<span class='comment'># print out the records in descending order by price</span>
+<span class='ident'>items</span><span class='punct'>.</span><span class='ident'>reverse_order</span><span class='punct'>(</span><span class='symbol'>:price</span><span class='punct'>).</span><span class='ident'>print</span>
+
+<span class='comment'># print out the average price</span>
+<span class='ident'>puts</span> <span class='punct'>&quot;</span><span class='string'>The average price is: <span class='expr'>#{ items.avg :price }</span></span><span class='punct'>&quot;</span></code></pre>
+
+<h2><a href='/documentation'>Learn more about Sequel&#8230;</a></h2>
View
@@ -0,0 +1,14 @@
+<h2>Press</h2>
+
+<h3>Web Articles on Sequel</h3>
+
+<ul>
+<li><a href='http://on-ruby.blogspot.com/2008/01/sequel-interview-with-sharon-rosner.html'>On Ruby: Sequel Interview with Sharon Rosner</a></li>
+<li><a href='http://www.oreillynet.com/ruby/blog/2007/07/ruby_project_spotlight_june_07.html'>Ruby Project Spotlight, June &#8216;07 : Sequel - O&#8217;Reilly Ruby</a></li>
+</ul>
+
+<h3>Magazine Articles on Sequel</h3>
+
+<ul>
+<li><a href='http://www.impressjapan.jp/books/2579'>Ruby! Vol. 1</a> in japanese (thanks Shunichi Arai)</li>
+</ul>
Oops, something went wrong.

0 comments on commit 189fe30

Please sign in to comment.