lib/enkaironment/install.rb
# Installs rbenv to a given user's home directory
Installs rbenv to a given user's home directory
Installs rbenv to a given user ' s home directory
def rbenv(username)
      return unless user_exists?(username)
      user = Etc.getpwnam(username)
      system %(su #{username} -c "git clone https://github.com/rbenv/rbenv.git #{user.dir}/.rbenv")
      rbenv_shim = <<~RBENV
        export PATH="$HOME/.rbenv/bin:$PATH"
        eval "$(rbenv init -)"
      RBENV
      %w[zshrc bashrc].map { |f| "#{user.dir}/.#{f}" }.
        select(&File.method(:file?)).
        map { |filename| append_to_file(filename, rbenv_shim) }
    end
def rbenv ( username ) return unless user_exists? ( username ) user = Etc . getpwnam ( username ) system %(su #{username} -c "git clone https://github.com/rbenv/rbenv.git #{user.dir}/.rbenv") rbenv_shim = <<~RBENV 
        export PATH="$HOME/.rbenv/bin:$PATH"
        eval "$(rbenv init -)"
       RBENV %w[ zshrc bashrc ] . map { | f | "#{user.dir}/.#{f}" } . select ( & File . method ( :file? ) ) . map { | filename | append_to_file ( filename , rbenv_shim ) } end
Installs rbenv to a given user's home directory
Installs rbenv to a given user ' s home directory
username
<not_specific>