Skip to content
forked from ruby-ovf/ovfparse

Library for browsing OVF repositories and parsing OVF files.

License

Notifications You must be signed in to change notification settings

6fusion/ovfparse

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project: ovfparse

Website: http://github.com/ruby-ovf/ovfparse
License: GPLv3
Mailing list: ruby-ovf@googlegroups.com
Source Code: git://github.com/ruby-ovf/ovfparse.git

== Requirements
---------------
 - ruby
 - net/ftp
 - net/http
 - net/https
 - nokogiri xml parser (native gem)

== Install
----------
From inside your ovfparse directory:
	$ rake gem
	$ cd pkg
	$ gem install ovfparse[-version]

Or from RubyGems:	
	$ gem install ovfparse 

=== Example1
------------
uri = "file://../test_files"
vmRepo = VmRepository.create(uri) #use factory method to get repo class
puts "\n\n****************************\n"
puts "protocol: " + vmRepo.protocol + "\n"
puts "url: " + vmRepo.url + "\n"
puts "uri: " + vmRepo.uri + "\n"
puts vmRepo.fetch #shows all the packages available at the repo


=== Example2
------------
# use factory method to get correct package type
package = VmPackage.create("http://ambrosia/repo/someOVF.ovf")
# retrieve package
package.fetch 
# spit out package xml
puts package.xml


=== Example3
------------
# use factory method to get correct package type
package = VmPackage.create("http://ambrosia/repo/someOVF.ovf")
# retrieve package
package.fetch 
# spit out specific xml section
puts package.ProductSection

== Useful tips
-----------
'method_missing' is implemented to return xml nodes of the section that is named like the missing method.
For example, if your xml has a section called <FirstName>some data</FirstName> you can simply 
request the object through any of the following methods:

 node = package.first_name()
 node = package.first_name
 node = package.FirstName()
 node = package.FirstName

About

Library for browsing OVF repositories and parsing OVF files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%