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

Initial rack support? #1

Merged
merged 2 commits into from
Nov 13, 2014
Merged

Initial rack support? #1

merged 2 commits into from
Nov 13, 2014

Conversation

schneems
Copy link
Member

Is there anything we can "know" by default? Like will there always be a config.ru? Can we require that an do something?

task :rack_load do
  require 'config.ru'
  DERAILED_APP = Foo.bar
end

cc @deafbybeheading @jroes

@jroes
Copy link

jroes commented Oct 16, 2014

Whoa, sweet!

Yeah, I don't think there's much we can know. Maybe we can use Rack::Builder.parse_file somehow?

@msakrejda
Copy link

Nice. I honestly don't think I know enough about Rack to give useful input here--I've mostly just copied templates to bootstrap my apps--but for what it's worth, everything even moderately serious that I've worked on has had a config.ru. If that simplifies things but still doesn't handle all cases, you could always add it as another special case (like Rails is in the PR), and fall back to more manual setup if the file is missing?

@Kagetsuki
Copy link
Contributor

I think using config.ru makes sense. Even if someone were to be using a rack app without config.ru (if that's even a thing?) they could always add it in order to support derailed_benchmarks.

schneems added a commit that referenced this pull request Nov 13, 2014
@schneems schneems merged commit b0a099b into master Nov 13, 2014
@schneems
Copy link
Member Author

Going to merge this in, we can still investigate a config.ru helper of some kind, but I don't have the knowledge right now. Maybe others going through the process of manually defining their rack setup tasks and sharing them can help make this a bit more general

@jroes
Copy link

jroes commented Nov 17, 2014

So now that rack is supported, does the whole project name need to change, or README get updated? :trollface:

@schneems
Copy link
Member Author

@gangleton
Copy link
Contributor

In order for the custom rake task to be loaded when rake perf:rack_load is invoked, you have to namespace it in your perf.rake. Might be helpful to put that in the README, unless I'm missing something?

@schneems
Copy link
Member Author

@gangleton ahh, too true, could you give me a PR, I accidentally left that part out. Thanks for bringing it up ❤️

@gangleton
Copy link
Contributor

No problem, just submitted a PR

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

Successfully merging this pull request may close these issues.

None yet

5 participants