lib/lolcommits/runner.rb in lolcommits-0.9.3 vs lib/lolcommits/runner.rb in lolcommits-0.9.4.pre1

- old
+ new

@@ -36,25 +36,24 @@ # do main capture to snapshot_loc run_capture # check capture succeded, file must exist if File.exist?(snapshot_loc) - ## resize snapshot first resize_snapshot! - # do native plugins that need to happen immediately after capture and - # resize this is effectively the "image processing" phase for now, - # reserve just for us and handle manually...? - Lolcommits::Plugin::Loltext.new(self).execute_postcapture - - # do plugins that need to happen after capture + # execute postcapture plugins, use to alter the capture plugin_manager.plugins_for(:postcapture).each do |plugin| plugin.new(self).execute_postcapture end - # do things that should happen last + # execute captureready plugins, capture is ready for export/sharing + plugin_manager.plugins_for(:captureready).each do |plugin| + plugin.new(self).execute_captureready + end + + # clean away any tmp files cleanup! else debug 'Runner: failed to capture a snapshot' exit 1 end @@ -93,10 +92,10 @@ def resize_snapshot! debug 'Runner: resizing snapshot' image = MiniMagick::Image.open(snapshot_loc) if image[:width] > 640 || image[:height] > 480 - # this is ghetto resize-to-fill + # this is hacky resize-to-fill image.combine_options do |c| c.resize '640x480^' c.gravity 'center' c.extent '640x480' end