Class: VpsbClient::Builders::UnameParser
- Inherits:
-
SystemInfoParser
- Object
- SystemInfoParser
- VpsbClient::Builders::UnameParser
- Defined in:
- lib/vpsb_client/builders/system_info_parser.rb
Constant Summary collapse
- REGEX =
Linux lino 3.12.6-x86_64-linode36 #2 SMP Mon Jan 13 18:54:10 EST 2014 x86_64 x86_64 x86_64 GNU/Linux
Regexp.new(/\w+ \S+ (?<kernel>\d+\.\d+\.\d+)-(?<type>[^\-\s]+)[\-\s]/)
Instance Attribute Summary collapse
-
#kernel ⇒ Object
readonly
Returns the value of attribute kernel.
-
#os_type ⇒ Object
readonly
Returns the value of attribute os_type.
Instance Method Summary collapse
-
#initialize ⇒ UnameParser
constructor
A new instance of UnameParser.
- #parse ⇒ Object
Methods inherited from SystemInfoParser
#find_matches, #find_matches!, #lines
Constructor Details
#initialize ⇒ UnameParser
Returns a new instance of UnameParser.
63 64 65 |
# File 'lib/vpsb_client/builders/system_info_parser.rb', line 63 def initialize super('uname -a') end |
Instance Attribute Details
#kernel ⇒ Object (readonly)
Returns the value of attribute kernel.
59 60 61 |
# File 'lib/vpsb_client/builders/system_info_parser.rb', line 59 def kernel @kernel end |
#os_type ⇒ Object (readonly)
Returns the value of attribute os_type.
59 60 61 |
# File 'lib/vpsb_client/builders/system_info_parser.rb', line 59 def os_type @os_type end |
Instance Method Details
#parse ⇒ Object
67 68 69 70 71 |
# File 'lib/vpsb_client/builders/system_info_parser.rb', line 67 def parse matches = find_matches!(REGEX) @kernel = matches[:kernel] @os_type = matches[:type] end |