On 08/19/2013 05:19 PM, Josef Reidinger wrote:
Hi, because we have now ruby I want to show really simple way how we can refactor existing code. I choose just simple example to be easy to understand and on other hand full working. [1]
There is two interesting points in it.
- using minitest for testing, its structure ( so you can imagine how it looks ) and how it can be easy integrated with automake ( nice part is that if you run `make check` then both testsuite is run, old and new one
- Using ruby builtin regex, so we no longer need our own.
Just to add some more info on this refactoring piece. Josef has used a standard Ruby Resolv [1] class to replace our built-in functionality. This will save our time in the future as we don't need to care about our own implementation and saves some space as well as our implementation was a duplicate to standard Ruby library which will be installed anyway. I like the idea and I expect that you will identify and replace more ;) This is actually something that anyone with a basic Ruby knowledge can do. It's could even be marked as, so called, junior job. Bye Lukas #1 http://ruby-doc.org/stdlib-1.9.2/libdoc/resolv/rdoc/Resolv.html -- Lukas Ocilka, Cloud & Systems Management Department SUSE LINUX s.r.o., Praha -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org