Class: JavaBuildpackUtils::Jre::SelectedJre
- Inherits:
-
Object
- Object
- JavaBuildpackUtils::Jre::SelectedJre
- Defined in:
- lib/java-buildpack-utils/jre/selected_jre.rb
Overview
A class containing information about the JRE selected by the user.
Constant Summary collapse
- DEFAULT_VENDOR =
The default JRE vendor
'oracle'- KEY_VENDOR =
The property key for specifying the vendor
'java.runtime.vendor'- DEFAULT_VERSION =
The default JRE version
'7'- KEY_VERSION =
The property key for specifying the version
'java.runtime.version'- JRES =
The collection of legal JREs
{ openjdk: { J6: '', J7: '', J8: 'http://download.java.net/jdk8/archive/b88/binaries/jre-8-ea-bin-b88-linux-x64-02_may_2013.tar.gz' }, oracle: { J6: '', J7: 'http://javadl.sun.com/webapps/download/AutoDL?BundleId=76853', J8: '' } }
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
A unique value indicating exactly which JRE is being used.
-
#uri ⇒ String
readonly
The download URI for the JRE being used.
-
#vendor ⇒ String
readonly
The vendor for the JRE being used.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(app_dir) ⇒ SelectedJre
constructor
Creates a new instance, passing in the application directory used during release.
Constructor Details
#initialize(app_dir) ⇒ SelectedJre
Creates a new instance, passing in the application directory used during release
59 60 61 62 63 64 65 66 67 |
# File 'lib/java-buildpack-utils/jre/selected_jre.rb', line 59 def initialize(app_dir) properties = system_properties(app_dir) @vendor = configured_vendor properties @version = configured_version properties @id = "java-#{@vendor}-#{@version}" @uri = JRES[@vendor.to_sym]["J#{@version}".to_sym] end |
Instance Attribute Details
#id ⇒ String (readonly)
Returns a unique value indicating exactly which JRE is being used. The value is structured as ‘java-<vendor>-<version>’.
54 55 56 |
# File 'lib/java-buildpack-utils/jre/selected_jre.rb', line 54 def id @id end |
#uri ⇒ String (readonly)
Returns the download URI for the JRE being used.
54 |
# File 'lib/java-buildpack-utils/jre/selected_jre.rb', line 54 attr_reader :id, :uri, :vendor, :version |
#vendor ⇒ String (readonly)
Returns the vendor for the JRE being used.
54 |
# File 'lib/java-buildpack-utils/jre/selected_jre.rb', line 54 attr_reader :id, :uri, :vendor, :version |
#version ⇒ Object (readonly)
Returns the value of attribute version.
54 |
# File 'lib/java-buildpack-utils/jre/selected_jre.rb', line 54 attr_reader :id, :uri, :vendor, :version |