From: Daniel Carrera Date: 2003-07-26T05:16:54+09:00 Subject: Re: [ANN] CrossCase-0.01 Cool! Can you also make a module that turns hungarian notation into human-readable code? On Sat, Jul 26, 2003 at 05:08:57AM +0900, Michael Granger wrote: > Hi, > > I'd like to announce the first release of the 'CrossCase' module: a > mixin which auto-generates under_barred aliases for class or instance > methods with names which follow the camelCased naming conventions, and > vice-versa. E.g., in a class which mixes in CrossCase, defining the > #foo_bar method will also create an alias for that method called > #fooBar. > > For example: > > require 'crosscase' > class MyClass > include CrossCase > > def underbarred_method; ...; end > def camelCasedMethod; ...; end > end > > obj = MyClass::new > obj.underbarredMethod > obj.camel_cased_method > > # -or- > > class MyClass > def underbarred_method; ...; end > def camelCasedMethod; ...; end > end > > require 'crosscase' > MyClass.extend( CrossCase ) > obj = MyClass::new > obj.underbarredMethod > obj.camel_cased_method > > I wrote this module because I prefer camelCased method names, but also > wish to respect the preferences of my fellow Rubyists for whom such > practices are an abomination. And I'm too lazy to type > > alias :twinkle_twinkle :twinkleTwinkle > > for every method. It's all about laziness. Or perhaps I'm catering to > my hubris. Or both; I'll shut up now. > > The project page is at: > > http://www.deveiate.org/code/CrossCase.shtml > > and may be downloaded from: > > http://www.deveiate.org/code/CrossCase-0.01.tar.gz > > This module requires Ruby >= 1.8.0; it has not been tested with 1.6.8 + > Ruby-shim, but that may also work as well. Suggestions, bug reports, > and comments welcomed. > -- > Michael Granger > Rubymage, Believer, Architect > The FaerieMUD Consortium > -- Daniel Carrera | OpenPGP fingerprint: Mathematics Dept. | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88 UMD, College Park | http://www.math.umd.edu/~dcarrera/pgp.html