Guest User

Untitled

a guest
Jun 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. require 'yaml'
  4.  
  5. class SystemProfiler
  6. class SPHardware
  7. def uuid
  8. data.dig 'Hardware', 'Hardware Overview', 'Hardware UUID'
  9. end
  10.  
  11. def data
  12. @command_output ||= YAML.load(`/usr/sbin/system_profiler SPHardwareDataType`)
  13. end
  14. end
  15. end
  16.  
  17. puts SystemProfiler::SPHardware.new.uuid
Add Comment
Please, Sign In to add comment