aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/versions.rb
AgeCommit message (Collapse)Author
2012-05-07Unify 'which' and which_s' utility methodsJack Nagel
'which' only returns a Pathname or nil, and doesn't care about anything sent to stderr, so just silence it by default and combine the two methods. Closes Homebrew/homebrew#12115. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-18Set MACOS_VERSION as 0 on non-OSX platforms.Mike McQuaid
2012-03-16Tell user to `brew update' if no .gitMax Howell
2012-02-04Warn the user of required argumentsJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-29versions: ignore NameError and ArgumentErrorJack Nagel
Fixes Homebrew/homebrew#9856. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-27versions: fix up error handlingJack Nagel
Now we handle some things more explicitly and in the process get rid of the blanket rescue on the mktemp block, which is something of an antipattern. By unloading the class *after* determining the version, we avoid the case where the class had previously been unloaded but Formula.factory failed, and trying to unload the nonexistent class results in a NameError. Doing it this way, we avoid having to rescue NameError and thereby avoid hiding other cases where it may occur. We also rescue TypeError which gets us past a few more bad formula in the history in some instances. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-26versions: silence 'aka' warning and syntax errorsJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-24versions: don't print 'nil' when stdout is not a ttyDylan Smith
Closes Homebrew/homebrew#8960. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-12versions: use the actual class name when unloadingJack Nagel
And document a bit more why this hack is present. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-06versions: unload old class before obtaining versionJack Nagel
This is silly, but I am no Rubyist and I don't have time to figure out why Formula.factory(foo).url works as expected but Formula.factory(foo).version does not. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-06versions: enable '--compact' outputJack Nagel
This will be useful for shell tab completion when something like `brew install <formula> --version <version>` is implemented. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-06versions: determine version from a Formula instanceJack Nagel
Rather than regex the output of `git show <rev>:<path>`, we write the output of `git cat-file blog <rev>:<path>` to a temporary file, and then operate on it just as we would a normal formula. I haven't observed any speed difference. `git cat-file blob` is faster than `git show`, but the "slow part" is still the git-rev-list invocation. But really it's pretty fast overall. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-05Fix nil handling in `brew versions`Max Howell
Fixes Homebrew/homebrew#7392.
2011-08-02Prettier `brew versions` outputMax Howell
2011-08-02Oops, show proper git checkout commandMax Howell
2011-08-02Improvements to `brew versions`Max Howell
The output happens as it is determined, rather than all at once, which is preferable for CLI commands. This meant I had to hard-code the left-justification. The pre-amble warning is removed. Instead the command outputs the git checkout command for each she that you can type to get that old formula. I decided that reseting the one file will work 99% of the time and that it is too risky to reset the whole repo, this will roll-back bug fixes. Instead we should add functionality to compat/ in order to support old formula as required. Sometimes deps may have to be rolled-back too, but the user will have to figure this out on an ad-hoc basis. We are assuming a failure sophisticated user anyway, one who would like to get old versions of stuff. I moved most of the functions into Formula since IMO this makes more conceptual sense. I made the she get abbreviated by git (using --abbrev-commit) itself so it as short as can be.
2011-08-02Added new command "versions"Sebastian Staudt