Tag Archives: ruby

Kouzelne Ruby

Ruby jsem se zacal venovat posledni rok ponekud aktivneji a porad me neprastava prekvapovat svou eleganci, za niz vdeci predevsim blokum(closures), mixinum (injektovani funkcionality vedle dedicnosti) a runtime modifikacim objektoveho modelu.

Demonstrovat silu techto konstruktu si muzeme napriklad na patternu Singleton. V prehistorickych programovacich jazycich obvykle udelam private konstruktor, budu mit lokalni statickou instanci a statickou synchronizovanou metodu pro pristup k ni.

V Ruby kod vypada nasledovne

require 'singleton' 
class FooService include Singleton end

a pouziti

foo1 = FooService.instance

NetBeans bugs/misconceptions list

Note: This post has been created a few days back, so needn’t necessary reflect the current status of NB 6.1 beta. In fact, I would be more than happy to be blamed for being “lama” with the lack of knowledge of this and that killer feature of NetBeans…

As Jiri Pisa recently became a true fan of ruby, we started to discuss this language almost every day. I summed some of our findings related to the best ruby editor currently available – NetBeans. Note, that the list is not ruby specific only. I will keep updating this list until NetBeans is perfect. 🙂

Domain: Setup

– on Mac: if you turn on Eclipse key binding it’s Windows one not Mac OS one

– keyboard shortcut card (pdf) is static – default Windows eg. doesn’t represent the current status. Looks like somebody made his life easier. 😛

– no setup filtering aka Eclipse – difficult to find the setting (example: try to change key mapping for “Format”)

Domain: Ruby editor

-caching of context help – shows even deleted classes/attributes in content assistant

-quotes pairing madness – duplicates the second quote when closing the first one

missing features

-content assistant in script/console – example: Foo.column_names

-refactoring – file rename – update require clause when changing ruby file name

More to come….

Pekne srovnani ruby/RoR IDEcek

Pokud se stale nemuzete rozhodnout pro vyvojovy tool pro ruby/RoR, mrknete na nasledujici pekny prehled. Tabulka je neustale aktualizovana tak, jak Tor Norbye (Netbeans) pridava jeden komentar za druhym. Zatim zustanu u Netbeans, ktere ale maji take much vic nez dost – viz budouci prispevek v anglictine – pro Tora…. :).

Ruby and RoR IDEs