Class: FunCi::Setup::ProjectDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/fun_ci/setup/project_detector.rb

Instance Method Summary collapse

Constructor Details

#initialize(filenames) ⇒ ProjectDetector

Returns a new instance of ProjectDetector.



6
7
8
# File 'lib/fun_ci/setup/project_detector.rb', line 6

def initialize(filenames)
  @filenames = filenames
end

Instance Method Details

#detectObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/fun_ci/setup/project_detector.rb', line 10

def detect
  return :ruby_bundler if @filenames.include?("Gemfile")
  return :jvm_gradle_kotlin if @filenames.include?("build.gradle.kts")
  return :jvm_gradle_kotlin if @filenames.include?("settings.gradle.kts")
  return :jvm_gradle_groovy if @filenames.include?("build.gradle")
  return :jvm_gradle_groovy if @filenames.include?("settings.gradle")
  return :jvm_maven if @filenames.include?("pom.xml")

  :unknown
end