# File lib/pom/metadata.rb, line 16 def initialize(root, opts={}) root = Pathname.new(root) @profile = nil @metadir = nil @package = Package.new(root, opts) #if Package.find(root) @profile = Profile.new(root, name) #if Profile.find(root) # DEPRECATE @metadir = Metadir.new(root) if Metadir.find(root) # TODO: Add @profile.resources to lookup ? @sources = [@package, @profile, @metadir].compact end
Backup all metadata resources to `.cache/pom` location.
# File lib/pom/metadata.rb, line 71 def backup! sources.each do |source| source.backup! end end
Load path(s) of the project, which are provided by the package.
# File lib/pom/metadata.rb, line 59 def loadpath @package.loadpath end
Access to meta directory entries. For backward compatability, maybe deprecated in future.
# File lib/pom/metadata.rb, line 44 def metadir @metadir end
Delegate access to metdata sources.
# File lib/pom/metadata.rb, line 78 def method_missing(sym, *args, &blk) vals = [] sources.each do |source| if source.respond_to?(sym) val = source.__send__(sym, *args, &blk) if val return val unless $DEBUG vals << val end end end # warn "multiple values that are not equal" ? vals.first end
Name of the project, which is provided by the package.
# File lib/pom/metadata.rb, line 49 def name @package.name end
The PACKAGE provides access to current package information.
# File lib/pom/metadata.rb, line 33 def package @package end
The PROFILE provides general information about the project.
# File lib/pom/metadata.rb, line 38 def profile @profile end
Save all metadata resources, i.e. package and profile.
# File lib/pom/metadata.rb, line 64 def save! sources.each do |source| source.save! end end
Provide a summary text of project’s metadata.
# File lib/pom/metadata.rb, line 94 def to_s s = [] s << "#{title} v#{version}" s << "" s << "#{summary}" s << "" s << "contact : #{contact}" s << "homepage : #{homepage}" s << "repository : #{repository}" s << "authors : #{authors.join(',')}" s << "package : #{name}-#{version}" s << "requires : #{requires.join(',')}" s.join("\n") end
Generated with the Darkfish Rdoc Generator 2.