Class: Boxen::Postflight::Env
- Inherits:
-
Boxen::Postflight
- Object
- Check
- Boxen::Postflight
- Boxen::Postflight::Env
- Defined in:
- lib/boxen/postflight/env.rb
Constant Summary collapse
- CHECKSUM =
The checksum when this file was loaded.
self.checksum
Instance Attribute Summary
Attributes inherited from Check
Class Method Summary collapse
-
.checksum ⇒ Object
Calculate an MD5 checksum for the current environment.
Instance Method Summary collapse
Methods inherited from Check
#abort, checks, #initialize, register, run, #warn
Constructor Details
This class inherits a constructor from Boxen::Check
Class Method Details
.checksum ⇒ Object
Calculate an MD5 checksum for the current environment.
7 8 9 10 11 12 13 14 15 16 |
# 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 |
Instance Method Details
#ok? ⇒ Boolean
22 23 24 |
# File 'lib/boxen/postflight/env.rb', line 22 def ok? self.class.checksum == CHECKSUM end |
#run ⇒ Object
26 27 28 |
# File 'lib/boxen/postflight/env.rb', line 26 def run warn "Run source #{config.envfile} or restart your shell for new stuff!" end |