diff options
Diffstat (limited to 'lib/chef/resource/homebrew_tap.rb')
-rw-r--r-- | lib/chef/resource/homebrew_tap.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/chef/resource/homebrew_tap.rb b/lib/chef/resource/homebrew_tap.rb index 6e6d9c823f..8f415a3ff1 100644 --- a/lib/chef/resource/homebrew_tap.rb +++ b/lib/chef/resource/homebrew_tap.rb @@ -32,25 +32,25 @@ class Chef include Chef::Mixin::HomebrewUser property :tap_name, String, - description: "An optional property to set the tap name if it differs from the resource block's name.", - validation_message: "Homebrew tap names must be in the form REPO/TAP format!", - regex: %r{^[\w-]+(?:\/[\w-]+)+$}, - name_property: true + description: "An optional property to set the tap name if it differs from the resource block's name.", + validation_message: "Homebrew tap names must be in the form REPO/TAP format!", + regex: %r{^[\w-]+(?:\/[\w-]+)+$}, + name_property: true property :url, String, - description: "The URL of the tap." + description: "The URL of the tap." property :full, [TrueClass, FalseClass], - description: "Perform a full clone on the tap, as opposed to a shallow clone.", - default: false + description: "Perform a full clone on the tap, as opposed to a shallow clone.", + default: false property :homebrew_path, String, - description: "The path to the Homebrew binary.", - default: "/usr/local/bin/brew" + description: "The path to the Homebrew binary.", + default: "/usr/local/bin/brew" property :owner, String, - description: "The owner of the Homebrew installation.", - default: lazy { find_homebrew_username } + description: "The owner of the Homebrew installation.", + default: lazy { find_homebrew_username } action :tap do description "Add a Homebrew tap." @@ -58,9 +58,9 @@ class Chef unless tapped?(new_resource.tap_name) converge_by("tap #{new_resource.tap_name}") do shell_out!("#{new_resource.homebrew_path} tap #{new_resource.full ? '--full' : ''} #{new_resource.tap_name} #{new_resource.url || ''}", - user: new_resource.owner, - env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, - cwd: ::Dir.home(new_resource.owner)) + user: new_resource.owner, + env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, + cwd: ::Dir.home(new_resource.owner)) end end end @@ -71,9 +71,9 @@ class Chef if tapped?(new_resource.tap_name) converge_by("untap #{new_resource.tap_name}") do shell_out!("#{new_resource.homebrew_path} untap #{new_resource.tap_name}", - user: new_resource.owner, - env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, - cwd: ::Dir.home(new_resource.owner)) + user: new_resource.owner, + env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, + cwd: ::Dir.home(new_resource.owner)) end end end |