Building source, understanding pkg-config

Building from latest git ruby-gnome2 git source.
Ruby 2.1.2p95
pkg-config (1.1.5)
CentOS 6.5

So I’m finally getting some free time to start tinkering with Ruby
again. On my system, (CentOS 6.5) gio2 won’t build, because I have glib2
2.26, and it looks like gio2 requires glib2 2.28. That’s fine.

However, it passes the “ruby extconf.rb” test, and the fails in

I started looking at what I could do to extconf.rb to make it fail
earlier, which is always nice… I’m not sure the best way to go about
this, but I was trying to do something like

adding the following to gio2/ext/gio2/extconf.rb (maybe add some more
details on error?)

PKGConfig.check_version?(‘glib-2.0’, 2, 28) or exit 1

I did not see anything else doing this in the source. Is there a better
way to do this, or how would this functionality fit in with the standard
that Ruby/Gtk currently has.