diff options
author | Scott Bonds <scott@ggr.com> | 2014-10-27 14:56:29 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-01-25 10:43:21 -0800 |
commit | ad7a9aacf2b4e6167d29627423101d1c53fc74df (patch) | |
tree | 9f85f994dfc710d629939907d972e8a974785705 /lib/chef | |
parent | c39794b472b950733233fec0a8f99f1f03f07719 (diff) | |
download | chef-ad7a9aacf2b4e6167d29627423101d1c53fc74df.tar.gz |
add question mark to methods that return a boolean
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/provider/service/openbsd.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/chef/provider/service/openbsd.rb b/lib/chef/provider/service/openbsd.rb index 047fc445b6..8734c53fb1 100644 --- a/lib/chef/provider/service/openbsd.rb +++ b/lib/chef/provider/service/openbsd.rb @@ -85,9 +85,9 @@ class Chef end def enable_service - if !is_enabled - if is_builtin - if is_enabled_by_default + if !is_enabled? + if is_builtin? + if is_enabled_by_default? update_rcl! @rc_conf_local.sub(/^#{Regexp.escape(builtin_service_enable_variable_name)}=.*/, '') else # add line with blank string, which means enable @@ -110,9 +110,9 @@ class Chef end def disable_service - if is_enabled - if is_builtin - if is_enabled_by_default + if is_enabled? + if is_builtin? + if is_enabled_by_default? # add line to disable update_rcl! @rc_conf_local + "\n" + "#{builtin_service_enable_variable_name}=\"NO\"" else @@ -179,7 +179,7 @@ class Chef end end - def is_builtin + def is_builtin? result = false var_name = builtin_service_enable_variable_name if var_name @@ -190,7 +190,7 @@ class Chef result end - def is_enabled_by_default + def is_enabled_by_default? result = false var_name = builtin_service_enable_variable_name if var_name @@ -206,7 +206,7 @@ class Chef def determine_enabled_status! result = false # Default to disabled if the service doesn't currently exist at all @enabled_state_found = false - if is_builtin + if is_builtin? var_name = builtin_service_enable_variable_name if var_name if m = @rc_conf_local.match(/^#{Regexp.escape(var_name)}=(.*)/) @@ -217,7 +217,7 @@ class Chef end end if !@enabled_state_found - result = is_enabled_by_default + result = is_enabled_by_default? end else var_name = @new_resource.service_name @@ -233,7 +233,7 @@ class Chef current_resource.enabled result end - alias :is_enabled :determine_enabled_status! + alias :is_enabled? :determine_enabled_status! end end |