Class: Sprout::System::UnixSystem

Inherits:
Object
  • Object
show all
Defined in:
lib/flashplayer/system_mixins.rb,
lib/flashsdk/adl.rb

Overview

TODO: This should NOT be here! This is preventing that method from working as expected only after this FILE is required.

Direct Known Subclasses

OSXSystem

Instance Method Summary collapse

Instance Method Details

#open_flashplayer_with(exe, swf) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/flashplayer/system_mixins.rb', line 65

def open_flashplayer_with exe, swf
  player_open = false
  trap("INT") { 
    close_flashplayer
    @player_thread.kill
  }

  @player_thread = Thread.new {
    require 'open4'
    @player_pid, stdin, stdout, stderr = Open4.popen4("#{exe} #{swf}")
    player_open = true
    stdout.read
  }

  # Wait until the player process has actually
  # openned...
  while !player_open
    sleep 0.1
  end

  @player_thread
end

#should_repair_executable(path) ⇒ Object



79
80
81
82
# File 'lib/flashsdk/adl.rb', line 79

def should_repair_executable path
  return false
  #return (File.exists?(path) && !File.directory?(path) && File.read(path).match(/^\#\!\/bin\/sh/))
end