Class: Guard::Stitchplus
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ Stitchplus
constructor
A new instance of Stitchplus.
- #reload ⇒ Object
- #run_all ⇒ Object
- #run_on_additions(paths) ⇒ Object
- #run_on_changes(paths) ⇒ Object
- #run_on_removals(paths) ⇒ Object
- #start ⇒ Object
- #write ⇒ Object
Constructor Details
#initialize(watchers = [], options = {}) ⇒ Stitchplus
Returns a new instance of Stitchplus.
7 8 9 10 |
# File 'lib/guard/stitch-plus.rb', line 7 def initialize (watchers=[], ={}) super @options = end |
Instance Method Details
#reload ⇒ Object
19 20 21 |
# File 'lib/guard/stitch-plus.rb', line 19 def reload write end |
#run_all ⇒ Object
23 24 25 |
# File 'lib/guard/stitch-plus.rb', line 23 def run_all write end |
#run_on_additions(paths) ⇒ Object
33 34 35 36 37 38 |
# 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) ⇒ Object
40 41 42 43 44 45 46 47 |
# 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) ⇒ Object
27 28 29 30 31 |
# File 'lib/guard/stitch-plus.rb', line 27 def run_on_removals(paths) if (paths & @stitch_files).size > 0 write end end |
#start ⇒ Object
12 13 14 15 16 17 |
# 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 ⇒ Object
49 50 51 52 |
# File 'lib/guard/stitch-plus.rb', line 49 def write @stitcher.write ENV['GUARD_STITCH_PLUS_OUTPUT'] = @stitcher.last_write end |