Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
Psych.libyaml_version
Psych.libyaml_version
ext/psych/psych.c
View on GitHub ↗
static VALUE libyaml_version(VALUE module)
{
int major, minor, patch;
VALUE list[3];
#ifdef PSYCH_USE_LIBFYAML
/* Experimental libfyaml backend: there is no libyaml linked in. Report
* the libfyaml version so callers still receive a 3-element version. */
const struct fy_version *v = fy_version_default();
major = v ? v->major : 0;
minor = v ? v->minor : 0;
patch = 0;
#else
yaml_get_version(&major, &minor, &patch);
#endif
list[0] = INT2NUM(major);
list[1] = INT2NUM(minor);
list[2] = INT2NUM(patch);
return rb_ary_new4((long)3, list);
}
Returns the version of the underlying YAML library as a three-element array. This is libyaml by default. On the experimental libfyaml backend, where libyaml is not linked, it reports the libfyaml version instead.