49 Commits

Author SHA1 Message Date
Caleb Xu
2e6b8d65b3 extract: fix typo 2020-06-18 11:19:04 -04:00
vidusheeamoli
9cfef07682 dev-cmd/extract: instruct users to run git fetch unshallow 2020-04-14 18:07:41 +05:30
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Mike McQuaid
e3ac94fc5d
dev-cmd: use more and cleanup new args APIs. 2020-03-05 09:40:15 +00:00
Mike McQuaid
2eb908a9fb
dev-cmd/extract: allow maintainers to extract to core.
I was wanting to do this today to add `ruby@2.6` and it's a social
rather than technical requirement (i.e. we don't want users to mess
with their homebrew/core unless they know what they are doing) so allow
overriding with `HOMEBREW_DEVELOPER` set.
2020-02-27 10:36:10 +00:00
Caleb Xu
fa5faf3895 extract: handle versioned formulae names
Turn the output versioned formula from the form "name@version" to
"name-version", then following by appending the specific version
after it.

This solution ensures that separate extracted versions of a formulae
can exist alongside each other (e.g. 'python-2@2.7.17' and
'python-2@2.7.16').
2020-02-23 14:32:13 -05:00
Gautham Goli
161c3fb6a4 ARGV: Replaces usages of ARGV.force? with Homebrew.args.force? 2020-01-15 21:09:31 +05:30
EricFromCanada
aea6d79d21 option parser: check for extra named args 2019-12-15 00:04:45 -05:00
EricFromCanada
2f7c3afeb8 cmd: improve wording of messages, spacing 2019-12-15 00:04:45 -05:00
Figroc Chen
3c09ab0d06 extract: semver aware 2019-12-03 21:45:55 +08:00
EricFromCanada
9bfd597991 Format debug messages with odebug 2019-12-02 11:33:19 -05:00
EricFromCanada
8a8359cdd4 manpages: sentence rewording for readability
Use active voice when applicable, better verbs & adjectives, preposition usage, proper tense, etc.
2019-08-20 09:05:45 -04:00
EricFromCanada
6340792f78 manpages: output formatting fixes 2019-08-20 08:28:35 -04:00
EricFromCanada
a3e0647797 manpages: whitespace fixes 2019-08-20 08:24:20 -04:00
Mike McQuaid
c4f72312ce
Fixup brew style failures. 2019-04-30 09:19:18 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
d42f562d45
Merge pull request #6038 from GauthamGoli/extract-args-fix
extract: Replace ARGV.named with args.remaining
2019-04-19 17:40:55 +09:00
Gautham Goli
8374c3713a extract: Replace ARGV.named with args.remaining 2019-04-19 13:13:43 +05:30
Mike McQuaid
e40b171127
Rename cli_parser to cli/parser. 2019-04-17 22:16:50 +09:00
kiendang
028b8b408d Remove use of bash 2019-03-20 20:19:33 +08:00
kiendang
6be6bba0be brew extract from all taps 2019-03-17 23:44:35 +08:00
kiendang
d58e94ed6f Fix class name for brew extract 2019-03-15 11:27:39 +08:00
kiendang
330015ffbd Fix incorrect formula name from file name 2019-03-13 00:49:56 +08:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Mike McQuaid
bbea109926
dev-cmd: remove --help headers and tweak docs. 2019-01-30 21:39:28 +00:00
EricFromCanada
388781f6a7 dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs.
2018-10-19 13:12:55 -04:00
EricFromCanada
ddf057f3dd dev-cmd/: edit help text and descriptions. 2018-10-19 13:12:11 -04:00
Markus Reiter
c4d418e126 Use ActiveSupport’s #second. 2018-10-07 23:10:56 +02:00
EricFromCanada
997a207889 docs: fix Official External Commands section
Work around ronn's inability to nest indents within list items by modifying its output to add a line break and indent after lines ending with a colon that aren't a list item's first line. This allows `brew.1.md.erb` to join the commands' help text without extra line breaks, which avoids the issue where kramdown was turning any command specs containing pipe characters into tables in the HTML output.
2018-10-05 23:47:48 -04:00
Gautham Goli
38feaf1270
extract: Add option descriptions 2018-10-03 20:18:05 +05:30
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Caleb Xu
b1120dd404 extract: check if DependencyCollector::Compat is defined before monkey-patch 2018-08-26 02:22:09 -04:00
Caleb Xu
ad0f9d603f extract: localize DependencyCollector monkey-patches too 2018-08-25 19:52:22 -04:00
Caleb Xu
bd352bcf35 extract: use localized monkey-patching
Instead of just blanketing over with monkey-patches like before,
set up monkey-patches as needed, and make sure to clean up after
we're done.
2018-08-25 14:52:30 -04:00
Caleb Xu
a8563afc9e extract: add progress message when searching Git history
For the impatient ones out there.
2018-08-25 13:40:57 -04:00
Caleb Xu
ff2ce2f093 extract: better success message
Fixes the empty rev string when copying file from HEAD; explicitly
set rev to HEAD in that case.
2018-08-25 13:35:08 -04:00
Caleb Xu
d4a2006f04 extract: add missing monkey-patch 2018-08-25 13:33:25 -04:00
Caleb Xu
be0cd21d0f extract: explicitly load cli_parser 2018-08-25 10:58:13 -04:00
Caleb Xu
1e4cd780c3 extract: fix style 2018-08-25 10:49:06 -04:00
Caleb Xu
a232e3a791 extract: fix corner case
If the formula to be retrieved was just version-bumped in the most
recent commit (HEAD), we would've ended up grabbing the second-most
recent version.

Instead, if the file already exists in tree at the current commit,
just construct the formula from that to get the version (for naming
purposes) and copy the file outright to its new location.
2018-08-24 11:38:14 -04:00
Caleb Xu
0552dcff62 extract: accept tap as a non-flagged argument 2018-08-21 10:17:23 -04:00
Caleb Xu
6018968f91 Further collapse monkeypatches 2018-08-21 10:17:23 -04:00
Caleb Xu
713aedb6ed Fix code review requests 2018-08-21 10:17:23 -04:00
Caleb Xu
260867627b Switch back to monkey-patching
Also gsub! some particular formula contents to work around older
formulae ("brewkit" isn't around anymore, and url is expected to
be a method, not an instance variable).
2018-08-21 10:17:23 -04:00
Caleb Xu
95abdf9662 Use refinements instead of general monkey-patching 2018-08-21 10:17:23 -04:00
Caleb Xu
ff8b5f8c5a extract: rework to search through old/deleted formulae
- Removed use of FormulaVersions - it's generally too brittle for our uses. We
  now interface directly with the Git repo via utils/git and monkeypatch the
  formula loading process where needed.

- Really old formulae (that specify fields as instance vars instead of methods)
  still need more work to be supported; they don't work here quite yet.

- Properly handles deleted/removed formulae from Homebrew/homebrew-core.
  Additional work is still needed to search through Homebrew/legacy-homebrew if
  this functionality is desired.
2018-08-21 10:17:23 -04:00
Caleb Xu
1003aa72c9 Additional fixups for extract command
- Rework command line options
- Make specifying a version optional
- Remove stdout option and require a tap to be specified
- Do not allow user to extract into homebrew/core
- Rework new class name generation to use existing Formulary tools
2018-08-21 10:17:23 -04:00
Caleb Xu
bd2ac70c0f Fix style issues in extract command 2018-08-21 10:17:23 -04:00
Caleb Xu
055460884b Fix up extract command
- Move from cmd to dev-cmd
- Add --stdout flag
- Add sanity checks for args/flags
- Minor rewording on error messages
2018-08-21 10:17:23 -04:00