From 4f6bae46f9c0f7b713cdbb999318460135f423de Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 5 Sep 2016 21:32:58 +0100 Subject: [PATCH] cmd/*: don't restrict dev-cmd to Homebrew developers. --- Library/Homebrew/cmd/command.rb | 6 +----- Library/Homebrew/cmd/commands.rb | 2 +- Library/Homebrew/cmd/help.rb | 4 ++-- Library/Homebrew/test/test_commands.rb | 4 ---- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Library/Homebrew/cmd/command.rb b/Library/Homebrew/cmd/command.rb index 8c8a8c6990..bab0257c83 100644 --- a/Library/Homebrew/cmd/command.rb +++ b/Library/Homebrew/cmd/command.rb @@ -21,11 +21,7 @@ module Homebrew def internal_command_path(cmd) extensions = %w[rb sh] paths = extensions.map { |ext| HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.#{ext}" } - - if ARGV.homebrew_developer? - paths += extensions.map { |ext| HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.#{ext}" } - end - + paths += extensions.map { |ext| HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.#{ext}" } paths.find { |p| p.file? } end end diff --git a/Library/Homebrew/cmd/commands.rb b/Library/Homebrew/cmd/commands.rb index 52705c58a9..bb1e6fe4d0 100644 --- a/Library/Homebrew/cmd/commands.rb +++ b/Library/Homebrew/cmd/commands.rb @@ -8,7 +8,7 @@ module Homebrew def commands if ARGV.include? "--quiet" cmds = internal_commands + external_commands - cmds += internal_development_commands if ARGV.homebrew_developer? + cmds += internal_development_commands cmds += HOMEBREW_INTERNAL_COMMAND_ALIASES.keys if ARGV.include? "--include-aliases" puts_columns cmds.sort else diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb index ac5fce5b75..eae08395da 100644 --- a/Library/Homebrew/cmd/help.rb +++ b/Library/Homebrew/cmd/help.rb @@ -72,11 +72,11 @@ module Homebrew def command_path(cmd) if File.exist?(HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.sh") HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.sh" - elsif ARGV.homebrew_developer? && File.exist?(HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.sh") + elsif File.exist?(HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.sh") HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.sh" elsif File.exist?(HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.rb") HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.rb" - elsif ARGV.homebrew_developer? && File.exist?(HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.rb") + elsif File.exist?(HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.rb") HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.rb" end end diff --git a/Library/Homebrew/test/test_commands.rb b/Library/Homebrew/test/test_commands.rb index b6dd5c2be9..4a24107a96 100644 --- a/Library/Homebrew/test/test_commands.rb +++ b/Library/Homebrew/test/test_commands.rb @@ -70,10 +70,6 @@ class CommandsTests < Homebrew::TestCase end def test_internal_dev_command_path - ARGV.stubs(:homebrew_developer?).returns false - assert_nil Homebrew.send(:internal_command_path, "rbdevcmd") - - ARGV.stubs(:homebrew_developer?).returns true assert_equal HOMEBREW_LIBRARY_PATH/"dev-cmd/rbdevcmd.rb", Homebrew.send(:internal_command_path, "rbdevcmd") assert_equal HOMEBREW_LIBRARY_PATH/"dev-cmd/shdevcmd.sh",