On 10/21/07, Chad Woolley <[EMAIL PROTECTED]> wrote: > > Howdy, > > Please take a look at Enhancement #9943 (2) and see what you think. > Here's the pitch for this little 5-line patch: > > Even though boot.rb has the familiar "Don't change this file..." > message, sometimes I want to. > > This would allow dynamic control over RAILS_GEM_VERSION and the > Version Specification passed to the RubyGems 'gem' method for the > rails gem. For example, users could test an app or plugin in a > Continuous Integration environment which performs automated regression > testing against various old Rails versions. > > This patch would also to facilitate my GemInstaller gem, which > centrally manages the installation and loading of all gem dependencies > and versions, including Rails. Currently, I have to tell people (1) > to ignore the dire "Don't change this file..." warning and hack > boot.rb if they want to manage the Rails gem version along with the > rest of their gems. This is not compatible with Rails upgrades which > modify boot.rb, such as changeset [7832] and ticket #9834; users will > have to re-modify boot.rb after upgrading. > > So, whaddaya think? I'm happy to rewrite this patch however you would > like. I thought the simplest and most flexible approach would be to > mirror the config/initializers directory approach, which is done in > just 5 lines. If you don't like the extra config/preinitializers > directory, it could just look for a single hook file like > config/preinitializer.rb. This would be one less default dir in > /config, but it would be less flexible. For example, I couldn't just > have GemInstaller dump a provided geminstaller_preinitilizer.rb file > into config/preinitializers, I'd have to modify the single hook file. > If it's OK to have an extra dir in config, though, I think the current > approach is best > > One other note. This patch is untested, because boot.rb would require > some refactoring to be testable, and I didn't want to overengineer > this patch. For an example of how boot.rb could be more made more > testable, see #9834. We could even pull out all of the logic from > boot.rb into a class, which would be much easier to test in isolation. > I'm definitely up for this if you are interested, but I wanted to do > The Simplest Thing That Could Possibly Work as the first cut. > > Thanks, > -- Chad Woolley > > (1) > http://geminstaller.rubyforge.org/documentation/tutorials.html#integrating_geminstaller_into_ruby_on_rails > (2) http://dev.rubyonrails.org/ticket/9943 >
I would love to see this patch (or a similar one) make it in, as we are dealing with this very issue with a tool we built test our apps and plugins against multiple versions of Rails in our CI environment. We went with the rubygem approach because it lets use gems for version management, but we are hitting issues in apps due to the way the boot process works. thanks, Rob http://robsanheim.com http://thinkrelevance.com http://streamlinedframework.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
