Class: TTK::Strategies::Compile

Inherits:
Proxy show all
Includes:
Concrete
Defined in:
lib/ttk/strategies/Compile.rb

Instance Attribute Summary

Attributes inherited from Strategy

#status, #symtbl

Instance Method Summary collapse

Methods inherited from Proxy

#create

Methods inherited from Composite

#<<, #create, #initialize, #initialize_test, #new_symtbl

Methods inherited from Strategy

#abort, #assign, #clean_instance_variables, #display_unexpected_exc, #display_unexpected_synflow_exc, #fail, #initialize, #initialize_flow_factory, #pass, #raise_error, #reject, #run, #running?, #skip, #skip_if_cached, #strategy, #strategy=, #symbols=, #testify, #timeout=, #to_s, #wclass=

Constructor Details

This class inherits a constructor from TTK::Strategies::Composite

Instance Method Details

#mk_commandObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ttk/strategies/Compile.rb', line 15

def mk_command
  # Build compiling command
  command = ''
  unless @source_dir.nil?
    @source_dir = Pathname.new(@source_dir)
    @source.map! { |file| @source_dir + file }
  end
  command << @compiler << ' ' << @flags
  @include.each do |dir|
	  command << ' -I ' << dir
	end
  command << ' ' << @source.join(' ')
  command << ' -o ' << @bin
end

#prologueObject



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/ttk/strategies/Compile.rb', line 30

def prologue 
  super
  test = create(self, Cmd)
  test.name = 'internal command'
  test.exit = 0
  test.fatal = true
  test.command = mk_command

  # Configure output
  test.reject :exit
  test.reject :fatal
end