Mailinglist Archive: yast-devel (251 mails)

< Previous Next >
Re: [yast-devel] Introduce Y2DIR "lib" directory
Corrupted memory in brain. Directory is of course "lib" like in rails,
not "dir".
sorry for confusion

On Wed, 24 Jul 2013 15:47:31 +0200
Josef Reidinger <jreidinger@xxxxxxx> wrote:

in short, I add in ruby bindings automatic inclusion of "dir"
repositories in Y2 paths to ruby load path. Reason is to have common
place to have pure ruby private ( in sense of not share it with rest
of ruby world ) files. Its intended usage is for various modules,
classes and other stuff that makes your plugins nicer. Include
directory is not good as it contain now translated code and contain
some special magic to make it work in ycp-way.

Namespace is shared between plugins so it make sense to use own
namespace there same way as in "include" directory.

Thanks locilka for initial idea.

Long story:
For code now there is modules, clients and includes. Modules is
intended for modules that share its functionality over component
system. You can import it. Clients is scripts, that can be executed by
Yast2 environment. Include is tricky as it is code snippets that is
internally shared, but it has few limitations - It must be included in
code, it must be ensured that it is included only once, so it is very
limited compared to ruby ( or perl, python ) ability to share code
That leads to idea, that we need directory where you can have
proprietary parts of code that is intended only for given module and
its usage depends on language.

Current status is that it is supported only in ruby-bindings, but plan
is also to add it to perl and python bindings, if there is someone who
is interested in it (e.g. now in perl it must be all in one file or
use some tricky loading or write upstream perl library, that can be

Example demonstration ( not working, just to demonstrate, real example
comes after Milestone 4 ):

client C:

require "services/main_dialog"

data = Services.load
dialog = data
result =

if result == :ok

return result

require "yast"

class Services

attr_reader :data

def initialize

def run


To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >