hawx / guard-sass

Guard::Sass automatically rebuilds sass files when modified (like sass --watch)
MIT License
88 stars 35 forks source link

Guard::Sass run_on_changes exception: undefined method `run_on_changes' for Guard::Refresher #45

Closed codemoe closed 11 years ago

codemoe commented 11 years ago

I don't know if this is the right place for this but I was using Larvel-Guard with the respective guard gems and while I was working with the guard-sass gem, I noticed that the file wasn't processing itself into CSS and received the next ERROR

Guard::Sass failed to achieve its , exception was:

[#] NoMethodError: undefined method `run_on_changes' for #Guard::Refresher:0x007fee69c0b7c8

So after debuging a bit I found out that on line 164 of sass.rb it calls on guard.run_on_changes but that method is actually not defined anywhere so I found 2 possible solutions (I would like to know if I'm wrong or maybe it is an error)

  1. Comment the line 164 on sass.rb

    guard.run_on_changes(paths) unless paths.empty?

  2. Add the method inside the Refresher of your Guardfile

[...] module ::Guard class Refresher < Guard def run_all

refresh

end
def run_on_changes(paths)
 # refresh
end

def run_on_additions(paths)
  refresh
end

def run_on_removals(paths)
  refresh
end

def refresh
  `php artisan guard:refresh`
end

end end

[...]

Regards and I hope that someone can tell me if this is wrong or what happened (or even if I should put this on another place)

hawx commented 11 years ago

Yes, you're probably right. I've removed the offending #notify method, so it shouldn't be trying to call non-existant methods. I've pushed a new version (1.1.0) to rubygems, so hopefully updating to that fixes the problem. Reopen this issue if it doesn't. Thanks.