Class: TTK::Strategies::Configure

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

Constant Summary collapse

CONFIGURE =
/^configure(\.sh)?$/
CONFIGURE_INPUT =
/^configure\.(ac|in)$/

Instance Attribute Summary

Attributes inherited from Strategy

#status, #symtbl

Class Method Summary collapse

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

Class Method Details

.have_configure?(dir = Pathname.new('.')) ⇒ Boolean

Returns:

  • (Boolean)


51
52
53
54
# File 'lib/ttk/strategies/Configure.rb', line 51

def self.have_configure? ( dir=Pathname.new('.') )
  res = dir.entries.find { |ent| ent.to_s =~ CONFIGURE }
  (res.nil?) ? nil : dir + res
end

.have_configure_input?(dir = Pathname.new('.')) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
49
# File 'lib/ttk/strategies/Configure.rb', line 46

def self.have_configure_input? ( dir=Pathname.new('.') )
  res = dir.entries.find { |ent| ent.to_s =~ CONFIGURE_INPUT }
  (res.nil?) ? nil : dir + res
end

Instance Method Details

#mk_command(script) ⇒ Object



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

def mk_command ( script )
  cmd = script.to_s
  cmd += " --prefix=#@prefix" if @prefix
  if @flags.is_a? Array
    @flags = @flags.join(' ')
  else
    @flags = @flags.to_s
  end
  symtbl_configure_flags = @symtbl[:configure_flags]
  @flags += ' ' + symtbl_configure_flags unless symtbl_configure_flags.nil?
  @symtbl[:configure_flags] = @flags
  cmd + ' ' + @flags
end

#prologueObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ttk/strategies/Configure.rb', line 31

def prologue 
  super
	@dir = Pathname.new(@dir)
	if script = self.class.have_configure?(@dir)
	  create(Cmd) do |test|
      test.name = 'command'
      test.exit = 0
      test.dir = @dir
      test.command = mk_command(script)
      test.verbose_print = true
      test.reject :strategy, :dir
    end
	end
end