Class: FlashPlayer::Executable

Inherits:
Sprout::Executable::Base
  • Object
show all
Defined in:
lib/flashplayer/executable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeExecutable

Returns a new instance of Executable.



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/flashplayer/executable.rb', line 27

def initialize
  super
  @mm_config = MMConfig.new
  @reader = LogFile.new
  @trust_config = Trust.new
  @process = nil
  @stdout = $stdout
  @stderr = $stderr
  @logger = $stdout
  self.pkg_name = FlashPlayer::NAME
  self.pkg_version = FlashPlayer::VERSION
end

Instance Attribute Details

#stderrObject

Returns the value of attribute stderr.



7
8
9
# File 'lib/flashplayer/executable.rb', line 7

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout.



6
7
8
# File 'lib/flashplayer/executable.rb', line 6

def stdout
  @stdout
end

Instance Method Details

#execute(*args) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/flashplayer/executable.rb', line 40

def execute *args
  execute_safely do
    update_mm_config
    update_trust_config_with input
  end

  if use_fdb?
    launch_fdb_and_player_with input
  else
    player_thread = launch_player_with input
    tail_flashlog player_thread
  end
end

#fdbObject

Drop into FDB after launching the Player.

flashplayer --fdb bin/SomeProject.swf


21
# File 'lib/flashplayer/executable.rb', line 21

add_param :fdb, Boolean, { :hidden_value => true }

#inputObject

The file that the Flash Player should launch.

flashplayer bin/SomeProject.swf


14
# File 'lib/flashplayer/executable.rb', line 14

add_param :input, String, { :hidden_name => true, :required => true }

#loggerObject



68
69
70
# File 'lib/flashplayer/executable.rb', line 68

def logger
  @logger
end

#logger=(logger) ⇒ Object



61
62
63
64
65
66
# File 'lib/flashplayer/executable.rb', line 61

def logger=(logger)
  @logger              = logger
  @mm_config.logger    = logger
  @reader.logger       = logger
  @trust_config.logger = logger
end

#use_fdb?Boolean

Returns:

  • (Boolean)


54
55
56
57
58
59
# File 'lib/flashplayer/executable.rb', line 54

def use_fdb?
  # Check as string b/c this is
  # how the boolean value comes
  # accross the command line input.
  fdb || ENV['USE_FDB'].to_s == 'true'
end

#versionObject

The Flash Player version to use.



25
# File 'lib/flashplayer/executable.rb', line 25

add_param :version, String, { :default => FlashPlayer::VERSION }