Class: Script::Trigger

Inherits:
Object
  • Object
show all
Defined in:
lib/script.rb,
lib/plugins/watch.rb,
lib/plugins/mercurial.rb

Overview

in TopLevel

Instance Method Summary collapse

Constructor Details

#initialize(toplevel, &block) ⇒ Trigger

Returns a new instance of Trigger.



34
35
36
37
# File 'lib/script.rb', line 34

def initialize(toplevel, &block)
  @toplevel = toplevel
  instance_eval(&block)
end

Instance Method Details

#doitObject



39
40
41
# File 'lib/script.rb', line 39

def doit
  @crawler.doit
end

#interval(n, &block) ⇒ Object


DSL



45
46
47
# File 'lib/script.rb', line 45

def interval(n, &block)
  @crawler = Interval.new(@toplevel, n, &block)
end

#mercurial(repository, &block) ⇒ Object



3
4
5
# File 'lib/plugins/mercurial.rb', line 3

def mercurial(repository, &block)
  @crawler = Mercurial.new(@toplevel, repository, &block)
end

#watch(filename, &block) ⇒ Object



4
5
6
# File 'lib/plugins/watch.rb', line 4

def watch(filename, &block)
  @crawler = Watch.new(@toplevel, filename, &block)
end