public
Fork of drnic/newgem
Description: newgem - New Gem Generator for RubyGems
Homepage: http://newgem.rubyforge.org
Clone URL: git://github.com/wycats/newgem.git
Search Repo:
website now shows only git repos for newgem
drnic (author)
Thu Apr 17 05:18:45 -0700 2008
commit  80c0ed416578fdfe46a58564cc70dca076ff25f5
tree    65a0fe9c1ae29d80c590b61a3a27aeb9681a8c1d
parent  c59ad4802cb69cadfaa7e78670a964d7206876e8
...
1
2
 
 
 
3
 
 
 
 
 
 
 
 
4
5
6
 
 
 
 
 
 
 
 
7
8
9
...
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
...
49
50
51
52
 
 
53
54
55
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
...
48
49
50
 
 
 
 
 
51
52
53
 
54
55
56
...
62
63
64
 
65
66
67
68
69
0
@@ -1,9 +1,28 @@
0
 #!/usr/bin/env ruby
0
 
0
+GEM_NAME = 'newgem' # what ppl will type to install your gem
0
+RUBYFORGE_PROJECT = 'newgem'
0
+
0
 require 'rubygems'
0
+begin
0
+ require 'newgem'
0
+ require 'rubyforge'
0
+rescue LoadError
0
+ puts "\n\nGenerating the website requires the newgem RubyGem"
0
+ puts "Install: gem install newgem\n\n"
0
+ exit(1)
0
+end
0
 require 'redcloth'
0
 require 'syntax/convertors/html'
0
 require 'erb'
0
+require File.dirname(__FILE__) + "/../lib/#{GEM_NAME}/version.rb"
0
+
0
+version = Newgem::VERSION::STRING
0
+download = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
0
+
0
+def rubyforge_project_id
0
+ RubyForge.new.autoconfig["group_ids"][RUBYFORGE_PROJECT]
0
+end
0
 
0
 class Fixnum
0
   def ordinal
0
@@ -29,15 +48,9 @@ def convert_syntax(syntax, source)
0
   return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
0
 end
0
 
0
-require File.join(File.dirname(__FILE__), '/../lib/newgem/version.rb')
0
-
0
-version = Newgem::VERSION::STRING
0
-download = ENV['DOWNLOAD_PATH']
0
-
0
 if ARGV.length >= 1
0
   src, template = ARGV
0
   template ||= File.join(File.dirname(__FILE__), '/../website/template.html.erb')
0
-
0
 else
0
   puts("Usage: #{File.split($0).last} source.txt [template.html.erb] > output.html")
0
   exit!
0
@@ -49,7 +62,8 @@ title = nil
0
 body = nil
0
 File.open(src) do |fsrc|
0
   title_text = fsrc.readline
0
- body_text = fsrc.read
0
+ body_text_template = fsrc.read
0
+ body_text = ERB.new(body_text_template).result(binding)
0
   syntax_items = []
0
   body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){
0
     ident = syntax_items.length
...
31
32
33
34
 
35
36
 
37
38
39
...
322
323
324
325
 
 
 
 
 
 
 
 
 
 
 
 
 
326
327
328
329
330
 
 
331
 
 
 
332
333
334
...
341
342
343
344
 
345
346
347
...
31
32
33
 
34
35
 
36
37
38
39
...
322
323
324
 
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
 
342
343
344
345
346
347
348
349
350
...
357
358
359
 
360
361
362
363
0
@@ -31,9 +31,9 @@
0
 <div id="main">
0
 
0
     <h1>New Gem Generator</h1>
0
- <div id="version"> <!-- class="clickable" onclick='document.location = ""; return true' -->
0
+ <div id="version"> <!-- class="clickable" onclick='document.location = "http://rubyforge.org/projects/newgem"; return true' -->
0
       <p>Get Version</p>
0
- <a href="" class="numbers">0.23.1</a>
0
+ <a href="http://rubyforge.org/projects/newgem" class="numbers">0.23.1</a>
0
       <p>Featured in</p>
0
       <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2FBeginning-Ruby-Novice-Professional-Experts%2Fdp%2F1590597664%2F&tag=drnic-20&linkCode=ur2&camp=1789&creative=9325" class="book"><img src="images/beginning-ruby.jpg" /></a>
0
     </div>
0
@@ -322,13 +322,29 @@ other stories and things.</p>
0
   <p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people&#8217;s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
0
 
0
 
0
- <p>The source for this project is available via git. You can <a href="http://github.com/drnic/newgem/tree/master">browse and/or fork the source</a>, or to clone the project locally:</p>
0
+ <p>You can fetch the source from either:</p>
0
+
0
+
0
+ <ul>
0
+ <li>rubyforge: <a href="http://rubyforge.org/scm/?group_id=2340">http://rubyforge.org/scm/?group_id=2340</a></li>
0
+ </ul>
0
+
0
+
0
+<pre>git clone git://rubyforge.org/newgem.git</pre>
0
+
0
+ <ul>
0
+ <li>github: <a href="http://github.com/drnic/newgem/tree/master">http://github.com/drnic/newgem/tree/master</a></li>
0
+ </ul>
0
 
0
 
0
 <pre>git clone git://github.com/drnic/newgem.git</pre>
0
 
0
- <p>The original Subversion repository is <code>svn://rubyforge.org/var/svn/newgem/trunk</code> for anonymous access.</p>
0
+ <h3>Build and test instructions</h3>
0
+
0
 
0
+<pre>cd newgem
0
+rake test
0
+rake install_gem</pre>
0
 
0
   <h2>License</h2>
0
 
0
@@ -341,7 +357,7 @@ other stories and things.</p>
0
 
0
   <p>Comments are welcome. Send an email to <a href="mailto:drnicwilliams@gmail.com">Dr Nic Williams</a>.</p>
0
     <p class="coda">
0
- <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 5th April 2008<br>
0
+ <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 17th April 2008<br>
0
       Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
0
     </p>
0
 </div>
...
214
215
216
217
218
 
 
 
 
 
 
 
 
219
220
221
 
 
 
 
 
222
223
224
...
214
215
216
 
 
217
218
219
220
221
222
223
224
225
226
 
227
228
229
230
231
232
233
234
0
@@ -214,11 +214,21 @@ h2. How to submit patches
0
 
0
 Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
0
 
0
-The source for this project is available via git. You can "browse and/or fork the source":http://github.com/drnic/newgem/tree/master, or to clone the project locally:
0
-
0
+You can fetch the source from either:
0
+
0
+* rubyforge: "http://rubyforge.org/scm/?group_id=<%= rubyforge_project_id %>":http://rubyforge.org/scm/?group_id=<%= rubyforge_project_id %>
0
+
0
+<pre>git clone git://rubyforge.org/newgem.git</pre>
0
+
0
+* github: "http://github.com/drnic/newgem/tree/master":http://github.com/drnic/newgem/tree/master
0
+
0
 <pre>git clone git://github.com/drnic/newgem.git</pre>
0
 
0
-The original Subversion repository is <code>svn://rubyforge.org/var/svn/newgem/trunk</code> for anonymous access.
0
+h3. Build and test instructions
0
+
0
+<pre>cd newgem
0
+rake test
0
+rake install_gem</pre>
0
 
0
 h2. License
0
 
...
31
32
33
34
 
35
36
 
37
38
39
...
31
32
33
 
34
35
 
36
37
38
39
0
@@ -31,9 +31,9 @@
0
 <div id="main">
0
 
0
     <h1>New Gem Generator</h1>
0
- <div id="version"> <!-- class="clickable" onclick='document.location = ""; return true' -->
0
+ <div id="version"> <!-- class="clickable" onclick='document.location = "http://rubyforge.org/projects/newgem"; return true' -->
0
       <p>Get Version</p>
0
- <a href="" class="numbers">0.23.1</a>
0
+ <a href="http://rubyforge.org/projects/newgem" class="numbers">0.23.1</a>
0
       <p>Featured in</p>
0
       <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2FBeginning-Ruby-Novice-Professional-Experts%2Fdp%2F1590597664%2F&tag=drnic-20&linkCode=ur2&camp=1789&creative=9325" class="book"><img src="images/beginning-ruby.jpg" /></a>
0
     </div>

Comments

    No one has commented yet.