Class: Capistrano::Rbenv::SetupRuby

Inherits:
Plugin
  • Object
show all
Defined in:
lib/capistrano/rbenv/setup_ruby.rb

Instance Method Summary collapse

Instance Method Details

#define_tasksObject



3
4
5
# File 'lib/capistrano/rbenv/setup_ruby.rb', line 3

def define_tasks
  eval_rakefile File.expand_path('../tasks/setup_ruby.rake', __dir__)
end

#register_hooksObject



7
8
9
# File 'lib/capistrano/rbenv/setup_ruby.rb', line 7

def register_hooks
  after 'rbenv:map_bins', 'rbenv:install_ruby'
end

#set_defaultsObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/capistrano/rbenv/setup_ruby.rb', line 11

def set_defaults
  # Set rbenv directory for installed ruby versions
  set_if_empty :rbenv_ruby_dir, "#{fetch(:rbenv_path)}/versions/#{fetch(:rbenv_ruby)}"

  # Set list of dependencies needed for ruby
  set_if_empty :rbenv_ruby_deps, %w[libssl-dev zlib1g-dev libreadline-dev build-essential]

  # Set dependencies installer
  set_if_empty :rbenv_ruby_deps_installler, 'sudo apt-get install -y'
end