On Sep 20, 2007, at 05:46, SpringFlowers AutumnMoon wrote:
> Is there a way to print the Ruby version from within a Ruby program?
>
> I know i can use ruby -v at the command line, but what if it is inside
> of the code and i want to print it out.

patchlevel = " patchlevel #{RUBY_PATCHLEVEL}" if defined?  
RUBY_PATCHLEVEL
version = "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}#{patchlevel}) [# 
{RUBY_PLATFORM}]"

Is the string `ruby -v` prints out.

--
Poor workers blame their tools. Good workers build better tools. The
best workers get their tools to do the work for them. -- Syndicate Wars