rstacruz / sinatra-assetpack

Package your assets transparently in Sinatra.
http://ricostacruz.com/sinatra-assetpack/
MIT License
541 stars 97 forks source link

Asset routes aren't matched under Padrino #19

Closed mikesten closed 13 years ago

mikesten commented 13 years ago

Use regular expression route matcher instead of splat pattern for Padrino compatibility.

rstacruz commented 13 years ago

Interesting—any clue as to why splats won't work in Padrino?

By the way you're missing a ^ and $ in those regexes.

mikesten commented 13 years ago

And to answer your question about Padrino and splats... I don't rightly know. Padrino implements named splats - you can specify the route /posts/dates/show and then access params[:dates]. Nice and consistent with the /posts/:slug/show style. I took a brief look around padrino-core but haven't absolutely verified that it's this that's interfering. But changing from / to r{.*} style fixes the problem. Um. Yeah. It's a working hypothesis. ;)

rstacruz commented 13 years ago

Thanks! I hope you don't mind I'm squashing your 3 commits into 1 (git rebase -i HEAD~3).

rstacruz commented 13 years ago

https://github.com/rstacruz/sinatra-assetpack/commit/e32047955ccdd943b09d7d1f1319a530800f36f7

mikesten commented 13 years ago

Nope, I don't mind at all. :)