Permalink
Browse files

In preparation for 1.0.

  • Loading branch information...
1 parent 4e8e29b commit 3ece811ceb9c41555616754fabfbabcd56fe2301 @ciconia ciconia committed Jan 2, 2008
Showing with 127 additions and 7 deletions.
  1. +4 −4 Rakefile
  2. +1 −1 core/Rakefile
  3. +2 −2 model/Rakefile
  4. +18 −0 sequel/COPYING
  5. +81 −0 sequel/README
  6. +21 −0 sequel/Rakefile
View
8 Rakefile
@@ -70,17 +70,17 @@ RDOC_OPTS = [
"--title", "Sequel Model: Lightweight ORM for Ruby",
"--opname", "index.html",
"--line-numbers",
- "--main", "core/README",
+ "--main", "sequel/README",
"--inline-source"
]
Rake::RDocTask.new do |rdoc|
- rdoc.rdoc_dir = "doc/rdoc"
+ rdoc.rdoc_dir = "sequel/doc/rdoc"
rdoc.options += RDOC_OPTS
rdoc.main = "core/README"
rdoc.title = "Sequel: Lightweight ORM for Ruby"
- rdoc.rdoc_files.add ["core/README", "core/COPYING",
- "core/lib/sequel.rb", "core/lib/**/*.rb",
+ rdoc.rdoc_files.add ["sequel/README", "sequel/COPYING",
+ "core/lib/sequel_core.rb", "core/lib/**/*.rb",
"model/lib/sequel_model.rb", "model/lib/**/*.rb",
]
end
View
2 core/Rakefile
@@ -48,7 +48,7 @@ spec = Gem::Specification.new do |s|
s.has_rdoc = true
s.extra_rdoc_files = ["README", "CHANGELOG", "COPYING"]
s.rdoc_options += RDOC_OPTS +
- ["--exclude", "^(examples|extras)\/", "--exclude", "lib/sequel.rb"]
+ ["--exclude", "^(examples|extras)\/", "--exclude", "lib/sequel_core.rb"]
s.summary = "Database access for Ruby"
s.description = s.summary
s.author = "Sharon Rosner"
View
4 model/Rakefile
@@ -30,7 +30,7 @@ Rake::RDocTask.new do |rdoc|
rdoc.options += RDOC_OPTS
rdoc.main = "README"
rdoc.title = "Sequel: Lightweight ORM for Ruby"
- rdoc.rdoc_files.add ["README", "COPYING", "lib/sequel.rb", "lib/**/*.rb"]
+ rdoc.rdoc_files.add ["README", "COPYING", "lib/sequel_model.rb", "lib/**/*.rb"]
end
##############################################################################
@@ -48,7 +48,7 @@ spec = Gem::Specification.new do |s|
s.has_rdoc = true
s.extra_rdoc_files = ["README", "CHANGELOG", "COPYING"]
s.rdoc_options += RDOC_OPTS +
- ["--exclude", "^(examples|extras)\/", "--exclude", "lib/sequel.rb"]
+ ["--exclude", "^(examples|extras)\/", "--exclude", "lib/sequel_model.rb"]
s.summary = "Lightweight ORM for Ruby"
s.description = s.summary
s.author = "Sharon Rosner"
View
18 sequel/COPYING
@@ -0,0 +1,18 @@
+Copyright (c) 2006-2007 Sharon Rosner
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
81 sequel/README
@@ -0,0 +1,81 @@
+== Sequel: Concise ORM for Ruby
+
+Sequel is an ORM framework for Ruby. Sequel provides thread safety, connection pooling, and a concise DSL for constructing queries and table schemas.
+
+Sequel makes it easy to deal with multiple records without having to break your teeth on SQL.
+
+== Resources
+
+* {Project page}[http://code.google.com/p/ruby-sequel/]
+* {Source code}[http://ruby-sequel.googlecode.com/svn/]
+* {Bug tracking}[http://code.google.com/p/ruby-sequel/issues/list]
+* {Google group}[http://groups.google.com/group/sequel-talk]
+* {RubyForge page}[http://rubyforge.org/projects/sequel/]
+
+To check out the source code:
+
+ svn co http://ruby-sequel.googlecode.com/svn/trunk
+
+=== Contact
+
+If you have any comments or suggestions please send an email to ciconia at gmail.com and I'll get back to you.
+
+== Installation
+
+ sudo gem install sequel
+
+Note: as of version 0.5, Sequel models are distributed in a separate gem. In order to use sequel models, you should install the sequel_model gem:
+
+ sudo gem install sequel_model
+
+== Supported Databases
+
+Sequel currently supports:
+
+* ADO (on Windows)
+* DBI
+* Informix
+* MySQL
+* ODBC
+* Oracle
+* PostgreSQL
+* SQLite 3
+
+There are also experimental adapters for DB2, OpenBase and JDBC (on JRuby).
+
+== The Sequel Console
+
+Sequel includes an IRB console for quick'n'dirty access to databases. You can use it like this:
+
+ sequel sqlite:///test.db
+
+You get an IRB session with the database object stored in DB.
+
+== An Introduction
+
+Sequel was designed to take the hassle away from connecting to databases and manipulating them. Sequel deals with all the boring stuff like maintaining connections, formatting SQL correctly and fetching records so you can concentrate on your application.
+
+Sequel uses the concept of datasets to retrieve data. A Dataset object encapsulates an SQL query and supports chainability, letting you fetch data using a convenient Ruby DSL that is both concise and infinitely flexible.
+
+For example, the following one-liner returns the average GDP for the five biggest countries in the middle east region:
+
+ DB[:countries].filter(:region => 'Middle East').reverse_order(:area).limit(5).avg(:GDP)
+
+Which is equivalent to:
+
+ SELECT avg(GDP) FROM countries WHERE region = 'Middle East' ORDER BY area DESC LIMIT 5
+
+Since datasets retrieve records only when needed, they can be stored and later reused. Records are fetched as hashes (they can also be fetched as custom model objects), and are accessed using an Enumerable interface:
+
+ middle_east = DB[:countries].filter(:region => 'Middle East')
+ middle_east.order(:name).each {|r| puts r[:name]}
+
+Sequel also offers convenience methods for extracting data from Datasets, such as an extended map method:
+
+ middle_east.map(:name) #=> ['Egypt', 'Greece', 'Israel', ...]
+
+Or getting results as a transposed hash, with one column as key and another as value:
+
+ middle_east.to_hash(:name, :area) #=> {'Israel' => 20000, 'Greece' => 120000, ...}
+
+You can find more information on getting started with Sequel {here}[http://code.google.com/p/ruby-sequel/wiki/GettingStarted]
View
21 sequel/Rakefile
@@ -1,6 +1,7 @@
require "rake"
require "rake/clean"
require "rake/gempackagetask"
+require "rake/rdoctask"
require "fileutils"
include FileUtils
@@ -10,6 +11,14 @@ include FileUtils
NAME = "sequel"
VERS = "1.0"
CLEAN.include ["**/.*.sw?", "pkg/*", ".config", "doc/*", "coverage/*"]
+RDOC_OPTS = [
+ "--quiet",
+ "--title", "Sequel: Database access for Ruby",
+ "--opname", "index.html",
+ "--line-numbers",
+ "--main", "README",
+ "--inline-source"
+]
##############################################################################
# Gem packaging
@@ -18,6 +27,15 @@ desc "Packages up Sequel."
task :default => [:package]
task :package => [:clean]
+RDOC_OPTS = [
+ "--quiet",
+ "--title", "Sequel Model: Lightweight ORM for Ruby",
+ "--opname", "index.html",
+ "--line-numbers",
+ "--main", "README",
+ "--inline-source"
+]
+
spec = Gem::Specification.new do |s|
s.name = NAME
s.rubyforge_project = 'sequel'
@@ -30,6 +48,9 @@ spec = Gem::Specification.new do |s|
s.homepage = "http://sequel.rubyforge.org"
s.required_ruby_version = ">= 1.8.4"
+ s.has_rdoc = true
+ s.extra_rdoc_files = ["README", "COPYING"]
+
s.add_dependency("sequel_core")
s.add_dependency("sequel_model")

0 comments on commit 3ece811

Please sign in to comment.