aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compat
diff options
context:
space:
mode:
authorMike McQuaid2017-04-22 16:28:07 +0100
committerMike McQuaid2017-04-22 16:28:07 +0100
commitba3c46d24fe6423845cc5e827eb94b3427d75a10 (patch)
tree12c6c401ff351c34c7fea3ec322e34814999e99c /Library/Homebrew/compat
parent206d6de845c9041bbbd4d955e56befb338295e96 (diff)
downloadbrew-ba3c46d24fe6423845cc5e827eb94b3427d75a10.tar.bz2
More deprecations.
Deprecate more methods. Internal APIs have been verified to be unused elsewhere and removed. External APIs have had deprecation methods added. Existing deprecations have been either upgraded to produce warnings or no longer deprecated and the reasoning documented.
Diffstat (limited to 'Library/Homebrew/compat')
-rw-r--r--Library/Homebrew/compat/ARGV.rb2
-rw-r--r--Library/Homebrew/compat/build_options.rb7
-rw-r--r--Library/Homebrew/compat/dependency_collector.rb1
-rw-r--r--Library/Homebrew/compat/global.rb2
-rw-r--r--Library/Homebrew/compat/software_spec.rb2
-rw-r--r--Library/Homebrew/compat/tab.rb2
-rw-r--r--Library/Homebrew/compat/tap.rb2
-rw-r--r--Library/Homebrew/compat/utils.rb11
-rw-r--r--Library/Homebrew/compat/utils/shell.rb8
9 files changed, 20 insertions, 17 deletions
diff --git a/Library/Homebrew/compat/ARGV.rb b/Library/Homebrew/compat/ARGV.rb
index 23d02ce1a..e5fa8188f 100644
--- a/Library/Homebrew/compat/ARGV.rb
+++ b/Library/Homebrew/compat/ARGV.rb
@@ -1,6 +1,6 @@
module HomebrewArgvExtension
def build_32_bit?
- # odeprecated "ARGV.build_32_bit?"
+ odeprecated "ARGV.build_32_bit?"
include? "--32-bit"
end
end
diff --git a/Library/Homebrew/compat/build_options.rb b/Library/Homebrew/compat/build_options.rb
index 52aa9b951..73722dadb 100644
--- a/Library/Homebrew/compat/build_options.rb
+++ b/Library/Homebrew/compat/build_options.rb
@@ -1,6 +1,11 @@
class BuildOptions
def build_32_bit?
- # odeprecated "build.build_32_bit?"
+ odeprecated "build.build_32_bit?"
include?("32-bit") && option_defined?("32-bit")
end
+
+ def build_bottle?
+ odeprecated "build.build_bottle?", "build.bottle?"
+ bottle?
+ end
end
diff --git a/Library/Homebrew/compat/dependency_collector.rb b/Library/Homebrew/compat/dependency_collector.rb
index bd72c55d4..fbcf1c2a0 100644
--- a/Library/Homebrew/compat/dependency_collector.rb
+++ b/Library/Homebrew/compat/dependency_collector.rb
@@ -14,7 +14,6 @@ class DependencyCollector
output_deprecation(spec, tags)
Dependency.new(spec.to_s, tags)
when :apr
- # TODO: reenable in future when we've fixed a few of the audits.
# output_deprecation(spec, tags, "apr-util")
Dependency.new("apr-util", tags)
when :libltdl
diff --git a/Library/Homebrew/compat/global.rb b/Library/Homebrew/compat/global.rb
index 797e9ffe5..82c452cc0 100644
--- a/Library/Homebrew/compat/global.rb
+++ b/Library/Homebrew/compat/global.rb
@@ -3,7 +3,7 @@ module Homebrew
def method_missing(method, *args, &block)
if instance_methods.include?(method)
- # odeprecated "#{self}##{method}", "'module_function' or 'def self.#{method}' to convert it to a class method"
+ odeprecated "#{self}##{method}", "'module_function' or 'def self.#{method}' to convert it to a class method"
return instance_method(method).bind(self).call(*args, &block)
end
super
diff --git a/Library/Homebrew/compat/software_spec.rb b/Library/Homebrew/compat/software_spec.rb
index 51b0f3a0b..5efd2aeb4 100644
--- a/Library/Homebrew/compat/software_spec.rb
+++ b/Library/Homebrew/compat/software_spec.rb
@@ -1,7 +1,5 @@
class BottleSpecification
def revision(*args)
- # Don't announce deprecation yet as this is quite a big change
- # to a public interface.
# odeprecated "BottleSpecification.revision", "BottleSpecification.rebuild"
rebuild(*args)
end
diff --git a/Library/Homebrew/compat/tab.rb b/Library/Homebrew/compat/tab.rb
index 58fdc4913..2cf71c923 100644
--- a/Library/Homebrew/compat/tab.rb
+++ b/Library/Homebrew/compat/tab.rb
@@ -1,6 +1,6 @@
class Tab < OpenStruct
def build_32_bit?
- # odeprecated "Tab.build_32_bit?"
+ odeprecated "Tab.build_32_bit?"
include?("32-bit")
end
end
diff --git a/Library/Homebrew/compat/tap.rb b/Library/Homebrew/compat/tap.rb
index d1cf7f1d5..37b1eeac1 100644
--- a/Library/Homebrew/compat/tap.rb
+++ b/Library/Homebrew/compat/tap.rb
@@ -6,5 +6,3 @@ class Tap
core_tap?
end
end
-
-CoreFormulaRepository = CoreTap
diff --git a/Library/Homebrew/compat/utils.rb b/Library/Homebrew/compat/utils.rb
index 56b0824ba..3842e8a83 100644
--- a/Library/Homebrew/compat/utils.rb
+++ b/Library/Homebrew/compat/utils.rb
@@ -1,18 +1,13 @@
-# return the shell profile file based on users' preference shell
def shell_profile
- opoo "shell_profile has been deprecated in favor of Utils::Shell.profile"
- case ENV["SHELL"]
- when %r{/(ba)?sh} then "~/.bash_profile"
- when %r{/zsh} then "~/.zshrc"
- when %r{/ksh} then "~/.kshrc"
- else "~/.bash_profile"
- end
+ # odeprecated "shell_profile", "Utils::Shell.profile"
+ Utils::Shell.profile
end
module Tty
module_function
def white
+ odeprecated "Tty.white", "Tty.reset.bold"
reset.bold
end
end
diff --git a/Library/Homebrew/compat/utils/shell.rb b/Library/Homebrew/compat/utils/shell.rb
new file mode 100644
index 000000000..161f10ebb
--- /dev/null
+++ b/Library/Homebrew/compat/utils/shell.rb
@@ -0,0 +1,8 @@
+module Utils
+ module Shell
+ def self.shell_profile
+ odeprecated "Utils::Shell.shell_profile", "Utils::Shell.profile"
+ Utils::Shell.profile
+ end
+ end
+end