camping 1.4.2 → 1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +44 -1
- data/README +4 -11
- data/Rakefile +10 -10
- data/bin/camping +155 -97
- data/doc/camping.1.gz +0 -0
- data/examples/{blog/blog.rb → blog.rb} +45 -59
- data/examples/{campsh/campsh.rb → campsh.rb} +38 -39
- data/examples/tepee.rb +242 -0
- data/lib/camping-unabridged.rb +203 -131
- data/lib/camping.rb +49 -48
- data/lib/camping/db.rb +78 -0
- data/lib/camping/fastcgi.rb +198 -0
- data/lib/camping/reloader.rb +169 -0
- data/lib/camping/session.rb +1 -1
- data/lib/camping/webrick.rb +51 -6
- metadata +73 -72
- data/examples/charts/charts.rb +0 -89
- data/examples/charts/pie.rb +0 -70
- data/examples/tepee/tepee.rb +0 -149
data/lib/camping/session.rb
CHANGED
@@ -86,7 +86,7 @@ module Camping
|
|
86
86
|
#
|
87
87
|
# 1. <tt>require 'camping/session'</tt>
|
88
88
|
# 2. Mixin the module: <tt>module YourApp; include Camping::Session end</tt>
|
89
|
-
# 3. In your application's <tt>create</tt> method, add a call to <tt>Camping::Models::
|
89
|
+
# 3. In your application's <tt>create</tt> method, add a call to <tt>Camping::Models::Session.create_schema</tt>
|
90
90
|
# 4. Throughout your application, use the <tt>@state</tt> var like a hash to store your application's data.
|
91
91
|
#
|
92
92
|
# If you are unfamiliar with the <tt>create</tt> method, see
|
data/lib/camping/webrick.rb
CHANGED
@@ -1,20 +1,65 @@
|
|
1
|
+
# == About camping/webrick.rb
|
2
|
+
#
|
3
|
+
# For many who have Ruby installed, Camping and WEBrick is a great option.
|
4
|
+
# It's definitely the easiest configuration, however some performance is sacrificed.
|
5
|
+
# For better speed, check out Mongrel at http://mongrel.rubyforge.org/, which comes
|
6
|
+
# with Camping hooks and is supported by the Camping Tool.
|
1
7
|
require 'camping'
|
2
8
|
require 'webrick/httpservlet/abstract.rb'
|
3
9
|
|
4
|
-
|
10
|
+
module WEBrick
|
11
|
+
# WEBrick::CampingHandler is a very simple handle for hosting Camping apps in
|
12
|
+
# a WEBrick server. It's used much like any other WEBrick handler.
|
13
|
+
#
|
14
|
+
# == Mounting a Camping App
|
15
|
+
#
|
16
|
+
# Assuming Camping.goes(:Blog), the Blog application can be mounted alongside
|
17
|
+
# other WEBrick mounts.
|
18
|
+
#
|
19
|
+
# s = WEBrick::HTTPServer.new(:BindAddress => host, :Port => port)
|
20
|
+
# s.mount "/blog", WEBrick::CampingHandler, Blog
|
21
|
+
# s.mount_proc("/") { ... }
|
22
|
+
#
|
23
|
+
# == How Does it Compare?
|
24
|
+
#
|
25
|
+
# Compared to other handlers, WEBrick is well-equipped in terms of features.
|
26
|
+
#
|
27
|
+
# * The <tt>X-Sendfile</tt> header is supported, along with etags and
|
28
|
+
# modification time headers for the file served. Since this handler
|
29
|
+
# is a subclass of WEBrick::HTTPServlet::DefaultFileHandler, all of its
|
30
|
+
# logic is used.
|
31
|
+
# * IO is streaming up and down. When you upload a file, it is streamed to
|
32
|
+
# the server's filesystem. When you download a file, it is streamed to
|
33
|
+
# your browser.
|
34
|
+
#
|
35
|
+
# While WEBrick is a bit slower than Mongrel and FastCGI options, it's
|
36
|
+
# a decent choice, for sure!
|
37
|
+
class CampingHandler < WEBrick::HTTPServlet::DefaultFileHandler
|
38
|
+
# Creates a CampingHandler, which answers for the application within +klass+.
|
5
39
|
def initialize(server, klass)
|
6
40
|
super(server, klass)
|
7
41
|
@klass = klass
|
8
42
|
end
|
9
|
-
|
43
|
+
# Handler for WEBrick requests (also aliased as do_POST).
|
44
|
+
def service(req, resp)
|
10
45
|
controller = @klass.run((req.body and StringIO.new(req.body)), req.meta_vars)
|
11
46
|
resp.status = controller.status
|
47
|
+
@local_path = nil
|
12
48
|
controller.headers.each do |k, v|
|
13
|
-
|
14
|
-
|
49
|
+
if k =~ /^X-SENDFILE$/i
|
50
|
+
@local_path = v
|
51
|
+
else
|
52
|
+
[*v].each do |vi|
|
53
|
+
resp[k] = vi
|
54
|
+
end
|
15
55
|
end
|
16
56
|
end
|
17
|
-
|
57
|
+
|
58
|
+
if @local_path
|
59
|
+
do_GET(req, res)
|
60
|
+
else
|
61
|
+
resp.body = controller.body.to_s
|
62
|
+
end
|
18
63
|
end
|
19
|
-
|
64
|
+
end
|
20
65
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.0.1
|
3
3
|
specification_version: 1
|
4
4
|
name: camping
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.
|
7
|
-
date: 2006-
|
6
|
+
version: "1.5"
|
7
|
+
date: 2006-10-03 00:00:00 -06:00
|
8
8
|
summary: minature rails for stay-at-home moms
|
9
9
|
require_paths:
|
10
|
-
|
10
|
+
- lib
|
11
11
|
email: why@ruby-lang.org
|
12
12
|
homepage: http://code.whytheluckystiff.net/camping/
|
13
13
|
rubyforge_project:
|
@@ -18,87 +18,88 @@ bindir: bin
|
|
18
18
|
has_rdoc: true
|
19
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
20
|
requirements:
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.8.2
|
24
24
|
version:
|
25
25
|
platform: ruby
|
26
26
|
signing_key:
|
27
27
|
cert_chain:
|
28
|
+
post_install_message:
|
28
29
|
authors:
|
29
|
-
|
30
|
+
- why the lucky stiff
|
30
31
|
files:
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
32
|
+
- COPYING
|
33
|
+
- README
|
34
|
+
- Rakefile
|
35
|
+
- bin/camping
|
36
|
+
- doc/camping.1.gz
|
37
|
+
- lib/camping
|
38
|
+
- lib/camping.rb
|
39
|
+
- lib/camping-unabridged.rb
|
40
|
+
- lib/camping/reloader.rb
|
41
|
+
- lib/camping/fastcgi.rb
|
42
|
+
- lib/camping/session.rb
|
43
|
+
- lib/camping/db.rb
|
44
|
+
- lib/camping/webrick.rb
|
45
|
+
- extras/permalink.gif
|
46
|
+
- extras/Camping.gif
|
47
|
+
- extras/flipbook_rdoc.rb
|
48
|
+
- examples/tepee.rb
|
49
|
+
- examples/blog.rb
|
50
|
+
- examples/campsh.rb
|
51
|
+
- CHANGELOG
|
49
52
|
test_files: []
|
50
53
|
|
51
54
|
rdoc_options:
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
- --exclude
|
66
|
-
- lib/camping.rb
|
55
|
+
- --quiet
|
56
|
+
- --title
|
57
|
+
- Camping, the Documentation
|
58
|
+
- --opname
|
59
|
+
- index.html
|
60
|
+
- --line-numbers
|
61
|
+
- --main
|
62
|
+
- README
|
63
|
+
- --inline-source
|
64
|
+
- --exclude
|
65
|
+
- ^(examples|extras)\/
|
66
|
+
- --exclude
|
67
|
+
- lib/camping.rb
|
67
68
|
extra_rdoc_files:
|
68
|
-
|
69
|
-
|
70
|
-
|
69
|
+
- README
|
70
|
+
- CHANGELOG
|
71
|
+
- COPYING
|
71
72
|
executables:
|
72
|
-
|
73
|
+
- camping
|
73
74
|
extensions: []
|
74
75
|
|
75
76
|
requirements: []
|
76
77
|
|
77
78
|
dependencies:
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: activesupport
|
81
|
+
version_requirement:
|
82
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 1.3.1
|
87
|
+
version:
|
88
|
+
- !ruby/object:Gem::Dependency
|
89
|
+
name: markaby
|
90
|
+
version_requirement:
|
91
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: "0.5"
|
96
|
+
version:
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: metaid
|
99
|
+
version_requirement:
|
100
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 0.0.0
|
105
|
+
version:
|
data/examples/charts/charts.rb
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
$:.unshift File.dirname(__FILE__) + "/../../lib"
|
4
|
-
$:.unshift File.dirname(__FILE__)
|
5
|
-
require 'rubygems'
|
6
|
-
require 'fileutils'
|
7
|
-
require 'camping'
|
8
|
-
require 'rvg/rvg'
|
9
|
-
require 'pie'
|
10
|
-
|
11
|
-
Camping.goes :Charts
|
12
|
-
|
13
|
-
module Charts::Controllers
|
14
|
-
class Index < R '/'
|
15
|
-
def get
|
16
|
-
# find all charts
|
17
|
-
@charts = Dir.glob("charts/*.gif").sort_by{|f|f.match(/(\d+)/)[1].to_i}.reverse
|
18
|
-
|
19
|
-
# keep only ten charts
|
20
|
-
(@charts[10..-1] || []).each{|f|FileUtils.rm(f,:force => true)}
|
21
|
-
@charts = @charts[0..9]
|
22
|
-
|
23
|
-
render :index
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
class Create < R '/create'
|
28
|
-
def post
|
29
|
-
# get our data
|
30
|
-
slices = input.data.split(',')
|
31
|
-
slices.reject!{|slice| slice !~ /\d+/}
|
32
|
-
slices.map!{|slice| slice.match(/(\d+)/)[1].to_i}
|
33
|
-
slices = [100] if slices.empty?
|
34
|
-
|
35
|
-
data = slices.map{|slice| {:value => slice, :style => "rgb(#{rand(255)},#{rand(255)},#{rand(255)})"}}
|
36
|
-
|
37
|
-
# save our chart
|
38
|
-
chart = Pie.new(data)
|
39
|
-
i = Dir.glob("charts/*.gif").map{|f|f.match(/(\d+)/)[1].to_i + 1}.max || 1
|
40
|
-
chart.draw(25).write("charts/#{i}.gif")
|
41
|
-
|
42
|
-
redirect Index
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
class Chart < R '/charts/(.+\.gif)'
|
47
|
-
def get filename
|
48
|
-
@headers["Content-Type"] = "image/gif"
|
49
|
-
|
50
|
-
@body = File.read("charts/#{filename}")
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
module Charts::Views
|
56
|
-
|
57
|
-
def layout
|
58
|
-
html do
|
59
|
-
head do
|
60
|
-
title 'Charts!'
|
61
|
-
end
|
62
|
-
body do
|
63
|
-
div.content do
|
64
|
-
self << yield
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
def index
|
71
|
-
form(:method => 'post', :action => '/create') do
|
72
|
-
label do
|
73
|
-
input :name => 'data', :type => 'text', :value => '10,20,30'
|
74
|
-
end
|
75
|
-
input :type => 'submit', :value => 'Prepare a chart'
|
76
|
-
end
|
77
|
-
|
78
|
-
div.charts do
|
79
|
-
@charts.each do |src|
|
80
|
-
img :src => src
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
end
|
86
|
-
|
87
|
-
if __FILE__ == $0
|
88
|
-
Charts.run
|
89
|
-
end
|
data/examples/charts/pie.rb
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
class Pie
|
2
|
-
|
3
|
-
RADIANS = Math::PI/180
|
4
|
-
MIN_PERCENT = (0.1 / 360.0) * 100
|
5
|
-
MAX_PERCENT = 100 - MIN_PERCENT
|
6
|
-
|
7
|
-
def initialize(data)
|
8
|
-
@data = data
|
9
|
-
end
|
10
|
-
|
11
|
-
def draw(size)
|
12
|
-
position = size / 2
|
13
|
-
offset = (size < 20 ? 1 : size / 20)
|
14
|
-
offset = 5 if offset > 5
|
15
|
-
radius = position - offset
|
16
|
-
|
17
|
-
total = @data.inject(0){|sum, item| sum + item[:value].to_f}
|
18
|
-
percent_scale = 100.0 / total
|
19
|
-
|
20
|
-
full_circle = false
|
21
|
-
angles = [12.5 * 3.6 * RADIANS]
|
22
|
-
slices = []
|
23
|
-
|
24
|
-
@data.each do |item|
|
25
|
-
percent = percent_scale * item[:value].to_f
|
26
|
-
percent = MIN_PERCENT if percent < MIN_PERCENT
|
27
|
-
if percent > MAX_PERCENT
|
28
|
-
full_circle = item
|
29
|
-
else
|
30
|
-
prev_angle = angles.last
|
31
|
-
angles << prev_angle + (percent * 3.6 * RADIANS)
|
32
|
-
slices << {:start => angles[-2], :end => angles[-1], :style => item[:style]}
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
rvg = Magick::RVG.new(size,size) do |canvas|
|
37
|
-
canvas.background_fill = 'white'
|
38
|
-
|
39
|
-
# is there a full circle here? then draw it
|
40
|
-
canvas.circle(radius,position,position).styles(:fill => full_circle[:style]) if full_circle
|
41
|
-
|
42
|
-
# draw the fills of the slices
|
43
|
-
slices.each do |slice|
|
44
|
-
canvas.path(slice_path(position,position,radius,slice[:start],slice[:end])).styles(:fill => slice[:style])
|
45
|
-
end
|
46
|
-
|
47
|
-
# outline the graph
|
48
|
-
canvas.circle(radius,position,position).styles(:stroke => 'black', :stroke_width => 0.7, :fill => 'transparent')
|
49
|
-
|
50
|
-
# draw lines between each slice
|
51
|
-
angles[0..-2].each do |a|
|
52
|
-
canvas.line(position, position, position+(Math.sin(a)*radius), position-(Math.cos(a)*radius)).styles(:stroke => 'black', :stroke_width => 0.7, :fill => 'transparent')
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
rvg.draw
|
57
|
-
|
58
|
-
end
|
59
|
-
|
60
|
-
protected
|
61
|
-
|
62
|
-
def slice_path(x, y, size, start_angle, end_angle)
|
63
|
-
x_start = x+(Math.sin(start_angle) * size)
|
64
|
-
y_start = y-(Math.cos(start_angle) * size)
|
65
|
-
x_end = x+(Math.sin(end_angle) * size)
|
66
|
-
y_end = y-(Math.cos(end_angle) * size)
|
67
|
-
"M#{x},#{y} L#{x_start},#{y_start} A#{size},#{size} 0, #{end_angle - start_angle >= 50 * 3.6 * RADIANS ? '1' : '0'},1, #{x_end} #{y_end} Z"
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
data/examples/tepee/tepee.rb
DELETED
@@ -1,149 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
$:.unshift File.dirname(__FILE__) + "/../../lib"
|
3
|
-
%w(rubygems redcloth camping acts_as_versioned).each { |lib| require lib }
|
4
|
-
|
5
|
-
Camping.goes :Tepee
|
6
|
-
|
7
|
-
module Tepee::Models
|
8
|
-
def self.schema(&block)
|
9
|
-
@@schema = block if block_given?
|
10
|
-
@@schema
|
11
|
-
end
|
12
|
-
|
13
|
-
class Page < Base
|
14
|
-
PAGE_LINK = /\[\[([^\]|]*)[|]?([^\]]*)\]\]/
|
15
|
-
validates_uniqueness_of :title
|
16
|
-
before_save { |r| r.title = r.title.underscore }
|
17
|
-
acts_as_versioned
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
Tepee::Models.schema do
|
22
|
-
create_table :tepee_pages, :force => true do |t|
|
23
|
-
t.column :title, :string, :limit => 255
|
24
|
-
t.column :body, :text
|
25
|
-
end
|
26
|
-
Tepee::Models::Page.create_versioned_table
|
27
|
-
end
|
28
|
-
|
29
|
-
module Tepee::Controllers
|
30
|
-
class Index < R '/'
|
31
|
-
def get
|
32
|
-
redirect Show, 'home_page'
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class List < R '/list'
|
37
|
-
def get
|
38
|
-
@pages = Page.find :all, :order => 'title'
|
39
|
-
render :list
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
class Show < R '/s/(\w+)', '/s/(\w+)/(\d+)'
|
44
|
-
def get page_name, version = nil
|
45
|
-
redirect(Edit, page_name, 1) and return unless @page = Page.find_by_title(page_name)
|
46
|
-
@version = (version.nil? or version == @page.version.to_s) ? @page : @page.versions.find_by_version(version)
|
47
|
-
render :show
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
class Edit < R '/e/(\w+)/(\d+)', '/e/(\w+)'
|
52
|
-
def get page_name, version = nil
|
53
|
-
@page = Page.find_or_create_by_title(page_name)
|
54
|
-
@page = @page.versions.find_by_version(version) unless version.nil? or version == @page.version.to_s
|
55
|
-
render :edit
|
56
|
-
end
|
57
|
-
|
58
|
-
def post page_name
|
59
|
-
Page.find_or_create_by_title(page_name).update_attributes :body => input.post_body and redirect Show, page_name
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
module Tepee::Views
|
65
|
-
def layout
|
66
|
-
html do
|
67
|
-
head do
|
68
|
-
title 'test'
|
69
|
-
end
|
70
|
-
body do
|
71
|
-
p do
|
72
|
-
small do
|
73
|
-
span "welcome to " ; a 'tepee', :href => "http://code.whytheluckystiff.net/svn/camping/trunk/examples/tepee/"
|
74
|
-
span '. go ' ; a 'home', :href => R(Show, 'home_page')
|
75
|
-
span '. list all ' ; a 'pages', :href => R(List)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
div.content do
|
79
|
-
self << yield
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def show
|
86
|
-
h1 @page.title
|
87
|
-
div { _markup @version.body }
|
88
|
-
p do
|
89
|
-
a 'edit', :href => R(Edit, @version.title, @version.version)
|
90
|
-
a 'back', :href => R(Show, @version.title, @version.version-1) unless @version.version == 1
|
91
|
-
a 'next', :href => R(Show, @version.title, @version.version+1) unless @version.version == @page.version
|
92
|
-
a 'current', :href => R(Show, @version.title) unless @version.version == @page.version
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
def edit
|
97
|
-
form :method => 'post', :action => R(Edit, @page.title) do
|
98
|
-
p do
|
99
|
-
label 'Body' ; br
|
100
|
-
textarea @page.body, :name => 'post_body', :rows => 50, :cols => 100
|
101
|
-
end
|
102
|
-
|
103
|
-
p do
|
104
|
-
input :type => 'submit'
|
105
|
-
a 'cancel', :href => R(Show, @page.title, @page.version)
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
def list
|
111
|
-
h1 'all pages'
|
112
|
-
ul { @pages.each { |p| li { a p.title, :href => R(Show, p.title) } } }
|
113
|
-
end
|
114
|
-
|
115
|
-
def _markup body
|
116
|
-
return '' if body.blank?
|
117
|
-
body.gsub!(Tepee::Models::Page::PAGE_LINK) do
|
118
|
-
page = title = $1
|
119
|
-
title = $2 unless $2.empty?
|
120
|
-
page = page.gsub /\W/, '_'
|
121
|
-
if Tepee::Models::Page.find(:all, :select => 'title').collect { |p| p.title }.include?(page)
|
122
|
-
%Q{<a href="#{self/R(Show, page)}">#{title}</a>}
|
123
|
-
else
|
124
|
-
%Q{<span>#{title}<a href="#{self/R(Edit, page, 1)}">?</a></span>}
|
125
|
-
end
|
126
|
-
end
|
127
|
-
RedCloth.new(body, [ :hard_breaks ]).to_html
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
def Tepee.create
|
132
|
-
unless Tepee::Models::Page.table_exists?
|
133
|
-
ActiveRecord::Schema.define(&Tepee::Models.schema)
|
134
|
-
Tepee::Models::Page.reset_column_information
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
if __FILE__ == $0
|
139
|
-
require 'mongrel/camping'
|
140
|
-
|
141
|
-
Tepee::Models::Base.establish_connection :adapter => 'sqlite3', :database => 'tepee.db'
|
142
|
-
Tepee::Models::Base.logger = Logger.new('camping.log')
|
143
|
-
Tepee::Models::Base.threaded_connections=false
|
144
|
-
Tepee.create
|
145
|
-
|
146
|
-
server = Mongrel::Camping::start("0.0.0.0",3001,"/tepee",Tepee)
|
147
|
-
puts "** Tepee example is running at http://localhost:3000/tepee"
|
148
|
-
server.join
|
149
|
-
end
|