Skip to content

Instantly share code, notes, and snippets.

@mvidner
Last active December 17, 2015 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvidner/5582498 to your computer and use it in GitHub Desktop.
Save mvidner/5582498 to your computer and use it in GitHub Desktop.
// if Modelist is imported here the test passes
{
// import "Modelist";
import "Intermediate";
// Modelist::Hello();
Intermediate::Hello();
}
{
module "Intermediate";
import "Modelist";
global void Hello() {
Modelist::Hello();
}
}
{
module "Modelist";
string greeting = nil;
global void Hello() {
y2milestone("%1", greeting);
}
// Modelist - Konstruktor
global void Modelist() {
greeting = "Zdravstvuj!";
}
}
#!/bin/bash
# test the constant lookup issue
# https://github.com/yast/yast-ruby-bindings/issues/17
# run it from the ycp killer directory so that bundle exec finds y2r
DIR=$(dirname $0)
title() {
figlet $1 2> /dev/null && return
echo $1
echo ====
echo
}
y2r() {
bundle exec y2r --module-path $DIR/modules $DIR/$1 $DIR/ruby/${1%.ycp}.rb
}
cd $DIR
title YCP
ln -snf . modules
ln -snf . clients
ycpc -c modules/Modelist.ycp
Y2DIR=. ycpc -c modules/Intermediate.ycp
Y2DIR=. /usr/lib/YaST2/bin/y2base -l - constant-lookup UI
title RUBY
mkdir -p ruby/modules ruby/clients
cd -
y2r modules/Modelist.ycp
y2r modules/Intermediate.ycp
y2r clients/constant-lookup.ycp
Y2DIR=$DIR/ruby /usr/lib/YaST2/bin/y2base -l - constant-lookup UI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment