def get_version(path = Dir.pwd, options = {})
      rootdir = normalized_path(path)
      version = (options[:default]) ? options[:default] : FalkorLib.config[:versioning][:default]
      type    = (options[:type])    ? options[:type]    : FalkorLib.config[:versioning][:type]
      source  = (options[:source])  ? options[:source]  : FalkorLib.config[:versioning][:source][ type ]
      puts "type = '#{type}'"
      case type
      when 'file'
        versionfile = File.join( rootdir, source[:filename] )
        puts "versionfile = '#{versionfile}'"
        version = File.read( versionfile ).chomp if File.exist?( versionfile )
      when 'gem'
        getmethod = source[:getmethod ]
        version = eval( getmethod ) unless (getmethod.nil? || getmethod.empty?)
      when 'puppet_module'
        jsonfile = File.join( rootdir, source[:filename] )
        metadata = JSON.parse( IO.read( jsonfile ) )
        version  = metadata["version"]
      end
      version
    end
def get_version(path = Dir.pwd, options = {})
      rootdir = normalized_path(path)
      version = (options[:default]) ? options[:default] : FalkorLib.config[:versioning][:default]
      type    = (options[:type])    ? options[:type]    : FalkorLib.config[:versioning][:type]
      source  = (options[:source])  ? options[:source]  : FalkorLib.config[:versioning][:source][ type ]
      puts "type = '#{type}'"
      case type
      when 'file'
        versionfile = File.join( rootdir, source[:filename] )
        puts "versionfile = '#{versionfile}'"
        version = File.read( versionfile ).chomp if File.exist?( versionfile )
      when 'gem'
        getmethod = source[:getmethod ]
        version = eval( getmethod ) unless (getmethod.nil? || getmethod.empty?)
      when 'puppet_module'
        jsonfile = File.join( rootdir, source[:filename] )
        metadata = JSON.parse( IO.read( jsonfile ) )
        version  = metadata["version"]
      end
      version
    end
Get the current version
 Supported options:
 * :default [string] default version
 * :type    in ['file','gem','puppet_module'] type of versionning mechanism
 * :source  [Hash] information on the way to retrieve the information