class Boxen::Postflight::Env

Constants

CHECKSUM

The checksum when this file was loaded.

Public Class Methods

checksum() click to toggle source

Calculate an MD5 checksum for the current environment.

# File lib/boxen/postflight/env.rb, line 7
def self.checksum

  # We can't get this from config 'cause it's static (gotta happen
  # on load), and BOXEN_HOME might not be set.

  home = ENV["BOXEN_HOME"] || "/opt/boxen"
  return unless File.file? "#{home}/env.sh"

  `find #{home}/env* -type f 2>&1 | sort | xargs /sbin/md5 | /sbin/md5 -q`.strip
end

Public Instance Methods

ok?() click to toggle source
# File lib/boxen/postflight/env.rb, line 22
def ok?
  self.class.checksum == CHECKSUM
end
run() click to toggle source
# File lib/boxen/postflight/env.rb, line 26
def run
  warn "Run source #{config.envfile} or restart your shell for new stuff!"
end