class Guard::Plant

Public Instance Methods

run_on_additions(paths = []) click to toggle source
# File lib/guard/plant.rb, line 6
def run_on_additions(paths = [])
  import_seeds(paths)
end
run_on_modifications(paths = []) click to toggle source
# File lib/guard/plant.rb, line 10
def run_on_modifications(paths = [])
  import_seeds(paths)
end
start() click to toggle source
# File lib/guard/plant.rb, line 14
def start
  import_seeds([])
end

Private Instance Methods

import_seeds(paths) click to toggle source
# File lib/guard/plant.rb, line 20
def import_seeds(paths)
  Guard::Compat::UI.info "Auto importing seeds"
  if paths.size == 0
    @result = system('bundle exec rake plant:seeds')
  else
    @result = 'Added seeds for:'
    paths.each do |path|
      system("bundle exec rake plant:specific_seed[#{path}]")
      @result += " #{path}"
    end
  end
  Guard::Compat::UI.info "Seeds imported: #{@result}"
end