Method: Rip::Env#use

Defined in:
lib/rip/env.rb

#use(env) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/rip/env.rb', line 35

def use(env)
  if env.strip.empty?
    return "must give a ripenv to use"
  end

  if error = validate_ripenv(env)
    return error
  end

  begin
    FileUtils.rm active_dir
  rescue Errno::ENOENT
  end
  FileUtils.ln_s(File.join(Rip.dir, env), active_dir)

  "using #{env}"
end