Class: RvmUtil

Inherits:
Object
  • Object
show all
Defined in:
lib/yadecli/util/rvm_util.rb

Overview

rvm util

Class Method Summary collapse

Class Method Details

.setup_rvm(project, rvm_runtime) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/yadecli/util/rvm_util.rb', line 6

def self.setup_rvm(project, rvm_runtime)

  puts ''
  puts 'Setup rvm:'.colorize(:mode => :bold)

  # .ruby-version
  puts " ↳ Create .ruby-version with #{rvm_runtime.version}"
  File.open("#{project.home}/.ruby-version", 'w') { |f| f.write(rvm_runtime.version) }

  # .ruby-gemset
  puts " ↳ Create .ruby-gemset with #{project.name}"
  File.open("#{project.home}/.ruby-gemset", 'w') { |f| f.write(project.name) }

  # .gems
  puts " ↳ Create .gems with #{rvm_runtime.packages}"
  File.open("#{project.home}/.gems", 'w') do |f|
    rvm_runtime.packages.split(',').each do |p|
      f.puts(p.strip! || p)
    end
  end

  # rvm gemset import
  # puts ''
  # puts 'Import gemset from .gems file.'.colorize(:mode => :bold)
  #
  # cmd = TTY::Command.new(output: Yadecli.LOGGER)
  #
  # script_path = FileUtil.script_path('rvm-gemset-import.sh')
  # cmdline = "#{script_path} #{project.home}"
  #
  # cmd.run(cmdline)
end