bivouac 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. data/AUTHORS +0 -0
  2. data/COPYING +0 -0
  3. data/README +38 -8
  4. data/bin/bivouac +4 -2
  5. data/doc/created.rid +1 -0
  6. data/doc/files/AUTHORS.html +95 -0
  7. data/doc/files/COPYING.html +519 -0
  8. data/doc/files/README.html +160 -0
  9. data/doc/index.html +10 -0
  10. data/doc/permalink.gif +0 -0
  11. data/doc/rdoc-style.css +106 -0
  12. data/doc/rubyfr.png +0 -0
  13. data/lib/bivouac.rb +0 -0
  14. data/lib/bivouac/commands/generate.rb +14 -10
  15. data/lib/bivouac/commands/server.rb +0 -0
  16. data/lib/bivouac/template.rb +54 -11
  17. data/lib/bivouac/template/application/postamble_cgi.rb +0 -0
  18. data/lib/bivouac/template/application/postamble_fastcgi.rb +0 -0
  19. data/lib/bivouac/template/application/postamble_mongrel.rb +0 -0
  20. data/lib/bivouac/template/application/postamble_none.rb +0 -0
  21. data/lib/bivouac/template/application/postamble_webrick.rb +0 -0
  22. data/lib/bivouac/template/application_erb.rb +0 -0
  23. data/lib/bivouac/template/application_goh.rb +0 -0
  24. data/lib/bivouac/template/application_jof.rb +0 -0
  25. data/lib/bivouac/template/environment.rb +0 -0
  26. data/lib/bivouac/template/generate.rb +0 -0
  27. data/lib/bivouac/template/generate/controller.rb +0 -0
  28. data/lib/bivouac/template/generate/create.rb +4 -0
  29. data/lib/bivouac/template/generate/migrate.rb +12 -0
  30. data/lib/bivouac/template/generate/model.rb +5 -0
  31. data/lib/bivouac/template/generate/view.rb +0 -0
  32. data/lib/bivouac/template/server.rb +0 -0
  33. data/lib/bivouac/template/static/camping.png +0 -0
  34. data/lib/bivouac/template/static/index.html +0 -0
  35. data/lib/bivouac/template/static/index.rb +0 -0
  36. data/test/{bivouac_test.rb → test_bivouac.rb} +0 -0
  37. data/test/{template_test.rb → test_template.rb} +0 -0
  38. metadata +17 -6
data/AUTHORS CHANGED
File without changes
data/COPYING CHANGED
File without changes
data/README CHANGED
@@ -1,16 +1,46 @@
1
- Bivouac - 0.0.1
1
+ = Bivouac - 0.0.1
2
2
 
3
3
  Copyright (C) 2007 Gregoire Lejeune
4
4
 
5
+ * http://bivouac.rubyforge.org/
6
+ * http://rubyforge.org/projects/bivouac/
7
+ * http://greg.rubyfr.net
8
+
9
+ == DESCRIPTION:
10
+
11
+ Bivouac is a simple generator for camping.
12
+
13
+ == FEATURES/PROBLEMS:
14
+
15
+ === 0.0.1:
16
+ * Can't generate models and migrates
17
+
18
+ === Extra:
19
+ * With camping 1.5 there is a bug in /usr/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/webrick.rb line 59, change <tt>do_GET(req, res)</tt> to <tt>do_GET(req, resp)</tt>
20
+
21
+ == SYNOPSIS:
22
+
23
+ % bivouac your_app_name
24
+ ...
25
+ % cd your_app_name
26
+ % ruby script/generate controller your_controller
27
+ ...
28
+
29
+ == REQUIREMENTS:
30
+
31
+ * camping
32
+ * mime-types
33
+ * extra
34
+
35
+ == INSTALL:
36
+
37
+ sudo gem install bivouac
38
+
39
+ == LICENSE:
40
+
5
41
  Bivouac is freely distributable according to the terms of the
6
- GNU General Public License (see the file 'COPYING').
42
+ GNU General Public License.
7
43
 
8
44
  This program is distributed without any warranty. See the file
9
45
  'COPYING' for details.
10
46
 
11
- !!! With camping 1.5 there is a bug in
12
- /usr/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/webrick.rb line 59,
13
- change
14
- do_GET(req, res)
15
- to
16
- do_GET(req, resp)
data/bin/bivouac CHANGED
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
- # bivouac - 0.0.1
3
- # (c)2007 Grégoire Lejeune
2
+ =begin
3
+ bivouac - 0.0.1
4
+ (c)2007 Grégoire Lejeune
5
+ =end
4
6
 
5
7
  require 'rubygems'
6
8
  require 'optparse'
data/doc/created.rid ADDED
@@ -0,0 +1 @@
1
+ Mon, 30 Jul 2007 17:36:15 +0200
@@ -0,0 +1,95 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ Bivouac Documentation &raquo; File: AUTHORS
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: AUTHORS</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: AUTHORS<br />
62
+ [
63
+ "<a href="../files/README.html" value="File: README">README</a>",
64
+ "<a href="../files/COPYING.html" value="File: COPYING">COPYING</a>",
65
+ "<a href="../files/AUTHORS.html" value="File: AUTHORS">AUTHORS</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="AUTHORS" class="page_shade">
74
+ <div class="page">
75
+ <div class="header">
76
+ <div class="path">AUTHORS / Fri May 11 09:13:59 +0200 2007</div>
77
+ </div>
78
+
79
+ <p>
80
+ Gregoire Lejeune &lt;glejeune.lejeune@free.fr&gt;
81
+ </p>
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ </div>
90
+ </div>
91
+
92
+
93
+ </div>
94
+ </body>
95
+ </html>
@@ -0,0 +1,519 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ Bivouac Documentation &raquo; File: COPYING
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: COPYING</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: COPYING<br />
62
+ [
63
+ "<a href="../files/README.html" value="File: README">README</a>",
64
+ "<a href="../files/COPYING.html" value="File: COPYING">COPYING</a>",
65
+ "<a href="../files/AUTHORS.html" value="File: AUTHORS">AUTHORS</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="COPYING" class="page_shade">
74
+ <div class="page">
75
+ <div class="header">
76
+ <div class="path">COPYING / Fri May 11 09:13:59 +0200 2007</div>
77
+ </div>
78
+
79
+ <pre>
80
+ GNU GENERAL PUBLIC LICENSE
81
+ Version 2, June 1991
82
+
83
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
84
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
85
+ Everyone is permitted to copy and distribute verbatim copies
86
+ of this license document, but changing it is not allowed.
87
+
88
+ Preamble
89
+
90
+ The licenses for most software are designed to take away your
91
+ </pre>
92
+ <p>
93
+ freedom to share and change it. By contrast, the GNU General Public License
94
+ is intended to guarantee your freedom to share and change free
95
+ software&#8212;to make sure the software is free for all its users. This
96
+ General Public License applies to most of the Free Software
97
+ Foundation&#8216;s software and to any other program whose authors commit
98
+ to using it. (Some other Free Software Foundation software is covered by
99
+ the GNU Library General Public License instead.) You can apply it to your
100
+ programs, too.
101
+ </p>
102
+ <pre>
103
+ When we speak of free software, we are referring to freedom, not
104
+ </pre>
105
+ <p>
106
+ price. Our General Public Licenses are designed to make sure that you have
107
+ the freedom to distribute copies of free software (and charge for this
108
+ service if you wish), that you receive source code or can get it if you
109
+ want it, that you can change the software or use pieces of it in new free
110
+ programs; and that you know you can do these things.
111
+ </p>
112
+ <pre>
113
+ To protect your rights, we need to make restrictions that forbid
114
+ </pre>
115
+ <p>
116
+ anyone to deny you these rights or to ask you to surrender the rights.
117
+ These restrictions translate to certain responsibilities for you if you
118
+ distribute copies of the software, or if you modify it.
119
+ </p>
120
+ <pre>
121
+ For example, if you distribute copies of such a program, whether
122
+ </pre>
123
+ <p>
124
+ gratis or for a fee, you must give the recipients all the rights that you
125
+ have. You must make sure that they, too, receive or can get the source
126
+ code. And you must show them these terms so they know their rights.
127
+ </p>
128
+ <pre>
129
+ We protect your rights with two steps: (1) copyright the software, and
130
+ </pre>
131
+ <p>
132
+ (2) offer you this license which gives you legal permission to copy,
133
+ distribute and/or modify the software.
134
+ </p>
135
+ <pre>
136
+ Also, for each author's protection and ours, we want to make certain
137
+ </pre>
138
+ <p>
139
+ that everyone understands that there is no warranty for this free software.
140
+ If the software is modified by someone else and passed on, we want its
141
+ recipients to know that what they have is not the original, so that any
142
+ problems introduced by others will not reflect on the original
143
+ authors&#8217; reputations.
144
+ </p>
145
+ <pre>
146
+ Finally, any free program is threatened constantly by software
147
+ </pre>
148
+ <p>
149
+ patents. We wish to avoid the danger that redistributors of a free program
150
+ will individually obtain patent licenses, in effect making the program
151
+ proprietary. To prevent this, we have made it clear that any patent must be
152
+ licensed for everyone&#8216;s free use or not licensed at all.
153
+ </p>
154
+ <pre>
155
+ The precise terms and conditions for copying, distribution and
156
+ </pre>
157
+ <p>
158
+ modification follow.
159
+ </p>
160
+ <pre>
161
+ GNU GENERAL PUBLIC LICENSE
162
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
163
+
164
+ 0. This License applies to any program or other work which contains
165
+ </pre>
166
+ <p>
167
+ a notice placed by the copyright holder saying it may be distributed under
168
+ the terms of this General Public License. The &quot;Program&quot;, below,
169
+ refers to any such program or work, and a &quot;work based on the
170
+ Program&quot; means either the Program or any derivative work under
171
+ copyright law: that is to say, a work containing the Program or a portion
172
+ of it, either verbatim or with modifications and/or translated into another
173
+ language. (Hereinafter, translation is included without limitation in the
174
+ term &quot;modification&quot;.) Each licensee is addressed as
175
+ &quot;you&quot;.
176
+ </p>
177
+ <p>
178
+ Activities other than copying, distribution and modification are not
179
+ covered by this License; they are outside its scope. The act of running the
180
+ Program is not restricted, and the output from the Program is covered only
181
+ if its contents constitute a work based on the Program (independent of
182
+ having been made by running the Program). Whether that is true depends on
183
+ what the Program does.
184
+ </p>
185
+ <pre>
186
+ 1. You may copy and distribute verbatim copies of the Program's
187
+ </pre>
188
+ <p>
189
+ source code as you receive it, in any medium, provided that you
190
+ conspicuously and appropriately publish on each copy an appropriate
191
+ copyright notice and disclaimer of warranty; keep intact all the notices
192
+ that refer to this License and to the absence of any warranty; and give any
193
+ other recipients of the Program a copy of this License along with the
194
+ Program.
195
+ </p>
196
+ <p>
197
+ You may charge a fee for the physical act of transferring a copy, and you
198
+ may at your option offer warranty protection in exchange for a fee.
199
+ </p>
200
+ <pre>
201
+ 2. You may modify your copy or copies of the Program or any portion
202
+ </pre>
203
+ <p>
204
+ of it, thus forming a work based on the Program, and copy and distribute
205
+ such modifications or work under the terms of Section 1 above, provided
206
+ that you also meet all of these conditions:
207
+ </p>
208
+ <pre>
209
+ a) You must cause the modified files to carry prominent notices
210
+ stating that you changed the files and the date of any change.
211
+
212
+ b) You must cause any work that you distribute or publish, that in
213
+ whole or in part contains or is derived from the Program or any
214
+ part thereof, to be licensed as a whole at no charge to all third
215
+ parties under the terms of this License.
216
+
217
+ c) If the modified program normally reads commands interactively
218
+ when run, you must cause it, when started running for such
219
+ interactive use in the most ordinary way, to print or display an
220
+ announcement including an appropriate copyright notice and a
221
+ notice that there is no warranty (or else, saying that you provide
222
+ a warranty) and that users may redistribute the program under
223
+ these conditions, and telling the user how to view a copy of this
224
+ License. (Exception: if the Program itself is interactive but
225
+ does not normally print such an announcement, your work based on
226
+ the Program is not required to print an announcement.)
227
+ </pre>
228
+ <p>
229
+ These requirements apply to the modified work as a whole. If identifiable
230
+ sections of that work are not derived from the Program, and can be
231
+ reasonably considered independent and separate works in themselves, then
232
+ this License, and its terms, do not apply to those sections when you
233
+ distribute them as separate works. But when you distribute the same
234
+ sections as part of a whole which is a work based on the Program, the
235
+ distribution of the whole must be on the terms of this License, whose
236
+ permissions for other licensees extend to the entire whole, and thus to
237
+ each and every part regardless of who wrote it.
238
+ </p>
239
+ <p>
240
+ Thus, it is not the intent of this section to claim rights or contest your
241
+ rights to work written entirely by you; rather, the intent is to exercise
242
+ the right to control the distribution of derivative or collective works
243
+ based on the Program.
244
+ </p>
245
+ <p>
246
+ In addition, mere aggregation of another work not based on the Program with
247
+ the Program (or with a work based on the Program) on a volume of a storage
248
+ or distribution medium does not bring the other work under the scope of
249
+ this License.
250
+ </p>
251
+ <pre>
252
+ 3. You may copy and distribute the Program (or a work based on it,
253
+ </pre>
254
+ <p>
255
+ under Section 2) in object code or executable form under the terms of
256
+ Sections 1 and 2 above provided that you also do one of the following:
257
+ </p>
258
+ <pre>
259
+ a) Accompany it with the complete corresponding machine-readable
260
+ source code, which must be distributed under the terms of Sections
261
+ 1 and 2 above on a medium customarily used for software interchange; or,
262
+
263
+ b) Accompany it with a written offer, valid for at least three
264
+ years, to give any third party, for a charge no more than your
265
+ cost of physically performing source distribution, a complete
266
+ machine-readable copy of the corresponding source code, to be
267
+ distributed under the terms of Sections 1 and 2 above on a medium
268
+ customarily used for software interchange; or,
269
+
270
+ c) Accompany it with the information you received as to the offer
271
+ to distribute corresponding source code. (This alternative is
272
+ allowed only for noncommercial distribution and only if you
273
+ received the program in object code or executable form with such
274
+ an offer, in accord with Subsection b above.)
275
+ </pre>
276
+ <p>
277
+ The source code for a work means the preferred form of the work for making
278
+ modifications to it. For an executable work, complete source code means all
279
+ the source code for all modules it contains, plus any associated interface
280
+ definition files, plus the scripts used to control compilation and
281
+ installation of the executable. However, as a special exception, the source
282
+ code distributed need not include anything that is normally distributed (in
283
+ either source or binary form) with the major components (compiler, kernel,
284
+ and so on) of the operating system on which the executable runs, unless
285
+ that component itself accompanies the executable.
286
+ </p>
287
+ <p>
288
+ If distribution of executable or object code is made by offering access to
289
+ copy from a designated place, then offering equivalent access to copy the
290
+ source code from the same place counts as distribution of the source code,
291
+ even though third parties are not compelled to copy the source along with
292
+ the object code.
293
+ </p>
294
+ <pre>
295
+ 4. You may not copy, modify, sublicense, or distribute the Program
296
+ </pre>
297
+ <p>
298
+ except as expressly provided under this License. Any attempt otherwise to
299
+ copy, modify, sublicense or distribute the Program is void, and will
300
+ automatically terminate your rights under this License. However, parties
301
+ who have received copies, or rights, from you under this License will not
302
+ have their licenses terminated so long as such parties remain in full
303
+ compliance.
304
+ </p>
305
+ <pre>
306
+ 5. You are not required to accept this License, since you have not
307
+ </pre>
308
+ <p>
309
+ signed it. However, nothing else grants you permission to modify or
310
+ distribute the Program or its derivative works. These actions are
311
+ prohibited by law if you do not accept this License. Therefore, by
312
+ modifying or distributing the Program (or any work based on the Program),
313
+ you indicate your acceptance of this License to do so, and all its terms
314
+ and conditions for copying, distributing or modifying the Program or works
315
+ based on it.
316
+ </p>
317
+ <pre>
318
+ 6. Each time you redistribute the Program (or any work based on the
319
+ </pre>
320
+ <p>
321
+ Program), the recipient automatically receives a license from the original
322
+ licensor to copy, distribute or modify the Program subject to these terms
323
+ and conditions. You may not impose any further restrictions on the
324
+ recipients&#8217; exercise of the rights granted herein. You are not
325
+ responsible for enforcing compliance by third parties to this License.
326
+ </p>
327
+ <pre>
328
+ 7. If, as a consequence of a court judgment or allegation of patent
329
+ </pre>
330
+ <p>
331
+ infringement or for any other reason (not limited to patent issues),
332
+ conditions are imposed on you (whether by court order, agreement or
333
+ otherwise) that contradict the conditions of this License, they do not
334
+ excuse you from the conditions of this License. If you cannot distribute so
335
+ as to satisfy simultaneously your obligations under this License and any
336
+ other pertinent obligations, then as a consequence you may not distribute
337
+ the Program at all. For example, if a patent license would not permit
338
+ royalty-free redistribution of the Program by all those who receive copies
339
+ directly or indirectly through you, then the only way you could satisfy
340
+ both it and this License would be to refrain entirely from distribution of
341
+ the Program.
342
+ </p>
343
+ <p>
344
+ If any portion of this section is held invalid or unenforceable under any
345
+ particular circumstance, the balance of the section is intended to apply
346
+ and the section as a whole is intended to apply in other circumstances.
347
+ </p>
348
+ <p>
349
+ It is not the purpose of this section to induce you to infringe any patents
350
+ or other property right claims or to contest validity of any such claims;
351
+ this section has the sole purpose of protecting the integrity of the free
352
+ software distribution system, which is implemented by public license
353
+ practices. Many people have made generous contributions to the wide range
354
+ of software distributed through that system in reliance on consistent
355
+ application of that system; it is up to the author/donor to decide if he or
356
+ she is willing to distribute software through any other system and a
357
+ licensee cannot impose that choice.
358
+ </p>
359
+ <p>
360
+ This section is intended to make thoroughly clear what is believed to be a
361
+ consequence of the rest of this License.
362
+ </p>
363
+ <pre>
364
+ 8. If the distribution and/or use of the Program is restricted in
365
+ </pre>
366
+ <p>
367
+ certain countries either by patents or by copyrighted interfaces, the
368
+ original copyright holder who places the Program under this License may add
369
+ an explicit geographical distribution limitation excluding those countries,
370
+ so that distribution is permitted only in or among countries not thus
371
+ excluded. In such case, this License incorporates the limitation as if
372
+ written in the body of this License.
373
+ </p>
374
+ <pre>
375
+ 9. The Free Software Foundation may publish revised and/or new versions
376
+ </pre>
377
+ <p>
378
+ of the General Public License from time to time. Such new versions will be
379
+ similar in spirit to the present version, but may differ in detail to
380
+ address new problems or concerns.
381
+ </p>
382
+ <p>
383
+ Each version is given a distinguishing version number. If the Program
384
+ specifies a version number of this License which applies to it and
385
+ &quot;any later version&quot;, you have the option of following the terms
386
+ and conditions either of that version or of any later version published by
387
+ the Free Software Foundation. If the Program does not specify a version
388
+ number of this License, you may choose any version ever published by the
389
+ Free Software Foundation.
390
+ </p>
391
+ <pre>
392
+ 10. If you wish to incorporate parts of the Program into other free
393
+ </pre>
394
+ <p>
395
+ programs whose distribution conditions are different, write to the author
396
+ to ask for permission. For software which is copyrighted by the Free
397
+ Software Foundation, write to the Free Software Foundation; we sometimes
398
+ make exceptions for this. Our decision will be guided by the two goals of
399
+ preserving the free status of all derivatives of our free software and of
400
+ promoting the sharing and reuse of software generally.
401
+ </p>
402
+ <pre>
403
+ NO WARRANTY
404
+
405
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
406
+ </pre>
407
+ <p>
408
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
409
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
410
+ PROVIDE THE PROGRAM &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND, EITHER
411
+ EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
412
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
413
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
414
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
415
+ REPAIR OR CORRECTION.
416
+ </p>
417
+ <pre>
418
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
419
+ </pre>
420
+ <p>
421
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
422
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
423
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
424
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
425
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
426
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
427
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
428
+ POSSIBILITY OF SUCH DAMAGES.
429
+ </p>
430
+ <pre>
431
+ END OF TERMS AND CONDITIONS
432
+
433
+ How to Apply These Terms to Your New Programs
434
+
435
+ If you develop a new program, and you want it to be of the greatest
436
+ </pre>
437
+ <p>
438
+ possible use to the public, the best way to achieve this is to make it free
439
+ software which everyone can redistribute and change under these terms.
440
+ </p>
441
+ <pre>
442
+ To do so, attach the following notices to the program. It is safest
443
+ </pre>
444
+ <p>
445
+ to attach them to the start of each source file to most effectively convey
446
+ the exclusion of warranty; and each file should have at least the
447
+ &quot;copyright&quot; line and a pointer to where the full notice is found.
448
+ </p>
449
+ <pre>
450
+ &lt;one line to give the program's name and a brief idea of what it does.&gt;
451
+ Copyright (C) &lt;year&gt; &lt;name of author&gt;
452
+
453
+ This program is free software; you can redistribute it and/or modify
454
+ it under the terms of the GNU General Public License as published by
455
+ the Free Software Foundation; either version 2 of the License, or
456
+ (at your option) any later version.
457
+
458
+ This program is distributed in the hope that it will be useful,
459
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
460
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
461
+ GNU General Public License for more details.
462
+
463
+ You should have received a copy of the GNU General Public License
464
+ along with this program; if not, write to the Free Software
465
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
466
+ </pre>
467
+ <p>
468
+ Also add information on how to contact you by electronic and paper mail.
469
+ </p>
470
+ <p>
471
+ If the program is interactive, make it output a short notice like this when
472
+ it starts in an interactive mode:
473
+ </p>
474
+ <pre>
475
+ Gnomovision version 69, Copyright (C) year name of author
476
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
477
+ This is free software, and you are welcome to redistribute it
478
+ under certain conditions; type `show c' for details.
479
+ </pre>
480
+ <p>
481
+ The hypothetical commands `show w&#8217; and `show c&#8217; should show the
482
+ appropriate parts of the General Public License. Of course, the commands
483
+ you use may be called something other than `show w&#8217; and `show
484
+ c&#8217;; they could even be mouse-clicks or menu items&#8212;whatever
485
+ suits your program.
486
+ </p>
487
+ <p>
488
+ You should also get your employer (if you work as a programmer) or your
489
+ school, if any, to sign a &quot;copyright disclaimer&quot; for the program,
490
+ if necessary. Here is a sample; alter the names:
491
+ </p>
492
+ <pre>
493
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
494
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
495
+
496
+ &lt;signature of Ty Coon&gt;, 1 April 1989
497
+ Ty Coon, President of Vice
498
+ </pre>
499
+ <p>
500
+ This General Public License does not permit incorporating your program into
501
+ proprietary programs. If your program is a subroutine library, you may
502
+ consider it more useful to permit linking proprietary applications with the
503
+ library. If this is what you want to do, use the GNU Library General Public
504
+ License instead of this License.
505
+ </p>
506
+
507
+
508
+
509
+
510
+
511
+
512
+
513
+ </div>
514
+ </div>
515
+
516
+
517
+ </div>
518
+ </body>
519
+ </html>
@@ -0,0 +1,160 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ Bivouac 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/COPYING.html" value="File: COPYING">COPYING</a>",
65
+ "<a href="../files/AUTHORS.html" value="File: AUTHORS">AUTHORS</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 / Mon Jul 30 17:35:51 +0200 2007</div>
77
+ </div>
78
+
79
+ <h1>Bivouac - 0.0.1</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 camping.
98
+ </p>
99
+ <h2>FEATURES/PROBLEMS:</h2>
100
+ <h3>0.0.1:</h3>
101
+ <ul>
102
+ <li>Can&#8216;t generate models and migrates
103
+
104
+ </li>
105
+ </ul>
106
+ <h3>Extra:</h3>
107
+ <ul>
108
+ <li>With camping 1.5 there is a bug in
109
+ /usr/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/webrick.rb line 59,
110
+ change <tt>do_GET(req, res)</tt> to <tt>do_GET(req, resp)</tt>
111
+
112
+ </li>
113
+ </ul>
114
+ <h2>SYNOPSIS:</h2>
115
+ <pre>
116
+ % bivouac your_app_name
117
+ ...
118
+ % cd your_app_name
119
+ % ruby script/generate controller your_controller
120
+ ...
121
+ </pre>
122
+ <h2>REQUIREMENTS:</h2>
123
+ <ul>
124
+ <li>camping
125
+
126
+ </li>
127
+ <li>mime-types
128
+
129
+ </li>
130
+ <li>extra
131
+
132
+ </li>
133
+ </ul>
134
+ <h2>INSTALL:</h2>
135
+ <pre>
136
+ sudo gem install bivouac
137
+ </pre>
138
+ <h2>LICENSE:</h2>
139
+ <p>
140
+ Bivouac is freely distributable according to the terms of the GNU General
141
+ Public License.
142
+ </p>
143
+ <p>
144
+ This program is distributed without any warranty. See the file
145
+ &#8216;COPYING&#8217; for details.
146
+ </p>
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+ </div>
155
+ </div>
156
+
157
+
158
+ </div>
159
+ </body>
160
+ </html>
data/doc/index.html ADDED
@@ -0,0 +1,10 @@
1
+
2
+ <HTML>
3
+ <HEAD>
4
+ <META HTTP-EQUIV="refresh" content="0;URL=files/README.html">
5
+ <TITLE>Bivouac Documentation</TITLE>
6
+ </HEAD>
7
+ <BODY>
8
+ Click <a href="files/README.html">here</a> to open the Camping docs.
9
+ </BODY>
10
+ </HTML>
data/doc/permalink.gif ADDED
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; }
data/doc/rubyfr.png ADDED
Binary file
data/lib/bivouac.rb CHANGED
File without changes
@@ -30,12 +30,7 @@ module Bivouac
30
30
  end
31
31
 
32
32
  def run
33
- #begin
34
- send( @file_type.to_sym )
35
- #rescue
36
- # help( )
37
- # exit
38
- #end
33
+ send( @file_type.to_sym )
39
34
  end
40
35
 
41
36
  private
@@ -49,15 +44,24 @@ module Bivouac
49
44
  end
50
45
 
51
46
  def migrate
52
- puts "hello from migrate"
53
- puts "generate from #{@template_file} in #{@destination_file} for #{@app.environment.appname}::#{@generation_class_name}"
47
+ @generation_table_name = (@generation_app_name + "_" + @generation_name).tableize
48
+ @destination_file = File.dirname( $0 ) + "/../db/migrate/" + @generation_file_name.underscore + ".rb"
49
+ createFile( @destination_file ) do |io|
50
+ io.puts template( "generate/migrate", binding )
51
+ end
54
52
 
53
+ @destination_file = File.dirname( $0 ) + "/../db/create.rb"
54
+ createFile( @destination_file, false, false ) do |io|
55
+ io.puts template( "generate/create", binding )
56
+ end
55
57
  end
56
58
 
57
59
  def model
58
- puts "hello from model"
59
- puts "generate from #{@template_file} in #{@destination_file} for #{@app.environment.appname}::#{@generation_class_name}"
60
+ createFile( @destination_file ) do |io|
61
+ io.puts template( "generate/model", binding )
62
+ end
60
63
 
64
+ migrate( )
61
65
  end
62
66
 
63
67
  def view( )
File without changes
@@ -3,22 +3,65 @@ require 'erb'
3
3
  module Bivouac
4
4
  module Template
5
5
  def createDir( dirname )
6
- puts "\tcreate #{dirname}"
7
- FileUtils::mkdir_p( "#{dirname}" )
6
+ if File.exist?( dirname )
7
+ puts "\tskip #{File.expand_path( dirname )}: already exist"
8
+ else
9
+ puts "\tcreate #{File.expand_path( dirname )}"
10
+ FileUtils::mkdir_p( "#{dirname}" )
11
+ end
8
12
  end
9
13
 
10
- def createFile( filename, chmod_x = false, &block )
11
- puts "\tcreate #{filename}"
12
- open( "#{filename}", "w" ) { |io|
13
- yield( io )
14
- }
15
- FileUtils::chmod 0755, filename if chmod_x
14
+ def createFile( filename, chmod_x = false, force_create_if_existe = nil, &block )
15
+ create_ok = false
16
+
17
+ if force_create_if_existe.nil?
18
+ if File.exist?( filename )
19
+ print "\toverwrite #{File.expand_path( filename )}? [Yn] "
20
+ r = $stdin.gets.chomp
21
+ if r == "Y" or r == "y" or r == ""
22
+ puts "\tforce #{File.expand_path( filename )}"
23
+ create_ok = true
24
+ else
25
+ puts "\tskip #{File.expand_path( filename )}: already exist"
26
+ create_ok = false
27
+ end
28
+ else
29
+ puts "\tcreate #{File.expand_path( filename )}"
30
+ create_ok = true
31
+ end
32
+ elsif force_create_if_existe == false
33
+ if File.exist?( filename )
34
+ puts "\tskip #{File.expand_path( filename )}: already exist"
35
+ create_ok = false
36
+ else
37
+ puts "\tcreate #{File.expand_path( filename )}"
38
+ create_ok = true
39
+ end
40
+ elsif force_create_if_existe == true
41
+ if File.exist?( filename )
42
+ puts "\tforce #{File.expand_path( filename )}"
43
+ else
44
+ puts "\tcreate #{File.expand_path( filename )}"
45
+ end
46
+ create_ok = true
47
+ end
48
+
49
+ if create_ok == true
50
+ open( "#{filename}", "w" ) { |io|
51
+ yield( io )
52
+ }
53
+ FileUtils::chmod 0755, filename if chmod_x
54
+ end
16
55
  end
17
56
 
18
57
  def copyTemplate( file, dest )
19
- puts "\tcreate #{dest}"
20
- src = File.dirname(__FILE__) + "/template/" + file
21
- FileUtils::cp( src, dest )
58
+ if File.exist?( dest + "/" + file )
59
+ puts "\tskip #{File.expand_path( dest + "/" + file )}: already exist"
60
+ else
61
+ puts "\tcreate #{File.expand_path( dest )}"
62
+ src = File.dirname(__FILE__) + "/template/" + file
63
+ FileUtils::cp( src, dest )
64
+ end
22
65
  end
23
66
 
24
67
  def template( template_name, b = nil )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,4 @@
1
+ def <%= @generation_app_name %>.create
2
+ Camping::Models::Session.create_schema
3
+ <%= @generation_app_name %>::Models.create_schema :assume => (<%= @generation_app_name %>::Models::Post.table_exists? ? 1.0 : 0.0)
4
+ end
@@ -0,0 +1,12 @@
1
+ module <%= @generation_app_name %>::Models
2
+ class Create<%= @generation_class_name %> < V 1.0
3
+ def self.up
4
+ create_table :<%= @generation_table_name %> do |t|
5
+ # ...
6
+ end
7
+ end
8
+ def self.down
9
+ drop_table :<%= @generation_table_name %>
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ module <%= @generation_app_name %>::Models
2
+ class <%= @generation_class_name %> < Base
3
+ # ...
4
+ end
5
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: bivouac
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.1
7
- date: 2007-07-27 00:00:00 +02:00
6
+ version: 0.0.2
7
+ date: 2007-07-31 00:00:00 +02:00
8
8
  summary: Developpe with Camping like you do with Rails
9
9
  require_paths:
10
10
  - lib
@@ -15,7 +15,7 @@ description: Developpe with Camping like you do with Rails
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin
18
- has_rdoc: false
18
+ has_rdoc: true
19
19
  required_ruby_version: !ruby/object:Gem::Version::Requirement
20
20
  requirements:
21
21
  - - ">="
@@ -33,8 +33,18 @@ files:
33
33
  - README
34
34
  - AUTHORS
35
35
  - bin/bivouac
36
- - test/bivouac_test.rb
37
- - test/template_test.rb
36
+ - doc/classes
37
+ - doc/created.rid
38
+ - doc/files
39
+ - doc/files/AUTHORS.html
40
+ - doc/files/COPYING.html
41
+ - doc/files/README.html
42
+ - doc/index.html
43
+ - doc/permalink.gif
44
+ - doc/rdoc-style.css
45
+ - doc/rubyfr.png
46
+ - test/test_bivouac.rb
47
+ - test/test_template.rb
38
48
  - lib/bivouac
39
49
  - lib/bivouac/commands
40
50
  - lib/bivouac/commands/generate.rb
@@ -52,6 +62,7 @@ files:
52
62
  - lib/bivouac/template/environment.rb
53
63
  - lib/bivouac/template/generate
54
64
  - lib/bivouac/template/generate/controller.rb
65
+ - lib/bivouac/template/generate/create.rb
55
66
  - lib/bivouac/template/generate/migrate.rb
56
67
  - lib/bivouac/template/generate/model.rb
57
68
  - lib/bivouac/template/generate/view.rb
@@ -76,7 +87,7 @@ rdoc_options:
76
87
  - README
77
88
  - --inline-source
78
89
  - --exclude
79
- - ^(examples|extras)\/
90
+ - ^(examples|extras|test|bin|lib)\/
80
91
  extra_rdoc_files:
81
92
  - README
82
93
  - AUTHORS