diff options
| author | Jack Nagel | 2014-10-29 22:38:49 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-10-29 22:41:03 -0500 |
| commit | 39a5bbaa6305381b730d4ae09f95cf22e506117d (patch) | |
| tree | 3e09b9be59afd03c5f0a1e73962c7205ee9903c0 /Library/Homebrew/cmd/audit.rb | |
| parent | a3c16261069c88b896d9450cfedc497c4031d870 (diff) | |
| download | homebrew-39a5bbaa6305381b730d4ae09f95cf22e506117d.tar.bz2 | |
Rename "f" to "formula" in the installer
Diffstat (limited to 'Library/Homebrew/cmd/audit.rb')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 4ac5bb4f1..2bc10882e 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -70,7 +70,7 @@ end class FormulaAuditor include FormulaCellarChecks - attr_reader :f, :text, :problems + attr_reader :formula, :text, :problems BUILD_TIME_DEPS = %W[ autoconf @@ -87,27 +87,27 @@ class FormulaAuditor swig ] - def initialize f - @f = f + def initialize(formula) + @formula = formula @problems = [] - @text = f.text.without_patch - @specs = %w{stable devel head}.map { |s| f.send(s) }.compact + @text = formula.text.without_patch + @specs = %w{stable devel head}.map { |s| formula.send(s) }.compact end def audit_file - unless f.path.stat.mode.to_s(8) == "100644" - problem "Incorrect file permissions: chmod 644 #{f.path}" + unless formula.path.stat.mode.to_s(8) == "100644" + problem "Incorrect file permissions: chmod 644 #{formula.path}" end - if f.text.has_DATA? and not f.text.has_END? + if formula.text.has_DATA? and not formula.text.has_END? problem "'DATA' was found, but no '__END__'" end - if f.text.has_END? and not f.text.has_DATA? + if formula.text.has_END? and not formula.text.has_DATA? problem "'__END__' was found, but 'DATA' is not used" end - unless f.text.has_trailing_newline? + unless formula.text.has_trailing_newline? problem "File should end with a newline" end end @@ -167,7 +167,7 @@ class FormulaAuditor end def audit_conflicts - f.conflicts.each do |c| + formula.conflicts.each do |c| begin Formulary.factory(c.name) rescue FormulaUnavailableError @@ -177,7 +177,7 @@ class FormulaAuditor end def audit_urls - homepage = f.homepage + homepage = formula.homepage unless homepage =~ %r[^https?://] problem "The homepage should start with http or https (URL is #{homepage})." @@ -266,10 +266,10 @@ class FormulaAuditor end def audit_specs - problem "Head-only (no stable download)" if f.head_only? + problem "Head-only (no stable download)" if formula.head_only? %w[Stable Devel HEAD].each do |name| - next unless spec = f.send(name.downcase) + next unless spec = formula.send(name.downcase) ra = ResourceAuditor.new(spec).audit problems.concat ra.problems.map { |problem| "#{name}: #{problem}" } @@ -284,17 +284,17 @@ class FormulaAuditor spec.patches.select(&:external?).each { |p| audit_patch(p) } end - if f.stable && f.devel - if f.devel.version < f.stable.version - problem "devel version #{f.devel.version} is older than stable version #{f.stable.version}" - elsif f.devel.version == f.stable.version + if formula.stable && formula.devel + if formula.devel.version < formula.stable.version + problem "devel version #{formula.devel.version} is older than stable version #{formula.stable.version}" + elsif formula.devel.version == formula.stable.version problem "stable and devel versions are identical" end end end def audit_patches - legacy_patches = Patch.normalize_legacy_patches(f.patches).grep(LegacyPatch) + legacy_patches = Patch.normalize_legacy_patches(formula.patches).grep(LegacyPatch) if legacy_patches.any? problem "Use the patch DSL instead of defining a 'patches' method" legacy_patches.each { |p| audit_patch(p) } |
