Class: U3d::IvyPlaybackEngineUtils

Inherits:
Object
  • Object
show all
Defined in:
lib/u3d/installation.rb

Class Method Summary collapse

Class Method Details

.list_module_configs(playbackengine_parent_path) ⇒ Object



114
115
116
# File 'lib/u3d/installation.rb', line 114

def self.list_module_configs(playbackengine_parent_path)
  Dir.glob("#{playbackengine_parent_path}/PlaybackEngines/*/ivy.xml")
end

.module_name(config_path) ⇒ Object



127
128
129
# File 'lib/u3d/installation.rb', line 127

def self.module_name(config_path)
  node_value(config_path, 'ivy-module/info/@module')
end

.node_value(config_path, node_name) ⇒ Object



118
119
120
121
122
123
124
125
# File 'lib/u3d/installation.rb', line 118

def self.node_value(config_path, node_name)
  require 'rexml/document'
  UI.verbose("reading #{config_path}")
  raise "File not found at #{config_path}" unless File.exist? config_path

  doc = REXML::Document.new(File.read(config_path))
  REXML::XPath.first(doc, node_name).value
end

.unity_version(config_path) ⇒ Object



131
132
133
# File 'lib/u3d/installation.rb', line 131

def self.unity_version(config_path)
  node_value(config_path, 'ivy-module/info/@e:unityVersion')
end