Class: Aio::Module::Cmd::Maipu::ShowEnv

Inherits:
Aio::Module::Cmd::Maipu show all
Includes:
Aio::Module
Defined in:
lib/modules/cmd/maipu/show_env.rb

Instance Attribute Summary

Attributes inherited from Aio::Module::Cmd

#cmd_info, #context, #device_info, #ext_info, #useful, #warning_klass

Instance Method Summary collapse

Methods inherited from Aio::Module::Cmd

#author, #benchmark, #clear_useful, #cmd_full, #cmd_short, #description, #division, #key_stand, #license, #platform, #ranking, #set_defaults, #type

Methods included from Ui::Verbose

#clear_line, #print_error, #print_good, #progress_bar

Constructor Details

#initializeShowEnv

Returns a new instance of ShowEnv.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/modules/cmd/maipu/show_env.rb', line 8

def initialize
	super({
		:cmd_full		=> "show environment",
		:cmd_short	=> "sh env",
		:author			=> "Elin",
		:description	=> "This is Maipu Command# show environment",
		:ranking		=> Ranking_1,
		:platform		=> "all",
		:benchmark	=> {
			:cpu_temperature 				=> ["<", 70],
			:mainboard_temperature 	=> ["<", 70],
			}
	})
end

Instance Method Details

#parseObject



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/modules/cmd/maipu/show_env.rb', line 23

def parse
	cont = self.context.dup
	env = {}
	useful[:env] = env
	context.readline_match_block(/CPU Temperature is (?<cpu_temperature>\d+)/) do |block|
		block.warning_serious(env, :cpu_temperature, self)
	end
	context.readline_match_block(/MainBoard Temperature is (?<mainboard_temperature>\d+)/) do |block|
		block.warning_serious(env, :mainboard_temperature, self)
	end
end