Class: Simp::Cli::Config::Item::CommonRunLevelDefault
Instance Attribute Summary
#allow_user_apply, #config_items, #description, #die_on_apply_fail, #fact, #fail_on_missing_answer, #key, #next_items_tree, #silent, #skip_apply, #skip_query, #skip_yaml, #value
Instance Method Summary
collapse
#apply, #default_value, #highline_question_type, #next_items, #print_banner, #print_summary, #puppet_value, #query, #query_ask, #query_extras, #query_status, #safe_apply, #say_blue, #say_green, #say_red, #say_yellow, #to_yaml_s
Constructor Details
Returns a new instance of CommonRunLevelDefault.
9
10
11
12
13
|
# File 'lib/simp/cli/config/item/common_runlevel_default.rb', line 9
def initialize
super
@key = 'simplib::runlevel'
@description = %Q{The default system runlevel (1-5).}
end
|
Instance Method Details
#not_valid_message ⇒ Object
19
20
21
|
# File 'lib/simp/cli/config/item/common_runlevel_default.rb', line 19
def not_valid_message
'Must be a number between 1 and 5'
end
|
#os_value ⇒ Object
23
24
25
26
|
# File 'lib/simp/cli/config/item/common_runlevel_default.rb', line 23
def os_value
%x{runlevel | awk '{print $2}'}.strip
end
|
#recommended_value ⇒ Object
28
29
30
|
# File 'lib/simp/cli/config/item/common_runlevel_default.rb', line 28
def recommended_value
'3'
end
|
#validate(x) ⇒ Object
15
16
17
|
# File 'lib/simp/cli/config/item/common_runlevel_default.rb', line 15
def validate( x )
(x.to_s =~ /\A[1-5]\Z/) ? true : false
end
|