Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 6e6c04f

Browse files
committed
Merge pull request #50 from jgonzalez5/fix-homebrew-tap-path
Updated homebrew::tap name
2 parents a5f5782 + a35c923 commit 6e6c04f

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

lib/puppet/provider/homebrew_tap/default.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,12 @@ def destroy
3636
private
3737

3838
def install_dir
39-
@install_dir ||= "#{self.class.taps_dir}/#{hyphenated_source}"
39+
@install_dir ||= "#{self.class.taps_dir}/#{tap_name}"
4040
end
4141

42-
def hyphenate(s)
43-
s.gsub('/', '-')
44-
end
45-
46-
def hyphenated_source
47-
@hyphenated_source ||= hyphenate(@resource[:source])
42+
def tap_name
43+
user, repo = @resource[:source].split("/")
44+
"#{user}/homebrew-#{repo}"
4845
end
4946

5047
# Override default `execute` to run super method in a clean

spec/defines/homebrew__tap_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
let(:title) { "foo/bar" }
77

8-
let(:dir) { "#{facts[:boxen_home]}/homebrew/Library/Taps/foo-bar" }
9-
108
context "ensure => present" do
119
it do
1210
should contain_homebrew__tap("foo/bar").with_ensure(:present)

0 commit comments

Comments
 (0)