Skip to content
This repository has been archived by the owner on May 9, 2019. It is now read-only.

config.startup is ignored #26

Open
anamba opened this issue Sep 25, 2014 · 6 comments
Open

config.startup is ignored #26

anamba opened this issue Sep 25, 2014 · 6 comments
Assignees
Milestone

Comments

@anamba
Copy link

anamba commented Sep 25, 2014

I looked through lib/gollum_rails/setup.rb, and it looks like config.startup is never checked. I worked around it, but it might be nice to fix this someday.

@nirnanaaa
Copy link
Owner

Hey there. This feature was patched out in 1.6.x because I though no one is using it. Of course i can reimplement somenthing like an optional Parameter, which disables the startup. What do You think about it?

Am 25.09.2014 um 04:26 schrieb Aaron Namba [email protected]:

I looked through lib/gollum_rails/setup.rb, and it looks like config.startup is never checked. I worked around it, but it might be nice to fix this someday.


Reply to this email directly or view it on GitHub.

@anamba
Copy link
Author

anamba commented Sep 25, 2014

I guess this option is only needed because a missing repository completely prevents the app from starting.

If the repository check could be done lazily (the first time the gollum-enabled model is used) then there would be no need for config.startup.

@anamba
Copy link
Author

anamba commented Sep 25, 2014

Speaking of configuration, I had another thought as well. Since the repository path is global, that means there can be only one repository, right? It seems like it would make more sense to set the repository path in the model.

I think the most "Rails-y" way to do this would be to set a base path in the initializer, then each model would look in that path for a repository matching the name of the model. For example:
config.repository_base_path = File.join(Rails.root, 'gollum-repositories')

Then if you have a model called Page, it would look for gollum-repositories/pages.git and a model called Article would look for gollum-repositories/articles.git (by default... as with ActiveRecord, you should be able to override the default).

@nirnanaaa
Copy link
Owner

Thats actually an awesome idea. I will implement some sort of multi-repository support as soon i am back from my business trip tomorrow. As the actual gollum instance gets initialized in object creation i think this should be no problem at all.

Am 25.09.2014 um 09:51 schrieb Aaron Namba [email protected]:

Speaking of configuration, I had another thought as well. Since the repository path is global, that means there can be only one repository, right? It seems like it would make more sense to set the repository path in the model.

I think the most "Rails-y" way to do this would be to set a base path in the initializer, then each model would look in that path for a repository matching the name of the model. For example:
config.repository_base_path = File.join(Rails.root, 'gollum-repositories')

Then if you have a model called Page, it would look for gollum-repositories/pages.git and a model called Article would look for gollum-repositories/articles.git (by default... as with ActiveRecord, you should be able to override the default).


Reply to this email directly or view it on GitHub.

@nirnanaaa
Copy link
Owner

I had some time to dig into this. Will release a patch in a few days.

Thanks for you patience

@nirnanaaa
Copy link
Owner

The patch for multi-repository support will be implemented in version 1.6.5, which will be released on the 10th of November. Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants