Sha256: 3c764d22843ab01499968ce83e43f5d8c8073cd0207469da30571f97413f4c61
Contents?: true
Size: 1.26 KB
Versions: 1
Compression:
Stored size: 1.26 KB
Contents
# encoding: UTF-8 module Tetra # encapsulates a pom.xml file class Pom def initialize(filename) @doc = Nokogiri::XML( if filename && File.file?(filename) open(filename).read end ) @doc.remove_namespaces! end def group_id @doc.xpath("project/groupId").text || "" end def artifact_id @doc.xpath("project/artifactId").text || "" end def name @doc.xpath("project/name").text || "" end def version @doc.xpath("project/version").text || "" end def description @doc.xpath("project/description").text || "" end def url @doc.xpath("project/url").text || "" end def license_name @doc.xpath("project/licenses/license/name").text || "" end def runtime_dependency_ids @doc.xpath("project/dependencies/dependency[\ not(optional='true') and not(scope='provided') and not(scope='test') and not(scope='system')\ ]").map do |element| [element.xpath("groupId").text, element.xpath("artifactId").text, element.xpath("version").text] end end def scm_connection @doc.xpath("project/scm/connection").text || "" end def scm_url @doc.xpath("project/scm/url").text || "" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tetra-0.49.0 | lib/tetra/pom.rb |