Class: Xezat::Detector::Libtool

Inherits:
Object
  • Object
show all
Defined in:
lib/xezat/detector/libtool.rb

Instance Method Summary collapse

Instance Method Details

#detect(variables) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/xezat/detector/libtool.rb', line 8

def detect(variables)
  Find.find(variables[:S]) do |file|
    return true if file.end_with?("#{File::SEPARATOR}ltmain.sh")
  end
  Find.find(variables[:S]) do |file|
    next unless file.end_with?("#{File::SEPARATOR}Makefile", "#{File::SEPARATOR}makefile")
    next if File.directory?(file)

    File.foreach(file) do |line|
      return true if line.lstrip.include?('libtool')
    end
  end
  false
end