Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] Using Rails.root.join everywhere where possible

#4968

What I did, I went through source and replaced File.join(Rails.root[, ...]) into Rails.root.join(...). It's really handy method for joining paths, and since we have it, we should use it ;) Especially when it is used in core in some other places. There is even some inconsistency in guides, in initialization.textile where in almost all examples Rails.root.join is used but in one place File.join(Rails.root) I think we should go for rails "joiner" and that's why I've created this path.

What do you think?

Reported by Łukasz Strzałkowski · June 25th, 2010 @ 01:11 PM

State: invalid
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Łukasz Strzałkowski
    Łukasz Strzałkowski

    LH is throwing an error when I try to attach a patch - I've put it on github: http://gist.github.com/452725

    June 25th, 2010 @ 01:13 PM

  2. Bruno Michel
    Bruno Michel
    • Tag set to patch

    I think it's a good idea.

    June 26th, 2010 @ 05:04 PM

  3. Łukasz Strzałkowski
    Łukasz Strzałkowski
    • Title changed from Using Rails.root.join everywhere where possible to [PATCH] Using Rails.root.join everywhere where possible

    June 26th, 2010 @ 06:00 PM

  4. Łukasz Strzałkowski
    Łukasz Strzałkowski
    • Assigned user set to José Valim

    June 28th, 2010 @ 10:44 AM

  5. José Valim
    José Valim
    • State changed from new to incomplete
    • Importance changed from to Low

    Have you run tests after this change? A few tests fail here. Besides, interpolation would work just fine in these cases and would be more readable (and faster):

    "#{Rails.root}/lib/templates/fixjour"

    June 28th, 2010 @ 10:50 AM

  6. Jeremy Kemper
    Jeremy Kemper

    +1 for string interpolation instead of overusing join

    June 28th, 2010 @ 06:00 PM

  7. José Valim
    José Valim
    • State changed from incomplete to invalid

    Ok, I'm marking this one as invalid. Feel free to reopen the ticket if you have a patch using interpolation. :)

    July 8th, 2010 @ 10:13 PM