#
# ruby_binary.rb
#
# This fact provides information about where Ruby binary is located on
# the underlying file system ...
#

require 'facter'

if Facter.value(:kernel) == 'Linux'
  #
  # We add our fact as single word "rubybinary" instead of "ruby_binary"
  # purely to maintain compliance with other Ruby-related facts ...
  #
  Facter.add('rubybinary') do
    confine :kernel => :linux
    setcode do
      config = Config::CONFIG
      File.join(config['bindir'], config['ruby_install_name'])
    end
  end
end

# vim: set ts=2 sw=2 et :
# encoding: utf-8

Add Facter fact that exposes location of the Ruby binary on the system.
Add Facter fact that exposes location of the Ruby binary on the system.

This fact will expose location of the Ruby interpreter on the underlying
operating system.  This might be useful when Ruby binary is located
in a different place than "/usr/bin/ruby" for whatever reason ...

Signed-off-by: Krzysztof Wilczynski <9bf091559fc98493329f7d619638c79e91ccf029@linux.com>
