rstacruz / sinatra-assetpack

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

Support for additional environments to generate production asset pack #80

Closed spullen closed 11 years ago

spullen commented 11 years ago

I have a use case where I have a staging server and a production server. The staging server sets the RACK_ENV to :staging, however I want it to also produce the production asset pack.

I made a fork for the change I'm proposing. Would this be something that would be good for the project?

https://github.com/spullen/sinatra-assetpack/commit/6ca56cc96859ff1eba3a8fb770e94637d47d214b

https://github.com/spullen/sinatra-assetpack/commit/8d8ec4aa1a1af684c882ccc125377b4c29c1cc9b

j15e commented 11 years ago

Not sure about it, seems like a bit far fetch and maybe you could/should simply set your staging as a development rack environment? Otherwise deploy with RACK_ENV=development even if you name it "staging" for other purposes and use an other env variable for your staging specific needs (ex. MYAPP_ENV=).

Sinatra apps env should be either test, development or production I think, otherwise you might end up with other unexpected behaviors. Supporting this in every extension would be problematic I think.

 A symbol specifying the deployment environment; typically set to one of :development, :test, or :production. The :environment defaults to the value of the RACK_ENV environment variable (ENV['RACK_ENV']), or :development when no RACK_ENV environment variable is set.

http://www.sinatrarb.com/configuration.html

bentruyman commented 11 years ago

This would be very useful for us as well. There are many cases for having multiple production-like environments such as qa and staging. The proposed changes don't hardcode any environments, but rather allow them to be extended. I'm :+1: on this.

pjanuario commented 9 years ago

I'm :+1: on this.