lib/reap/manager/release.rb in reap-9.2.0 vs lib/reap/manager/release.rb in reap-9.2.1

- old
+ new

@@ -2,77 +2,43 @@ module Reap class Manager - # Update VERSION stamp file. - # - # TODO: Should we also update a lib/version.rb file? + # Release packages (to rubyforge). This generates + # the packages, and then distributes them to the + # file server. - def stamp(options={}) - options = configure_options(options, 'stamp') + def release(options={}) + package(options) + rubyforge_release(options) + end - meta = File.directory?('meta') + # A complete rollout. This will prepare (clean, stamp and package), + # then document, publish and release, tag and announce. It will + # do under direction. You can use the --force option to bypass this + # and have evey action taken automatically. - version = options['version'] || metadata.version || '0.0.0' - status = options['status'] || metadata.status || 'alpha' - - abort "Invalid version -- #{version}" unless /^[0-9]/ =~ version - - file = glob('{,meta/}version{,.txt}', File::FNM_CASEFOLD).first - file = (meta ? 'meta/VERSION' : 'VERSION') unless file - - text = "#{version} #{status} (#{Time.now.strftime('%Y-%m-%d')})" - - if File.exist?(file) - old_text = File.read(file).strip - return if text == old_text - end - - if dryrun? - puts file + ":" - puts text + def rollout(options={}) + if force? + doc, pub, ann, tag = true, true, true, true else - File.open(file, 'w'){|f| f << text} - puts "#{file} updated." + doc = ask("Generate doumentation?", "Yn").downcase =~ /^(|y|yes)$/i + pub = ask("Publish website?", "Yn") =~ /^(|y|yes)$/i + tag = ask("Tag current version?", "Yn") =~ /^(|y|yes)$/i + ann = ask("Announce release?", "Yn") =~ /^(|y|yes)$/i + puts end - # TODO: Stamp .roll if roll file exists. - # should we read current .roll file and use as defaults? - if File.exist?('.roll') - str = [] - str << "name = #{metadata.name}" - str << "version = #{metadata.version}" - str << "status = #{metadata.status}" - str << "date = #{metadata.date}" - str << "default = #{metadata.default}" - str << "libpath = #{metadata.libpath}" - # File.open('.roll','w'){ |f| f << str.join("\n") } - end - end + document(options) if doc + publish(options) if pub - # Clean, stamp if need be and package. - - def prepare(options={}) - clean - make_distclean if compiles? - stamp(options) - package(options) + #package(options) + release(options) + scm_tag(options) if tag + announce(options) if ann end - # Prepare and release to rubyforge. - - def release(options={}) - prepare(options) - rubyforge_release(options) - #announce(options) - puts "\nBe sure to tag and announce this release if need be." - end - - #def release(options) - #name, version = release.name, release.version - #sh "icli rubyforge release --version=#{version}" - #end - end end +