Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Can't set controller_name/action on service #11

Open
ryfow opened this issue May 14, 2012 · 3 comments
Open

Can't set controller_name/action on service #11

ryfow opened this issue May 14, 2012 · 3 comments

Comments

@ryfow
Copy link
Collaborator

ryfow commented May 14, 2012

WD supports setting controller_name and action attributes on the service for routing to implementation code. wd_sinatra supports setting a block as the implementation with the implementation(&block) method. As far as I can tell, wd_sinatra doesn't pay attention to the controller_name and action attributes.

I don't know if one way or the other is better, but it's confusing right now. Supporting something like service.implementation ModuleName, :method_name across the board might be nice.

@mattetti
Copy link
Owner

That is correct, wd_sinatra is currently opinionated and only supports the block approach. This implementation https://github.com/mattetti/Weasel-Diesel/blob/master/lib/framework_ext/sinatra.rb however does support the controller approach (which I personally don't prefer).

I don't think it's a good idea to mix both approach in the same app, so what we could do, is to make it a generator option if you are interested in taking care of that.

@ryfow
Copy link
Collaborator Author

ryfow commented May 14, 2012

I see. I think the confusing part for me is that controller_name and action are right in weasel_diesel.rb as well being mentioned in README.md making them seem like a core part of the DSL. Perhaps they should be stuck in framework_ext.

@mattetti
Copy link
Owner

Very good point, would you mind sending a pull request?

On May 14, 2012, at 20:27, Ryan [email protected] wrote:

I see. I think the confusing part for me is that controller_name and action are right in weasel_diesel.rb as well being mentioned in README.md making them seem like a core part of the DSL. Perhaps they should be stuck in framework_ext.


Reply to this email directly or view it on GitHub:
#11 (comment)

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

No branches or pull requests

2 participants