app/lib/build_detective.rb
# Individual detectives must identify their inputs, outputs
Individual detectives must identify their inputs, outputs
Individual detectives must identify their inputs outputs
def analyze(_evidence, current)
    repo_files = current[:repo_files]
    @results = {} 
    return {} if repo_files.blank?
    @top_level = repo_files.get_info('/')
    determine_results(
      :build_status,
      /\A(
          Makefile|                 # Make
          GNUmakefile|              # GNU make specific
          autoconf.ac|automake.am|  # autotools
          CMakeLists\.txt|          # cmake
          Rakefile|                 # rake, common for Ruby
          pom\.xml|                 # Maven, common for Java
          build\.xml|               # Ant, common for Java
          .*\.proj|                 # msbuild
          build\.sbt|               # SBT, for Scala
          SConstruct|               # SCONS. Uses Python.
          wscript                   # WAF build system
        )\Z
      /ix, 'build'
    )
    if @results.key?(:build_status)
      @results[:build_common_tools_status] = @results[:build_status]
    end
    @results
  end
def analyze ( _evidence , current ) repo_files = current [ :repo_files ] @results = { } return { } if repo_files . blank? @top_level = repo_files . get_info ( '/' ) determine_results ( :build_status , / \A (
          Makefile|                 # Make
          GNUmakefile|              # GNU make specific
          autoconf.ac|automake.am|  # autotools
          CMakeLists \. txt|          # cmake
          Rakefile|                 # rake, common for Ruby
          pom \. xml|                 # Maven, common for Java
          build \. xml|               # Ant, common for Java
          .* \. proj|                 # msbuild
          build \. sbt|               # SBT, for Scala
          SConstruct|               # SCONS. Uses Python.
          wscript                   # WAF build system
        ) \Z /ix , 'build' ) if @results . key? ( :build_status ) @results [ :build_common_tools_status ] = @results [ :build_status ] end @results end
Individual detectives must identify their inputs, outputs
Individual detectives must identify their inputs outputs
# repo_url = current[:repo_url] # For future use to search more thoroughly # doc = Nokogiri::HTML(open(repo_url)) # For future use to search # more thoroughly # Blank results for return # Top_level is iterable, contains a hash with name, size, type (file|dir). # doc.css('a').each do |link| # For future use to search more thoroughly # TODO perform search on actual tree rather than just top level. # If we can detect it, it's common enough to be considered common.
_evidence
<not_specific>
current
<not_specific>