Skip to content
Open
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 definitions/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

r_version = params[:version]
r_patchlevel = params[:patchlevel]
r_fullversion = [params[:version], params[:patchlevel]].join('-')
r_fullversion = [params[:version], params[:patchlevel]].compact.join('-')
r_extra_configure_args = node[:pkg_build][:ruby][:extra_configure_args].join(" ")

include_recipe 'pkg-build::deps'
Expand Down
6 changes: 4 additions & 2 deletions libraries/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ def gem_name(node, name, ruby_version=nil, include_rubygem=true)
end

def ruby_build(node, version, patchlevel)
patch = patchlevel.to_s.start_with?('p') ? patchlevel : "p#{patchlevel}"
"#{ruby_name(node, version)}-#{version}-#{patch}"
if (patchlevel)
patch = patchlevel.to_s.start_with?('p') ? patchlevel : "p#{patchlevel}"
end
[ruby_name(node, version), version, patch].compact.join('-')
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions recipes/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

versions.uniq.each do |r_ver|
version, patchlevel = r_ver.split('-')
comparable_versions << [Gem::Version.new(version), patchlevel[1,patchlevel.length].to_i]
comparable_versions << [Gem::Version.new(version), patchlevel.nil? ? nil : patchlevel.to_s[1,patchlevel.length].to_i]

if(node[:pkg_build][:isolate])
pkg_build_isolate "ruby-#{version}-#{patchlevel}" do
pkg_build_isolate ['ruby', version, patchlevel].compact.join('-') do
container 'ubuntu_1204'
attributes(
:pkg_build => {
Expand Down