class Maestro::Plugin::RakeTasks::Pom
Public Class Methods
new(pom_path = "pom.xml")
click to toggle source
# File lib/maestro/plugin/rake_tasks/pom.rb, line 8 def initialize(pom_path = "pom.xml") pom = File.open(pom_path) @doc = Nokogiri::XML(pom.read) pom.close end
Public Instance Methods
[](id)
click to toggle source
# File lib/maestro/plugin/rake_tasks/pom.rb, line 14 def [](id) xpath(@doc, id) end
artifact_id()
click to toggle source
# File lib/maestro/plugin/rake_tasks/pom.rb, line 18 def artifact_id @artifact_id ||= self[:artifactId] end
description()
click to toggle source
# File lib/maestro/plugin/rake_tasks/pom.rb, line 26 def description @description ||= self[:description] end
url()
click to toggle source
# File lib/maestro/plugin/rake_tasks/pom.rb, line 30 def url @url ||= self[:url] end
version()
click to toggle source
# File lib/maestro/plugin/rake_tasks/pom.rb, line 22 def version @version ||= self[:version] end
Private Instance Methods
xpath(doc, attribute)
click to toggle source
# File lib/maestro/plugin/rake_tasks/pom.rb, line 36 def xpath(doc, attribute) item = doc.at_xpath("/xmlns:project/xmlns:#{attribute}") item.nil? ? nil : item.text end