This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Jonas Pfenniger (author)
Thu Sep 24 09:57:16 -0700 2009
camping /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sun Aug 02 15:13:43 -0700 2009 | |
| |
CHANGELOG | Tue Oct 02 13:23:16 -0700 2007 | |
| |
COPYING | Wed May 03 08:29:20 -0700 2006 | |
| |
README | ||
| |
Rakefile | ||
| |
bin/ | Tue Feb 24 07:49:34 -0800 2009 | |
| |
book/ | Wed Aug 05 06:52:46 -0700 2009 | |
| |
examples/ | Thu Jun 11 10:32:57 -0700 2009 | |
| |
extras/ | ||
| |
lib/ | Thu Jun 11 13:33:38 -0700 2009 | |
| |
setup.rb | Tue Jan 17 21:39:29 -0800 2006 | |
| |
test/ | Thu Nov 13 13:25:07 -0800 2008 |
README
== Camping, a Microframework
Camping is a web framework which consistently stays at less than 3kb of code.
You can probably view the complete source code on a single page. But, you
know, it's so small that, if you think about it, what can it really do?
The idea here is to store a complete fledgling web application in a single
file like many small CGIs. But to organize it as a Model-View-Controller
application like Rails does. You can then easily move it to Rails once you've
got it going.
== A Camping Skeleton
A skeletal Camping blog could look like this:
require 'camping'
Camping.goes :Blog
module Blog::Models
class Post < Base; belongs_to :user; end
class Comment < Base; belongs_to :user; end
class User < Base; end
end
module Blog::Controllers
class Index
def get
@posts = Post.find :all
render :index
end
end
end
module Blog::Views
def layout
html do
head { title "My Blog" }
body do
h1 "My Blog"
self << yield
end
end
end
def index
for post in @posts
h1 post.title
end
end
end
== Installation
Interested yet? Luckily it's quite easy to install Camping. We'll be using
a tool called RubyGems, so if you don't have that installed yet, go grab it!
Once that's sorted out, open up a Terminal or Command Line and enter:
* <tt>gem install camping</tt>
Or for the bleeding edge:
* <tt>gem install camping --source http://gems.judofyr.net</tt>
Camping itself only depends on Rack[http://rack.rubyforge.org] and using the
command above will only install Camping and Rack. However, if you intend to
use the views you also need to install +markaby+, and if you're going to use
the database you need +activerecord+ as well:
* <tt>gem install markaby</tt>
* <tt>gem install activerecord</tt>
== Learning
* Start by reading the documentation in {the Camping module}[link:classes/Camping.html],
it should get you started pretty quick.
* {The wiki}[http://wiki.github.com/camping/camping] is the place for all tiny,
useful tricks that we've collected over the years. Don't be afraid to
share your own discoveries; the more, the better!
* Still wondering? Subscribe to {the mailing list}[http://rubyforge.org/mailman/listinfo/camping-list],
the place where it's all happening! Don't worry, though, the volume is just
as micro as Camping itself.
== Authors
Camping was originally started by {why the lucky stiff}[http://en.wikipedia.org/wiki/Why_the_lucky_stiff],
but is now maintained by the _community_. This simply means that if we like your
patch, it will be applied. Everything is managed through {the mailing
list}[http://rubyforge.org/mailman/listinfo/camping-list],
so just subscribe and you can instantly take a part in shaping Camping.








