99 Commits

Author SHA1 Message Date
Martin Afanasjew
68bbe6ee5f Use GitRepositoryExtension for 'path' in Tap
Closes #464.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-07-07 01:46:58 +02:00
Mike McQuaid
b05a596d57 tap: --config unsupported on old Gits. 2016-06-20 13:03:27 +01:00
Xu Cheng
9a6d5a4fee add Tap#default_remote
* without `default_remote`, `CoreTap#install` won't be able to tell
  whether user has passed to custom remote to it.
* simplify some part of logics
2016-04-19 16:29:29 +08:00
Xu Cheng
71b6e0aa18 Tap#install: better TapRemoteMismatchError check
* remote check requires `git` installed.
* Do not perform check if user does not passing remote explicitly.

Fixes #108
2016-04-19 16:29:29 +08:00
Xu Cheng
548be81b34 tap: various improvements (#77)
* make `read_or_set_private_config` private
* add doc
* add test
2016-04-12 18:51:43 +08:00
Mike McQuaid
1d5458843e Cache Tap#private? checks.
Use both an in-class and a `.git/config` cache for this so we can ensure
that the `Tap#private?` check is fast. Also, make sure this cache value
is set both when initially installing and updating a tap.

Thanks to @xu-cheng for most of the implementation here.
2016-04-12 11:00:23 +01:00
ilovezfs
fad235d8e8 tap: support --full even if installed
Makes `tap` re-runnable and unshallows when requested with `--full`.
Tapping with a different URL raises an exception.

The homebrew/core tap cannot be untapped with `untap` so running
`brew tap --full homebrew/core` is now a built-in way to get a full
clone of this tap without resorting to workarounds.

Closes #17.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-04-05 07:25:27 -07:00
Xu Cheng
1b7e13df4f CoreTap#install: fix clone target setting
When invoking `brew tap homebrew/core`, the input options will be like
`{ :clone_target => nil }`. This renders `Hash#merge` a dead operation.

It doesn't impact Homebrew itself, but could cause problem for
downstream projects Linxubrew/Tigerbrew when they adopt core/formula
separation.
2016-04-05 19:34:47 +08:00
Xu Cheng
a5cfc011e0 various: Homebrew/core is the core tap
Also make `Homebrew/homebrew` as an alias of this tap to keep
backward compatibility.
2016-04-02 21:51:36 +08:00
Xu Cheng
c5132daf63 introduce Homebrew/core tap as new default core tap.
It will be auto installed whenever necessary.
2016-04-02 21:51:36 +08:00
Xu Cheng
63c0a9fa92 Tap#install: set autocrlf to false
Ensure we don't munge line endings on checkout regardless with user's
global git config.

Closes Homebrew/homebrew#50514.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-31 14:49:01 +08:00
Xu Cheng
6e27e2db74 tap: cache dir path to avoid duplicated Pathname operations
As discovered in Homebrew/homebrew#50256, this becomes a performance bottleneck as we are
repeating construct same Pathname object.

At the same, this commit makes the behaviors between Tap and CoreTap more
consistence.
2016-03-23 15:01:28 +08:00
Xu Cheng
28f3dae8cd rename CoreFormulaRepository to CoreTap
Core tap will be separated from core code in the near future.
It makes sense to rename it to CoreTap.
2016-03-07 19:43:46 +08:00
Xu Cheng
9f96e41b40 tap: add methods to get git related information
These methods will be used in `brew --version`, `brew config`
and `brew doctor` after core/formula separation.

Closes Homebrew/homebrew#49796.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-06 13:51:06 +08:00
Xu Cheng
43c6061bc9 Tap#install: support quiet option 2016-02-26 18:42:36 +08:00
Xu Cheng
87ecd621eb add Tap#tap_migrations
This enables tap migration feature in per tap case, which will
ultimately help core/formula separation.
2016-02-25 17:22:28 +08:00
Xu Cheng
4e51c0b8ea add Tap#formula_file?
Return true if given path would present a Formula file in this Tap.
Accepts both absolute path and relative path (relative to this Tap's path)

It offer an abstraction such that caller would not need to worry about
low level file system in the tap.

It will be used in `brew pull` and `brew update`.

Closes Homebrew/homebrew#49191.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-16 14:23:39 +08:00
Xu Cheng
2e892bcf63 Tap: clear_cache for Tap#(un)install
If a tap is installed during the installation, the original cache need
to be purged. Otherwise, it will return wrong information afterwards.

Closes Homebrew/homebrew#48887.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-07 15:03:17 +08:00
Xu Cheng
09a79106d7 Tap: allow invoking formula_file_to_name by Homebrew internally 2016-01-17 14:52:09 +08:00
Misty De Meo
d99cfd1394 tap: require string extensions
Fixes Homebrew/homebrew#47684.
2016-01-04 16:22:26 -04:00
Baptiste Fontaine
c15c9dbaf3 Tap#issues_url added
Closes Homebrew/homebrew#47454.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-30 00:44:46 +01:00
Xu Cheng
ef7a5cfa3a Tap#unlink_manpages: fix symlink path 2015-12-19 22:05:30 +08:00
Xu Cheng
7efae4635b Tap#unpin: remove PinnedTaps directory if it's empty 2015-12-19 22:05:30 +08:00
Xu Cheng
0f84b976ba move CoreFormulaRepository into separate file
For users whose local brew is at around 2015-06-11 to 2015-08-06,
running `brew update` will emit following error:

  Error: uninitialized constant Formulary::CoreFormulaRepository

This is caused by the same bug described in Homebrew/homebrew#42553.

This commit workarounds this issue and restores `brew update` compatibility
for users mentioned above.

Also cleanup legacy `require "cmd/tap"`.
2015-12-19 22:05:30 +08:00
Mike McQuaid
d36d88edf2 Allow taps to link manpages.
A blocker for https://github.com/caskroom/homebrew-cask/pull/15381
being merged.

Closes Homebrew/homebrew#46795.
2015-12-09 09:09:26 +00:00
Xu Cheng
b100ad223d Tap#==: allow compare with string 2015-12-09 16:56:59 +08:00
Xu Cheng
5b435db3bf add Tap#core_formula_repository? 2015-12-09 16:56:59 +08:00
Xu Cheng
9f7a383017 add CoreFormulaRepository singleton class 2015-12-09 16:56:59 +08:00
Xu Cheng
c2a5a8388f Tap: add formula_file_to_name and alias_file_to_name 2015-12-09 16:56:59 +08:00
Xu Cheng
ea81963b8a add Tap#alias_dir 2015-12-09 16:56:59 +08:00
Xu Cheng
327286cdfb add Tap#formula_dir 2015-12-09 16:56:59 +08:00
Xu Cheng
89bd945bb7 Tap: use method instead of variable 2015-12-09 16:56:59 +08:00
Xu Cheng
48950f2cc0 centralize the logic of handling homebrew- in Tap.fetch
Closes Homebrew/homebrew#46537.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-12-03 13:46:59 +08:00
Xu Cheng
e97610b916 add Tap#install and Tap#uninstall 2015-11-09 15:34:20 +08:00
Xu Cheng
4e196a2348 tap: add more document 2015-11-09 15:34:20 +08:00
Xu Cheng
98633e03c6 add alias_table and alias_reverse_table for core and tap 2015-10-14 17:26:41 +08:00
Xu Cheng
3b520cf195 cache taps
There are plenty of IO operations inside Tap object, and it will be more
when implementing formula alias reverse look up(e.g. list all of alias
names for a formula). So let's cache them.

Some benchmark:

$ time brew info $(brew ruby -e 'puts Formula.tap_names') > /dev/null
Before: 6.40s user 2.42s system 96% cpu 9.134 total
After: 4.75s user 0.77s system 97% cpu 5.637 total

Closes Homebrew/homebrew#44377.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-30 16:25:30 +08:00
Xu Cheng
f001cdf777 Tap#aliases: output fully-qualified name 2015-09-13 17:19:06 +08:00
Xu Cheng
4613c9ecf5 Tap: add alias method 2015-09-13 12:58:00 +08:00
Xu Cheng
638eda5f2d tap-info: fix for not installed tap
Closes Homebrew/homebrew#42890.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-13 15:49:46 +08:00
Vlad Shablinsky
d88750652a tap: add formula_renames
- Tap#formula_renames is a method used for getting information
about renames in tap formulae.
2015-08-10 13:57:58 +01:00
CNA-Bld
1a82b2133e implement pinning of taps 2015-08-10 12:17:25 +01:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
a9b9c5ade7 Tap: allow enumerate non-git taps
Also add a `Tap#git?` method to indicate whether the tap is a git
repository.

Closes Homebrew/homebrew#42264.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-30 21:28:52 +08:00
Xu Cheng
8f85238094 remove incorrect tag for Tap document 2015-06-14 21:40:53 +08:00
Xu Cheng
4564ea899e document Tap class
Closes Homebrew/homebrew#40608.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-06-14 21:28:37 +08:00
Xu Cheng
4101cef3c5 Tap: make remote a separate method to reduce initial overhead
Also make remote method only response to installed tap.
2015-06-14 21:28:36 +08:00
Mike McQuaid
9c3a6a3f52 tap: taps don't need to be Git repositories.
For example e.g. Boxen uses just a managed directory and puts formulae
into it.
2015-06-11 21:54:00 +01:00
Xu Cheng
f7bcfe5115 add Tap class 2015-06-11 15:28:29 +08:00