rstacruz / sinatra-assetpack

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

Updates dependent require calls on invocation #168

Closed fj closed 10 years ago

fj commented 10 years ago

Without a require 'sinatra' in this spot, Sinatra::AssetPack must be loaded in a Gemfile after Sinatra is already loaded in order to work. Otherwise, it will generate problems:

NoMethodError: undefined method `register' for Sinatra:Module
...src/projects/uphex/uphex-pulse/.gem/ruby/2.1.0/gems/sinatra-assetpack-0.3.2/lib/sinatra/assetpack.rb:70:in `<module:Sinatra>'
...src/projects/uphex/uphex-pulse/.gem/ruby/2.1.0/gems/sinatra-assetpack-0.3.2/lib/sinatra/assetpack.rb:4:in `<top (required)>'

Since Sinatra::AssetPack depends on Sinatra, it needs to use that dependency here or else it is vulnerable to this sort of breakage.

j15e commented 10 years ago

Seems legit, thanks!

j15e commented 10 years ago

Just published 0.3.3 with this fix.