pacificclimate / Rudunits2

GNU General Public License v2.0
26 stars 10 forks source link

add fall back reading units database from package #1

Closed edzer closed 8 years ago

edzer commented 8 years ago

I have udunits2 in /usr/local; if UDUNITS2_XML_PATH is not set, udunits2 loads fine, but finds no units, without giving an error. This PR makes it fall back to the xml database shipped with the R package (which is not up-to-date with udunits 2.2.20, btw).

jameshiebert commented 8 years ago

Hi Edzer, Thanks for sending in this PR and sorry that it's taken me a while to get to it. It's been a busy couple of weeks. I have just a couple of small comments (that I'll put in line), but I think it's pretty close to merge-able.

edzer commented 8 years ago

Hi, this should address your comments, and now even passes R CMD check ;-)

jameshiebert commented 8 years ago

Ahh, I ran into the .onLoad args problem as well. Glad that you caught that. Looks good to me; I'm going to merge it and then just clean up a couple of style things (spaces v tabs, and using explicit {} for one line blocks).