linguistics 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/rake/hg.rb CHANGED
@@ -22,6 +22,8 @@ unless defined?( HG_DOTDIR )
22
22
  ###
23
23
 
24
24
  module MercurialHelpers
25
+ require './helpers.rb' unless defined?( RakefileHelpers )
26
+ include RakefileHelpers
25
27
 
26
28
  ###############
27
29
  module_function
@@ -81,9 +83,18 @@ unless defined?( HG_DOTDIR )
81
83
  return paths
82
84
  end
83
85
 
86
+ ### Return the list of files which are not of status 'clean'
87
+ def get_uncommitted_files
88
+ list = read_command_output( 'hg', 'status', '-n', '--color', 'never' )
89
+ list = list.split( /\n/ )
90
+
91
+ trace "Changed files: %p" % [ list ]
92
+ return list
93
+ end
94
+
84
95
  ### Return the list of files which are of status 'unknown'
85
96
  def get_unknown_files
86
- list = read_command_output( 'hg', 'status', '-un', '--no-color' )
97
+ list = read_command_output( 'hg', 'status', '-un', '--color', 'never' )
87
98
  list = list.split( /\n/ )
88
99
 
89
100
  trace "New files: %p" % [ list ]
@@ -147,11 +158,21 @@ unless defined?( HG_DOTDIR )
147
158
 
148
159
  desc "Prepare for a new release"
149
160
  task :prep_release do
161
+ uncommitted_files = get_uncommitted_files()
162
+ unless uncommitted_files.empty?
163
+ log "Uncommitted files:\n",
164
+ *uncommitted_files.map {|fn| " #{fn}\n" }
165
+ ask_for_confirmation( "\nRelease anyway?", true ) do
166
+ log "Okay, releasing with uncommitted versions."
167
+ end
168
+ end
169
+
150
170
  tags = get_tags()
151
171
  rev = get_current_rev()
172
+ pkg_version_tag = "v#{PKG_VERSION}"
152
173
 
153
174
  # Look for a tag for the current release version, and if it exists abort
154
- if tags.include?( PKG_VERSION )
175
+ if tags.include?( pkg_version_tag )
155
176
  error "Version #{PKG_VERSION} already has a tag. Did you mean " +
156
177
  "to increment the version in #{VERSION_FILE}?"
157
178
  fail
@@ -162,8 +183,8 @@ unless defined?( HG_DOTDIR )
162
183
  run 'hg', 'sign'
163
184
 
164
185
  # Tag the current rev
165
- log "Tagging rev #{rev} as #{PKG_VERSION}"
166
- run 'hg', 'tag', PKG_VERSION
186
+ log "Tagging rev #{rev} as #{pkg_version_tag}"
187
+ run 'hg', 'tag', pkg_version_tag
167
188
 
168
189
  # Offer to push
169
190
  Rake::Task['hg:push'].invoke
@@ -208,8 +229,39 @@ unless defined?( HG_DOTDIR )
208
229
  task :add => :newfiles
209
230
 
210
231
 
232
+ desc "Pull and update from the default repo"
233
+ task :pull do
234
+ paths = get_repo_paths()
235
+ if origin_url = paths['default']
236
+ ask_for_confirmation( "Pull and update from '#{origin_url}'?", false ) do
237
+ Rake::Task['hg:pull_without_confirmation'].invoke
238
+ end
239
+ else
240
+ trace "Skipping pull: No 'default' path."
241
+ end
242
+ end
243
+
244
+
245
+ desc "Pull and update without confirmation"
246
+ task :pull_without_confirmation do
247
+ run 'hg', 'pull', '-u'
248
+ end
249
+
250
+
251
+ desc "Update to tip"
252
+ task :update do
253
+ run 'hg', 'update'
254
+ end
255
+
256
+
257
+ desc "Clobber all changes (hg up -C)"
258
+ task :update_and_clobber do
259
+ run 'hg', 'update', '-C'
260
+ end
261
+
262
+
211
263
  desc "Check the current code in if tests pass"
212
- task :checkin => ['hg:newfiles', 'test', COMMIT_MSG_FILE] do
264
+ task :checkin => ['hg:pull', 'hg:newfiles', 'test', COMMIT_MSG_FILE] do
213
265
  targets = get_target_args()
214
266
  $stderr.puts '---', File.read( COMMIT_MSG_FILE ), '---'
215
267
  ask_for_confirmation( "Continue with checkin?" ) do
@@ -228,13 +280,18 @@ unless defined?( HG_DOTDIR )
228
280
  paths = get_repo_paths()
229
281
  if origin_url = paths['default']
230
282
  ask_for_confirmation( "Push to '#{origin_url}'?", false ) do
231
- run 'hg', 'push'
283
+ Rake::Task['hg:push_without_confirmation'].invoke
232
284
  end
233
285
  else
234
286
  trace "Skipping push: No 'default' path."
235
287
  end
236
288
  end
237
289
 
290
+ desc "Push to the default repo without confirmation"
291
+ task :push_without_confirmation do
292
+ run 'hg', 'push'
293
+ end
294
+
238
295
  end
239
296
 
240
297
  if HG_DOTDIR.exist?
data/rake/manual.rb CHANGED
@@ -147,9 +147,14 @@ module Manual
147
147
 
148
148
  layout = self.config['layout'].sub( /\.page$/, '' )
149
149
  templatepath = @layouts_dir + "#{layout}.page"
150
- template = ERB.new( templatepath.read )
151
- page = self
150
+ template = nil
151
+ if Object.const_defined?( :Encoding )
152
+ template = ERB.new( templatepath.read(:encoding => 'UTF-8') )
153
+ else
154
+ template = ERB.new( templatepath.read )
155
+ end
152
156
 
157
+ page = self
153
158
  html = template.result( binding() )
154
159
 
155
160
  # Use Tidy to clean up the html if 'cleanup' is turned on, but remove the Tidy
@@ -565,7 +570,7 @@ module Manual
565
570
  manual_pages = setup_page_conversion_tasks( sourcedir, outputdir, catalog )
566
571
 
567
572
  desc "Build the manual"
568
- task :build => [ :rdoc, :copy_resources, :copy_apidocs, :generate_pages ]
573
+ task :build => [ :apidocs, :copy_resources, :copy_apidocs, :generate_pages ]
569
574
 
570
575
  task :clobber do
571
576
  RakeFileUtils.verbose( $verbose ) do
@@ -686,8 +691,8 @@ module Manual
686
691
  end
687
692
 
688
693
  desc "Copy API documentation to the manual output directory"
689
- task :copy_apidocs => :rdoc do
690
- cp_r( RDOCDIR, outputdir )
694
+ task :copy_apidocs => :apidocs do
695
+ cp_r( API_DOCSDIR, outputdir )
691
696
  end
692
697
 
693
698
  # Now group all the resource file tasks into a containing task
@@ -713,7 +718,7 @@ if MANUALDIR.exist?
713
718
 
714
719
  Manual::GenTask.new do |manual|
715
720
  manual.metadata.version = PKG_VERSION
716
- manual.metadata.api_dir = RDOCDIR
721
+ manual.metadata.api_dir = API_DOCSDIR
717
722
  manual.output_dir = MANUALOUTPUTDIR
718
723
  manual.base_dir = MANUALDIR
719
724
  manual.source_dir = 'src'
data/rake/packaging.rb CHANGED
@@ -1,17 +1,27 @@
1
- #
2
- # Packaging Rake Tasks
3
-
4
- #
1
+ #####################################################################
2
+ ### P A C K A G I N G T A S K S
3
+ #####################################################################
5
4
 
6
5
  require 'rbconfig'
7
6
  require 'pathname'
8
- require 'rake/packagetask'
9
- require 'rake/gempackagetask'
7
+ require 'rubygems/package_task'
10
8
 
11
- require Pathname( __FILE__ ).dirname.expand_path + 'hg.rb'
12
9
 
13
10
  include Config
14
11
 
12
+ ### Task: prerelease
13
+ desc "Append the package build number to package versions"
14
+ task :prerelease do
15
+ GEMSPEC.version.version << "pre#{PKG_BUILD}"
16
+ Rake::Task[:gem].clear
17
+
18
+ Gem::PackageTask.new( GEMSPEC ) do |pkg|
19
+ pkg.need_zip = true
20
+ pkg.need_tar = true
21
+ end
22
+ end
23
+
24
+
15
25
  ### Task: gem
16
26
  ### Task: package
17
27
  Rake::PackageTask.new( PKG_NAME, PKG_VERSION ) do |task|
@@ -24,34 +34,9 @@ end
24
34
  task :package => [:gem]
25
35
 
26
36
 
27
- ### Task: gem
28
- gempath = PKGDIR + GEM_FILE_NAME
29
-
30
- desc "Build a RubyGem package (#{GEM_FILE_NAME})"
31
- task :gem => gempath.to_s
32
- file gempath.to_s => [PKGDIR.to_s] + GEMSPEC.files do
33
- when_writing( "Creating GEM" ) do
34
- Gem::Builder.new( GEMSPEC ).build
35
- verbose( true ) do
36
- mv GEM_FILE_NAME, gempath
37
- end
38
- end
39
- end
40
-
41
-
42
- prerelease_gempath = PKGDIR + SNAPSHOT_GEM_NAME
43
-
44
- desc "Build a pre-release RubyGem package"
45
- task :prerelease_gem => prerelease_gempath.to_s
46
- file prerelease_gempath.to_s => [PKGDIR.to_s] + GEMSPEC.files do
47
- when_writing( "Creating prerelease GEM" ) do
48
- gemspec = GEMSPEC.clone
49
- gemspec.version = Gem::Version.create( "%s.%s" % [GEMSPEC.version, PKG_BUILD] )
50
- Gem::Builder.new( gemspec ).build
51
- verbose( true ) do
52
- mv SNAPSHOT_GEM_NAME, prerelease_gempath
53
- end
54
- end
37
+ Gem::PackageTask.new( GEMSPEC ) do |pkg|
38
+ pkg.need_zip = true
39
+ pkg.need_tar = true
55
40
  end
56
41
 
57
42
 
data/rake/publishing.rb CHANGED
@@ -5,6 +5,8 @@
5
5
  RELEASE_NOTES_FILE = 'release.notes'
6
6
  RELEASE_ANNOUNCE_FILE = 'release.ann'
7
7
 
8
+ GEM_PUBHOST = '' unless defined?( GEM_PUBHOST )
9
+
8
10
  require 'net/smtp'
9
11
  require 'net/protocol'
10
12
  require 'openssl'
@@ -13,6 +15,7 @@ $publish_privately = false
13
15
 
14
16
  ### Add SSL to Net::SMTP
15
17
  class Net::SMTP
18
+
16
19
  def ssl_start( helo='localhost.localdomain', user=nil, secret=nil, authtype=nil )
17
20
  if block_given?
18
21
  begin
@@ -34,7 +37,13 @@ class Net::SMTP
34
37
 
35
38
  def do_ssl_start( helodomain, user, secret, authtype )
36
39
  raise IOError, 'SMTP session already started' if @started
37
- check_auth_args user, secret if user or secret
40
+ if user or secret
41
+ if self.method( :check_auth_args ).arity == 3
42
+ check_auth_args( user, secret, authtype )
43
+ else
44
+ check_auth_args( user, secret )
45
+ end
46
+ end
38
47
 
39
48
  # Open the connection
40
49
  @debug_output << "opening connection to #{@address}...\n" if @debug_output
@@ -85,9 +94,11 @@ begin
85
94
  require 'tmail'
86
95
  require 'net/smtp'
87
96
  require 'etc'
88
- require 'rubyforge'
89
97
  require 'socket'
90
98
  require 'text/format'
99
+ require 'rubygems/gemcutter_utilities'
100
+
101
+ include Gem::GemcutterUtilities
91
102
 
92
103
  ### Generate a valid RFC822 message-id
93
104
  def gen_message_id
@@ -99,6 +110,48 @@ begin
99
110
  end
100
111
 
101
112
 
113
+ ### Fetch the rubygems API token if it hasn't been already.
114
+ def sign_in_to_rubygems
115
+ return if Gem.configuration.rubygems_api_key
116
+
117
+ log "Enter your RubyGems.org credentials."
118
+
119
+ email = prompt " Email: "
120
+ password = prompt_for_password( "Password: " )
121
+
122
+ response = rubygems_api_request( :get, "api/v1/api_key" ) do |request|
123
+ request.basic_auth( email, password )
124
+ end
125
+
126
+ with_response( response ) do |resp|
127
+ log "Signed in."
128
+ Gem.configuration.rubygems_api_key = resp.body
129
+ end
130
+ end
131
+
132
+
133
+ ### Push the gem at the specified +path+ to the rubygems server at +gemhost+.
134
+ def push_gem( path, gemhost )
135
+ ENV['RUBYGEMS_HOST'] = "http://#{gemhost}"
136
+
137
+ sign_in_to_rubygems()
138
+
139
+ response = rubygems_api_request( :post, "api/v1/gems" ) do |request|
140
+ request.body = Gem.read_binary( path )
141
+ request.add_field "Content-Length", request.body.size
142
+ request.add_field "Content-Type", "application/octet-stream"
143
+ request.add_field "Authorization", Gem.configuration.rubygems_api_key
144
+ end
145
+
146
+ case response
147
+ when Net::HTTPSuccess
148
+ log( response.body )
149
+ else
150
+ fail( response.body )
151
+ end
152
+ end
153
+
154
+
102
155
  namespace :release do
103
156
  task :default => [ :prep_release, :upload, :publish, :announce ]
104
157
 
@@ -128,168 +181,137 @@ begin
128
181
  end
129
182
  CLOBBER.include( RELEASE_NOTES_FILE )
130
183
 
184
+ # Only define upload tasks if there's an upload host
185
+ if PROJECT_HOST.empty?
186
+ task :no_upload_host do
187
+ log "Skipping upload: no upload host."
188
+ end
189
+ task :upload => :no_upload_host
190
+ task :upload_docs => :no_upload_host
191
+ task :upload_packages => :no_upload_host
192
+ else
193
+ desc "Upload project documentation and packages to #{PROJECT_HOST}"
194
+ task :upload => [ :upload_docs, :upload_packages ]
195
+ task :project => :upload # the old name
196
+
197
+ desc "Publish the project docs to #{PROJECT_HOST}"
198
+ task :upload_docs => [ :apidocs ] do
199
+ when_writing( "Publishing docs to #{PROJECT_SCPDOCURL}" ) do
200
+ log "Uploading API documentation to %s:%s" % [ PROJECT_HOST, PROJECT_DOCDIR ]
201
+ run 'ssh', PROJECT_HOST, "rm -rf #{PROJECT_DOCDIR}"
202
+ run 'scp', '-qCr', API_DOCSDIR, PROJECT_SCPDOCURL
203
+ end
204
+ end
131
205
 
132
- desc "Upload project documentation and packages to #{PROJECT_HOST}"
133
- task :upload => [ :upload_docs, :upload_packages ]
134
- task :project => :upload # the old name
135
-
136
- desc "Publish the project docs to #{PROJECT_HOST}"
137
- task :upload_docs => [ :rdoc ] do
138
- when_writing( "Publishing docs to #{PROJECT_SCPDOCURL}" ) do
139
- log "Uploading API documentation to %s:%s" % [ PROJECT_HOST, PROJECT_DOCDIR ]
140
- run 'ssh', PROJECT_HOST, "rm -rf #{PROJECT_DOCDIR}"
141
- run 'scp', '-qCr', RDOCDIR, PROJECT_SCPDOCURL
206
+ desc "Publish the project packages to #{PROJECT_HOST}"
207
+ task :upload_packages => [ :package ] do
208
+ when_writing( "Uploading packages") do
209
+ pkgs = Pathname.glob( PKGDIR + "#{PKG_FILE_NAME}.{gem,tar.gz,tar.bz2,zip}" )
210
+ log "Uploading %d packages to #{PROJECT_SCPPUBURL}" % [ pkgs.length ]
211
+ pkgs.each do |pkgfile|
212
+ run 'scp', '-qC', pkgfile, PROJECT_SCPPUBURL
213
+ end
214
+ end
142
215
  end
143
216
  end
144
217
 
145
- desc "Publish the project packages to #{PROJECT_HOST}"
146
- task :upload_packages => [ :package ] do
147
- when_writing( "Uploading packages") do
148
- pkgs = Pathname.glob( PKGDIR + "#{PKG_FILE_NAME}.{gem,tar.gz,tar.bz2,zip}" )
149
- log "Uploading %d packages to #{PROJECT_SCPPUBURL}" % [ pkgs.length ]
150
- pkgs.each do |pkgfile|
151
- run 'scp', '-qC', pkgfile, PROJECT_SCPPUBURL
152
- end
153
- end
154
- end
218
+ # Only define the announcement tasks if there are addresses to announce to
219
+ if RELEASE_ANNOUNCE_ADDRESSES.empty?
220
+ task :no_announce_addresses do
221
+ log "Skipping announcement: no announce addresses"
222
+ end
223
+ task :announce => :no_announce_addresses
155
224
 
225
+ else
226
+ file RELEASE_ANNOUNCE_FILE => [RELEASE_NOTES_FILE] do |task|
227
+ relnotes = File.read( RELEASE_NOTES_FILE )
228
+ announce_body = %{
156
229
 
157
- file RELEASE_ANNOUNCE_FILE => [RELEASE_NOTES_FILE] do |task|
158
- relnotes = File.read( RELEASE_NOTES_FILE )
159
- announce_body = %{
230
+ Version #{PKG_VERSION} of #{PKG_NAME} has been released.
160
231
 
161
- Version #{PKG_VERSION} of #{PKG_NAME} has been released.
232
+ #{Text::Format.new(:first_indent => 0).format_one_paragraph(GEMSPEC.description)}
162
233
 
163
- #{Text::Format.new(:first_indent => 0).format_one_paragraph(GEMSPEC.description)}
234
+ == Project Page
164
235
 
165
- == Project Page
236
+ #{GEMSPEC.homepage}
166
237
 
167
- #{GEMSPEC.homepage}
238
+ == Installation
168
239
 
169
- == Installation
240
+ $ sudo gem install #{GEMSPEC.name}
170
241
 
171
- Via gems:
242
+ == Changes
243
+ #{relnotes}
244
+ }.gsub( /^\t+/, '' )
172
245
 
173
- $ sudo gem install #{GEMSPEC.name}
246
+ File.open( task.name, File::WRONLY|File::TRUNC|File::CREAT ) do |fh|
247
+ fh.print( announce_body )
248
+ end
174
249
 
175
- or from source:
250
+ edit task.name
251
+ end
252
+ CLOBBER.include( RELEASE_ANNOUNCE_FILE )
176
253
 
177
- $ wget http://deveiate.org/code/#{PKG_FILE_NAME}.tar.gz
178
- $ tar -xzvf #{PKG_FILE_NAME}.tar.gz
179
- $ cd #{PKG_FILE_NAME}
180
- $ sudo rake install
181
254
 
182
- == Changes
183
- #{relnotes}
184
- }.gsub( /^\t+/, '' )
255
+ desc 'Send out a release announcement'
256
+ task :announce => [RELEASE_ANNOUNCE_FILE] do
257
+ email = TMail::Mail.new
185
258
 
186
- File.open( task.name, File::WRONLY|File::TRUNC|File::CREAT ) do |fh|
187
- fh.print( announce_body )
188
- end
259
+ if $publish_privately || RELEASE_ANNOUNCE_ADDRESSES.empty?
260
+ trace "Sending private announce mail"
261
+ email.to = 'rubymage@gmail.com'
262
+ else
263
+ trace "Sending public announce mail"
264
+ email.to = RELEASE_ANNOUNCE_ADDRESSES
265
+ email.bcc = 'rubymage@gmail.com'
266
+ end
189
267
 
190
- edit task.name
191
- end
192
- CLOBBER.include( RELEASE_ANNOUNCE_FILE )
268
+ from = prompt_with_default( "Send announcement as:",
269
+ 'Michael Granger <ged@FaerieMUD.org>' ) or fail
193
270
 
271
+ email.from = from
272
+ email.subject = "[ANN] #{PKG_NAME} #{PKG_VERSION}"
273
+ email.body = File.read( RELEASE_ANNOUNCE_FILE )
274
+ email.date = Time.new
194
275
 
195
- desc 'Send out a release announcement'
196
- task :announce => [RELEASE_ANNOUNCE_FILE] do
197
- email = TMail::Mail.new
198
- if $publish_privately
199
- trace "Sending private announce mail"
200
- email.to = 'rubymage@gmail.com'
201
- else
202
- trace "Sending public announce mail"
203
- email.to = 'Ruby-Talk List <ruby-talk@ruby-lang.org>'
204
- email.bcc = 'rubymage@gmail.com'
205
- end
206
- email.from = GEMSPEC.email
207
- email.subject = "[ANN] #{PKG_NAME} #{PKG_VERSION}"
208
- email.body = File.read( RELEASE_ANNOUNCE_FILE )
209
- email.date = Time.new
210
-
211
- email.message_id = gen_message_id()
212
-
213
- log "About to send the following email:"
214
- puts '---',
215
- email.to_s,
216
- '---'
217
-
218
- ask_for_confirmation( "Will send via #{SMTP_HOST}." ) do
219
- pwent = Etc.getpwuid( Process.euid )
220
- curuser = pwent ? pwent.name : 'unknown'
221
- username = prompt_with_default( "SMTP user", curuser )
222
- password = prompt_for_password()
223
-
224
- trace "Creating SMTP connection to #{SMTP_HOST}:#{SMTP_PORT}"
225
- smtp = Net::SMTP.new( SMTP_HOST, SMTP_PORT )
226
- smtp.set_debug_output( $stdout )
227
- smtp.esmtp = true
228
-
229
- trace "connecting..."
230
- smtp.ssl_start( Socket.gethostname, username, password, :plain ) do |smtp|
231
- trace "sending message..."
232
- smtp.send_message( email.to_s, email.from, email.to )
233
- end
234
- trace "done."
235
- end
236
- end
276
+ email.message_id = gen_message_id()
237
277
 
278
+ log "About to send the following email:"
279
+ puts '---',
280
+ email.to_s,
281
+ '---'
238
282
 
239
- desc 'Publish the new release to RubyForge'
240
- task :publish => [:clean, :package, :notes] do |task|
241
- project = GEMSPEC.rubyforge_project
283
+ ask_for_confirmation( "Will send via #{SMTP_HOST}." ) do
284
+ pwent = Etc.getpwuid( Process.euid )
285
+ curuser = pwent ? pwent.name : 'unknown'
286
+ username = prompt_with_default( "SMTP user", curuser )
287
+ password = prompt_for_password()
242
288
 
243
- if $publish_privately
244
- log "Skipping push of release files to RubyForge"
245
- else
246
- rf = RubyForge.new
247
- log "Loading RubyForge config"
248
- rf.configure
249
-
250
- group_id = rf.autoconfig['group_ids'][RUBYFORGE_GROUP] or
251
- fail "Your configuration doesn't have a group id for '#{RUBYFORGE_GROUP}'"
252
-
253
- # If this project doesn't yet exist, create it
254
- unless rf.autoconfig['package_ids'].key?( project )
255
- ask_for_confirmation( "Package '#{project}' doesn't exist on RubyForge. Create it?" ) do
256
- log "Creating new package '#{project}'"
257
- rf.create_package( group_id, project )
289
+ trace "Creating SMTP connection to #{SMTP_HOST}:#{SMTP_PORT}"
290
+ smtp = Net::SMTP.new( SMTP_HOST, SMTP_PORT )
291
+ smtp.set_debug_output( $stdout )
292
+ smtp.esmtp = true
293
+
294
+ trace "connecting..."
295
+ smtp.ssl_start( Socket.gethostname, username, password, :plain ) do |smtp|
296
+ trace "sending message..."
297
+ smtp.send_message( email.to_s, email.from, email.to )
258
298
  end
299
+ trace "done."
259
300
  end
301
+ end
302
+ end
260
303
 
261
- package_id = rf.autoconfig['package_ids'][ project ]
262
-
263
- # Make sure this release doesn't already exist
264
- releases = rf.autoconfig['release_ids']
265
- if releases.key?( GEMSPEC.name ) && releases[ GEMSPEC.name ].key?( PKG_VERSION )
266
- log "Rubyforge seems to already have #{ PKG_FILE_NAME }"
267
- else
268
- config = rf.userconfig or
269
- fail "You apparently haven't set up your RubyForge credentials on this machine."
270
- config['release_notes'] = GEMSPEC.description
271
- config['release_changes'] = File.read( RELEASE_NOTES_FILE )
272
-
273
- files = FileList[ PKGDIR + GEM_FILE_NAME ]
274
- files.include PKGDIR + "#{PKG_FILE_NAME}.tar.gz"
275
- files.include PKGDIR + "#{PKG_FILE_NAME}.tar.bz2"
276
- files.include PKGDIR + "#{PKG_FILE_NAME}.zip"
277
-
278
- log "Releasing #{PKG_FILE_NAME}"
279
- when_writing do
280
- log "Publishing to RubyForge: \n",
281
- "\tproject: #{RUBYFORGE_GROUP}\n",
282
- "\tpackage: #{PKG_NAME.downcase}\n",
283
- "\tpackage version: #{PKG_VERSION}\n",
284
- "\tfiles: " + files.collect {|f| f.to_s }.join(', ') + "\n"
285
-
286
- ask_for_confirmation( "Publish to RubyForge?" ) do
287
- log 'Logging in...'
288
- rf.login
289
- log "Adding the new release to the '#{project}' project"
290
- rf.add_release( group_id, package_id, PKG_VERSION, *files )
291
- end
292
- end
304
+ if GEM_PUBHOST.empty?
305
+ task :no_gem_host do
306
+ log "Skipping gem push: no gem publication host."
307
+ end
308
+ task :publish => :no_gem_host
309
+ else
310
+ desc 'Publish the new gem to #{GEM_PUBHOST}'
311
+ task :publish => [:clean, :gem, :notes] do |task|
312
+ ask_for_confirmation( "Publish #{GEM_FILE_NAME} to #{GEM_PUBHOST}?", false ) do
313
+ gempath = PKGDIR + GEM_FILE_NAME
314
+ push_gem( gempath, GEM_PUBHOST )
293
315
  end
294
316
  end
295
317
  end
@@ -306,6 +328,7 @@ rescue LoadError => err
306
328
  end
307
329
 
308
330
  task :release => :no_release_tasks
331
+ task "release:rerelease" => :no_release_tasks
309
332
  task "release:announce" => :no_release_tasks
310
333
  task "release:publish" => :no_release_tasks
311
334
  task "release:notes" => :no_release_tasks