From ce06f8629208bb7e653c81582abd755e87fad432 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 18 Jul 2009 16:26:52 -0700 Subject: [PATCH] ruby version of Version.java --- bindings/ruby/examples/version.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 bindings/ruby/examples/version.rb diff --git a/bindings/ruby/examples/version.rb b/bindings/ruby/examples/version.rb new file mode 100644 index 00000000..fbcccdf1 --- /dev/null +++ b/bindings/ruby/examples/version.rb @@ -0,0 +1,23 @@ +require 'rbsigar' +require 'rbconfig' + +puts "Sigar version......." + Sigar::VERSION +puts "Build date.........." + Sigar::BUILD_DATE +puts "SCM rev............." + Sigar::SCM_REVISION + +sys = Sigar.new.sys_info +puts "OS description......" + sys.description +puts "OS name............." + sys.name +puts "OS arch............." + sys.arch +puts "OS machine.........." + sys.machine +puts "OS version.........." + sys.version +puts "OS patch level......" + sys.patch_level +puts "OS vendor..........." + sys.vendor +puts "OS vendor version..." + sys.vendor_version +if (sys.vendor_code_name != nil) + puts "OS code name........" + sys.vendor_code_name +end + +puts "Ruby version........" + RUBY_VERSION +puts "Ruby build vendor..." + ::Config::CONFIG['build_vendor'] +puts "Ruby archdir........" + ::Config::CONFIG['archdir']