Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow jdk_version to be a string or number #133

Merged
merged 1 commit into from
Jan 24, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class OpenJDK
def initialize(node)
@node = node.to_hash
@java_home = @node['java']['java_home'] || '/usr/lib/jvm/default-java'
@jdk_version = @node['java']['jdk_version'] || '6'
@jdk_version = @node['java']['jdk_version'].to_s || '6'
end

def java_location
Expand Down
2 changes: 1 addition & 1 deletion recipes/ibm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

java_alternatives 'set-java-alternatives' do
java_location node['java']['java_home']
case node['java']['jdk_version']
case node['java']['jdk_version'].to_s
when "6"
bin_cmds node['java']['ibm']['6']['bin_cmds']
when "7"
Expand Down
2 changes: 1 addition & 1 deletion recipes/ibm_tar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

java_alternatives 'set-java-alternatives' do
java_location node['java']['java_home']
case node['java']['jdk_version']
case node['java']['jdk_version'].to_s
when "6"
bin_cmds node['java']['ibm']['6']['bin_cmds']
when "7"
Expand Down
2 changes: 1 addition & 1 deletion recipes/openjdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
java_alternatives 'set-java-alternatives' do
java_location jdk.java_home
priority jdk.alternatives_priority
case node['java']['jdk_version']
case node['java']['jdk_version'].to_s
when "6"
bin_cmds node['java']['jdk']['6']['bin_cmds']
when "7"
Expand Down
8 changes: 1 addition & 7 deletions recipes/oracle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,8 @@

java_home = node['java']["java_home"]
arch = node['java']['arch']
jdk_version = node['java']['jdk_version']

#convert version number to a string if it isn't already
if jdk_version.instance_of? Fixnum
jdk_version = jdk_version.to_s
end

case jdk_version
case node['java']['jdk_version'].to_s
when "6"
tarball_url = node['java']['jdk']['6'][arch]['url']
tarball_checksum = node['java']['jdk']['6'][arch]['checksum']
Expand Down
2 changes: 1 addition & 1 deletion recipes/oracle_i386.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

java_home = node['java']["java_home"]

case node['java']['jdk_version']
case node['java']['jdk_version'].to_s
when "6"
tarball_url = node['java']['jdk']['6']['i586']['url']
tarball_checksum = node['java']['jdk']['6']['i586']['checksum']
Expand Down
2 changes: 1 addition & 1 deletion spec/libraries/helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{
'java' => {
'java_home' => '/usr/lib/jvm/default-java',
'jdk_version' => 6
'jdk_version' => '6'
},
'kernel' => {
'machine' => 'x86_64'
Expand Down