Class: Luban::Deployment::Packages::Java::Installer
- Inherits:
-
Luban::Deployment::Package::Installer
- Object
- Luban::Deployment::Package::Installer
- Luban::Deployment::Packages::Java::Installer
- Defined in:
- lib/luban/deployment/packages/java/installer.rb
Instance Method Summary collapse
- #build_path ⇒ Object
- #installed? ⇒ Boolean
- #jdk_version ⇒ Object
- #package_dist ⇒ Object
- #package_full_name ⇒ Object
- #source_repo ⇒ Object
- #source_url_root ⇒ Object
Instance Method Details
#build_path ⇒ Object
29 30 31 |
# File 'lib/luban/deployment/packages/java/installer.rb', line 29 def build_path @build_path ||= package_tmp_path.join("jdk#{jdk_version}") end |
#installed? ⇒ Boolean
23 24 25 26 27 |
# File 'lib/luban/deployment/packages/java/installer.rb', line 23 def installed? return false unless file?(java_executable) pattern = Regexp.new(Regexp.escape(jdk_version)) match?("#{java_executable} -version 2>&1", pattern) end |
#jdk_version ⇒ Object
19 20 21 |
# File 'lib/luban/deployment/packages/java/installer.rb', line 19 def jdk_version @jdk_version ||= "1.#{package_major_version.gsub('u', '.0_')}" end |
#package_dist ⇒ Object
8 |
# File 'lib/luban/deployment/packages/java/installer.rb', line 8 def package_dist; task.opts.dist; end |
#package_full_name ⇒ Object
9 |
# File 'lib/luban/deployment/packages/java/installer.rb', line 9 def package_full_name; "jdk-#{package_major_version}-#{package_dist}"; end |
#source_repo ⇒ Object
11 12 13 |
# File 'lib/luban/deployment/packages/java/installer.rb', line 11 def source_repo @source_repo ||= 'http://download.oracle.com' end |
#source_url_root ⇒ Object
15 16 17 |
# File 'lib/luban/deployment/packages/java/installer.rb', line 15 def source_url_root @source_url_root ||= "otn-pub/java/jdk/#{package_version}" end |