Module: Waddup::Extension::System
- Included in:
- AppleScript, Source::Git, Source::Git
- Defined in:
- lib/waddup/extensions/system.rb
Instance Method Summary collapse
-
#os ⇒ Object
Retrieves operating system See: github.com/celluloid/celluloid/blob/master/lib/celluloid/cpu_counter.rb.
-
#osx? ⇒ Boolean
Whether running OSX.
-
#run(command, options = {}) ⇒ Object
Runs given system command.
Instance Method Details
#os ⇒ Object
Retrieves operating system See: github.com/celluloid/celluloid/blob/master/lib/celluloid/cpu_counter.rb
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
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, = {}) command << ' 2>&1' if [:quietly] `#{command}`.chomp end |