require 'reap/systems/rubyforge' module Reap class Project # Returns Rubyforge system object. def rubyforge(options = nil) options = configure_options(options, 'rubyforge') rubyforge_options = {} rubyforge_options[:dryrun] = dryrun? rubyforge_options[:trace] = trace? rubyforge_options[:project] = options['project'] || metadata.project rubyforge_options[:username] = options['username'] || ENV['RUBYFORGE_USERNAME'] rubyforge_options[:group_id] = options['group'] Rubyforge.new(rubyforge_options) end # Release packages to rubyforge. def rubyforge_release(options) release_options = configure_options(options, 'release') store = 'pkg' version = metadata.version release_options['version'] = version release_options['store'] = store changelog = release_options['changelog'] #|| DEFAULT['release']['changelog'] || DEFAULT['rubyforge']['changelog'] notelog = release_options['notelog'] #|| DEFAULT['release']['notelog'] || DEFAULT['rubyforge']['notelog'] changelog = Dir.glob(changelog.to_s, File::FNM_CASEFOLD).first notelog = Dir.glob(notelog.to_s, File::FNM_CASEFOLD).first release_options['changelog'] = changelog if File.exist?(changelog) release_options['notelog'] = notelog if File.exist?(notelog) files = release_options['files'] || [] if files.empty? files = Dir[File.join(store, '*')].select do |file| /#{version}[.]/ =~ file end release_options['files'] = files #files = Dir.glob(File.join(store,"#{name}-#{version}*")) end # Not going to do dryrun in Rubyforge class b/c it still requires logging in. if dryrun? files.each do |file| puts "release #{file}" end else host = rubyforge(options) host.release(release_options) end end end end