I''ve been using edge Rails for development. Ever since the router rewrite, Rails was broken for me on Windows. Running unit tests discovered more errors and failures than I suspected, and, since they looked win32-specific, I decided to pull up my sleeves and fix them instead of just reporting because I suspect very few Rails developers work on Windows. This would be the first time I''ve stepped so deeply in Rails core, but there is a first time for anything. To my relief, all the fixes were pretty tiny. A couple were already reported and had working patches, so in the end I finished up sending only 3 patches. I wanted to discuss the last one because it is somewhat tricky and I''m not sure of the quality of my solution. #5278: fix sqlite tests on Windows when Rails path contains spaces http://dev.rubyonrails.org/ticket/5278 #5276: fix for CGI extensions when they expect string but get nil http://dev.rubyonrails.org/ticket/5276 #5285: routing broken on win32 after rewrite - Pathname#realpath issue http://dev.rubyonrails.org/ticket/5285 Rails uses Pathname library in several places. Unfortunately, Pathname is written only for unix-style paths (stressed out in the docs). Until Pathname2 replaces Pathname (if that ever happens) were stuck with its faulty methods. The culprit here was Pathname#realpath method that didn''t know how to recognize absolute paths (ones with drive letters) on Windows. For my patch I''ve copied the whole method to ActiveSupport/core_ext in a separate file, fixed the method and included the file from existing pathname.rb: require File.dirname(__FILE__) + ''/pathname/win32_fix'' I didn''t know better (if there IS a better solution). This should work on other platforms as before, but I''ll appreciate if someone could test it. The thing that troubles me now is that this fix is always included. Most of the Rails installations will never be on Windows, so they don''t need it. I''ve wondered if it would be more correct if I wrote this: require File.dirname(__FILE__) + ''/pathname/win32_fix'' if RUBY_PLATFORM =~ /(?:mswin|mingw|bccwin)32/ However, I haven''t yet seen this kind of practice in Rails core. Thoughts? Opinions? What is ''Rails'' approach to cross-platform problems? -- Mislav _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core