Module: BenchPress::SystemInformation
- Extended by:
- SystemInformation
- Included in:
- SystemInformation
- Defined in:
- lib/bench_press/system_information.rb
Instance Method Summary collapse
- #announce_cpu ⇒ Object
- #announce_memory ⇒ Object
- #announce_os ⇒ Object
- #announce_ruby_version ⇒ Object
- #cpu ⇒ Object
- #crypted_identifier ⇒ Object
- #memory ⇒ Object
- #os ⇒ Object
- #processor_count ⇒ Object
- #ruby_version ⇒ Object
- #summary ⇒ Object
Instance Method Details
#announce_cpu ⇒ Object
6 7 8 9 10 11 |
# File 'lib/bench_press/system_information.rb', line 6 def announce_cpu [ announce("CPU:", cpu), announce("Processor Count:", processor_count) ].join("\n") end |
#announce_memory ⇒ Object
13 14 15 |
# File 'lib/bench_press/system_information.rb', line 13 def announce_memory announce "Memory:", memory end |
#announce_os ⇒ Object
17 18 19 |
# File 'lib/bench_press/system_information.rb', line 17 def announce_os announce "Operating System:", os end |
#announce_ruby_version ⇒ Object
21 22 23 |
# File 'lib/bench_press/system_information.rb', line 21 def announce_ruby_version ruby_version end |
#cpu ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/bench_press/system_information.rb', line 25 def cpu if mac? "#{facts['sp_cpu_type']} #{facts['sp_current_processor_speed']}" else facts['processor0'] end end |
#crypted_identifier ⇒ Object
33 34 35 |
# File 'lib/bench_press/system_information.rb', line 33 def crypted_identifier Digest::SHA1.hexdigest(identifier) end |
#memory ⇒ Object
37 38 39 |
# File 'lib/bench_press/system_information.rb', line 37 def memory facts['sp_physical_memory'] || facts['memorysize'] end |
#os ⇒ Object
41 42 43 |
# File 'lib/bench_press/system_information.rb', line 41 def os facts['sp_os_version'] || facts['lsbdistdescription'] || facts['operatingsystem'] end |
#processor_count ⇒ Object
45 46 47 |
# File 'lib/bench_press/system_information.rb', line 45 def processor_count facts['sp_number_processors'] || facts['processorcount'] || facts['physicalprocessorcount'] end |
#ruby_version ⇒ Object
49 50 51 |
# File 'lib/bench_press/system_information.rb', line 49 def ruby_version RUBY_DESCRIPTION end |
#summary ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'lib/bench_press/system_information.rb', line 53 def summary [ announce_os, announce_cpu, announce_memory, announce_ruby_version ].join("\n") end |