aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorCharlie Sharpsteen2011-08-24 17:33:28 -0700
committerCharlie Sharpsteen2011-08-24 17:45:19 -0700
commit8cb7090723cd28d54a40788619288d007635effa (patch)
tree904bb5e5ccf3935e9d74e5cdac7d450857efbbfa /Library
parent99445ff4db2eb072bc078dbff8bd662a4034216d (diff)
downloadhomebrew-8cb7090723cd28d54a40788619288d007635effa.tar.bz2
Leopard: Fix undefined method `count` for `Array`
Leopard runs Ruby 1.8.6 while Snow Leopard runs 1.8.7 and `Array.count` was not introduced until 1.8.7. Using `Array.length` instead.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/upgrade.rb2
-rw-r--r--Library/Homebrew/formula.rb2
-rw-r--r--Library/Homebrew/formula_installer.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index f86e8a871..2f7bede42 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -17,7 +17,7 @@ module Homebrew extend self
ARGV.formulae.map{ |f| [f.prefix.parent, f.name, f.version] }
end
- if outdated.count > 1
+ if outdated.length > 1
oh1 "Upgrading #{outdated.count} outdated package#{outdated.count.plural_s}, with result:"
puts outdated.map{ |_, name, version| "#{name} #{version}" } * ", "
end
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index d422c7bbb..51e5dd397 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -512,7 +512,7 @@ private
def verify_download_integrity fn, *args
require 'digest'
- if args.count != 2
+ if args.length != 2
type=CHECKSUM_TYPES.detect { |type| instance_variable_defined?("@#{type}") }
type ||= :md5
supplied=instance_variable_get("@#{type}")
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index b8cb7d7b0..e25f28011 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -176,7 +176,7 @@ class FormulaInstaller
def check_PATH
# warn the user if stuff was installed outside of their PATH
[f.bin, f.sbin].each do |bin|
- if bin.directory? and bin.children.count > 0
+ if bin.directory? and bin.children.length > 0
bin = (HOMEBREW_PREFIX/bin.basename).realpath.to_s
unless paths.include? bin
opoo "#{bin} is not in your PATH"