imathis / guard-jekyll-plus

A Guard plugin for smarter Jekyll builds
MIT License
63 stars 16 forks source link

Scoping issue with @use_rack #24

Closed awood closed 9 years ago

awood commented 10 years ago

Hi,

I believe there is a scoping issue with the rack detection code. At the top of jekyll-plus.rb there is the following:

begin
  require 'rack'
  @use_rack = true
rescue LoadError
end

The @use_rack variable is then used later within the Jekyllplus class. However, I believe that when @use_rack is dereferenced, Ruby is looking within the Jekyllplus instance and @use_rack is undefined within the instance. When experimenting I was able to see that @use_rack was set to true within the begin block but evaluated to false within the Jekyllplus class.

I have a PR that I will submit.