Module: Stable::Bootstrap

Defined in:
lib/stable/bootstrap.rb

Class Method Summary collapse

Class Method Details

.disable_rvm_autolibs!Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/stable/bootstrap.rb', line 21

def self.disable_rvm_autolibs!
  return unless system("which rvm > /dev/null")

  # Only run once
  marker = File.join(Paths.root, ".rvm_autolibs_disabled")
  return if File.exist?(marker)

  puts "Configuring RVM (disabling autolibs)..."

  system("bash -lc 'rvm autolibs disable'")
  system("bash -lc 'echo rvm_silence_path_mismatch_check_flag=1 >> ~/.rvmrc'")

  FileUtils.touch(marker)
end

.run!Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/stable/bootstrap.rb', line 5

def self.run!
  FileUtils.mkdir_p(Paths.root)
  FileUtils.mkdir_p(Paths.caddy_dir)
  FileUtils.mkdir_p(Paths.certs_dir)

  unless File.exist?(Paths.apps_file)
    File.write(Paths.apps_file, "--- []\n")
  end

  unless File.exist?(Paths.caddyfile)
    File.write(Paths.caddyfile, "")
  end

  disable_rvm_autolibs!
end