Class: Guard::Mouch

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Mouch.



7
8
9
10
11
12
13
14
# File 'lib/guard/mouch.rb', line 7

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

  if options[:url] !~ /^https{0,1}:\/\//
  	raise "Please provide Guard::Mouch with a valid CouchDB server URL to push your app to."
  end
  @options = options
end

Instance Method Details

#reloadObject



24
25
26
# File 'lib/guard/mouch.rb', line 24

def reload
  true
end

#run_allObject



28
29
30
# File 'lib/guard/mouch.rb', line 28

def run_all
  true
end

#run_on_change(paths) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/guard/mouch.rb', line 32

def run_on_change(paths)
  print "Mouch push..."
  mouch_file = @options[:mouch_cmd_file] || './mouch'
  config_file = @options[:mouch_config_file] || 'app.json.erb'
  url = @options[:url]
  system(mouch_file, config_file, url)
  puts "... DONE"
end

#startObject



16
17
18
# File 'lib/guard/mouch.rb', line 16

def start
  true
end

#stopObject



20
21
22
# File 'lib/guard/mouch.rb', line 20

def stop
  true
end