This project is archived and is in readonly mode.
Having rails/init.rb in plugin should generate deprecation warning since it's is not being called anymore
I was not able to find any information about this in any of the
blog posts or even during the latest bugmash. However, in my
attempt to get my app updated to Rails 3 I noticed that one plugin
I use that follows the official
recommended plugin procedure no longer seems to be calling
Digging through git I identified this commit which seems to completely remove gem-style init loading. The gem-style plugin fixture that used to be used seems to just be orphaned without test coverage now. It seems like everything was collapsed down to a simpler case which maybe was intended to work with gems, but there is no longer a test case explicitly covering it. Either that or the particular gem I'm looking at or my Bundler vendor setup is somehow broken.
In any case, I am happy to work on a patch for this, but I need to know is rails/init.rb deprecated? Should we be just putting conditionals in the standard required file like factory_girl does? Is there another way to somehow flag a gem as a plugin that I'm missing?
Comments and changes to this ticket
Jeremy, thanks for dropping by. I caught Yehuda on irc and he tells me that the API is changed intentionally. I do believe this needs documentation though, definitely before Rails 3 drops. Deprecation would have been nice, but considering the scope of changes in Rails 3 it doesn't really seem worth it--there will be many breaking changes already.
I also noticed this with my by_star plugin. To make it dually compatible between 2.3 and 3.0 I've copied the file to the root folder and it seems to work ok. Should I just have a lib/by_star.rb file and let Rails automatically include that? Is that how it works now?
- Title changed from rails/init.rb is not being called anymore to Having rails/init.rb in plugin should generate deprecation warning since it's is not being called anymore
@Gabe da Silveira
+1 on the deprecation warning. I believe that Rails 3 is under rapid development, so they forgot to put one in.
After I have followed the irc, I think
lib/by_star.rbshould be a way to go for 3.0 compatibility.