Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per framework configuration #85

Closed
jodosha opened this issue Dec 5, 2014 · 0 comments · Fixed by #94
Closed

Per framework configuration #85

jodosha opened this issue Dec 5, 2014 · 0 comments · Fixed by #94
Assignees
Milestone

Comments

@jodosha
Copy link
Member

jodosha commented Dec 5, 2014

Framework configurations are a fast moving target.
With the current approach, if we introduce a new setting in a minor release of Model/View/Controller gems, we're forced to add it to Lotus::Configuration as well.

There are some configurations that makes sense to expose at the top level (Lotus::Configuration) like we do right now. Settings like adapter and mapping are stable in both Lotus and Lotus::Model.

There are also some minor things that we can add from time to time.

For instance, in the next version of Lotus::Controller there is Action#request_id. It's implemented like this: SecureRandom.hex(DEFAULT_REQUEST_ID_LENGTH). That constant is equal to 16.

Now, if some reason we want to add way to change the algorithm or the length, via Lotus::Controller::Configuration, we can't think to add the corresponding API in lotusrb. Again, the reason is the maintenance in the long term: it's hard to keep in sync Lotus with the other frameworks.

My proposal is to add per framework configuration.

module Bookshelf
  class Application < Lotus::Application
    configure do
      controller.handle_exceptions false

      view.prepare do
        include RoutingHelpers
      end
    end
  end
end

The idea is to forward those method calls to the underlying frameworks configurations.

Getting back to the example above, if we ship a minor release of lotus-controller with that setting. Once the developers do a bundle update they're able to use it, without the need of a new lotusrb release.

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

Successfully merging a pull request may close this issue.

1 participant