newgem 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,13 @@
1
+ == 0.10.2 2007-05-25
2
+
3
+ * 3 major enhancements
4
+ * Generated Rakefile only attempts to discover username from ~/.rubyforge/user-config.yml when its required [thx Jeroen Janssen]
5
+ * Helpful error message produced if 'rubyforge setup' never run
6
+ * Fixed the REV algorithm for subversion [thx Robert Berger]
7
+ * 2 minor enhancement
8
+ * Copied index.txt into README.txt - it looks crap, but at least there is content
9
+ * Generated Rakefile was missing a \
10
+
1
11
  == 0.10.1 2007-05-24
2
12
 
3
13
  * 4 minor enhancements
@@ -60,15 +70,15 @@
60
70
 
61
71
  == 0.8.1
62
72
 
63
- - Generated test file's class name now prefixed with Test, instead of suffixed
73
+ * Generated test file's class name now prefixed with Test, instead of suffixed
64
74
 
65
75
  == 0.8.0
66
76
 
67
- - Uses hoe itself - less hypocritical
68
- - Generated test files use name 'test_<gemname>.rb' instead of '<gemname>_test.rb' to support
69
- ZenTest's autotest expectations of naming. Manifest updated too.
77
+ * Uses hoe itself - less hypocritical
78
+ * Generated test files use name 'test_<gemname>.rb' instead of '<gemname>_test.rb' to support
79
+ * ZenTest's autotest expectations of naming. Manifest updated too.
70
80
 
71
81
  == 0.7.1
72
82
 
73
- - Installed gems now don't require 'hoe' (based on comments at http://blog.evanweaver.com/articles/2007/01/10/if-you-dont-want-to-hoe-echoe)
83
+ * Installed gems now don't require 'hoe' (based on comments at http://blog.evanweaver.com/articles/2007/01/10/if-you-dont-want-to-hoe-echoe)
74
84
 
data/README.txt CHANGED
@@ -1,3 +1,193 @@
1
- README for newgem
2
- =================
1
+ h1. New Gem Generator
3
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
+ As of 0.10.0 - you can generate test::unit or rspec test stubs via the -t, --test-with options
56
+
57
+ h3. Setup
58
+
59
+ 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).
60
+
61
+ h3. Create code and tests
62
+
63
+ 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.
64
+
65
+ 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.
66
+
67
+ h3. Executables
68
+
69
+ 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.
70
+
71
+ h3. Website
72
+
73
+ 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.
74
+
75
+ Run the rake task <code>rake website_generate</code> to convert all your website txt files into html files.
76
+
77
+ NOTE: Currently, the initial <code>index.txt</code> file includes my details not yours. Currently you need to change this manually.
78
+
79
+ If you don't want a website, remove the <code>website</code> related files from the Manifest.txt.
80
+
81
+ h3. Change the gems version number
82
+
83
+ 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.
84
+
85
+ h3. Check the manifest
86
+
87
+ <blockquote>Manifest: a customs document listing the contents put on a ship or plane.</blockquote>
88
+ <cite>"Google - define:manifest":http://www.google.com/search?q=define%3Amanifest</cite>
89
+
90
+ 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.
91
+
92
+ Before you package your gem, you can compared the list of files in your gem folder, with the Manifest.txt:
93
+
94
+ <pre>rake check_manifest</pre>
95
+
96
+ The results show a _diff_ of the two.
97
+
98
+ h2. Package and test locally
99
+
100
+ 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.
101
+
102
+ <pre>rake local_deploy</pre>
103
+
104
+ This generates the website html files into your website folder, and locally installs the gem, ready for testing and local use.
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
+
140
+ h3. Release the gem and upload the website and rdocs
141
+
142
+ Run <code>rake deploy VERSION=X.Y.Z</code> after you've done all these steps. It does the following:
143
+
144
+ # Uploads your website to rubyforge
145
+ # Uploads your rdocs to rubyforge
146
+ # Packages and uploads your gem to RubyForge
147
+
148
+ 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:
149
+
150
+ <pre>sudo gem install #gem_name#</pre>
151
+
152
+ If your GEM_NAME and RUBYFORGE_PROJECT name are the same, then:
153
+
154
+ * http://RUBYFORGE_PROJECT.rubyforge.org is your website, and
155
+ * http://RUBYFORGE_PROJECT.rubyforge.org/rdoc is your rdocs
156
+
157
+ If they are different, then:
158
+
159
+ * http://RUBYFORGE_PROJECT.rubyforge.org/GEM_NAME is your website, and
160
+ * http://RUBYFORGE_PROJECT.rubyforge.org/GEM_NAME/rdoc is your rdocs
161
+
162
+ h2. Bonus tasks thanks to Hoe
163
+
164
+ Your gem uses the Hoe gem to provide a dozen or so useful rake tasks for managing your gem, such as <code>release</code>, <code>check_manifest</code> and <code>publish_docs</code>.
165
+
166
+ See them all with:
167
+
168
+ <pre>rake -T</pre>
169
+
170
+ Remember, the Rakefile is yours to extend as you please with more rake tasks, such as the <code>website</code> tasks which are already added.
171
+
172
+ For more information about each task, see the "Hoe README":http://seattlerb.rubyforge.org/hoe/
173
+
174
+ h2. Related articles
175
+
176
+ * "Original blog article and tutorial":http://drnicwilliams.com/2006/10/11/generating-new-gems/
177
+
178
+ h2. Dr Nic's Blog
179
+
180
+ "http://www.drnicwilliams.com":http://www.drnicwilliams.com - for future announcements and
181
+ other stories and things.
182
+
183
+ h2. Forum
184
+
185
+ "http://groups.google.com/group/new-gem-generator":http://groups.google.com/group/new-gem-generator
186
+
187
+ h2. License
188
+
189
+ This code is free to use under the terms of the MIT license.
190
+
191
+ h2. Contact
192
+
193
+ Comments are welcome. Send an email to "Dr Nic Williams":mailto:drnicwilliams@gmail.com.
data/Rakefile CHANGED
@@ -22,6 +22,7 @@ HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
22
22
  DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
23
23
 
24
24
  REV = nil #File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
25
+ # REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
25
26
  VERS = Newgem::VERSION::STRING + (REV ? ".#{REV}" : "")
26
27
  CLEAN.include ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store']
27
28
  RDOC_OPTS = ['--quiet', '--title', "newgem documentation",
@@ -52,9 +53,9 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
52
53
  #p.spec_extras - A hash of extra values to set in the gemspec.
53
54
  end
54
55
 
55
- CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
56
+ CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\n\n")
56
57
  PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "\#{RUBYFORGE_PROJECT}/\#{GEM_NAME}"
57
- hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}/,''), 'rdoc')
58
+ hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
58
59
 
59
60
  desc 'Generate website files'
60
61
  task :website_generate => :load_consts do
data/lib/newgem.rb CHANGED
@@ -3,3 +3,5 @@ end
3
3
 
4
4
  require 'newgem/rubyforge'
5
5
  require 'newgem/version'
6
+
7
+
@@ -2,7 +2,7 @@ module Newgem #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 10
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/templates/Rakefile CHANGED
@@ -16,14 +16,33 @@ AUTHOR = '#{author}' # can also be an array of Authors
16
16
  EMAIL = "#{email}"
17
17
  DESCRIPTION = "description of gem"
18
18
  GEM_NAME = '#{gem_name}' # what ppl will type to install your gem
19
- config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
20
- RUBYFORGE_USERNAME = config["username"]
19
+
20
+ @config_file = "~/.rubyforge/user-config.yml"
21
+ @config = nil
22
+ def rubyforge_username
23
+ unless @config
24
+ begin
25
+ @config = YAML.load(File.read(File.expand_path(@config_file)))
26
+ rescue
27
+ puts <<-EOS
28
+ ERROR: No rubyforge config file found: \#{@config_file}"
29
+ Run 'rubyforge setup' to prepare your env for access to Rubyforge
30
+ - See http://newgem.rubyforge.org/rubyforge.html for more details
31
+ EOS
32
+ exit
33
+ end
34
+ end
35
+ @rubyforge_username ||= @config["username"]
36
+ end
37
+
21
38
  RUBYFORGE_PROJECT = '#{gem_name}' # The unix name for your project
22
39
  HOMEPATH = "http://\#{RUBYFORGE_PROJECT}.rubyforge.org"
23
40
  DOWNLOAD_PATH = "http://rubyforge.org/projects/\#{RUBYFORGE_PROJECT}"
24
41
 
25
42
  NAME = "#{gem_name}"
26
- REV = nil # UNCOMMENT IF REQUIRED: File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
43
+ REV = nil
44
+ # UNCOMMENT IF REQUIRED:
45
+ # REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
27
46
  VERS = #{module_name}::VERSION::STRING + (REV ? ".\#{REV}" : "")
28
47
  CLEAN.include ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store']
29
48
  RDOC_OPTS = ['--quiet', '--title', '#{gem_name} documentation',
@@ -58,7 +77,7 @@ end
58
77
 
59
78
  CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
60
79
  PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "\#{RUBYFORGE_PROJECT}/\#{GEM_NAME}"
61
- hoe.remote_rdoc_dir = File.join(PATH.gsub(/^\#{RUBYFORGE_PROJECT}/,''), 'rdoc')
80
+ hoe.remote_rdoc_dir = File.join(PATH.gsub(/^\#{RUBYFORGE_PROJECT}\\/?/,''), 'rdoc')
62
81
 
63
82
  desc 'Generate website files'
64
83
  task :website_generate do
@@ -69,8 +88,7 @@ end
69
88
 
70
89
  desc 'Upload website files to rubyforge'
71
90
  task :website_upload do
72
- config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
73
- host = "\#{config["username"]}@rubyforge.org"
91
+ host = "\#{rubyforge_username}@rubyforge.org"
74
92
  remote_dir = "/var/www/gforge-projects/\#{PATH}/"
75
93
  local_dir = 'website'
76
94
  sh %{rsync -av \#{local_dir}/ \#{host}:\#{remote_dir}}
@@ -82,8 +100,8 @@ task :website => [:website_generate, :website_upload]
82
100
  desc 'Release the website and new gem version'
83
101
  task :deploy => [:check_version, :website, :release] do
84
102
  puts "Remember to create SVN tag:"
85
- puts "svn copy svn+ssh://\#{RUBYFORGE_USERNAME}@rubyforge.org/var/svn/\#{PATH}/trunk " +
86
- "svn+ssh://\#{RUBYFORGE_USERNAME}@rubyforge.org/var/svn/\#{PATH}/tags/REL-\#{VERS} "
103
+ puts "svn copy svn+ssh://\#{rubyforge_username}@rubyforge.org/var/svn/\#{PATH}/trunk " +
104
+ "svn+ssh://\#{rubyforge_username}@rubyforge.org/var/svn/\#{PATH}/tags/REL-\#{VERS} "
87
105
  puts "Suggested comment:"
88
106
  puts "Tagging release \#{CHANGES}"
89
107
  end
data/test/test_svn.rb ADDED
@@ -0,0 +1,13 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+ require 'newgem/svn'
3
+ require 'mocha'
4
+
5
+ class NewgemSvnTest < Test::Unit::TestCase
6
+
7
+ def setup
8
+ end
9
+
10
+ def test_truth
11
+ assert true
12
+ end
13
+ end
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>New Gem Generator</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/newgem"; return false'>
35
35
  Get Version
36
- <a href="http://rubyforge.org/projects/newgem" class="numbers">0.10.1</a>
36
+ <a href="http://rubyforge.org/projects/newgem" class="numbers">0.10.2</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;newgem&#8217;</h1>
39
39
 
@@ -137,17 +137,6 @@ NOW - update wizzo/Rakefile with gem description, etc
137
137
  <p>If you don&#8217;t want a website, remove the <code>website</code> related files from the Manifest.txt.</p>
138
138
 
139
139
 
140
- <h2>Package and test locally</h2>
141
-
142
-
143
- <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>
144
-
145
-
146
- <pre>rake local_deploy</pre>
147
-
148
- <p>This generates the website into your website folder, and locally installs the gem, ready for testing and local use.</p>
149
-
150
-
151
140
  <h3>Change the gems version number</h3>
152
141
 
153
142
 
@@ -171,12 +160,15 @@ NOW - update wizzo/Rakefile with gem description, etc
171
160
  <p>The results show a <em>diff</em> of the two.</p>
172
161
 
173
162
 
174
- <h3>Installation</h3>
163
+ <h2>Package and test locally</h2>
175
164
 
176
165
 
177
- <pre>rake install_gem</pre>
166
+ <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>
167
+
178
168
 
179
- <p>This will repackage your code as a gem and install it as a local gem with the new version number.</p>
169
+ <pre>rake local_deploy</pre>
170
+
171
+ <p>This generates the website html files into your website folder, and locally installs the gem, ready for testing and local use.</p>
180
172
 
181
173
 
182
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>
@@ -206,13 +198,13 @@ NOW - update wizzo/Rakefile with gem description, etc
206
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>
207
199
 
208
200
 
209
- <pre>+++ 0.5.4 14/4/2007
201
+ <pre>== 0.5.4 14/4/2007
210
202
 
211
- + 1 major improvement
212
- + 150% more Wizzos
213
- + 2 bug fixes
214
- + Wizzos are the proper colour
215
- + You only get Wizzos when you ask for them
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
216
208
  </pre>
217
209
 
218
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>
@@ -221,30 +213,46 @@ NOW - update wizzo/Rakefile with gem description, etc
221
213
  <p>The History.txt notes for your first release have already been started for you.</p>
222
214
 
223
215
 
224
- <h3>Generate and upload the website</h3>
216
+ <h3>Release the gem and upload the website and rdocs</h3>
225
217
 
226
218
 
227
- <p>The rake task <code>rake website_upload</code> will upload the website into a RubyForge project.</p>
219
+ <p>Run <code>rake deploy VERSION=X.Y.Z</code> after you&#8217;ve done all these steps. It does the following:</p>
228
220
 
229
221
 
230
- <p>Or use the task <code>rake website</code>, which performs both the generation and the upload.</p>
222
+ <ol>
223
+ <li>Uploads your website to rubyforge</li>
224
+ <li>Uploads your rdocs to rubyforge</li>
225
+ <li>Packages and uploads your gem to RubyForge</li>
226
+ </ol>
231
227
 
232
228
 
233
- <h3>Release the gem</h3>
229
+ <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>
234
230
 
235
231
 
236
- <p>Run <code>rake deploy VERSION=X.Y.Z</code> after you&#8217;ve done all these steps, and your gem will be repackaged and released to RubyForge, <span class="caps">PLUS</span> your website will be released with the latest version number.</p>
232
+ <pre>sudo gem install #gem_name#</pre>
237
233
 
234
+ <p>If your <span class="caps">GEM</span>_NAME and <span class="caps">RUBYFORGE</span>_PROJECT name are the same, then:</p>
238
235
 
239
- <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>
240
236
 
237
+ <ul>
238
+ <li>http://RUBYFORGE_PROJECT.rubyforge.org is your website, and</li>
239
+ <li>http://RUBYFORGE_PROJECT.rubyforge.org/rdoc is your rdocs</li>
240
+ </ul>
241
+
242
+
243
+ <p>If they are different, then:</p>
244
+
245
+
246
+ <ul>
247
+ <li>http://RUBYFORGE_PROJECT.rubyforge.org/GEM_NAME is your website, and</li>
248
+ <li>http://RUBYFORGE_PROJECT.rubyforge.org/GEM_NAME/rdoc is your rdocs</li>
249
+ </ul>
241
250
 
242
- <pre>sudo gem install #gem_name#</pre>
243
251
 
244
252
  <h2>Bonus tasks thanks to Hoe</h2>
245
253
 
246
254
 
247
- <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>
255
+ <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>, <code>check_manifest</code> and <code>publish_docs</code>.</p>
248
256
 
249
257
 
250
258
  <p>See them all with:</p>
@@ -252,7 +260,7 @@ NOW - update wizzo/Rakefile with gem description, etc
252
260
 
253
261
  <pre>rake -T</pre>
254
262
 
255
- <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>
263
+ <p>Remember, the Rakefile is yours to extend as you please with more rake tasks, such as the <code>website</code> tasks which are already added.</p>
256
264
 
257
265
 
258
266
  <p>For more information about each task, see the <a href="http://seattlerb.rubyforge.org/hoe/">Hoe <span class="caps">README</span></a></p>
@@ -290,7 +298,7 @@ other stories and things.</p>
290
298
 
291
299
  <p>Comments are welcome. Send an email to <a href="mailto:drnicwilliams@gmail.com">Dr Nic Williams</a>.</p>
292
300
  <p class="coda">
293
- <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 20th May 2007<br>
301
+ <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 24th May 2007<br>
294
302
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
295
303
  </p>
296
304
  </div>
data/website/index.txt CHANGED
@@ -78,14 +78,6 @@ NOTE: Currently, the initial <code>index.txt</code> file includes my details not
78
78
 
79
79
  If you don't want a website, remove the <code>website</code> related files from the Manifest.txt.
80
80
 
81
- h2. Package and test locally
82
-
83
- 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.
84
-
85
- <pre>rake local_deploy</pre>
86
-
87
- This generates the website into your website folder, and locally installs the gem, ready for testing and local use.
88
-
89
81
  h3. Change the gems version number
90
82
 
91
83
  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.
@@ -103,11 +95,13 @@ Before you package your gem, you can compared the list of files in your gem fold
103
95
 
104
96
  The results show a _diff_ of the two.
105
97
 
106
- h3. Installation
98
+ h2. Package and test locally
99
+
100
+ 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.
107
101
 
108
- <pre>rake install_gem</pre>
102
+ <pre>rake local_deploy</pre>
109
103
 
110
- This will repackage your code as a gem and install it as a local gem with the new version number.
104
+ This generates the website html files into your website folder, and locally installs the gem, ready for testing and local use.
111
105
 
112
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>.
113
107
 
@@ -129,42 +123,51 @@ h3. Document changes in History.txt
129
123
 
130
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:
131
125
 
132
- <pre>+++ 0.5.4 14/4/2007
126
+ <pre>== 0.5.4 14/4/2007
133
127
 
134
- + 1 major improvement
135
- + 150% more Wizzos
136
- + 2 bug fixes
137
- + Wizzos are the proper colour
138
- + You only get Wizzos when you ask for them
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
139
133
  </pre>
140
134
 
141
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.
142
136
 
143
137
  The History.txt notes for your first release have already been started for you.
144
138
 
145
- h3. Generate and upload the website
146
-
147
- The rake task <code>rake website_upload</code> will upload the website into a RubyForge project.
148
139
 
149
- Or use the task <code>rake website</code>, which performs both the generation and the upload.
140
+ h3. Release the gem and upload the website and rdocs
150
141
 
151
- h3. Release the gem
142
+ Run <code>rake deploy VERSION=X.Y.Z</code> after you've done all these steps. It does the following:
152
143
 
153
- Run <code>rake deploy VERSION=X.Y.Z</code> after you've done all these steps, and your gem will be repackaged and released to RubyForge, PLUS your website will be released with the latest version number.
144
+ # Uploads your website to rubyforge
145
+ # Uploads your rdocs to rubyforge
146
+ # Packages and uploads your gem to RubyForge
154
147
 
155
148
  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:
156
149
 
157
150
  <pre>sudo gem install #gem_name#</pre>
158
151
 
152
+ If your GEM_NAME and RUBYFORGE_PROJECT name are the same, then:
153
+
154
+ * http://RUBYFORGE_PROJECT.rubyforge.org is your website, and
155
+ * http://RUBYFORGE_PROJECT.rubyforge.org/rdoc is your rdocs
156
+
157
+ If they are different, then:
158
+
159
+ * http://RUBYFORGE_PROJECT.rubyforge.org/GEM_NAME is your website, and
160
+ * http://RUBYFORGE_PROJECT.rubyforge.org/GEM_NAME/rdoc is your rdocs
161
+
159
162
  h2. Bonus tasks thanks to Hoe
160
163
 
161
- Your gem uses the Hoe gem to provide a dozen or so useful rake tasks for managing your gem, such as <code>release</code>.
164
+ Your gem uses the Hoe gem to provide a dozen or so useful rake tasks for managing your gem, such as <code>release</code>, <code>check_manifest</code> and <code>publish_docs</code>.
162
165
 
163
166
  See them all with:
164
167
 
165
168
  <pre>rake -T</pre>
166
169
 
167
- Remember, the Rakefile is yours to extend as you please with more rake tasks, such as the <code>website</code> tasks already added.
170
+ Remember, the Rakefile is yours to extend as you please with more rake tasks, such as the <code>website</code> tasks which are already added.
168
171
 
169
172
  For more information about each task, see the "Hoe README":http://seattlerb.rubyforge.org/hoe/
170
173
 
@@ -33,7 +33,7 @@
33
33
  <h1>New Gem Generator</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/newgem"; return false'>
35
35
  Get Version
36
- <a href="http://rubyforge.org/projects/newgem" class="numbers">0.10.1</a>
36
+ <a href="http://rubyforge.org/projects/newgem" class="numbers">0.10.2</a>
37
37
  </div>
38
38
  <h1>&#x2192; using &#8216;rubyforge&#8217;</h1>
39
39
 
@@ -1,3 +1,3 @@
1
1
  // Announcement JS file
2
- var version = "0.10.1";
2
+ var version = "0.10.2";
3
3
  MagicAnnouncement.show('compositekeys', version);
data/website/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // Version JS file
2
- var version = "0.10.1";
2
+ var version = "0.10.2";
3
3
 
4
4
  document.write(" - " + version);
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: newgem
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.10.1
7
- date: 2007-05-24 00:00:00 +02:00
6
+ version: 0.10.2
7
+ date: 2007-05-25 00:00:00 +02:00
8
8
  summary: Make your own gems at home
9
9
  require_paths:
10
10
  - lib
@@ -75,6 +75,7 @@ files:
75
75
  test_files:
76
76
  - test/test_helper.rb
77
77
  - test/test_newgem.rb
78
+ - test/test_svn.rb
78
79
  rdoc_options:
79
80
  - --main
80
81
  - README.txt