[Rails-core] New JavaScript Engine

2014-05-02 Thread Stephen Paul Weber
I'm trying to build a new JavaScript engine (like coffee-rails, but for purescript), and I'm having an issue with the generators. I cloned coffee-rails to start, and changed the javascript engine generator from :coffee to :purescript, but in test/controller_generator_test.rb I can't get it to

Re: [Rails-core] Namespacing Models et al

2014-04-16 Thread Stephen Paul Weber
On Wednesday, 16 April 2014 14:06:52 UTC-5, Xavier Noria wrote: > > On Wed, Apr 16, 2014 at 9:03 PM, Stephen Paul Weber < > singp...@singpolyma.net > wrote: > >> If we throw out the magical version (which seems a popular opinion, and >> is certainly quite f

Re: [Rails-core] Namespacing Models et al

2014-04-16 Thread Stephen Paul Weber
On Wednesday, 16 April 2014 13:54:52 UTC-5, Xavier Noria wrote: > > > Any of the options are terrible in my view, expectations are broken all > over the place. > > If we throw out the magical version (which seems a popular opinion, and is certainly quite fine with me), does letting the autoload

Re: [Rails-core] Namespacing Models et al

2014-04-16 Thread Stephen Paul Weber
On Wednesday, 16 April 2014 10:15:39 UTC-5, Matt jones wrote: > A million times no. The autoloader can be confusing enough without it > magically gluing namespaces onto things - making autoloading `User` result > in different classes than just doing a `require ‘user’` seems very bad. > > Well, s

Re: [Rails-core] Namespacing Models et al

2014-04-16 Thread Stephen Paul Weber
On Tuesday, 15 April 2014 20:17:29 UTC-5, Xavier Noria wrote: > > I don't think automatic namespacing is the way to go, but out of curiosity > if user.rb has > > class User < AR::Base > end > > and UsersController references User and triggers loading that file, how > would you put User un

Re: [Rails-core] Namespacing Models et al

2014-04-15 Thread Stephen Paul Weber
The case I've run into the gem *is* namespaced, but with a name that clashed with one of my model names. Rails as currently implemented does not control the namespace, but given how the autoloader works I don't see any reason it couldn't. A middleground would be to have the autoloader expect

[Rails-core] Namespacing Models et al

2014-04-15 Thread Stephen Paul Weber
Just ran into this for the first time and thought it was worth talking about: because models and controllers and such just live in the root namespace, they can be shadowed when importing a gem. My proposal (for discussion) is that Rails could put all the app classes inside the module that ex