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

make sure latest rubygems is used unless version is specified. #9

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
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
1 change: 1 addition & 0 deletions attributes/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
default[:pkg_build][:ruby][:version] = '1.9.3'
default[:pkg_build][:ruby][:patchlevel] = 'p392'
default[:pkg_build][:ruby][:install_prefix] = '/usr/local'
default[:pkg_build][:ruby][:rubygems][:version] = 'latest' # or set to rubygems version
default[:pkg_build][:ruby][:suffix_version] = false
default[:pkg_build][:ruby][:package_dependencies] = %w(
openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev
Expand Down
14 changes: 10 additions & 4 deletions recipes/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,21 @@
end.last
ruby_build = PkgBuild::Ruby.ruby_build(node, install_version.first.version, install_version.last)
ruby_dpkg = File.join(node[:fpm_tng][:package_dir], "#{ruby_build}.deb")

commands = ["dpkg -i #{ruby_dpkg}; apt-get -f -q -y install", "gem install --no-ri --no-rdoc rubygems-update"]
if (node[:pkg_build][:ruby][:rubygems][:version] == 'latest')
commands << "gem update --system"
else
commands << "gem update --system #{node[:pkg_build][:ruby][:rubygems][:version]}"
end
commands << "gem install --no-ri --no-rdoc fpm"

node[:pkg_build][:isolated_containers].each do |name, opts|
lxc_container "#{name}-ruby#{version.version}" do
action :create
clone name
default_fstab false
initialize_commands [
"dpkg -i #{ruby_dpkg}; apt-get -f -q -y install",
'gem install --no-ri --no-rdoc fpm'
]
initialize_commands commands
end
end
end
Expand Down