#360 ✓ resolved
Carl Lerche

Kernel#dependency does nothing after the Dependencies BootLoader ran

Reported by Carl Lerche | June 5th, 2008 @ 01:43 PM

If Kernel#dependency is used anytime after Merb::BootLoader::Dependencies is run, it does nothing. This is because dependency adds all the dependencies to an array that Merb::BootLoader::Dependencies iterates through and loads once.

This causes a problem if dependency is used in a before_app_loads or after_app_loads block since both are invoked after the Dependencies BootLoader is run.

The patch changes Kernel#dependency so that instead of appending directly to an array, it invokes an append_dependency method. The append_dependency automatically calls Kernel#load_dependency IF Merb::BootLoader::Dependencies already ran.

Comments and changes to this ticket

  • Yehuda Katz (wycats)

    Yehuda Katz (wycats) June 5th, 2008 @ 05:10 PM

    • State changed from “new” to “resolved”

    (from [4d6aeea5b3751b7db0aead50369e32a3847a65bf]) Handles use of dependency after BootLoading. [#360 state:resolved]

    http://github.com/wycats/merb-co...

  • Yehuda Katz (wycats)

    Yehuda Katz (wycats) June 5th, 2008 @ 05:12 PM

    @carl I fixed this a more generic way that allows you to check whether any BootLoader is complete (in case we need this functionality later).

  • Carl Lerche

    Carl Lerche June 5th, 2008 @ 05:42 PM

    Definitely done a lot better.

    Thanks.

  • Yehuda Katz (wycats)

    Yehuda Katz (wycats) June 11th, 2008 @ 11:06 AM

    (from [75f71027c5f023eebb91023845f06262cb16a880]) Merge branch 'master' of git://github.com/wycats/merb-core

    • 'master' of git://github.com/wycats/merb-core: (192 commits)

    siiiiiigh.

    Revert partial counter and yielding.

    Remove some duplication

    For crying out loud.

    Refactor display. WARNING: This commit might not be stable. I need to add a bunch more specs for display before I feel confident.

    Make the TemplateNotFound error read better. Slight refactor of _get_layout.

    Fix _template_for so it's actually readable

    uhhhhhhhh...

    Added Merb::Router.reset! and Merb::Router.capture

    Speedup Route URL generation

    Start work on fixing contaminated cousins bug.

    Changed controller inheritance of _template_root

    Added the ability to use full/absolute template paths for render, display and partial views

    This cannot be tested this way. It needs to be tested as a public spec (testing it privately here was a cop-out and fails when I fixed up the way dependency works).

    Allows passage of query string via env["QUERY_STRING"] in tests. [#358 state:resolved]

    Handles use of dependency after BootLoading. [#360 state:resolved]

    properly set the session_id_key

    added 2 specs for multipart formdata: (1) for checking request with IO, (2) for testing GET with content_type not erroring on multipart/form-data absence; fixed error with multipart/form-data absence.

    Made Class a lot more sane.

    Fix README for merb-gen app foo

    ...

    http://github.com/wycats/merb-co...

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Attachments

Pages