newgem 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,48 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>
8
+ <%= title %>
9
+ </title>
10
+ <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
11
+ <style>
12
+
13
+ </style>
14
+ <script type="text/javascript">
15
+ window.onload = function() {
16
+ settings = {
17
+ tl: { radius: 10 },
18
+ tr: { radius: 10 },
19
+ bl: { radius: 10 },
20
+ br: { radius: 10 },
21
+ antiAlias: true,
22
+ autoPad: true,
23
+ validTags: ["div"]
24
+ }
25
+ var versionBox = new curvyCorners(settings, document.getElementById("version"));
26
+ versionBox.applyCornersToAll();
27
+ }
28
+ </script>
29
+ </head>
30
+ <body>
31
+ <div id="main">
32
+
33
+ <h1><%= title %></h1>
34
+ <div id="version" class="clickable" onclick='document.location = "<%= download %>"; return false'>
35
+ Get Version
36
+ <a href="<%= download %>" class="numbers"><%= version %></a>
37
+ </div>
38
+ <%= body %>
39
+ <p class="coda">
40
+ <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, <%= modified.pretty %><br>
41
+ Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
42
+ </p>
43
+ </div>
44
+
45
+ <!-- insert site tracking codes here, like Google Urchin -->
46
+
47
+ </body>
48
+ </html>
@@ -0,0 +1,287 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>
8
+ New Gem Generator
9
+ </title>
10
+ <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
11
+ <style>
12
+
13
+ </style>
14
+ <script type="text/javascript">
15
+ window.onload = function() {
16
+ settings = {
17
+ tl: { radius: 10 },
18
+ tr: { radius: 10 },
19
+ bl: { radius: 10 },
20
+ br: { radius: 10 },
21
+ antiAlias: true,
22
+ autoPad: true,
23
+ validTags: ["div"]
24
+ }
25
+ var versionBox = new curvyCorners(settings, document.getElementById("version"));
26
+ versionBox.applyCornersToAll();
27
+ }
28
+ </script>
29
+ </head>
30
+ <body>
31
+ <div id="main">
32
+
33
+ <h1>New Gem Generator</h1>
34
+ <div id="version" class="clickable" onclick='document.location = ""; return false'>
35
+ Get Version
36
+ <a href="" class="numbers">0.9.0</a>
37
+ </div>
38
+ <h1>&#x2192; &#8216;newgem&#8217;</h1>
39
+
40
+
41
+ <h2>What</h2>
42
+
43
+
44
+ <p>Quickly bundle any Ruby libraries into a RubyGem and share it with the world, your colleagues, or perhaps just with yourself amongst your projects.</p>
45
+
46
+
47
+ <p>RubyGems are centrally stored, versioned, and support dependencies between other gems, so they are the ultimate way to bundle libraries, executables, associated tests, examples, and more.</p>
48
+
49
+
50
+ <p>Within this gem, you get one thing &#8211; <code>newgem</code> &#8211; an executable to create your own gems. Your new gems will include designated folders for Ruby code, test files, executables, and even a default website page for you to explain your project, and which instantly uploads to RubyForge website (which looks just like this one by default)</p>
51
+
52
+
53
+ <h2>Installing</h2>
54
+
55
+
56
+ <p>The <code>newgem</code> application is distributed itself as a RubyGem and is available immediately after installation.</p>
57
+
58
+
59
+ <p><pre class="syntax"><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">newgem</span></pre></p>
60
+
61
+
62
+ <p>Alternately, download the gem and install manually.</p>
63
+
64
+
65
+ <h2>The basics</h2>
66
+
67
+
68
+ <p>Go to the folder where you want to create your new gem folder structure, and run the <code>newgem</code> command to generate your gem scaffolding.</p>
69
+
70
+
71
+ <pre>$ cd ~/ruby_projects
72
+ $ newgem wizzo
73
+ creating: wizzo
74
+ creating: wizzo/CHANGELOG.txt
75
+ creating: wizzo/README.txt
76
+ creating: wizzo/lib
77
+ creating: wizzo/scripts
78
+ creating: wizzo/website
79
+ creating: wizzo/website/javascripts
80
+ creating: wizzo/website/stylesheets
81
+ creating: wizzo/lib/wizzo
82
+ creating: wizzo/lib/wizzo.rb
83
+ creating: wizzo/lib/wizzo/version.rb
84
+ creating: wizzo/bin
85
+ creating: wizzo/test
86
+ creating: wizzo/test/test_helper.rb
87
+ creating: wizzo/test/test_wizzo.rb
88
+ creating: wizzo/examples
89
+ creating: wizzo/setup.rb
90
+ creating: wizzo/Rakefile
91
+ creating: wizzo/Manifest.txt
92
+ creating: wizzo/History.txt
93
+ creating: wizzo/scripts/txt2html
94
+ creating: wizzo/website/index.txt
95
+ creating: wizzo/website/template.rhtml
96
+ copying: wizzo/website/javascripts/rounded_corners_lite.inc.js
97
+ copying: wizzo/website/stylesheets/screen.css
98
+ NOW - update wizzo/Rakefile with gem description, etc
99
+ </pre>
100
+
101
+ <h3>Setup</h3>
102
+
103
+
104
+ <p>Now modify the constants at the top of <strong>Rakefile</strong>, with your name, email and the location where you&#8217;ll host your website for the gem. The defaults are tied to RubyForge for uploading the gems and the website (see below).</p>
105
+
106
+
107
+ <h3>Create code and tests</h3>
108
+
109
+
110
+ <p>Then create your libraries (files in <code>lib</code>) and your tests (files in <code>test</code> that look like <code>test_TESTNAME.rb</code>). John Grey <span class="caps">III</span> did a nice video on test-driven design, that&#8217;s worth watching if <span class="caps">TDD</span> is new to you.</p>
111
+
112
+
113
+ <p>If you create any new files, you need to manually add them to the Manifest.txt. Alphabetical order is optional, but it will make the results of <code>rake check_manifest</code> look clean if you keep them ordered. If a file is not in the Manifest.txt it will not be included in the gem when you package and release it.</p>
114
+
115
+
116
+ <h3>Executables</h3>
117
+
118
+
119
+ <p>You can include executable Ruby applications in your gem, which will be accessible on Windows and Unix/Linux/MacOS, by creating scripts in the <code>bin</code> folder. When the gem is deployed by users, these executables will be automatically placed within their path.</p>
120
+
121
+
122
+ <h3>Website</h3>
123
+
124
+
125
+ <p>The final step before releasing your gem to the world is the all-important website. Edit the file <code>website/index.txt</code> using Textile/Redcloth syntax. Syntax highlighting is also supported (see below). If you need more website pages, create more <strong>txt</strong> files in the website folder.</p>
126
+
127
+
128
+ <p>Run the rake task <code>rake website_generate</code> to convert all your website txt files into html files.</p>
129
+
130
+
131
+ <p>If you don&#8217;t want a website, remove the <code>website</code> related files from the Manifest.txt.</p>
132
+
133
+
134
+ <p>Make sure you&#8217;ve generated the <code>website/index.html</code> file before continuing to package and release your gem (unless you remove it from the Manifest.txt).</p>
135
+
136
+
137
+ <h2>Package and test locally</h2>
138
+
139
+
140
+ <p>Before releasing a new version of a gem, it is a great idea to install the gem locally and do some sanity checks. You know, to limit the chance of you looking like a noob.</p>
141
+
142
+
143
+ <h3>Change the gems version number</h3>
144
+
145
+
146
+ <p>The version number is set in the file <code>lib/#gem name#/version.rb</code>. Update it as appropriate with major, minor and bug fix numbers. This value will be used when generating your website, for example.</p>
147
+
148
+
149
+ <h3>Check the manifest</h3>
150
+
151
+
152
+ <blockquote>Manifest: a customs document listing the contents put on a ship or plane.</blockquote>
153
+ <cite><a href="http://www.google.com/search?q=define%3Amanifest">Google &#8211; define:manifest</a></cite>
154
+
155
+ <p>Similarly here, a manifest is the log of the files to be packaged into a gem. If its not in the <code>Manifest.txt</code> file, the users won&#8217;t get it.</p>
156
+
157
+
158
+ <p>Before you package your gem, you can compared the list of files in your gem folder, with the Manifest.txt:</p>
159
+
160
+
161
+ <pre>rake check_manifest</pre>
162
+
163
+ <p>The results show a <em>diff</em> of the two.</p>
164
+
165
+
166
+ <h3>Installation</h3>
167
+
168
+
169
+ <pre>rake install_gem</pre>
170
+
171
+ <p>This will repackage your code as a gem and install it as a local gem with the new version number.</p>
172
+
173
+
174
+ <p>Now pretend to be a user, and do some tests &#8211; especially of new functionality &#8211; so you are comfortable all the files have been packaged up, and you haven&#8217;t missed anything in the <code>Manifest.txt</code>.</p>
175
+
176
+
177
+ <p>One set of tests you should do is to repeat any tutorials you include in your website. If your gem is dependent on other gems that are rapidly changing, its possible your tutorial might be invalid even if your unit tests are successful. Best you find any errors before the users start emailing you!</p>
178
+
179
+
180
+ <h2>Releasing your gem to the world</h2>
181
+
182
+
183
+ <p>Once you&#8217;re ready for release there are some final steps.</p>
184
+
185
+
186
+ <p><a name="setup_rubyforge"></a></p>
187
+
188
+
189
+ <h3>Setup your environment to upload to RubyForge.</h3>
190
+
191
+
192
+ <p>There are several steps you need to perform initially to <a href="rubyforge.html">setup your environment for uploading gems to RubyForge</a>.</p>
193
+
194
+
195
+ <h3>Document changes in History.txt</h3>
196
+
197
+
198
+ <p>Between each version of your gem, you probably changed something. You should document this in the <code>History.txt</code> file. For each new release, you need to add two paragraphs that look like this:</p>
199
+
200
+
201
+ <pre>+++ 0.5.4 14/4/2007
202
+
203
+ + 1 major improvement
204
+ + 150% more Wizzos
205
+ + 2 bug fixes
206
+ + Wizzos are the proper colour
207
+ + You only get Wizzos when you ask for them
208
+ </pre>
209
+
210
+ <p>The two paragraphs will be automatically picked up by the following release process and documented against the release on RubyForge site. To see an example of the end result, look at the <a href="http://rubyforge.org/frs/shownotes.php?release_id=9695"><strong>Changes</strong> section for hoe 1.2</a>.</p>
211
+
212
+
213
+ <p>The History.txt notes for your first release have already been started for you.</p>
214
+
215
+
216
+ <h3>Generate and upload the website</h3>
217
+
218
+
219
+ <p>The rake task <code>rake website_upload</code> will upload the website into a RubyForge project.</p>
220
+
221
+
222
+ <p>Or use the task <code>rake website</code>, which performs both the generation and the upload.</p>
223
+
224
+
225
+ <h3>Release the gem</h3>
226
+
227
+
228
+ <p>Run <code>rake release VERSION=X.Y.Z</code> after you&#8217;ve done all these steps, and your gem will be repackaged and released to RubyForge.</p>
229
+
230
+
231
+ <p>It can take an hour or two before new gem releases are available via the gem installer. But when they are ready, everyone will be able to download and install your gem using:</p>
232
+
233
+
234
+ <pre>sudo gem install #gem_name#</pre>
235
+
236
+ <h2>Bonus tasks thanks to Hoe</h2>
237
+
238
+
239
+ <p>Your gem uses the Hoe gem to provide a dozen or so useful rake tasks for managing your gem, such as <code>release</code>.</p>
240
+
241
+
242
+ <p>See them all with:</p>
243
+
244
+
245
+ <pre>rake -T</pre>
246
+
247
+ <p>Remember, the Rakefile is yours to extend as you please with more rake tasks, such as the <code>website</code> tasks already added.</p>
248
+
249
+
250
+ <h2>Dr Nic&#8217;s Blog</h2>
251
+
252
+
253
+ <p><a href="http://www.drnicwilliams.com">http://www.drnicwilliams.com</a> &#8211; for future announcements and
254
+ other stories and things.</p>
255
+
256
+
257
+ <h2>Forum</h2>
258
+
259
+
260
+ <p><a href="http://groups.google.com/group/new-gem-generator">http://groups.google.com/group/new-gem-generator</a></p>
261
+
262
+
263
+ <h2>Licence</h2>
264
+
265
+
266
+ <p>This code is free to use under the terms of the <span class="caps">MIT</span> licence.</p>
267
+
268
+
269
+ <h2>Contact</h2>
270
+
271
+
272
+ <p>Comments are welcome. Send an email to <a href="mailto:drnicwilliams@gmail.com">Dr Nic Williams</a>.</p>
273
+ <p class="coda">
274
+ <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 13th April 2007<br>
275
+ Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
276
+ </p>
277
+ </div>
278
+
279
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
280
+ </script>
281
+ <script type="text/javascript">
282
+ _uacct = "UA-567811-2";
283
+ urchinTracker();
284
+ </script>
285
+
286
+ </body>
287
+ </html>
data/website/index.txt ADDED
@@ -0,0 +1,178 @@
1
+ h1. New Gem Generator
2
+
3
+ h1. &#x2192; 'newgem'
4
+
5
+ h2. What
6
+
7
+ Quickly bundle any Ruby libraries into a RubyGem and share it with the world, your colleagues, or perhaps just with yourself amongst your projects.
8
+
9
+ RubyGems are centrally stored, versioned, and support dependencies between other gems, so they are the ultimate way to bundle libraries, executables, associated tests, examples, and more.
10
+
11
+ Within this gem, you get one thing - <code>newgem</code> - an executable to create your own gems. Your new gems will include designated folders for Ruby code, test files, executables, and even a default website page for you to explain your project, and which instantly uploads to RubyForge website (which looks just like this one by default)
12
+
13
+ h2. Installing
14
+
15
+ The <code>newgem</code> application is distributed itself as a RubyGem and is available immediately after installation.
16
+
17
+ <pre syntax="ruby">sudo gem install newgem</pre>
18
+
19
+ Alternately, download the gem and install manually.
20
+
21
+ h2. The basics
22
+
23
+ Go to the folder where you want to create your new gem folder structure, and run the <code>newgem</code> command to generate your gem scaffolding.
24
+
25
+ <pre>$ cd ~/ruby_projects
26
+ $ newgem wizzo
27
+ creating: wizzo
28
+ creating: wizzo/CHANGELOG.txt
29
+ creating: wizzo/README.txt
30
+ creating: wizzo/lib
31
+ creating: wizzo/scripts
32
+ creating: wizzo/website
33
+ creating: wizzo/website/javascripts
34
+ creating: wizzo/website/stylesheets
35
+ creating: wizzo/lib/wizzo
36
+ creating: wizzo/lib/wizzo.rb
37
+ creating: wizzo/lib/wizzo/version.rb
38
+ creating: wizzo/bin
39
+ creating: wizzo/test
40
+ creating: wizzo/test/test_helper.rb
41
+ creating: wizzo/test/test_wizzo.rb
42
+ creating: wizzo/examples
43
+ creating: wizzo/setup.rb
44
+ creating: wizzo/Rakefile
45
+ creating: wizzo/Manifest.txt
46
+ creating: wizzo/History.txt
47
+ creating: wizzo/scripts/txt2html
48
+ creating: wizzo/website/index.txt
49
+ creating: wizzo/website/template.rhtml
50
+ copying: wizzo/website/javascripts/rounded_corners_lite.inc.js
51
+ copying: wizzo/website/stylesheets/screen.css
52
+ NOW - update wizzo/Rakefile with gem description, etc
53
+ </pre>
54
+
55
+ h3. Setup
56
+
57
+ Now modify the constants at the top of *Rakefile*, with your name, email and the location where you'll host your website for the gem. The defaults are tied to RubyForge for uploading the gems and the website (see below).
58
+
59
+ h3. Create code and tests
60
+
61
+ Then create your libraries (files in <code>lib</code>) and your tests (files in <code>test</code> that look like <code>test_TESTNAME.rb</code>). John Grey III did a nice video on test-driven design, that's worth watching if TDD is new to you.
62
+
63
+ If you create any new files, you need to manually add them to the Manifest.txt. Alphabetical order is optional, but it will make the results of <code>rake check_manifest</code> look clean if you keep them ordered. If a file is not in the Manifest.txt it will not be included in the gem when you package and release it.
64
+
65
+ h3. Executables
66
+
67
+ You can include executable Ruby applications in your gem, which will be accessible on Windows and Unix/Linux/MacOS, by creating scripts in the <code>bin</code> folder. When the gem is deployed by users, these executables will be automatically placed within their path.
68
+
69
+ h3. Website
70
+
71
+ The final step before releasing your gem to the world is the all-important website. Edit the file <code>website/index.txt</code> using Textile/Redcloth syntax. Syntax highlighting is also supported (see below). If you need more website pages, create more *txt* files in the website folder.
72
+
73
+ Run the rake task <code>rake website_generate</code> to convert all your website txt files into html files.
74
+
75
+ If you don't want a website, remove the <code>website</code> related files from the Manifest.txt.
76
+
77
+ Make sure you've generated the <code>website/index.html</code> file before continuing to package and release your gem (unless you remove it from the Manifest.txt).
78
+
79
+ h2. Package and test locally
80
+
81
+ Before releasing a new version of a gem, it is a great idea to install the gem locally and do some sanity checks. You know, to limit the chance of you looking like a noob.
82
+
83
+ h3. Change the gems version number
84
+
85
+ The version number is set in the file <code>lib/#gem name#/version.rb</code>. Update it as appropriate with major, minor and bug fix numbers. This value will be used when generating your website, for example.
86
+
87
+ h3. Check the manifest
88
+
89
+ <blockquote>Manifest: a customs document listing the contents put on a ship or plane.</blockquote>
90
+ <cite>"Google - define:manifest":http://www.google.com/search?q=define%3Amanifest</cite>
91
+
92
+ Similarly here, a manifest is the log of the files to be packaged into a gem. If its not in the <code>Manifest.txt</code> file, the users won't get it.
93
+
94
+ Before you package your gem, you can compared the list of files in your gem folder, with the Manifest.txt:
95
+
96
+ <pre>rake check_manifest</pre>
97
+
98
+ The results show a _diff_ of the two.
99
+
100
+ h3. Installation
101
+
102
+ <pre>rake install_gem</pre>
103
+
104
+ This will repackage your code as a gem and install it as a local gem with the new version number.
105
+
106
+ Now pretend to be a user, and do some tests - especially of new functionality - so you are comfortable all the files have been packaged up, and you haven't missed anything in the <code>Manifest.txt</code>.
107
+
108
+ One set of tests you should do is to repeat any tutorials you include in your website. If your gem is dependent on other gems that are rapidly changing, its possible your tutorial might be invalid even if your unit tests are successful. Best you find any errors before the users start emailing you!
109
+
110
+ h2. Releasing your gem to the world
111
+
112
+ Once you're ready for release there are some final steps.
113
+
114
+ <a name="setup_rubyforge"></a>
115
+
116
+
117
+ h3. Setup your environment to upload to RubyForge.
118
+
119
+ There are several steps you need to perform initially to "setup your environment for uploading gems to RubyForge":rubyforge.html.
120
+
121
+
122
+ h3. Document changes in History.txt
123
+
124
+ Between each version of your gem, you probably changed something. You should document this in the <code>History.txt</code> file. For each new release, you need to add two paragraphs that look like this:
125
+
126
+ <pre>+++ 0.5.4 14/4/2007
127
+
128
+ + 1 major improvement
129
+ + 150% more Wizzos
130
+ + 2 bug fixes
131
+ + Wizzos are the proper colour
132
+ + You only get Wizzos when you ask for them
133
+ </pre>
134
+
135
+ The two paragraphs will be automatically picked up by the following release process and documented against the release on RubyForge site. To see an example of the end result, look at the "*Changes* section for hoe 1.2":http://rubyforge.org/frs/shownotes.php?release_id=9695.
136
+
137
+ The History.txt notes for your first release have already been started for you.
138
+
139
+ h3. Generate and upload the website
140
+
141
+ The rake task <code>rake website_upload</code> will upload the website into a RubyForge project.
142
+
143
+ Or use the task <code>rake website</code>, which performs both the generation and the upload.
144
+
145
+ h3. Release the gem
146
+
147
+ Run <code>rake release VERSION=X.Y.Z</code> after you've done all these steps, and your gem will be repackaged and released to RubyForge.
148
+
149
+ It can take an hour or two before new gem releases are available via the gem installer. But when they are ready, everyone will be able to download and install your gem using:
150
+
151
+ <pre>sudo gem install #gem_name#</pre>
152
+
153
+ h2. Bonus tasks thanks to Hoe
154
+
155
+ Your gem uses the Hoe gem to provide a dozen or so useful rake tasks for managing your gem, such as <code>release</code>.
156
+
157
+ See them all with:
158
+
159
+ <pre>rake -T</pre>
160
+
161
+ Remember, the Rakefile is yours to extend as you please with more rake tasks, such as the <code>website</code> tasks already added.
162
+
163
+ h2. Dr Nic's Blog
164
+
165
+ "http://www.drnicwilliams.com":http://www.drnicwilliams.com - for future announcements and
166
+ other stories and things.
167
+
168
+ h2. Forum
169
+
170
+ "http://groups.google.com/group/new-gem-generator":http://groups.google.com/group/new-gem-generator
171
+
172
+ h2. Licence
173
+
174
+ This code is free to use under the terms of the MIT licence.
175
+
176
+ h2. Contact
177
+
178
+ Comments are welcome. Send an email to "Dr Nic Williams":mailto:drnicwilliams@gmail.com.