3049 Commits

Author SHA1 Message Date
Jack Nagel
666b48e391 Check Requirement before Dependency
It's much more likely that an instance of Requirement is passed.
2013-05-06 16:08:49 -05:00
Jack Nagel
f47e43aa2b Extract string and class logic from parse_spec 2013-05-06 16:08:49 -05:00
Misty De Meo
9ec3102e57 Formula: fix to_hash output for bottles 2013-05-05 10:58:12 -05:00
Adam Vandenberg
1c12c8b7a2 Add frameworks helper to formula 2013-05-03 11:41:55 -07:00
Jack Nagel
9dd7672ae7 info: re-raise on blacklist miss 2013-05-02 21:34:48 -05:00
Adam Vandenberg
afd2dde474 --env: show HOMEBREW_CC in superenv
Closes Homebrew/homebrew#18247.
2013-05-02 11:36:30 -07:00
Adam Vandenberg
b163ed03e9 info: try blacklist for unknown formula names
Closes Homebrew/homebrew#17399.
2013-04-29 10:12:40 -07:00
Jack Nagel
c2889de323 Avoid capturing groups when unnused 2013-04-27 15:21:06 -05:00
Jack Nagel
364c5c3473 Combine GitHub version regexes 2013-04-27 15:21:05 -05:00
Jack Nagel
16723afaa8 Only remove DS_Store on ENOTEMPTY 2013-04-27 15:21:05 -05:00
Jack Nagel
bffe090b21 Don't test error message
Now that we are testing for a custom exception type, we don't need to
make any assertion about the message.
2013-04-27 14:50:35 -05:00
Jack Nagel
9b5cb6cfb6 Allow brew versions to work with underspecified formulae 2013-04-27 14:44:48 -05:00
Jack Nagel
62db042277 audit: fix interpolation check
Fixes Homebrew/homebrew#19363.
2013-04-26 19:18:13 -05:00
Mike McQuaid
17667c03d0 Add deps target to tests Rakefile for needed gems. 2013-04-26 22:32:26 +01:00
Misty De Meo
f4cf04b95e doctor: don't shell out in coreutils check 2013-04-25 18:23:43 -05:00
Misty De Meo
814b969963 doctor: add default-names findutils check
Fixes Homebrew/homebrew#19265.
2013-04-25 18:23:43 -05:00
Jack Nagel
b7066b6e74 Add a couple more version tests 2013-04-24 15:02:05 -05:00
Jack Nagel
be32a3ee88 Split up big version detection test 2013-04-24 15:01:54 -05:00
Jack Nagel
8a74e648e7 audit: warn about top-level methods 2013-04-22 15:19:03 -05:00
Simon Sigurdhsson
4f45077fde Remove global methods from formulae
Removes any global methods from formulae, and moves #kext_prefix (which
seems to be at least somewhat abstractable) into the Formula class. The
only formula with global methods is now aspell; it (and its generating
script in contrib) has been changed to prefix that method with
`aspell_`, to minimize the risk of name collisions.

Closes Homebrew/homebrew#19331.
Closes Homebrew/homebrew#19343.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-04-21 23:48:50 -05:00
Jack Nagel
51bfd4fc1e Avoid calling to_s on the same Pathname multiple times 2013-04-20 13:50:42 -05:00
Jack Nagel
368ba306d7 Don't accept Formula objects as dep specs
It was pointed out that this isn't used at all.
2013-04-18 01:17:15 -05:00
Jack Nagel
7ea15918bb Reorder dep spec types by frequency 2013-04-17 14:12:41 -05:00
Adam Vandenberg
a7714a804b Add :hg build requirement.
Closes Homebrew/homebrew#19074.
2013-04-17 10:01:38 -07:00
Xiyue Deng
869642e635 Fix download strategy for SVN HEAD
After converting to Pathname to create paths, using '+=' will result in
path concatenation by '/', which result in weird path like
'gcc--svn/-HEAD'. This patch should fix this.

Closes Homebrew/homebrew#19233.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-04-16 16:17:48 -05:00
Jack Nagel
b7c0c53ffc VersionElement: attempt most likely match first 2013-04-16 14:56:22 -05:00
Jack Nagel
42da1295ce Only call Pathname#to_s once per Version object 2013-04-16 14:32:32 -05:00
Jack Nagel
1426b92a82 Only dup and shift when specs hash is populated 2013-04-16 14:18:23 -05:00
Jack Nagel
0fb4f9c426 Reduce repeated array inclusion check
Currently we check if "tag" is present in LANGUAGE_MODULES for every
String dep, even if tag is nil. Stop doing this, and make the
LANGUAGE_MODULES array into a Set instead to improve lookup performance.
2013-04-16 09:53:02 -05:00
Jack Nagel
3a0726406b Add tests for FormulaPin and simplify implementation 2013-04-16 01:58:11 -05:00
Ashley Towns
d600d6c0be Update for Xcode 4.6.2
Closes Homebrew/homebrew#19227.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-04-15 21:44:12 -05:00
Jack Nagel
d504d50dcb Don't create MacOS.version multiple times 2013-04-15 16:04:35 -05:00
Jack Nagel
466a32df02 Optimize Version#<=> 2013-04-15 15:00:57 -05:00
Jack Nagel
49682e854d Avoid expensive Pathname concatenation 2013-04-15 15:00:57 -05:00
Jack Nagel
841c8bedca Clean up remaining DownloadStrategy initializers 2013-04-15 15:00:57 -05:00
Jack Nagel
010a1461f7 Avoid repeated interpolation here too 2013-04-14 23:48:20 -05:00
Jack Nagel
33e00b7f7c Style nit 2013-04-14 23:29:15 -05:00
Jack Nagel
a78ae63153 Performance fix for Pathname#prepend_prefix
See 05a456c231dc6da7cb0f7c70cb21feaf9a0d803c; same story.
2013-04-14 22:38:18 -05:00
Jack Nagel
5e9cfec8b8 Performance fix for Pathname#chop_basename
This is an internal method, but is called a bunch of times in
performance-critical codepaths, and is ultra slow because the constant
is interpoplated into the Regexp each time the method is called.

Alas, this has been fixed in Ruby 1.9+.
2013-04-14 21:56:04 -05:00
Jack Nagel
1bad199776 Avoid slow operations in FormulaPin#initialize
A FormulaPin object is created every time Formula is instantiated, so
don't do filesystem operations or Pathname concatenation eagerly.
2013-04-14 21:41:30 -05:00
Jack Nagel
b258bee44e Don't use Pathname#/ in performance-critical code
This method (well, really, #join) is *twice* as slow as simple
concatenation, and shouldn't really be used at all in non-Formula code.
2013-04-14 20:09:20 -05:00
Jack Nagel
3c73cc28e0 Optimization: avoid repeated interpolation in regexp
Benchmark.bm do |b|
  b.report("before") do
    100_000.times { /(\.#{MacOS.cat}\.bottle\.(\d+\.)?tar\.gz)$/ }
  end
  b.report("after ") do
    100_000.times { /(\.#{MacOS.cat}\.bottle\.(\d+\.)?tar\.gz)$/o }
  end
end
            user     system      total        real
before 35.400000   0.140000  35.540000 ( 35.619674)
after   0.020000   0.000000   0.020000 (  0.016662)
2013-04-14 18:32:48 -05:00
Jack Nagel
2e58fbf260 Keg requires OpenStruct 2013-04-14 15:38:14 -05:00
Adam Vandenberg
4daf0de435 Only prune taps if taps exist.
Closes Homebrew/homebrew#19192.
2013-04-14 09:35:16 -07:00
Jaime Marquínez Ferrándiz
adbd8cee6d New visualization for brew deps --tree
Closes Homebrew/homebrew#18835.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-04-13 20:32:45 -05:00
Jack Nagel
c8f2d41fe4 Remove extra require 2013-04-13 20:07:14 -05:00
Jack Nagel
5fc772b8e9 Use assert_operator 2013-04-13 19:50:02 -05:00
Jack Nagel
e5eaa6696c Remove obsolete tests
This behavior is now tested at more appropriate levels in
test_software_spec, test_formula_spec_selection, and
test_formula_validation.
2013-04-13 18:23:06 -05:00
Jack Nagel
00bcc5e8ad Make a specific assertion in this test 2013-04-13 17:40:14 -05:00
Jack Nagel
a05bb48807 Raise a useful exception for incomplete formulae 2013-04-13 17:40:14 -05:00