.first and .last

You can obtain the name of the program at hand, and the associated version, like so:

require 'program_information'
x = ProgramInformation.new('ruby-2.5.0')
puts x.first
puts x.last