class Guard::Stitchplus

Public Class Methods

new(watchers=[], options={}) click to toggle source
Calls superclass method
# File lib/guard/stitch-plus.rb, line 7
def initialize (watchers=[], options={})
  super
  @options = options
end

Public Instance Methods

reload() click to toggle source
# File lib/guard/stitch-plus.rb, line 19
def reload
  write
end
run_all() click to toggle source
# File lib/guard/stitch-plus.rb, line 23
def run_all
  write
end
run_on_additions(paths) click to toggle source
# File lib/guard/stitch-plus.rb, line 33
def run_on_additions(paths)
  @stitch_files = stitch_files
  if (paths & @stitch_files).size > 0
    write
  end
end
run_on_changes(paths) click to toggle source
# File lib/guard/stitch-plus.rb, line 40
def run_on_changes(paths)
  @stitch_files = stitch_files
  if @options[:config] and paths.include? @options[:config]
    start
  elsif (paths & @stitch_files).size > 0
    write
  end
end
run_on_removals(paths) click to toggle source
# File lib/guard/stitch-plus.rb, line 27
def run_on_removals(paths)
  if (paths & @stitch_files).size > 0
    write
  end
end
start() click to toggle source
# File lib/guard/stitch-plus.rb, line 12
def start
  @stitcher = ::StitchPlus.new(@options.merge({guard: true}))
  ENV['GUARD_STITCH_PLUS'] = 'true'
  @stitch_files = stitch_files
  write
end
write() click to toggle source
# File lib/guard/stitch-plus.rb, line 49
def write
  @stitcher.write
  ENV['GUARD_STITCH_PLUS_OUTPUT'] = @stitcher.last_write
end

Private Instance Methods

stitch_files() click to toggle source
# File lib/guard/stitch-plus.rb, line 56
def stitch_files
  all_files = @stitcher.all_files
  ENV['GUARD_STITCH_PLUS_FILES'] = all_files.join(',')
  all_files
end