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

Add simpler version of ClosureBackedEmbeddedApplication #299

Closed
ldaley opened this issue Apr 6, 2014 · 5 comments
Closed

Add simpler version of ClosureBackedEmbeddedApplication #299

ldaley opened this issue Apr 6, 2014 · 5 comments
Assignees
Milestone

Comments

@ldaley
Copy link
Member

ldaley commented Apr 6, 2014

I think we can create something that requires a little less setup for the embedded tests in the docs.

Dependent on #293.

@rhart
Copy link
Member

rhart commented Apr 8, 2014

This simpler version is providing a default constructor so no app dir needs to be set? Or is it more involved?

And this task also includes updating all the snippets in the Javadoc?

@ldaley
Copy link
Member Author

ldaley commented Apr 8, 2014

I'm not entirely sure. All I know is that it's a bit too much boilerplate now.

I think maybe even just a static factory method…

ratpack.groovy.test.EmbeddedApplications.embeddedApp {
  modules {}
  handlers {}
}

And have the following overloads:

EmbeddedApplication embeddedApplication(Closure) // use default launch config
EmbeddedApplication embeddedApplication(LaunchConfig, Closure)

Most samples would static import it so it would be…

def app = embeddedApplication {
  handlers {
    get { … }
  }
}

That's a bit of a brain dump. Haven't thought it through too much.

@rhart
Copy link
Member

rhart commented Apr 9, 2014

There are a couple of places that only want to set the base directory in the launch config, like RatpackGroovyAppSpec. So, is it worth also adding an overload for EmbeddedApplication embeddedApplication(BaseDir, Closure)?

@ldaley
Copy link
Member Author

ldaley commented Apr 9, 2014

Yeah, I think it is.

On Wed, Apr 9, 2014 at 10:55 PM, rhart notifications@github.com wrote:

There are a couple of places that only want to set the base directory in the launch config, like RatpackGroovyAppSpec. So, is it worth also adding an overload for EmbeddedApplication embeddedApplication(BaseDir, Closure)?

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

@rhart
Copy link
Member

rhart commented Apr 9, 2014

66e919a is a start to this

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

No branches or pull requests

2 participants