parsing a configuration file that is expressed in ruby dsl [message #966297] |
Wed, 31 October 2012 18:39  |
Eclipse User |
|
|
|
Hi,
I have an eclipse plugin for the opscode chef configuration management system, which would benefit from being able to interrogate a ruby configuration file "knife.rb", that looks like something like this;
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name "#{ENV['node_name']}"
client_key "#{ENV['client_key']}"
validation_client_name "#{ENV['validation_client_name']}"
validation_key "#{ENV['validation_key']}"
chef_server_url "#{ENV['chef_server_url']}"
cache_type 'BasicFile'
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path ["#{ENV['chef_cookbook_path']}"]
ssl_verify_mode :verify_none
knife[:openstack_access_key_id] = "#{ENV['EC2_ACCESS_KEY']}"
knife[:openstack_secret_access_key] = "#{ENV['EC2_SECRET_KEY']}"
knife[:openstack_api_endpoint] = "#{ENV['EC2_URL']}"
Is there an appropriate method to get a java object representation of that file using dltk?
I have investigated the code from the point of view of the dltk model, but it is not populated with the instance vars;
IScriptProject scriptProject = DLTKCore.create(project);
IProjectFragment fragment : scriptProject#getAllProjectFragments()
IModelElement element : fragment.getChildren()
However if I search for method references, such as "validation_client_name", they are found by the dltk search plugin, so clearly the indexer is finding the method calls, even if the outline view and the DLTKCore.create(project)#getModel() has only a limited view of the code.
Thanks
Tom
|
|
|
|
Powered by
FUDForum. Page generated in 0.05228 seconds