yast/y2r

Undefine `main` in modules/Assert.rb

Closed this issue · 3 comments

Original Assert.ycp file from yast2 is translated wrongly to Ruby.

The end of the generated file is

Assert = AssertClass.new
Assert.main

The problem is that there is no main method defined in the file, only two other methods (EqualMsg and Equal).

Because of this bug yast2 testsuite fails.

Problem is probably because main is not created if there is no statement, so options is to not generate this line or generate empty method

Not generating the main call is cleaner solution IMHO, on the other hand empty main will set kind of standard name, if anybody will add some initialization code later than the place will be given and clean.

It could avoid mess in naming, someone could later use my_init...

Well, in fact name of init method is not interesting and usually it is not visible outside of module.