# How to get tomcat_version to display the whole version of tomcat in script instead of just the first number

With the input provided to me from this site i was able to modify a script that match what i needed for my tomcat_version fact. The only problem is that it does not display the whole version of the tomcat file just the one number like tomcat 6, 7, 9 instead of 6.2.1 for example. This wouldn't be a problem if it wasn't for another class reference this file that being the case i need a way to display the full version of tomcat. Avoiding using the version.bat file since it has cause us some issues and we are trying to move away from it .

Facter.add(:tomcat_version) do
confine :kernel => 'windows'

setcode do
if version = Dir.glob('C:\guidewire\bin\tomcat?.exe').sort().last()
version = version.match(/\d+/) if version.is_a?(String)
else
version = 'Tomcat not installed'
end
end
end


example of what its shows right now

edit retag close merge delete