Skip to content

Commit 3f00d35

Browse files
committed
Fix ARGV.next method not found
Already partially addressed in timsutton#16, but that PR missed one call to the non-existent `Array.next`.
1 parent 157dbe8 commit 3f00d35

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

brew-pkg.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def pkg
3131

3232
abort unpack_usage if ARGV.empty?
3333
identifier_prefix = if ARGV.include? '--identifier-prefix'
34-
ARGV.next.chomp(".")
34+
ARGV[ARGV.index('--identifier-prefix') + 1].chomp(".")
3535
else
3636
'org.homebrew'
3737
end
@@ -103,7 +103,7 @@ def pkg
103103
# Add scripts if we specified --scripts
104104
found_scripts = false
105105
if ARGV.include? '--scripts'
106-
scripts_path = ARGV.next
106+
scripts_path = ARGV[ARGV.index('--scripts') + 1]
107107
if File.directory?(scripts_path)
108108
pre = File.join(scripts_path,"preinstall")
109109
post = File.join(scripts_path,"postinstall")
@@ -126,7 +126,7 @@ def pkg
126126
# Custom ownership
127127
found_ownership = false
128128
if ARGV.include? '--ownership'
129-
custom_ownership = ARGV.next
129+
custom_ownership = ARGV[ARGV.index('--ownership') + 1]
130130
if ['recommended', 'preserve', 'preserve-other'].include? custom_ownership
131131
found_ownership = true
132132
ohai "Setting pkgbuild option --ownership with value #{custom_ownership}"

0 commit comments

Comments
 (0)