Module: Waddup::Extension::System

Included in:
AppleScript, Source::Git, Source::Git
Defined in:
lib/waddup/extensions/system.rb

Instance Method Summary collapse

Instance Method Details

#osObject



20
21
22
# File 'lib/waddup/extensions/system.rb', line 20

def os
  @os ||= RbConfig::CONFIG['host_os'][/^[A-Za-z]+/]
end

#osx?Boolean

Whether running OSX

Returns:

  • (Boolean)


25
26
27
# File 'lib/waddup/extensions/system.rb', line 25

def osx?
  os == 'darwin'
end

#run(command, options = {}) ⇒ Object

Runs given system command

Options:

:quietly (supresses output)


13
14
15
16
# File 'lib/waddup/extensions/system.rb', line 13

def run(command, options = {})
  command << ' 2>&1' if options[:quietly]
  `#{command}`.chomp
end