module TestLab::DualMethods
Test Lab Class Methods
These are special methods that we both include and extend on the parent class.
Public Instance Methods
build_command_line(name, *args)
click to toggle source
Build Command Line
Attempts to build a command line to a binary for us. We use ZTK::Locator to attempt to determine if we are using bundler binstubs; otherwise we simply rely on /bin/env to find the executable for us via the PATH environment variable.
@return [String] Constructed command line with arguments.
# File lib/testlab.rb, line 533 def build_command_line(name, *args) executable = (ZTK::Locator.find('bin', name) rescue "/usr/bin/env #{name}") [executable, args].flatten.compact.join(' ') end
gem_dir()
click to toggle source
Test Lab Gem Directory
Returns the directory path to where the gem is installed.
@return [String] The directory path to the gem installation.
# File lib/testlab.rb, line 520 def gem_dir directory = File.join(File.dirname(__FILE__), "..") File.expand_path(directory, File.dirname(__FILE__)) end
hostname()
click to toggle source
TestLab
Hostname
Gets the hostname portion of the fqdn for the current host.
@return [String] The hostname for the current host.
# File lib/testlab.rb, line 511 def hostname Socket.gethostname.split('.').first.strip end
ui()
click to toggle source
ui=(value)
click to toggle source