bivouac 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README +50 -1
- data/bin/bivouac +10 -3
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/AUTHORS.html +95 -0
- data/doc/rdoc/files/COPYING.html +519 -0
- data/doc/rdoc/files/README.html +262 -0
- data/doc/rdoc/index.html +10 -0
- data/doc/rdoc/permalink.gif +0 -0
- data/doc/rdoc/rdoc-style.css +106 -0
- data/doc/rdoc/rubyfr.png +0 -0
- data/examples/blog_erb/app/{controllers/blog.rb → blog.rb} +11 -11
- data/examples/blog_erb/config/environment.rb +2 -2
- data/examples/blog_erb/db/Blog.db +0 -0
- data/examples/blog_erb/db/create.rb +1 -1
- data/examples/blog_erb/log/Blog.log +51 -106
- data/examples/blog_erb/script/server +1 -1
- data/examples/blog_goh/app/{controllers/blog.rb → blog.rb} +10 -14
- data/examples/blog_goh/config/environment.rb +1 -1
- data/examples/blog_goh/db/Blog.db +0 -0
- data/examples/blog_goh/db/create.rb +5 -1
- data/examples/blog_goh/log/Blog.log +75 -0
- data/examples/blog_goh/script/server +1 -1
- data/lib/bivouac/template/application/postamble_cgi.rb +2 -2
- data/lib/bivouac/template/application/postamble_fastcgi.rb +2 -2
- data/lib/bivouac/template/application/postamble_mongrel.rb +16 -1
- data/lib/bivouac/template/application/postamble_webrick.rb +4 -3
- data/lib/bivouac/template/application_erb.rb +11 -8
- data/lib/bivouac/template/application_goh.rb +10 -7
- data/lib/bivouac/template/server.rb +1 -1
- metadata +20 -5
- data/examples/blog_goh/log/camping.log +0 -19
@@ -1,112 +1,57 @@
|
|
1
|
-
# Logfile created on
|
2
|
-
[4;36;1mSQL (0.
|
1
|
+
# Logfile created on Wed Aug 01 09:49:19 +0200 2007 by /
|
2
|
+
[4;36;1mSQL (0.000265)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
3
3
|
[4;35;1mSQL (0.000000)[0m [0mSQLite3::SQLException: no such table: sessions: DROP TABLE sessions[0m
|
4
|
-
[4;36;1mSQL (0.
|
5
|
-
[4;35;1mSQL (0.
|
6
|
-
[4;36;1mSQL (0.
|
7
|
-
[4;35;1mSQL (0.
|
8
|
-
[4;36;1mBlog::Models::SchemaInfo Load (0.
|
9
|
-
[4;35;1mSQL (0.
|
10
|
-
[4;36;1mSQL (0.
|
11
|
-
[4;35;1mSQL (0.
|
12
|
-
[4;36;1mSQL (0.
|
13
|
-
[4;35;1mSQL (0.
|
14
|
-
[4;36;1mCamping::Models::Session Load (0.
|
15
|
-
[4;35;1mSQL (0.
|
4
|
+
[4;36;1mSQL (0.092496)[0m [0;1mCREATE TABLE sessions ("id" INTEGER PRIMARY KEY NOT NULL, "hashid" varchar(32) DEFAULT NULL, "created_at" datetime DEFAULT NULL, "ivars" text DEFAULT NULL) [0m
|
5
|
+
[4;35;1mSQL (0.000450)[0m [0mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
6
|
+
[4;36;1mSQL (0.000275)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
7
|
+
[4;35;1mSQL (0.133069)[0m [0mCREATE TABLE blog_schema_infos ("id" INTEGER PRIMARY KEY NOT NULL, "version" float DEFAULT NULL) [0m
|
8
|
+
[4;36;1mBlog::Models::SchemaInfo Load (0.000260)[0m [0;1mSELECT * FROM blog_schema_infos LIMIT 1[0m
|
9
|
+
[4;35;1mSQL (0.243340)[0m [0mCREATE TABLE blog_comments ("id" INTEGER PRIMARY KEY NOT NULL, "post_id" integer NOT NULL, "username" varchar(255) DEFAULT NULL, "body" text DEFAULT NULL) [0m
|
10
|
+
[4;36;1mSQL (0.068921)[0m [0;1mCREATE TABLE blog_posts ("id" INTEGER PRIMARY KEY NOT NULL, "user_id" integer NOT NULL, "title" varchar(255) DEFAULT NULL, "body" text DEFAULT NULL) [0m
|
11
|
+
[4;35;1mSQL (0.067700)[0m [0mCREATE TABLE blog_users ("id" INTEGER PRIMARY KEY NOT NULL, "username" varchar(255) DEFAULT NULL, "password" varchar(255) DEFAULT NULL) [0m
|
12
|
+
[4;36;1mSQL (0.000618)[0m [0;1mINSERT INTO blog_users ("username", "password") VALUES('admin', 'bivouac')[0m
|
13
|
+
[4;35;1mSQL (0.000532)[0m [0mINSERT INTO blog_schema_infos ("version") VALUES(1.0)[0m
|
14
|
+
[4;36;1mCamping::Models::Session Load (0.000319)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
15
|
+
[4;35;1mSQL (0.000543)[0m [0mINSERT INTO sessions ("hashid", "created_at", "ivars") VALUES('TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG', '2007-08-01 09:52:28', '--- !map:HashWithIndifferentAccess {}
|
16
16
|
|
17
17
|
')[0m
|
18
|
-
[4;36;1mBlog::Models::Post Load (0.
|
19
|
-
[4;35;1mCamping::Models::Session Load (0.
|
20
|
-
[4;36;1mCamping::Models::Session Load (0.
|
21
|
-
[4;35;1mBlog::Models::User Load (0.
|
22
|
-
[4;36;1mCamping::Models::Session Update (0.
|
18
|
+
[4;36;1mBlog::Models::Post Load (0.000306)[0m [0;1mSELECT * FROM blog_posts [0m
|
19
|
+
[4;35;1mCamping::Models::Session Load (0.000577)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
20
|
+
[4;36;1mCamping::Models::Session Load (0.000534)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
21
|
+
[4;35;1mBlog::Models::User Load (0.000382)[0m [0mSELECT * FROM blog_users WHERE (username = 'admin' AND password = 'bivouac') LIMIT 1[0m
|
22
|
+
[4;36;1mCamping::Models::Session Update (0.001286)[0m [0;1mUPDATE sessions SET "created_at" = '2007-08-01 09:52:28', "hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG', "ivars" = '--- !map:HashWithIndifferentAccess
|
23
23
|
Blog: !map:HashWithIndifferentAccess
|
24
24
|
user_id: 1
|
25
25
|
' WHERE "id" = 1[0m
|
26
|
-
[4;35;1mCamping::Models::Session Load (0.
|
27
|
-
[4;36;1mBlog::Models::User Load (0.
|
28
|
-
[4;
|
29
|
-
[4;
|
30
|
-
[4;
|
31
|
-
[4;
|
32
|
-
[4;
|
33
|
-
[4;
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
[4;36;
|
38
|
-
[4;35;1mCamping::Models::Session Load (0.
|
39
|
-
[4;36;1mBlog::Models::
|
40
|
-
[4;35;
|
41
|
-
[4;36;1mCamping::Models::Session Load (0.
|
42
|
-
[4;35;1mBlog::Models::
|
43
|
-
[4;36;
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
[4;
|
48
|
-
[4;
|
49
|
-
[4;
|
50
|
-
[4;
|
51
|
-
[4;
|
52
|
-
[4;
|
53
|
-
[4;
|
54
|
-
[4;
|
55
|
-
[4;
|
56
|
-
[4;
|
57
|
-
[4;
|
58
|
-
[4;36;1mCamping::Models::Session Load (0.000449)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
59
|
-
[4;36;1mSQL (0.000700)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
60
|
-
[4;35;1mSQL (0.000420)[0m [0mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
61
|
-
[4;36;1mSQL (0.000408)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
62
|
-
[4;35;1mBlog::Models::SchemaInfo Load (0.000292)[0m [0mSELECT * FROM blog_schema_infos LIMIT 1[0m
|
63
|
-
[4;36;1mCamping::Models::Session Load (0.000495)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
64
|
-
[4;35;1mBlog::Models::Post Load (0.000400)[0m [0mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
65
|
-
[4;36;1mBlog::Models::Comment Load (0.000217)[0m [0;1mSELECT * FROM blog_comments WHERE (post_id = '1') [0m
|
66
|
-
[4;35;1mCamping::Models::Session Load (0.000420)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
67
|
-
[4;36;1mCamping::Models::Session Load (0.000608)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
68
|
-
[4;35;1mBlog::Models::Post Load (0.000464)[0m [0mSELECT * FROM blog_posts [0m
|
69
|
-
[4;36;1mCamping::Models::Session Load (0.000702)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
70
|
-
[4;35;1mCamping::Models::Session Load (0.000590)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
71
|
-
[4;36;1mBlog::Models::Post Load (0.000448)[0m [0;1mSELECT * FROM blog_posts [0m
|
72
|
-
[4;35;1mCamping::Models::Session Load (0.000525)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
73
|
-
[4;36;1mCamping::Models::Session Load (0.000552)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
74
|
-
[4;35;1mBlog::Models::Post Load (0.000458)[0m [0mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
75
|
-
[4;36;1mBlog::Models::Comment Load (0.000211)[0m [0;1mSELECT * FROM blog_comments WHERE (post_id = '1') [0m
|
76
|
-
[4;35;1mCamping::Models::Session Load (0.000472)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
77
|
-
[4;36;1mCamping::Models::Session Load (0.000538)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
78
|
-
[4;35;1mBlog::Models::User Load (0.000485)[0m [0mSELECT * FROM blog_users WHERE (blog_users."id" = 1) [0m
|
79
|
-
[4;36;1mBlog::Models::Post Load (0.000415)[0m [0;1mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
80
|
-
[4;35;1mCamping::Models::Session Load (0.000452)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
81
|
-
[4;36;1mBlog::Models::Post Load (0.000285)[0m [0;1mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
82
|
-
[4;35;1mBlog::Models::Post Update (0.000950)[0m [0mUPDATE blog_posts SET "title" = 'Blog ERB', "body" = 'Ca fonctionne aussi avec ERB !!!', "user_id" = 1 WHERE "id" = 1[0m
|
83
|
-
[4;36;1mCamping::Models::Session Load (0.000620)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
84
|
-
[4;35;1mBlog::Models::Post Load (0.000437)[0m [0mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
85
|
-
[4;36;1mBlog::Models::Comment Load (0.000189)[0m [0;1mSELECT * FROM blog_comments WHERE (post_id = '1') [0m
|
86
|
-
[4;35;1mCamping::Models::Session Load (0.000473)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
87
|
-
[4;36;1mCamping::Models::Session Load (0.000583)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
88
|
-
[4;35;1mBlog::Models::Post Load (0.000392)[0m [0mSELECT * FROM blog_posts [0m
|
89
|
-
[4;36;1mCamping::Models::Session Load (0.000540)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
90
|
-
[4;35;1mBlog::Models::Post Load (0.000447)[0m [0mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
91
|
-
[4;36;1mBlog::Models::Comment Load (0.000188)[0m [0;1mSELECT * FROM blog_comments WHERE (post_id = '1') [0m
|
92
|
-
[4;35;1mCamping::Models::Session Load (0.000498)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
93
|
-
[4;36;1mSQL (0.000516)[0m [0;1mINSERT INTO blog_comments ("body", "post_id", "username") VALUES('pipo', 1, 'greg')[0m
|
94
|
-
[4;35;1mCamping::Models::Session Load (0.000517)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
95
|
-
[4;36;1mBlog::Models::Post Load (0.000355)[0m [0;1mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
96
|
-
[4;35;1mBlog::Models::Comment Load (0.000337)[0m [0mSELECT * FROM blog_comments WHERE (post_id = '1') [0m
|
97
|
-
[4;36;1mCamping::Models::Session Load (0.000510)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
98
|
-
[4;35;1mSQL (0.000521)[0m [0mINSERT INTO blog_comments ("body", "post_id", "username") VALUES('C''est beau et il faut chaud. Je me sent bien !!!', 1, 'Hello')[0m
|
99
|
-
[4;36;1mCamping::Models::Session Load (0.000513)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
100
|
-
[4;35;1mBlog::Models::Post Load (0.000384)[0m [0mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
101
|
-
[4;36;1mBlog::Models::Comment Load (0.000513)[0m [0;1mSELECT * FROM blog_comments WHERE (post_id = '1') [0m
|
102
|
-
[4;35;1mCamping::Models::Session Load (0.000558)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
103
|
-
[4;36;1mBlog::Models::Post Load (0.000403)[0m [0;1mSELECT * FROM blog_posts [0m
|
104
|
-
[4;35;1mCamping::Models::Session Load (0.000499)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
105
|
-
[4;36;1mBlog::Models::User Load (0.000364)[0m [0;1mSELECT * FROM blog_users WHERE (blog_users."id" = 1) [0m
|
106
|
-
[4;35;1mCamping::Models::Session Load (0.000519)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
107
|
-
[4;36;1mSQL (0.000832)[0m [0;1mINSERT INTO blog_posts ("body", "title", "user_id") VALUES('Ceci et le second post !', 'Post #2', 1)[0m
|
108
|
-
[4;35;1mCamping::Models::Session Load (0.000521)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
109
|
-
[4;36;1mBlog::Models::Post Load (0.000352)[0m [0;1mSELECT * FROM blog_posts WHERE (blog_posts."id" = 2) [0m
|
110
|
-
[4;35;1mBlog::Models::Comment Load (0.000184)[0m [0mSELECT * FROM blog_comments WHERE (post_id = '2') [0m
|
111
|
-
[4;36;1mCamping::Models::Session Load (0.000505)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'qnIE0e112l1pvd5dRiZrGfJgFJvW2y19') LIMIT 1[0m
|
112
|
-
[4;35;1mBlog::Models::Post Load (0.000476)[0m [0mSELECT * FROM blog_posts [0m
|
26
|
+
[4;35;1mCamping::Models::Session Load (0.000677)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
27
|
+
[4;36;1mBlog::Models::User Load (0.000486)[0m [0;1mSELECT * FROM blog_users WHERE (blog_users."id" = 1) [0m
|
28
|
+
[4;35;1mCamping::Models::Session Load (0.000516)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
29
|
+
[4;36;1mSQL (0.000519)[0m [0;1mINSERT INTO blog_posts ("body", "title", "user_id") VALUES('P11', '11', 1)[0m
|
30
|
+
[4;35;1mCamping::Models::Session Load (0.000606)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
31
|
+
[4;36;1mBlog::Models::Post Load (0.000389)[0m [0;1mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
32
|
+
[4;35;1mBlog::Models::Comment Load (0.000365)[0m [0mSELECT * FROM blog_comments WHERE (post_id = '1') [0m
|
33
|
+
[4;36;1mCamping::Models::Session Load (0.000516)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
34
|
+
[4;35;1mSQL (0.000521)[0m [0mINSERT INTO blog_comments ("body", "post_id", "username") VALUES('HW', 1, 'g')[0m
|
35
|
+
[4;36;1mCamping::Models::Session Load (0.000570)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
36
|
+
[4;35;1mBlog::Models::Post Load (0.000392)[0m [0mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
37
|
+
[4;36;1mBlog::Models::Comment Load (0.000354)[0m [0;1mSELECT * FROM blog_comments WHERE (post_id = '1') [0m
|
38
|
+
[4;35;1mCamping::Models::Session Load (0.000454)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
39
|
+
[4;36;1mBlog::Models::User Load (0.000313)[0m [0;1mSELECT * FROM blog_users WHERE (blog_users."id" = 1) [0m
|
40
|
+
[4;35;1mBlog::Models::Post Load (0.000266)[0m [0mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
41
|
+
[4;36;1mCamping::Models::Session Load (0.000486)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
42
|
+
[4;35;1mBlog::Models::Post Load (0.000366)[0m [0mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
43
|
+
[4;36;1mBlog::Models::Post Update (0.001053)[0m [0;1mUPDATE blog_posts SET "title" = '112', "body" = 'P112', "user_id" = 1 WHERE "id" = 1[0m
|
44
|
+
[4;35;1mCamping::Models::Session Load (0.000554)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
45
|
+
[4;36;1mBlog::Models::Post Load (0.000433)[0m [0;1mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
46
|
+
[4;35;1mBlog::Models::Comment Load (0.000356)[0m [0mSELECT * FROM blog_comments WHERE (post_id = '1') [0m
|
47
|
+
[4;36;1mCamping::Models::Session Load (0.000550)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
48
|
+
[4;35;1mBlog::Models::Post Load (0.000414)[0m [0mSELECT * FROM blog_posts [0m
|
49
|
+
[4;36;1mCamping::Models::Session Load (0.000543)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
50
|
+
[4;35;1mBlog::Models::User Load (0.000403)[0m [0mSELECT * FROM blog_users WHERE (blog_users."id" = 1) [0m
|
51
|
+
[4;36;1mCamping::Models::Session Load (0.000501)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
52
|
+
[4;35;1mSQL (0.000908)[0m [0mINSERT INTO blog_posts ("body", "title", "user_id") VALUES('33333333', '333', 1)[0m
|
53
|
+
[4;36;1mCamping::Models::Session Load (0.000511)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
54
|
+
[4;35;1mBlog::Models::Post Load (0.000356)[0m [0mSELECT * FROM blog_posts WHERE (blog_posts."id" = 2) [0m
|
55
|
+
[4;36;1mBlog::Models::Comment Load (0.000185)[0m [0;1mSELECT * FROM blog_comments WHERE (post_id = '2') [0m
|
56
|
+
[4;35;1mCamping::Models::Session Load (0.000488)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'TZLL5FG1tzSuDkuxtYL3L0x4kvUzcEIG') LIMIT 1[0m
|
57
|
+
[4;36;1mBlog::Models::Post Load (0.000427)[0m [0;1mSELECT * FROM blog_posts [0m
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# Project Blog
|
5
5
|
#
|
6
|
-
# Created using bivouac on
|
6
|
+
# Created using bivouac on Wed Aug 01 09:38:28 +0200 2007.
|
7
7
|
# Copyright (c) 2007 __My__. All rights reserved.
|
8
8
|
#
|
9
9
|
|
@@ -17,24 +17,20 @@ include Bivouac
|
|
17
17
|
|
18
18
|
Camping.goes :Blog
|
19
19
|
|
20
|
-
module Blog
|
21
|
-
include Camping::Session
|
22
|
-
end
|
23
|
-
|
24
20
|
# Load helpers from app/helpers
|
25
|
-
files( '
|
21
|
+
files( 'helpers' ) { |file| require( file ) }
|
26
22
|
|
27
23
|
# Load models from app/models
|
28
|
-
files( '
|
24
|
+
files( 'models' ) { |file| require( file ) }
|
29
25
|
|
30
26
|
# Load database schema from db/migrate
|
31
|
-
files( '
|
27
|
+
files( '../db/migrate' ) { |file| require( file ) }
|
32
28
|
|
33
29
|
# Load views from app/views
|
34
|
-
files( '
|
30
|
+
files( 'views' ) { |file| require( file ) }
|
35
31
|
|
36
32
|
# Load controllers from app/controllers
|
37
|
-
files( '
|
33
|
+
files( 'controllers', :except => [File.basename(__FILE__)] ) { |file| require( file ) }
|
38
34
|
|
39
35
|
module Blog::Controllers
|
40
36
|
class Public < R '/public/(.+)'
|
@@ -47,22 +43,22 @@ module Blog::Controllers
|
|
47
43
|
else
|
48
44
|
type = (MIME::Types.type_for(file)[0] || '/text/plain').to_s
|
49
45
|
@headers['Content-Type'] = type
|
50
|
-
@headers['X-Sendfile'] = File.join PATH, '..', '
|
46
|
+
@headers['X-Sendfile'] = File.join PATH, '..', 'public', file
|
51
47
|
end
|
52
48
|
end
|
53
49
|
end
|
54
50
|
end
|
55
51
|
|
56
52
|
# Load create
|
57
|
-
files( '
|
53
|
+
files( '../db' ) { |file| require( file ) }
|
58
54
|
|
59
55
|
# WEBrick postamble
|
60
56
|
if __FILE__ == $0
|
61
57
|
require 'webrick/httpserver'
|
62
58
|
require 'camping/webrick'
|
63
59
|
|
64
|
-
Blog::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.dirname(__FILE__) + "
|
65
|
-
Blog::Models::Base.logger = Logger.new(File.dirname(__FILE__) + "
|
60
|
+
Blog::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.dirname(__FILE__) + "/../db/Blog.db"
|
61
|
+
Blog::Models::Base.logger = Logger.new(File.dirname(__FILE__) + "/../log/Blog.log")
|
66
62
|
Blog.create if Blog.respond_to? :create
|
67
63
|
s = WEBrick::HTTPServer.new :BindAddress => "0.0.0.0", :Port => 3301
|
68
64
|
s.mount "/", WEBrick::CampingHandler, Blog
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Project Blog
|
3
3
|
#
|
4
|
-
# Created using bivouac on
|
4
|
+
# Created using bivouac on Wed Aug 01 09:38:28 +0200 2007.
|
5
5
|
# Copyright (c) 2007 __My__. All rights reserved.
|
6
6
|
#
|
7
7
|
# DO NOT EDIT THIS FILE, OR YOU REALLY KNOW WHAT YOU ARE DOING !
|
Binary file
|
@@ -1,4 +1,8 @@
|
|
1
|
+
module Blog
|
2
|
+
include Camping::Session
|
3
|
+
end
|
4
|
+
|
1
5
|
def Blog.create
|
2
6
|
Camping::Models::Session.create_schema
|
3
|
-
Blog::Models.create_schema :assume => (Blog::Models::
|
7
|
+
Blog::Models.create_schema :assume => (Blog::Models::Comment.table_exists? ? 1.0 : 0.0)
|
4
8
|
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# Logfile created on Wed Aug 01 09:39:05 +0200 2007 by /
|
2
|
+
[4;36;1mSQL (0.000268)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
3
|
+
[4;35;1mSQL (0.000000)[0m [0mSQLite3::SQLException: no such table: sessions: DROP TABLE sessions[0m
|
4
|
+
[4;36;1mSQL (0.277974)[0m [0;1mCREATE TABLE sessions ("id" INTEGER PRIMARY KEY NOT NULL, "hashid" varchar(32) DEFAULT NULL, "created_at" datetime DEFAULT NULL, "ivars" text DEFAULT NULL) [0m
|
5
|
+
[4;35;1mSQL (0.000459)[0m [0mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
6
|
+
[4;36;1mSQL (0.000348)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
7
|
+
[4;35;1mSQL (0.090689)[0m [0mCREATE TABLE blog_schema_infos ("id" INTEGER PRIMARY KEY NOT NULL, "version" float DEFAULT NULL) [0m
|
8
|
+
[4;36;1mBlog::Models::SchemaInfo Load (0.000262)[0m [0;1mSELECT * FROM blog_schema_infos LIMIT 1[0m
|
9
|
+
[4;35;1mSQL (0.088558)[0m [0mCREATE TABLE blog_comments ("id" INTEGER PRIMARY KEY NOT NULL, "post_id" integer NOT NULL, "username" varchar(255) DEFAULT NULL, "body" text DEFAULT NULL) [0m
|
10
|
+
[4;36;1mSQL (0.093018)[0m [0;1mCREATE TABLE blog_posts ("id" INTEGER PRIMARY KEY NOT NULL, "user_id" integer NOT NULL, "title" varchar(255) DEFAULT NULL, "body" text DEFAULT NULL) [0m
|
11
|
+
[4;35;1mSQL (0.068089)[0m [0mCREATE TABLE blog_users ("id" INTEGER PRIMARY KEY NOT NULL, "username" varchar(255) DEFAULT NULL, "password" varchar(255) DEFAULT NULL) [0m
|
12
|
+
[4;36;1mSQL (0.000583)[0m [0;1mINSERT INTO blog_users ("username", "password") VALUES('admin', 'bivouac')[0m
|
13
|
+
[4;35;1mSQL (0.000507)[0m [0mINSERT INTO blog_schema_infos ("version") VALUES(1.0)[0m
|
14
|
+
[4;36;1mCamping::Models::Session Load (0.000300)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = '2BZzk1mWnunHy4FqcP3qX2HR1IU3hFwK') LIMIT 1[0m
|
15
|
+
[4;35;1mSQL (0.005173)[0m [0mINSERT INTO sessions ("hashid", "created_at", "ivars") VALUES('EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv', '2007-08-01 09:44:15', '--- !map:HashWithIndifferentAccess {}
|
16
|
+
|
17
|
+
')[0m
|
18
|
+
[4;36;1mBlog::Models::Post Load (0.000335)[0m [0;1mSELECT * FROM blog_posts [0m
|
19
|
+
[4;35;1mCamping::Models::Session Load (0.000451)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
20
|
+
[4;36;1mCamping::Models::Session Load (0.000566)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
21
|
+
[4;35;1mCamping::Models::Session Load (0.000493)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
22
|
+
[4;36;1mCamping::Models::Session Load (0.000502)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
23
|
+
[4;35;1mBlog::Models::User Load (0.000374)[0m [0mSELECT * FROM blog_users WHERE (username = 'admin' AND password = 'bivouac') LIMIT 1[0m
|
24
|
+
[4;36;1mCamping::Models::Session Update (0.005425)[0m [0;1mUPDATE sessions SET "created_at" = '2007-08-01 09:44:15', "hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv', "ivars" = '--- !map:HashWithIndifferentAccess
|
25
|
+
Blog: !map:HashWithIndifferentAccess
|
26
|
+
user_id: 1
|
27
|
+
' WHERE "id" = 1[0m
|
28
|
+
[4;35;1mCamping::Models::Session Load (0.000453)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
29
|
+
[4;36;1mCamping::Models::Session Load (0.000492)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
30
|
+
[4;35;1mBlog::Models::User Load (0.000337)[0m [0mSELECT * FROM blog_users WHERE (blog_users."id" = 1) [0m
|
31
|
+
[4;36;1mCamping::Models::Session Load (0.000426)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
32
|
+
[4;35;1mCamping::Models::Session Load (0.000516)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
33
|
+
[4;36;1mSQL (0.004818)[0m [0;1mINSERT INTO blog_posts ("body", "title", "user_id") VALUES('P1
|
34
|
+
', '1', 1)[0m
|
35
|
+
[4;35;1mCamping::Models::Session Load (0.000516)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
36
|
+
[4;36;1mBlog::Models::Post Load (0.000385)[0m [0;1mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
37
|
+
[4;35;1mBlog::Models::Comment Load (0.000187)[0m [0mSELECT * FROM blog_comments WHERE (post_id = '1') [0m
|
38
|
+
[4;36;1mCamping::Models::Session Load (0.000415)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
39
|
+
[4;35;1mCamping::Models::Session Load (0.000505)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
40
|
+
[4;36;1mSQL (0.004120)[0m [0;1mINSERT INTO blog_comments ("body", "post_id", "username") VALUES('cg1', 1, 'g')[0m
|
41
|
+
[4;35;1mCamping::Models::Session Load (0.000514)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
42
|
+
[4;36;1mBlog::Models::Post Load (0.000348)[0m [0;1mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
43
|
+
[4;35;1mBlog::Models::Comment Load (0.000343)[0m [0mSELECT * FROM blog_comments WHERE (post_id = '1') [0m
|
44
|
+
[4;36;1mCamping::Models::Session Load (0.000749)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
45
|
+
[4;35;1mCamping::Models::Session Load (0.000512)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
46
|
+
[4;36;1mBlog::Models::User Load (0.000383)[0m [0;1mSELECT * FROM blog_users WHERE (blog_users."id" = 1) [0m
|
47
|
+
[4;35;1mBlog::Models::Post Load (0.000335)[0m [0mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
48
|
+
[4;36;1mCamping::Models::Session Load (0.000482)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
49
|
+
[4;35;1mCamping::Models::Session Load (0.000465)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
50
|
+
[4;36;1mBlog::Models::Post Load (0.000330)[0m [0;1mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
51
|
+
[4;35;1mBlog::Models::Post Update (0.004381)[0m [0mUPDATE blog_posts SET "title" = '1', "body" = 'P1.01
|
52
|
+
', "user_id" = 1 WHERE "id" = 1[0m
|
53
|
+
[4;36;1mCamping::Models::Session Load (0.000506)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
54
|
+
[4;35;1mBlog::Models::Post Load (0.000345)[0m [0mSELECT * FROM blog_posts WHERE (blog_posts."id" = 1) [0m
|
55
|
+
[4;36;1mBlog::Models::Comment Load (0.000326)[0m [0;1mSELECT * FROM blog_comments WHERE (post_id = '1') [0m
|
56
|
+
[4;35;1mCamping::Models::Session Load (0.000477)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
57
|
+
[4;36;1mCamping::Models::Session Load (0.000517)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
58
|
+
[4;35;1mBlog::Models::User Load (0.000333)[0m [0mSELECT * FROM blog_users WHERE (blog_users."id" = 1) [0m
|
59
|
+
[4;36;1mCamping::Models::Session Load (0.000486)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
60
|
+
[4;35;1mCamping::Models::Session Load (0.000488)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
61
|
+
[4;36;1mSQL (0.004740)[0m [0;1mINSERT INTO blog_posts ("body", "title", "user_id") VALUES('P2', '2', 1)[0m
|
62
|
+
[4;35;1mCamping::Models::Session Load (0.000523)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
63
|
+
[4;36;1mBlog::Models::Post Load (0.000455)[0m [0;1mSELECT * FROM blog_posts WHERE (blog_posts."id" = 2) [0m
|
64
|
+
[4;35;1mBlog::Models::Comment Load (0.000197)[0m [0mSELECT * FROM blog_comments WHERE (post_id = '2') [0m
|
65
|
+
[4;36;1mCamping::Models::Session Load (0.000901)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
66
|
+
[4;35;1mCamping::Models::Session Load (0.000483)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
67
|
+
[4;36;1mBlog::Models::Post Load (0.000415)[0m [0;1mSELECT * FROM blog_posts [0m
|
68
|
+
[4;35;1mCamping::Models::Session Load (0.000438)[0m [0mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
69
|
+
[4;36;1mSQL (0.000724)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
70
|
+
[4;35;1mSQL (0.000444)[0m [0mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
71
|
+
[4;36;1mSQL (0.000400)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
72
|
+
[4;35;1mBlog::Models::SchemaInfo Load (0.000234)[0m [0mSELECT * FROM blog_schema_infos LIMIT 1[0m
|
73
|
+
[4;36;1mCamping::Models::Session Load (0.000482)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
74
|
+
[4;35;1mBlog::Models::Post Load (0.000481)[0m [0mSELECT * FROM blog_posts [0m
|
75
|
+
[4;36;1mCamping::Models::Session Load (0.000456)[0m [0;1mSELECT * FROM sessions WHERE (sessions."hashid" = 'EhhszLKn3LN0HDKOVcnRlmgF8LDAuHPv') LIMIT 1[0m
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# CGI postamble
|
2
2
|
|
3
3
|
if __FILE__ == $0
|
4
|
-
<%= @appname %>::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.dirname(__FILE__) + "
|
5
|
-
<%= @appname %>::Models::Base.logger = Logger.new(File.dirname(__FILE__) + "
|
4
|
+
<%= @appname %>::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.dirname(__FILE__) + "/../db/<%= @appname %>.db"
|
5
|
+
<%= @appname %>::Models::Base.logger = Logger.new(File.dirname(__FILE__) + "/../log/<%= @appname %>.log")
|
6
6
|
<%= @appname %>.create if <%= @appname %>.respond_to? :create
|
7
7
|
puts <%= @appname %>.run
|
8
8
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# FastCGI postamble
|
2
2
|
if __FILE__ == $0
|
3
3
|
require 'camping/fastcgi'
|
4
|
-
<%= @appname %>::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.dirname(__FILE__) + "
|
5
|
-
<%= @appname %>::Models::Base.logger = Logger.new(File.dirname(__FILE__) + "
|
4
|
+
<%= @appname %>::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.dirname(__FILE__) + "/../db/<%= @appname %>.db"
|
5
|
+
<%= @appname %>::Models::Base.logger = Logger.new(File.dirname(__FILE__) + "/../log/<%= @appname %>.log")
|
6
6
|
<%= @appname %>.create if <%= @appname %>.respond_to? :create
|
7
7
|
Camping::FastCGI.start(<%= @appname %>)
|
8
8
|
end
|
@@ -1,4 +1,19 @@
|
|
1
1
|
# Mongrel postamble
|
2
2
|
if __FILE__ == $0
|
3
|
-
|
3
|
+
require 'mongrel/camping'
|
4
|
+
|
5
|
+
<%= @appname %>::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.dirname(__FILE__) + "/../db/<%= @appname %>.db"
|
6
|
+
<%= @appname %>::Models::Base.logger = Logger.new(File.dirname(__FILE__) + "/../log/<%= @appname %>.log")
|
7
|
+
<%= @appname %>.create if <%= @appname %>.respond_to? :create
|
8
|
+
<%= @appname %>::Models::Base.threaded_connections = false
|
9
|
+
|
10
|
+
s = Mongrel::Camping.start("<%= @server_address %>", <%= @server_port %>, "/", <%= @appname %>)
|
11
|
+
|
12
|
+
# This lets Ctrl+C shut down your server
|
13
|
+
trap(:INT) do
|
14
|
+
s.stop
|
15
|
+
end
|
16
|
+
|
17
|
+
puts "** <%= @appname %> is running at http://<%= @server_address %>:<%= @server_port %>/"
|
18
|
+
s.run.join
|
4
19
|
end
|
@@ -3,10 +3,10 @@ if __FILE__ == $0
|
|
3
3
|
require 'webrick/httpserver'
|
4
4
|
require 'camping/webrick'
|
5
5
|
|
6
|
-
<%= @appname %>::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.dirname(__FILE__) + "
|
7
|
-
<%= @appname %>::Models::Base.logger = Logger.new(File.dirname(__FILE__) + "
|
6
|
+
<%= @appname %>::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.dirname(__FILE__) + "/../db/<%= @appname %>.db"
|
7
|
+
<%= @appname %>::Models::Base.logger = Logger.new(File.dirname(__FILE__) + "/../log/<%= @appname %>.log")
|
8
8
|
<%= @appname %>.create if <%= @appname %>.respond_to? :create
|
9
|
-
s = WEBrick::HTTPServer.new :BindAddress => "
|
9
|
+
s = WEBrick::HTTPServer.new :BindAddress => "<%= @server_address %>", :Port => <%= @server_port %>
|
10
10
|
s.mount "/", WEBrick::CampingHandler, <%= @appname %>
|
11
11
|
|
12
12
|
# This lets Ctrl+C shut down your server
|
@@ -14,5 +14,6 @@ if __FILE__ == $0
|
|
14
14
|
s.shutdown
|
15
15
|
end
|
16
16
|
|
17
|
+
puts "** <%= @appname %> is running at http://<%= @server_address %>:<%= @server_port %>/"
|
17
18
|
s.start
|
18
19
|
end
|
@@ -7,6 +7,9 @@
|
|
7
7
|
# Copyright (c) <%= Time.now.year %> __My__. All rights reserved.
|
8
8
|
#
|
9
9
|
|
10
|
+
LIB = File.join File.expand_path(File.dirname(__FILE__)), '..', 'lib'
|
11
|
+
$:.unshift( LIB )
|
12
|
+
|
10
13
|
require 'rubygems'
|
11
14
|
require 'camping'
|
12
15
|
require 'camping/session'
|
@@ -26,23 +29,23 @@ Camping.goes :<%= @appname %>
|
|
26
29
|
|
27
30
|
module <%= @appname %>
|
28
31
|
def render(m, layout=false)
|
29
|
-
content = ERB.new(IO.read("#{File.dirname(__FILE__)}
|
30
|
-
content = ERB.new(IO.read("#{File.dirname(__FILE__)}
|
32
|
+
content = ERB.new(IO.read("#{File.dirname(__FILE__)}/views/#{m}.html")).result(binding)
|
33
|
+
content = ERB.new(IO.read("#{File.dirname(__FILE__)}/views/layout.html")).result(binding) if layout
|
31
34
|
return content
|
32
35
|
end
|
33
36
|
end
|
34
37
|
|
35
38
|
# Load helpers from app/helpers
|
36
|
-
files( '
|
39
|
+
files( 'helpers' ) { |file| require( file ) }
|
37
40
|
|
38
41
|
# Load models from app/models
|
39
|
-
files( '
|
42
|
+
files( 'models' ) { |file| require( file ) }
|
40
43
|
|
41
44
|
# Load database schema from db/migrate
|
42
|
-
files( '
|
45
|
+
files( '../db/migrate' ) { |file| require( file ) }
|
43
46
|
|
44
47
|
# Load controllers from app/controllers
|
45
|
-
files( '
|
48
|
+
files( 'controllers', :except => [File.basename(__FILE__)] ) { |file| require( file ) }
|
46
49
|
|
47
50
|
module <%= @appname %>::Controllers
|
48
51
|
class Public < R '/public/(.+)'
|
@@ -55,12 +58,12 @@ module <%= @appname %>::Controllers
|
|
55
58
|
else
|
56
59
|
type = (MIME::Types.type_for(file)[0] || '/text/plain').to_s
|
57
60
|
@headers['Content-Type'] = type
|
58
|
-
@headers['X-Sendfile'] = File.join PATH, '..', '
|
61
|
+
@headers['X-Sendfile'] = File.join PATH, '..', 'public', file
|
59
62
|
end
|
60
63
|
end
|
61
64
|
end
|
62
65
|
end
|
63
66
|
|
64
67
|
# Load create
|
65
|
-
files( '
|
68
|
+
files( '../db' ) { |file| require( file ) }
|
66
69
|
|
@@ -7,6 +7,9 @@
|
|
7
7
|
# Copyright (c) <%= Time.now.year %> __My__. All rights reserved.
|
8
8
|
#
|
9
9
|
|
10
|
+
LIB = File.join File.expand_path(File.dirname(__FILE__)), '..', 'lib'
|
11
|
+
$:.unshift( LIB )
|
12
|
+
|
10
13
|
require 'rubygems'
|
11
14
|
require 'camping'
|
12
15
|
require 'camping/session'
|
@@ -18,19 +21,19 @@ include Bivouac
|
|
18
21
|
Camping.goes :<%= @appname %>
|
19
22
|
|
20
23
|
# Load helpers from app/helpers
|
21
|
-
files( '
|
24
|
+
files( 'helpers' ) { |file| require( file ) }
|
22
25
|
|
23
26
|
# Load models from app/models
|
24
|
-
files( '
|
27
|
+
files( 'models' ) { |file| require( file ) }
|
25
28
|
|
26
29
|
# Load database schema from db/migrate
|
27
|
-
files( '
|
30
|
+
files( '../db/migrate' ) { |file| require( file ) }
|
28
31
|
|
29
32
|
# Load views from app/views
|
30
|
-
files( '
|
33
|
+
files( 'views' ) { |file| require( file ) }
|
31
34
|
|
32
35
|
# Load controllers from app/controllers
|
33
|
-
files( '
|
36
|
+
files( 'controllers', :except => [File.basename(__FILE__)] ) { |file| require( file ) }
|
34
37
|
|
35
38
|
module <%= @appname %>::Controllers
|
36
39
|
class Public < R '/public/(.+)'
|
@@ -43,12 +46,12 @@ module <%= @appname %>::Controllers
|
|
43
46
|
else
|
44
47
|
type = (MIME::Types.type_for(file)[0] || '/text/plain').to_s
|
45
48
|
@headers['Content-Type'] = type
|
46
|
-
@headers['X-Sendfile'] = File.join PATH, '..', '
|
49
|
+
@headers['X-Sendfile'] = File.join PATH, '..', 'public', file
|
47
50
|
end
|
48
51
|
end
|
49
52
|
end
|
50
53
|
end
|
51
54
|
|
52
55
|
# Load create
|
53
|
-
files( '
|
56
|
+
files( '../db' ) { |file| require( file ) }
|
54
57
|
|