diff options
author | Thom May <thom@chef.io> | 2016-01-14 14:08:03 +0000 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-01-14 14:08:03 +0000 |
commit | 51cfbdc4d16739caac4d946fadbe678444aafe34 (patch) | |
tree | 56dfd8f1cd9fd933de27268b32402e955a43ac2b /lib/chef/provider/service/macosx.rb | |
parent | 05064423057d4cf46f4713b81b08829cf6d20af6 (diff) | |
download | chef-51cfbdc4d16739caac4d946fadbe678444aafe34.tar.gz |
Use double quotes by default
This is an entirely mechanically generated (chefstyle -a) change, to go
along with chef/chefstyle#5 . We should pick something and use it
consistently, and my opinion is that double quotes are the appropriate
thing.
Diffstat (limited to 'lib/chef/provider/service/macosx.rb')
-rw-r--r-- | lib/chef/provider/service/macosx.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/chef/provider/service/macosx.rb b/lib/chef/provider/service/macosx.rb index 47c74f9425..b939f78b03 100644 --- a/lib/chef/provider/service/macosx.rb +++ b/lib/chef/provider/service/macosx.rb @@ -16,12 +16,12 @@ # limitations under the License. # -require 'etc' -require 'rexml/document' -require 'chef/resource/service' -require 'chef/resource/macosx_service' -require 'chef/provider/service/simple' -require 'chef/util/path_helper' +require "etc" +require "rexml/document" +require "chef/resource/service" +require "chef/resource/macosx_service" +require "chef/provider/service/simple" +require "chef/util/path_helper" class Chef class Provider @@ -36,14 +36,14 @@ class Chef /Library/LaunchDaemons /System/Library/LaunchAgents /System/Library/LaunchDaemons } - Chef::Util::PathHelper.home('Library', 'LaunchAgents') { |p| locations << p } + Chef::Util::PathHelper.home("Library", "LaunchAgents") { |p| locations << p } locations end PLIST_DIRS = gather_plist_dirs def this_version_or_newer?(this_version) - Gem::Version.new(node['platform_version']) >= Gem::Version.new(this_version) + Gem::Version.new(node["platform_version"]) >= Gem::Version.new(this_version) end def load_current_resource @@ -53,17 +53,17 @@ class Chef @plist = @new_resource.plist ? @new_resource.plist : find_service_plist @service_label = find_service_label # LauchAgents should be loaded as the console user. - @console_user = @plist ? @plist.include?('LaunchAgents') : false + @console_user = @plist ? @plist.include?("LaunchAgents") : false @session_type = @new_resource.session_type if @console_user @console_user = Etc.getlogin Chef::Log.debug("#{new_resource} console_user: '#{@console_user}'") cmd = "su " - param = this_version_or_newer?('10.10') ? '' : '-l ' + param = this_version_or_newer?("10.10") ? "" : "-l " @base_user_cmd = cmd + param + "#{@console_user} -c" # Default LauchAgent session should be Aqua - @session_type = 'Aqua' if @session_type.nil? + @session_type = "Aqua" if @session_type.nil? end Chef::Log.debug("#{new_resource} Plist: '#{@plist}' service_label: '#{@service_label}'") @@ -161,13 +161,13 @@ class Chef end def load_service - session = @session_type ? "-S #{@session_type} " : '' - cmd = 'launchctl load -w ' + session + @plist + session = @session_type ? "-S #{@session_type} " : "" + cmd = "launchctl load -w " + session + @plist shell_out_as_user(cmd) end def unload_service - cmd = 'launchctl unload -w ' + @plist + cmd = "launchctl unload -w " + @plist shell_out_as_user(cmd) end |