Hi James, hi all,

Like we agreed on #engines last week I've worked on Engines for Rails  
2.0
(still using RC1) this weekend. I've commited my work here:

http://svn.artweb-design.de/engines/tests/rails_2_0

Please criticize everything :)

Analog to the test apps in the Engines repo this is a complete rails  
app. You
should be able to run the tests once you've created the database(s).
Apperently the migration tests uses the development database at the  
moment
when you use rake test:units. (I'll have to figure out how to only  
rely on the
test database, TODO)

Based on our discussion on IRC I've added tests and further refactored  
the
Engines plugin.

As for the tests I had to invest some time to figure out how Al Pacino,
Baldwin, Stephen and William work together with James and how they all  
cope
with funk, bananas and hobbits! (Which was quite fun.)

So I've decided to restructure this using some more descriptive  
names ...
hoping to increase comprehensibility a little. I hope this is ok for  
you.
Also, doing this I think I was able to remove some duplicate and add  
some
missing functionality to test.

I believe that the tests now cover the important parts (not sure though)
aside from these (TODO):

* ActionMailer breaks with the Engines::RailsExtension (tests disabled)
* $LOAD_PATH seems to be in reverse order so tests fail here (tests  
disabled)
* no tests for arbitrary code mixing ported (unclear what's going to  
drop)

As for the refactoring, I've changed quite a bit (mostly but not solely
responding to your considerations in IRC):

* moved Rails.plugins to Engines.plugins
* removed about.yml and version attribute
* removed Engines.current
* removed block from Engines::PluginList, left the rest there for now
* removed LegacySupport
* added an Engines::Assets module to hold file/dir creation/copying  
related
   stuff
* added the following line in Engines::RailsExtensions::Routing
   map = self # allows to just copy and paste routes around
* moved extensions to an accessible attribute on Engines and  
extensions loding
   from init.rb to Engines.init to declutter the init.rb file
* supposedly quite some stuff that I forgot to take notes about ...

Engines and Engines::Plugin are pretty lean now. I moved stuff out of  
init.rb
because I thought it would be a nice idea to have the Engines plugin  
behave
just like a normal Rails plugin if it hasn't been "booted". I think this
also responds to your consideration to mess as little with Rails core  
code as
possible.

(On the other hand) I've added a default_attr_accessor method to Class  
in
order to dry up the repetition in Engine::Plugin. Personally I feel  
that this
extension to Class is quite useful (it could even go into  
ActiveSupport). If
you don't like it, I'll revert this.

Regarding the location of the routes.rb file: I'm sure this has been  
discussed
before, but as there are the plugin subdirectories /db/migrations and / 
public
... why isn't the directory structure mirrored for the routes file?  
I.e. why
is it located in the plugin root dir instead of a /config subdir? IMHO
mirroring the directory structure here would make things even more  
intuitive.




--
sven fuchs                      [EMAIL PROTECTED]
artweb design           http://www.artweb-design.de
grünberger 65           + 49 (0) 30 - 47 98 69 96 (phone)
d-10245 berlin          + 49 (0) 171 - 35 20 38 4 (mobile)



_______________________________________________
Engine-Developers mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org

Reply via email to