Mailinglist Archive: yast-devel (66 mails)

< Previous Next >
Re: [yast-devel] Ruby code in SCR
On 06/20/2013 03:14 PM, Klaus Kaempf wrote:
This seems to add lots of complexity (and responsability) to
individual modules.

Instead of Network.write(complex_map)

I'd rather see something like

# global 'chroot' call, done by installer

That's how it works now.


module Network

# SCR init still needed if Network is run stand-alone
# it's a no-op if SCR.init was called before
SCR.write ...

Actually, if no SCR.init (different call name in use currently) SCR automatically uses "/" (no chroot).

It looks good except one thing: It doesn't solve running some Ruby code defined in the Yast library. I still have to create a special agent and call the agent.

What I wanted to solve was: There is a Yast library with some business logic and nice API. In this module, I want to use another Ruby libraries, such as File/Dir to read/modify the system. Right now, I have to use SCR for accessing the system.

Totally hackish solution for this:
--- cut ---
code = '$some_fancy_code_in_ruby'

--- cut ---

Agent .ruby would then eval() the code.

Sounds horrible but it would do the trick :) I'm not sure about proper testing though.



Lukas Ocilka, Cloud & Systems Management Department
SUSE LINUX s.r.o., Praha
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups