[rspec-devel] Ruby 1.8 does allow non-ascii method names in the source

Marcello Nuccio marcello.nuccio at gmail.com
Sun Feb 8 16:46:32 EST 2009

Sorry if this is a dupe, but I think the first delivery failed...

In cucumber History.txt I read:
* Given, When, Then are automatically aliased to current language.
 Ruby 1.8 doesn't allow non-ascii method names in the source, so
unless you're on 1.9
 you will have to use Given, When, Then or set up your own aliases.
Here is Norwegian:
   Cucumber.alias_steps(%w{Naar Saa}) # Når, Så already aliased, but
can't be called. (Aslak Hellesøy)

I think this is not true.  On my computer (Ubuntu 8.10):

$ ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
$ file prova.rb
prova.rb: UTF-8 Unicode C++ program text
$ cat prova.rb
class Facoltà
 CÌÈÒÉÙÀ = :çèéù

 def self.àèìòù
   @sì_o_no = CÌÈÒÉÙÀ

puts Facoltà.àèìòù
$ ruby -Ku prova.rb

I can use UTF-8 characters in class, method, variable, and constant names.
I use this feature in rails to have model, attributes, and controller
names with non-ascii characters.  You need a small rails patch, but it
works fine for me.

 Marcello Nuccio

More information about the rspec-devel mailing list