Mailinglist Archive: yast-devel (144 mails)

< Previous Next >
[yast-devel] Questions about some YCP Equivalents in ruby

While I was just fixing a bug in current head and had to test the
fix anyway I assumed I could easily modify the ruby code needing
to be adapted anyway to a more ruby-like style.

I replaced the common usage of hash access with default parameter by

YCP Code --> Ruby like replacement
part["fsid"]:0 --> (part["fsid"]||0)
part["type"]:`none --> (part["type"]||:none)
substring(part["device"]:"",0,9) --> part["device"][0,9]

Could someone with more ruby experience tell me if these replacements
are reasonable? My testing showed they work, but I am not sure if there
are pitfalls I am not aware of.

Thomas Fehr
Thomas Fehr, SuSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imend├Ârffer, HRB 16746 (AG N├╝rnberg)
Tel: +49-911-74053-0, Fax: +49-911-74053-482, Email: fehr@xxxxxxx
GPG public key available.
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >