Sha256: b6cdf7439f636194fa858efc7841b23f5316bf6c85a9f576caf5f3721b012da1

Contents?: true

Size: 711 Bytes

Versions: 2

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: true

require 'find'

module Xezat
  module Detector
    class Python38Docutils
      def detect(variables)
        Find.find(variables[:S]) do |file|
          next unless file.end_with?("#{File::SEPARATOR}configure.ac", "#{File::SEPARATOR}configure.in")

          File.foreach(file) do |line|
            return true if line.strip.start_with?('AC_CHECK_PROG') && line.index('rst2man').is_a?(Integer)
          end
        end
        if variables.key?(:_meson_CYGCLASS_)
          File.foreach(File.join(variables[:S], 'meson.build')) do |line|
            return true if line.strip.index('rst2man').is_a?(Integer)
          end
        end
        false
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xezat-0.2.2 lib/xezat/detector/python38-docutils.rb
xezat-0.2.1 lib/xezat/detector/python38-docutils.rb