Parent

Files

POM::Commands::Show

Attributes

entry[R]
project[R]

Public Class Methods

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

Public Instance Methods

execute() click to toggle source
# File lib/pom/commands/show.rb, line 45
def execute
  if entry
    puts project.metadata.__send__(entry)
    #if project.package.respond_to?(entry)
    #  puts project.package.__send__(entry)
    #else
    #  puts project.profile.__send__(entry)
    #end
  else
    vars = project.package.to_h.keys + project.profile.to_h.keys
    puts vars.sort.join(' ')
  end
end
parse() click to toggle source
# File lib/pom/commands/show.rb, line 24
def parse
  parser = OptionParser.new do |opt|
    opt.banner = "pom show [ENTRY]"

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

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

  parser.parse!

  @entry = ARGV.last
end
run() click to toggle source
# File lib/pom/commands/show.rb, line 18
def run
  parse
  execute
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.