Class: Uttk::Strategies::Bootstrap

Inherits:
Proxy show all
Includes:
Concrete
Defined in:
lib/uttk/strategies/Bootstrap.rb

Overview

Run the bootstrap(.sh)? script or a classic autoreconf. This strategy is used by the Package strategy in case of the tested package does use the autotools or not.

Constant Summary collapse

BOOTSTRAP =
/bootstrap(\.sh)?/
AUTORECONF =
'autoreconf -fvi'

Instance Attribute Summary

Attributes inherited from Strategy

#status

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Proxy

#create

Methods inherited from Composite

#<<, #contents, #create, #initialize, #initialize_copy, #initialize_test

Methods inherited from Strategy

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

Constructor Details

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

Class Method Details

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

Returns:

  • (Boolean)


44
45
46
47
# File 'lib/uttk/strategies/Bootstrap.rb', line 44

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

Instance Method Details

#dir=(dir) ⇒ Object



39
40
41
# File 'lib/uttk/strategies/Bootstrap.rb', line 39

def dir= ( dir )
  @dir = Pathname.new(dir)
end

#prologueObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/uttk/strategies/Bootstrap.rb', line 20

def prologue
  super

  cmd = self.class.have_bootstrap? @dir
  if cmd.nil? and Configure.have_configure_input? @dir
    cmd = AUTORECONF
  end
  unless cmd.nil? or Configure.have_configure?(@dir)
    create(Cmd) do |test|
      test.name = 'internal command'
      test.exit = 0
      test.dir = @dir
      test.command = cmd
      test.reject :strategy
    end
  end
end