As you already know, YaST team has been working on an automatic translation of the YaST code from YCP to Ruby. This is possible thanks to two projects
The whole source code is written in Ruby and it's connected to the YaST framework via yast2-ruby-bindings (version >= 1.0.0).
Note: Just in case it will stuck in the middle of the translation, search for ruby process and kill it (kill -9 $PROCESS_ID). Then write the second quote, please :) Yes, there was a bug in yast2-core that it was searching for closing quote in strings like string message = "Unfinished.
- y2r - translates YCP code into Ruby
- ycp-killer - manages tasks related to translation of YCP code in YaST modules into Ruby
Y2R Editor
I've been asked by the team to write a simple application allowing writing YCP code that would be automatically translated to Ruby and shown aside. Creating this application using YaST framework was the very next logical step. Development was fast and easy and it has proven that we can use that framework for system applications as well.The whole source code is written in Ruby and it's connected to the YaST framework via yast2-ruby-bindings (version >= 1.0.0).
How to Run the Editor
If you want to try running the editor yourself, follow the README.md file in y2r-tools project. You will need to have y2r project cloned to your system and it's also helpful to have to latest yast2-core from YaST:Head project, because part of it is used for the translation.Note: Just in case it will stuck in the middle of the translation, search for ruby process and kill it (kill -9 $PROCESS_ID). Then write the second quote, please :) Yes, there was a bug in yast2-core that it was searching for closing quote in strings like string message = "Unfinished.
YaST Framework
Applications written using YaST framework can benefit from several features:
- UI support for ncurses, Qt, and GTK (as plug-ins) just by writing one single UI definition
- Possibility to use YaST libraries (even those still written in YCP)
- Possibility to use any Ruby library or Gem, such as Cheetah in this case
- SCR - Layer for accessing the system configuration (read, write, execute)