Class: Guard::Soca

Inherits:
Guard
  • Object
show all
Defined in:
lib/guard/soca.rb

Instance Method Summary collapse

Constructor Details

#initialize(watchers = [], options = {}) ⇒ Soca

Returns a new instance of Soca.



8
9
10
11
12
13
14
15
16
# File 'lib/guard/soca.rb', line 8

def initialize(watchers = [], options = {})
  super

  appdir = options[:appdir] || File.expand_path(Dir.pwd)
  env = options[:env] || "default"
  config_file = options[:config_file]
  @pusher = ::Soca::Pusher.new(appdir, env, config_file)
  @times = 0
end

Instance Method Details

#reloadObject



26
27
28
# File 'lib/guard/soca.rb', line 26

def reload
  true
end

#run_allObject



30
31
32
# File 'lib/guard/soca.rb', line 30

def run_all
  true
end

#run_on_change(paths) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/guard/soca.rb', line 34

def run_on_change(paths)
  @times += 1
  print "Soca: push..."
  @pusher.push!
  puts "DONE"
  if @times % 5 == 0
    print "Soca: Running a compact..."
    @pusher.compact!
    puts "DONE"
  end
end

#startObject



18
19
20
# File 'lib/guard/soca.rb', line 18

def start
  true
end

#stopObject



22
23
24
# File 'lib/guard/soca.rb', line 22

def stop
  true
end