Class: Rake::ShipitTask::Step::RubyForge

Inherits:
Object
  • Object
show all
Defined in:
lib/shipit.rb

Instance Method Summary collapse

Constructor Details

#initialize(step, group_id = RUBYFORGE_PROJECT) ⇒ RubyForge

Returns a new instance of RubyForge.



232
233
234
235
236
237
# File 'lib/shipit.rb', line 232

def initialize(step, group_id=RUBYFORGE_PROJECT)
	@group_id    = group_id
	@description = DESCRIPTION
	@name        = NAME
	@vers        = VERS
end

Instance Method Details

#prepareObject



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/shipit.rb', line 239

def prepare
	require 'rubyforge'
	@rf = RubyForge.new
	@rf.configure {}
	puts "Logging in"
	@rf.
	@c = @rf.userconfig
	@c["preformatted"] = true
	unless @rf.autoconfig["group_ids"].keys.include?(@group_id)
		raise "Unknown group: #{@group_id}"
	end
	unless @rf.autoconfig["package_ids"].keys.include?(@name)
		@rf.create_package(@group_id, @name)
	end
end

#runObject



255
256
257
258
259
260
261
262
263
264
# File 'lib/shipit.rb', line 255

def run
	pkg = "pkg/#{@name}-#{@vers}"
	@files = [
		"#{pkg}.tgz",
		"#{pkg}.gem"
	].compact
	puts "Releasing #{@name} #{@vers}"
	@rf.add_release @group_id, @name, @vers, *@files
	@rf.post_news @group_id, "#{@name} #{@vers} released.", "#{@description}"
end