Skip to content
This repository has been archived by the owner on Apr 7, 2018. It is now read-only.

Commit

Permalink
Cookstyle fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 committed Dec 14, 2016
1 parent 2c85101 commit 0f9f4a4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace :style do
FoodCritic::Rake::LintTask.new(:chef) do |t|
t.options = {
fail_tags: ['any'],
progress: true
progress: true,
}
end
rescue LoadError
Expand Down
4 changes: 2 additions & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: dmg
# Cookbook:: dmg
# Attributes:: default
#
# Copyright 2011-2016, Chef Software, Inc.
# Copyright:: 2011-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions libraries/matchers.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: dmg
# Cookbook:: dmg
# Library:: matchers
#
# Copyright 2014, Fletcher Nichol <fnichol@nichol.ca>
# Copyright:: 2014-2016, Fletcher Nichol <fnichol@nichol.ca>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
10 changes: 5 additions & 5 deletions providers/package.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: dmg
# Cookbook:: dmg
# Provider:: package
#
# Copyright 2011-2016, Chef Software, Inc.
# Copyright:: 2011-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -51,7 +51,7 @@ def load_current_resource
ruby_block "attach #{dmg_file}" do
block do
cmd = shell_out("hdiutil imageinfo #{passphrase_cmd} '#{dmg_file}' | grep -q 'Software License Agreement: true'")
software_license_agreement = (cmd.exitstatus == 0)
software_license_agreement = (cmd.exitstatus.zero?)
raise "Requires EULA Acceptance; add 'accept_eula true' to package resource" if software_license_agreement && !new_resource.accept_eula
accept_eula_cmd = new_resource.accept_eula ? 'echo Y | PAGER=true' : ''
shell_out!("#{accept_eula_cmd} hdiutil attach #{passphrase_cmd} '#{dmg_file}' -quiet")
Expand All @@ -66,7 +66,7 @@ def load_current_resource
end

file "#{new_resource.destination}/#{new_resource.app}.app/Contents/MacOS/#{new_resource.app}" do
mode 0755
mode '755'
ignore_failure true
end
when 'mpkg', 'pkg'
Expand All @@ -86,7 +86,7 @@ def installed?
if ::File.directory?("#{new_resource.destination}/#{new_resource.app}.app")
Chef::Log.info "Already installed; to upgrade, remove \"#{new_resource.destination}/#{new_resource.app}.app\""
true
elsif shell_out("pkgutil --pkgs='#{new_resource.package_id}'").exitstatus == 0
elsif shell_out("pkgutil --pkgs='#{new_resource.package_id}'").exitstatus.zero?
Chef::Log.info "Already installed; to upgrade, try \"sudo pkgutil --forget '#{new_resource.package_id}'\""
true
else
Expand Down
4 changes: 2 additions & 2 deletions resources/package.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Encoding: utf-8
# Cookbook Name:: dmg
# Cookbook:: dmg
# Resource:: package
#
# Copyright 2011, Joshua Timberman
# Copyright:: 2011-2016, Joshua Timberman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tasks/maintainers.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright:: Copyright (c) 2015-2016 Chef Software, Inc.
# Copyright:: 2015-2016, Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down

0 comments on commit 0f9f4a4

Please sign in to comment.