Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

vistahigherlearning / common_cartridge   ruby

Repository URL to install this package:

Version: 1.0.1 

/ lib / common_cartridge / parsers / dependencies.rb

module CommonCartridge
  module Parsers
    class Dependencies
      attr_reader :resource

      def initialize(zipfile, resource)
        @zipfile = zipfile
        @resource = resource
      end

      def parse!(package)
        resource.dependencies.each do |d|
          resource = package.find_resource(d.identifierref)
          resource.files.each do |f|
            Parser.use_file(@zipfile, f.href) do |xml|
              d.contents << CommonCartridge::Elements::Resources::Content.parse(xml)
            end
          end
        end
      end
    end
  end
end