Class: JavaBuildpackUtils::Jre::Detect

Inherits:
Object
  • Object
show all
Defined in:
lib/java-buildpack-utils/jre/detect.rb

Overview

A class containing the functionality required to determine if an application is a Java application based on the its explicit JRE configuration

Instance Method Summary collapse

Constructor Details

#initialize(app_dir) ⇒ Detect

Creates a new instance, passing in the application directory used during detection

Parameters:

  • app_dir (String)

    The application directory used during detection



23
24
25
# File 'lib/java-buildpack-utils/jre/detect.rb', line 23

def initialize(app_dir)
  @selected_jre = JavaBuildpackUtils::Jre::SelectedJre.new(app_dir)
end

Instance Method Details

#runString

The execution entry point for detection. This method is responsible for identifying exactly which version of Java should be used and returning a string that represents it.

Returns:

  • (String)

    a unique value indicating exactly which version should be used. The value is structured as ‘java-<vendor>-<version>’.



32
33
34
# File 'lib/java-buildpack-utils/jre/detect.rb', line 32

def run
  @selected_jre.id
end