Sha256: 525264753020bf087499af5cb037c7ce693d58e8c8330b75021ef6a64a36260b

Contents?: true

Size: 674 Bytes

Versions: 9

Compression:

Stored size: 674 Bytes

Contents

# -*- encoding : utf-8 -*-
module Lolcommits
  class CaptureCygwin < Capturer
    def capture
      # DirectShow takes a while to show... at least for me anyway
      delaycmd = ' /delay 3000'
      if capture_delay > 0
        # CommandCam delay is in milliseconds
        delaycmd = " /delay #{capture_delay * 1000}"
      end

      _, r, _ = Open3.popen3("#{executable_path} /filename `cygpath -w #{snapshot_location}`#{delaycmd}")

      # looks like we still need to read the output for something to happen
      r.read
    end

    def executable_path
      File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'CommandCam', 'CommandCam.exe')
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
lolcommits-0.5.9 lib/lolcommits/capturer/capture_cygwin.rb
lolcommits-0.5.9.pre1 lib/lolcommits/capturer/capture_cygwin.rb
lolcommits-0.5.8 lib/lolcommits/capturer/capture_cygwin.rb
lolcommits-0.5.8.pre1 lib/lolcommits/capturer/capture_cygwin.rb
lolcommits-0.5.7 lib/lolcommits/capturer/capture_cygwin.rb
lolcommits-0.5.6 lib/lolcommits/capturer/capture_cygwin.rb
lolcommits-0.5.5 lib/lolcommits/capturer/capture_cygwin.rb
lolcommits-0.5.4 lib/lolcommits/capture_cygwin.rb
lolcommits-0.5.3 lib/lolcommits/capture_cygwin.rb