Class: Yuzu::Command::Watch

Inherits:
Base show all
Defined in:
lib/yuzu/commands/watch.rb

Constant Summary

Constants included from Uploader

Uploader::ENDC, Uploader::GREEN

Instance Attribute Summary

Attributes inherited from Base

#args

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize, requires_config?, service_override, shell, #updater, #uploader, #uploader_config

Constructor Details

This class inherits a constructor from Yuzu::Command::Base

Class Method Details

.help(method) ⇒ Object



59
60
61
62
63
64
65
66
# File 'lib/yuzu/commands/watch.rb', line 59

def self.help method
  case method
  when :index
    "Watches the current directory for changes and automatically updates the preview of changed files."
  else

  end
end

Instance Method Details

#indexObject

Method to start the watcher.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/yuzu/commands/watch.rb', line 41

def index
  $stder.puts "The watcher has been temporarily disabled. Please use yuzu preview."

  #$stderr.puts ">>> Yuzu is watching for changes <<<"

  ## The block below doesn't have the current Watch object in its scope,
  ## so we can't pass in @config directly. Pass it into the *args parameter
  ## and the hash becomes part of the @options instance variable in the
  ## FSSM implementation. Then unpack it and pass the YuzuConfig(@config)
  ## to the rebuild_site method.
  #FSSM.monitor("#{Dir.pwd}", '**/*', :config => @config) do
  #  update {|base, relative| rebuild_site(base, relative, @options[:config])}
  #  delete {|base, relative| rebuild_site(base, relative, @options[:config])}
  #  create {|base, relative| rebuild_site(base, relative, @options[:config])}
  #end

end