bivouac 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,262 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ Bivouac, the Documentation &raquo; File: README
7
+ </title>
8
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
10
+ <script language="JavaScript" type="text/javascript">
11
+ // <![CDATA[
12
+
13
+ function toggleSource( id )
14
+ {
15
+ var elem
16
+ var link
17
+
18
+ if( document.getElementById )
19
+ {
20
+ elem = document.getElementById( id )
21
+ link = document.getElementById( "l_" + id )
22
+ }
23
+ else if ( document.all )
24
+ {
25
+ elem = eval( "document.all." + id )
26
+ link = eval( "document.all.l_" + id )
27
+ }
28
+ else
29
+ return false;
30
+
31
+ if( elem.style.display == "block" )
32
+ {
33
+ elem.style.display = "none"
34
+ link.innerHTML = "show source"
35
+ }
36
+ else
37
+ {
38
+ elem.style.display = "block"
39
+ link.innerHTML = "hide source"
40
+ }
41
+ }
42
+
43
+ function openCode( url )
44
+ {
45
+ window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
46
+ }
47
+ // ]]>
48
+ </script>
49
+ </head>
50
+ <body>
51
+ <!--
52
+ <div id="menu">
53
+ <h3 class="title">File: README</h3>
54
+ </div>
55
+ -->
56
+ <div id="fullpage">
57
+ <div id="pager">
58
+ <table>
59
+ <tr><td><img src="../rubyfr.png" /></td>
60
+ <td id="pagertd">
61
+ <strong># File: README<br />
62
+ [
63
+ "<a href="../files/README.html" value="File: README">README</a>",
64
+ "<a href="../files/AUTHORS.html" value="File: AUTHORS">AUTHORS</a>",
65
+ "<a href="../files/COPYING.html" value="File: COPYING">COPYING</a>",
66
+ <a href="http://greg.rubyfr.net">nil</a>].each do<br />
67
+ end</strong>
68
+ </td></tr>
69
+ </table>
70
+ </ul>
71
+ </div>
72
+
73
+ <div id="README" class="page_shade">
74
+ <div class="page">
75
+ <div class="header">
76
+ <div class="path">README / Sat Aug 04 02:26:17 +0200 2007</div>
77
+ </div>
78
+
79
+ <h1>Bivouac</h1>
80
+ <p>
81
+ Copyright (C) 2007 Gregoire Lejeune
82
+ </p>
83
+ <ul>
84
+ <li><a href="http://bivouac.rubyforge.org">bivouac.rubyforge.org</a>/
85
+
86
+ </li>
87
+ <li><a
88
+ href="http://rubyforge.org/projects/bivouac">rubyforge.org/projects/bivouac</a>/
89
+
90
+ </li>
91
+ <li><a href="http://greg.rubyfr.net">greg.rubyfr.net</a>
92
+
93
+ </li>
94
+ </ul>
95
+ <h2>DESCRIPTION:</h2>
96
+ <p>
97
+ Bivouac is a simple generator for <a
98
+ href="http://code.whytheluckystiff.net/camping">camping</a>.
99
+ </p>
100
+ <h2>FEATURES/PROBLEMS:</h2>
101
+ <h3>0.0.4:</h3>
102
+ <ul>
103
+ <li>the application file is now in app and not in app/controller
104
+
105
+ </li>
106
+ <li>Mongrel postamble is no more in the TODO list
107
+
108
+ </li>
109
+ <li>You can specify which address (<tt>-a</tt>) and port (<tt>-P</tt>) to bind
110
+ to.
111
+
112
+ </li>
113
+ </ul>
114
+ <h3>0.0.3:</h3>
115
+ <ul>
116
+ <li>Model generation is now ok (i hope)
117
+
118
+ </li>
119
+ <li>It&#8216;s now possible to create &quot;Get Out of Hand&quot; and
120
+ &quot;Eruby/Erb&quot; projects
121
+
122
+ </li>
123
+ <li>script/generate have 3 new options :
124
+
125
+ <ul>
126
+ <li><tt>-v</tt> if you don&#8216;t want to create the view
127
+
128
+ </li>
129
+ <li><tt>-d</tt> if you don&#8216;t want the default route
130
+
131
+ </li>
132
+ <li><tt>-r</tt> if you want to add more routes
133
+
134
+ </li>
135
+ </ul>
136
+ </li>
137
+ <li>Only sqlite3 is supported
138
+
139
+ </li>
140
+ </ul>
141
+ <h3>0.0.2:</h3>
142
+ <ul>
143
+ <li>So many problems!
144
+
145
+ </li>
146
+ </ul>
147
+ <h3>0.0.1:</h3>
148
+ <ul>
149
+ <li>Can&#8216;t generate models and migrates
150
+
151
+ </li>
152
+ </ul>
153
+ <h3>Extra:</h3>
154
+ <ul>
155
+ <li>With camping 1.5 there is a bug in
156
+ /usr/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/webrick.rb line 59,
157
+ change <tt>do_GET(req, res)</tt> to <tt>do_GET(req, resp)</tt>
158
+
159
+ </li>
160
+ </ul>
161
+ <h2>TODO:</h2>
162
+ <ul>
163
+ <li>add test with <a
164
+ href="http://code.whytheluckystiff.net/camping/wiki/MosquitoForBugFreeCamping">mosquito</a>
165
+
166
+ </li>
167
+ <li>test with Apache and Lighttpd
168
+
169
+ </li>
170
+ <li>add scaffold generator &#8212; who want it ?
171
+
172
+ </li>
173
+ <li>rewrite script/server and remove postamble
174
+
175
+ </li>
176
+ <li>add mysql, postgresql, oracle, &#8230; support
177
+
178
+ </li>
179
+ </ul>
180
+ <h2>SYNOPSIS:</h2>
181
+ <pre>
182
+ % bivouac -h
183
+ Usage: bivouac [options] app
184
+ bivouac, the generator for the microframework ON-button
185
+ for ruby 1.8.6 (2007-06-07) [universal-darwin9.0]
186
+
187
+ Specific options:
188
+ -P, --port PORT Which port to bind to (3301)
189
+ -a, --address ADDR Address to bind to (0.0.0.0)
190
+ -o, --organize TYPE Type or organisation
191
+ (options: JOF:Just On File
192
+ GOH:Get Out of Hand
193
+ ERB:use Eruby or Erb)
194
+ -p, --postamble TYPE Add a postamble
195
+ (options: CGI/FastCGI/Mongrel/WEBrick/none)
196
+
197
+ Common options:
198
+ -?, --help Show this message
199
+ -v, --version Show version
200
+
201
+ % bivouac your_app_name
202
+ ...
203
+ % cd your_app_name
204
+ % ruby script/generate -h
205
+ Usage: script/generate generator [options] [args]
206
+
207
+ Generators
208
+ Builtin: controller, model, migrate, view
209
+
210
+ controller generator options:
211
+ -v, --no-view Do not generate any view for the controller
212
+ -d, --no-route Do not add the default route to the controller
213
+ (/controller_name)
214
+ -r, --route ROUTE,ROUTE,... Add ROUTES to the controller
215
+
216
+ Common options:
217
+ -h, --help Show this message
218
+
219
+ % ruby script/generate controller your_controller
220
+ ...
221
+ % ruby script/server
222
+ ...
223
+ </pre>
224
+ <h2>REQUIREMENTS:</h2>
225
+ <ul>
226
+ <li>camping
227
+
228
+ </li>
229
+ <li>mime-types
230
+
231
+ </li>
232
+ <li>extra
233
+
234
+ </li>
235
+ </ul>
236
+ <h2>INSTALL:</h2>
237
+ <pre>
238
+ sudo gem install bivouac
239
+ </pre>
240
+ <h2>LICENSE:</h2>
241
+ <p>
242
+ Bivouac is freely distributable according to the terms of the GNU General
243
+ Public License.
244
+ </p>
245
+ <p>
246
+ This program is distributed without any warranty. See the file
247
+ &#8216;COPYING&#8217; for details.
248
+ </p>
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+ </div>
257
+ </div>
258
+
259
+
260
+ </div>
261
+ </body>
262
+ </html>
@@ -0,0 +1,10 @@
1
+
2
+ <HTML>
3
+ <HEAD>
4
+ <META HTTP-EQUIV="refresh" content="0;URL=files/README.html">
5
+ <TITLE>Bivouac, the Documentation</TITLE>
6
+ </HEAD>
7
+ <BODY>
8
+ Click <a href="files/README.html">here</a> to open the docs.
9
+ </BODY>
10
+ </HTML>
Binary file
@@ -0,0 +1,106 @@
1
+
2
+ body {
3
+ font: normal 14px verdana,arial,'Bitstream Vera Sans',helvetica,sans-serif;
4
+ line-height: 160%;
5
+ padding: 0; margin: 0;
6
+ margin-bottom: 30px;
7
+ /* background-color: #402; */
8
+ background-color: #CCCC99;
9
+ }
10
+ h1, h2, h3, h4 {
11
+ font-family: Utopia, Georgia, serif;
12
+ font-weight: bold;
13
+ letter-spacing: -0.018em;
14
+ }
15
+ h1 { font-size: 24px; margin: .15em 1em 0 0 }
16
+ h2 { font-size: 24px }
17
+ h3 { font-size: 19px }
18
+ h4 { font-size: 17px; font-weight: normal; }
19
+ h4.ruled { border-bottom: solid 1px #CC9; }
20
+ h2.ruled { padding-top: 35px; border-top: solid 1px #AA5; }
21
+
22
+ /* Link styles */
23
+ :link, :visited {
24
+
25
+ }
26
+ :link:hover, :visited:hover {
27
+
28
+ }
29
+ #fullpage {
30
+ width: 720px;
31
+ padding-top: 20px;
32
+ margin: 0 auto;
33
+ }
34
+ .page_shade, .page {
35
+ border-left: 1px solid black;
36
+ border-right: 1px solid black;
37
+ border-bottom: 1px solid black;
38
+ background-color: #FFFFFF;
39
+ }
40
+ .page {
41
+ padding: 20px 35px;
42
+ }
43
+ .page .header {
44
+ float: right;
45
+ color: #777;
46
+ font-size: 10px;
47
+ }
48
+ .page h1, .page h2, .page h3 {
49
+ clear: both;
50
+ text-align: center;
51
+ }
52
+ #pager {
53
+ background-color: #EEEEAE;
54
+ border-top: 2px solid black;
55
+ border-left: 2px solid black;
56
+ border-right: 2px solid black;
57
+ border-bottom: 1px dashed #999966;
58
+ padding: 20px 0 20px 20px;
59
+ color: #666633;
60
+ font-size: 11px;
61
+ }
62
+ #pager :link, #pager :visited {
63
+ color: #8E2400;
64
+ padding: 0px 5px;
65
+ }
66
+ #pager :link:hover, #pager :visited:hover {
67
+ color: #8E2400;
68
+ }
69
+ #pagertd {
70
+ font-size: 11px;
71
+ }
72
+ #logo { float: left; }
73
+ #menu {
74
+ padding: 4px 12px;
75
+ margin: 0;
76
+ }
77
+ #menu h3 { padding: 0; margin: 0; }
78
+ #menu #links { float: right; }
79
+ pre { font-weight: bold; color: black; }
80
+ tt { color: #703; font-size: 12pt; }
81
+ .dyn-source {
82
+ background-color: #EEEEEE;
83
+ border: 1px solid #CCCCCC;
84
+ padding: 4px 8px;
85
+ margin: 0;
86
+ display: none; }
87
+ .dyn-source pre {
88
+ color: #000000;
89
+ font-size: 8pt;
90
+ font-familly: monospace;
91
+
92
+ }
93
+ .source-link { text-align: right; font-size: 8pt; }
94
+ .ruby-comment { color: green; font-style: italic }
95
+ .ruby-constant { color: #CCDDFF; font-weight: bold; }
96
+ .ruby-identifier { color: #CCCCCC; }
97
+ .ruby-ivar { color: #BBCCFF; }
98
+ .ruby-keyword { color: #EEEEFF; font-weight: bold }
99
+ .ruby-node { color: #FFFFFF; }
100
+ .ruby-operator { color: #CCCCCC; }
101
+ .ruby-regexp { color: #DDFFDD; }
102
+ .ruby-value { color: #FFAAAA; font-style: italic }
103
+ .kw { color: #DDDDFF; font-weight: bold }
104
+ .cmt { color: #CCFFCC; font-style: italic }
105
+ .str { color: #EECCCC; font-style: italic }
106
+ .re { color: #EECCCC; }
Binary file
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # Project Blog
5
5
  #
6
- # Created using bivouac on Tue Jul 31 18:19:12 +0200 2007.
6
+ # Created using bivouac on Wed Aug 01 09:49:08 +0200 2007.
7
7
  # Copyright (c) 2007 __My__. All rights reserved.
8
8
  #
9
9
 
@@ -26,23 +26,23 @@ Camping.goes :Blog
26
26
 
27
27
  module Blog
28
28
  def render(m, layout=false)
29
- content = ERB.new(IO.read("#{File.dirname(__FILE__)}/../views/#{m}.html")).result(binding)
30
- content = ERB.new(IO.read("#{File.dirname(__FILE__)}/../views/layout.html")).result(binding) if layout
29
+ content = ERB.new(IO.read("#{File.dirname(__FILE__)}/views/#{m}.html")).result(binding)
30
+ content = ERB.new(IO.read("#{File.dirname(__FILE__)}/views/layout.html")).result(binding) if layout
31
31
  return content
32
32
  end
33
33
  end
34
34
 
35
35
  # Load helpers from app/helpers
36
- files( '../helpers' ) { |file| require( file ) }
36
+ files( 'helpers' ) { |file| require( file ) }
37
37
 
38
38
  # Load models from app/models
39
- files( '../models' ) { |file| require( file ) }
39
+ files( 'models' ) { |file| require( file ) }
40
40
 
41
41
  # Load database schema from db/migrate
42
- files( '../../db/migrate' ) { |file| require( file ) }
42
+ files( '../db/migrate' ) { |file| require( file ) }
43
43
 
44
44
  # Load controllers from app/controllers
45
- files( '../controllers', :except => [File.basename(__FILE__)] ) { |file| require( file ) }
45
+ files( 'controllers', :except => [File.basename(__FILE__)] ) { |file| require( file ) }
46
46
 
47
47
  module Blog::Controllers
48
48
  class Public < R '/public/(.+)'
@@ -55,22 +55,22 @@ module Blog::Controllers
55
55
  else
56
56
  type = (MIME::Types.type_for(file)[0] || '/text/plain').to_s
57
57
  @headers['Content-Type'] = type
58
- @headers['X-Sendfile'] = File.join PATH, '..', '..', 'public', file
58
+ @headers['X-Sendfile'] = File.join PATH, '..', 'public', file
59
59
  end
60
60
  end
61
61
  end
62
62
  end
63
63
 
64
64
  # Load create
65
- files( '../../db' ) { |file| require( file ) }
65
+ files( '../db' ) { |file| require( file ) }
66
66
 
67
67
  # WEBrick postamble
68
68
  if __FILE__ == $0
69
69
  require 'webrick/httpserver'
70
70
  require 'camping/webrick'
71
71
 
72
- Blog::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.dirname(__FILE__) + "/../../db/Blog.db"
73
- Blog::Models::Base.logger = Logger.new(File.dirname(__FILE__) + "/../../log/Blog.log")
72
+ Blog::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.dirname(__FILE__) + "/../db/Blog.db"
73
+ Blog::Models::Base.logger = Logger.new(File.dirname(__FILE__) + "/../log/Blog.log")
74
74
  Blog.create if Blog.respond_to? :create
75
75
  s = WEBrick::HTTPServer.new :BindAddress => "0.0.0.0", :Port => 3301
76
76
  s.mount "/", WEBrick::CampingHandler, Blog
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Project Blog
3
3
  #
4
- # Created using bivouac on Tue Jul 31 18:01:08 +0200 2007.
4
+ # Created using bivouac on Wed Aug 01 09:49:08 +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 !
@@ -20,7 +20,7 @@ module Bivouac
20
20
  @environment.appname = "Blog"
21
21
  @environment.db = "sqlite3"
22
22
  @environment.appdir = "blog"
23
- @environment.orgtype = "ERB"
23
+ @environment.orgtype = "erb"
24
24
  @environment.postamble = "webrick"
25
25
  end
26
26
  end
Binary file
@@ -4,5 +4,5 @@ end
4
4
 
5
5
  def Blog.create
6
6
  Camping::Models::Session.create_schema
7
- Blog::Models.create_schema :assume => (Blog::Models::Post.table_exists? ? 1.0 : 0.0)
7
+ Blog::Models.create_schema :assume => (Blog::Models::Comment.table_exists? ? 1.0 : 0.0)
8
8
  end