Parent

Files

POM::Commands::Upgrade

Public Class Methods

new() click to toggle source
# File lib/pom/commands/upgrade.rb, line 14
def initialize
  #@project = POM::Project.new(:lookup=>true)
end
run() click to toggle source
# File lib/pom/commands/upgrade.rb, line 9
def self.run
  new.run
end

Public Instance Methods

execute() click to toggle source
# File lib/pom/commands/upgrade.rb, line 48
def execute
  if %{PROFILE PACKAGE REQUIRE}.any?{ |f| File.exist?(f) }
    abort "Use --force to overwrite PACKAGE, PROFILE and/or REQUIRE files." unless $FORCE
  end
  metadir = POM::Metadir.new('.')
  if metadir.store
    profile = metadir.to_profile
    package = metadir.to_package
    require = metadir.to_require
    profile.save!('PROFILE')
    package.save!('PACKAGE')
    require.save!('REQUIRE')
    puts "Please edit the PACKAGE, PROFILE and REQUIRE files."
  else
    $stderr.puts "No meta directory found to convert."
  end
end
parse() click to toggle source
# File lib/pom/commands/upgrade.rb, line 25
def parse
  parser = OptionParser.new do |opt|
    opt.banner = "pom upgrade"

    opt.on("--debug", "run in debug mode") do
      $DEBUG   = true
      $VERBOSE = true
    end

    opt.on("--force", "overwrite pre-existing PACKAGE/PROFILE files") do
      $FORCE = true
    end

    opt.on_tail("--help", "-h", "display this help message") do
      puts opt
      exit
    end
  end

  parser.parse!
end
run() click to toggle source
# File lib/pom/commands/upgrade.rb, line 19
def run
  parse
  execute
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.