Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Gem extension views are appended, not prepended, to the view paths array #135

Closed
joshfrench opened this Issue · 3 comments

2 participants

@joshfrench
Owner

Gem extension view paths end up at the end of the view_paths array, instead of up front like vendored extensions. Therefore they can add views, but not overwrite core views.

This will take some tracking down, but here's what I know so far:

  • The Rails plugin loader thinks these extensions are engines because they have an app dir. It's the plugin loader that's actually adding their paths to view_paths, not anything on the Radiant side. That's an oversight.
  • Radiant::Initializer.initialize_framework_views is I think where this should be handled.
  • There's some manipulation that happens before this array is finalized in ActionController::Base.view_paths. So even if I set the gem paths inside of initialize_framework_views, that array is reshuffled into the unwanted order at some later point during the load process.
@mislav
Collaborator

Interesting. Can't promise to fix this for 0.9, but I'll definitely make sure overriding views is possible with the new extensions system in the rails3 branch.

@joshfrench
Owner

Subclass Plugin locators to be aware of extension gems (closed by 73016db)

This creates a new plugin type: Radiant::ExtensionGem. It only differs from
normal GemPlugins in that it won't be treated as an engine, meaning its load
paths will be prioritized above the base application's. Also, the plugin
locator is split into two classes that are aware of the new plugin type.

@joshfrench
Owner

I feel like I may have taken the long way around, but this works and shouldn't affect the normal plugin loading. Not sure if it's at all portable to Rails 3; I'll investigate separately.

@rx rx referenced this issue from a commit in voomify/radiant
@joshfrench joshfrench Subclass Plugin locators to be aware of extension gems (closes gh-135)
This creates a new plugin type: Radiant::ExtensionGem. It only differs from
normal GemPlugins in that it won't be treated as an engine, meaning its load
paths will be prioritized above the base application's. Also, the plugin
locator is split into two classes that are aware of the new plugin type.
7454b36
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.