jonswar / perl-mason

Mason 2
58 stars 20 forks source link

Fixed bug with classname generation #32

Closed hurricup closed 8 years ago

hurricup commented 8 years ago

Seems it was intended to convert foo/bar.mc to MC0::foo::bar_mc but current implementation makes MC0::foo_bar_mc

jonswar commented 8 years ago

Actually, MC0::foo_bar_mc was intended as far as I can remember. Why do you think MC0::foo::bar_mc is more appropriate? It just matters that they are unique classnames right?

hurricup commented 8 years ago

Well, what is the second regexp for than ? :) $classname =~ s/\//::/g;

And quoting docs:

Prefix to use in generated component classnames. Defaults to 'MC' plus the interpreter's count, e.g. MC0. So a component '/foo/bar' would get a classname like 'MC0::foo::bar'.

But it's really doesn't matter, just inaccurate. And fix this is faster than fix in few occurances in docs :)