234 Commits

Author SHA1 Message Date
Markus Reiter
2d6ae61314 Re-revert "Fix operator spacing." 2017-06-02 19:22:05 +02:00
ilovezfs
197392b56d Revert "Fix operator spacing." 2017-06-01 04:06:40 -07:00
Markus Reiter
d34ba7395b Fix operator spacing. 2017-05-31 19:53:41 +02:00
Misty De Meo
a40291ee4a
Pathname: use Digest::SHA256 alias
Digest::SHA2 wasn't exposed under that name in older versions of Ruby.
2017-05-30 18:30:16 -07:00
Mike McQuaid
45a7730f61 Fix and remove various TODOs.
Fix those that can be done so without tearing Homebrew to pieces and
remove the comments for those that can never be done.
2017-04-23 15:10:18 +01:00
Mike McQuaid
ba3c46d24f More deprecations.
Deprecate more methods. Internal APIs have been verified to be unused
elsewhere and removed. External APIs have had deprecation methods added.
Existing deprecations have been either upgraded to produce warnings or
no longer deprecated and the reasoning documented.
2017-04-22 16:28:07 +01:00
Naoto Kaneko
928eaca267 Merge branch 'master' into exclude-executable-metafiles
Added tests in keg_test and pathname_test was
moved into keg_spec and pathname_spec.
2017-02-27 14:23:53 +09:00
Naoto Kaneko
56a0afe579 Extend #ds_file? in Pathname 2017-02-24 17:44:18 +09:00
Markus Reiter
9dda84ad6b Add integration test helper methods. 2017-02-23 09:23:22 +01:00
Mike McQuaid
6c2b614a04 pathname: make compute_disk_usage handle symlinks. 2017-01-06 08:50:20 +00:00
Markus Reiter
59e2d67721 No if/unless-modifier on multiline blocks. 2016-11-13 23:37:40 +01:00
Markus Reiter
e851c9bf6c Style/Alias: Prefer alias. 2016-09-23 18:19:53 +02:00
Markus Reiter
4be3aff253 Fix Lint/NonLocalExitFromIterator. 2016-09-23 15:30:06 +02:00
Mike McQuaid
b42f646cec extend/pathname: fix Rubocop warnings. 2016-09-13 07:57:15 +01:00
Markus Reiter
85635a1e19 Merge Cask’s Pathname extension with Homebrew’s. 2016-08-24 00:43:32 +02:00
Xu Cheng
e423617d77
remove ruby 1.8 compatible codes 2016-08-18 14:35:39 +08:00
Paolo G. Giarrusso
2f20a42292 Synchronize counts for link and unlink (#242)
Closes #239.
2016-05-15 12:07:58 +01:00
Xu Cheng
91fd357c90 Pathname: improve compute_disk_usage
* Count .DS_Store disk usage but not file count.
* Count symlink's own disk usage instead of ignoring it.
* Count hardlinks disk usage only once.
* Add testcase.

Closes Homebrew/homebrew#50563.

Closes Homebrew/homebrew#50566.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-04-01 16:30:14 +08:00
Xu Cheng
028d155e97 Pathname#version: only parse version from file basename
i.e. Ignoring the file's directory for version parsing.

Closes Homebrew/homebrew#50568.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-31 17:10:22 +08:00
Xu Cheng
bd7e8543b3 deprecate SHA1 2016-03-20 14:55:58 +08:00
Mike McQuaid
0578ba0f42 install_renamed: handle recursive installs.
Closes Homebrew/homebrew#49845.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-03-08 13:47:29 +08:00
Dominyk Tiller
ff4d16deeb pathname: add append_lines method
* Blocks writing of new files via accidental typos, etc, which the normal open("blah", "a") doesn't.
* Where files don't exist they should ideally be using `(buildpath/"dog").write` instead of open("blah", "a") already.
* It's a bit less cluttered looking if you need several writes to different files in the formula, IMO.
2016-02-21 04:22:23 +00:00
Dominyk Tiller
abd4c699d1 pathname: remove redundant spacing 2016-01-03 19:08:10 +00:00
Dominyk Tiller
7e7838b5ba pathname: become less introspective
These self references are unnecessary.
2016-01-03 19:07:55 +00:00
Mike McQuaid
0bca7ad9c3 pathname: don't try to calculate symlink size.
Closes https://github.com/Homebrew/homebrew/issues/47532
Closes https://github.com/Homebrew/homebrew-dupes/issues/542
2015-12-30 19:46:23 +00:00
Xu Cheng
24224dc896 pathname: improve compute_disk_usage
* Avoid parallel assignment.
* Use Pathname#size instead of File#size
* Use Pathname#directory? instead of File#directory?
* Use basename to check `.DS_Store`. Original regex has poor
  performance, and may match with incorrect file.
2015-12-30 16:27:15 +08:00
Mike McQuaid
482481d24c pathname: fix use of find on Ruby 1.8. 2015-12-30 08:23:57 +00:00
Rakesh
e4f2a1e0ef pathname: store file count and disk usage.
especially for directory instances of `Pathname` class and all
instances of `Keg` class.
2015-12-30 08:11:23 +00:00
Xu Cheng
d108bf0a55 move more deprecated methods to compat folder 2015-11-17 18:52:00 +08:00
Xu Cheng
646f94adfe move mach.rb to os/mac/mach.rb 2015-10-18 22:57:42 +08:00
Xu Cheng
235c5b6bfa ObserverPathnameExtension: only puts first 100 operations
Fixes https://github.com/Homebrew/homebrew/issues/44320#issuecomment-143951973

Closes Homebrew/homebrew#44440.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-08 16:12:01 +08:00
Mike McQuaid
2c959a7d58 More API documentation.
And remove the documented stuff from the `example-formula.rb`.

Closes Homebrew/homebrew#43241.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-29 15:43:16 +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
fd7f3b9496 Pathname#abv: handle the case du returns empty string
This can happen when read permission is denied.

Fixes Homebrew/homebrew#41925.

Closes Homebrew/homebrew#42011.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-22 20:35:01 +08:00
Xu Cheng
f2d0a88292 remove Pathname#find_formula
Closes Homebrew/homebrew#40486.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-06-11 15:28:30 +08:00
Xu Cheng
31ca2831f3 Revert "Pathname#version: support bottle version"
This reverts commit 02fba8ce25f1e34c981cb30197e2b4711f88b266.
2015-06-07 23:51:15 +08:00
Xu Cheng
ef7eb0750c Pathname#version: support bottle version
Closes Homebrew/homebrew#40365.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-06-04 20:05:43 +08:00
Misty De Meo
8fe0b56810 Add support for extracting LHA archives 2015-04-26 11:11:56 -07:00
Dominyk Tiller
2fa87369b3 pathname: prune unnecessary whitespace
Closes Homebrew/homebrew#38413.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-04-07 18:32:29 +01:00
Shaun Jackman
6ca42964cb pathname: remove hyphen from BOTTLE_EXTNAME_RX
A hyphen is not a valid character in a Ruby symbol, and the bottle
tag should be a valid Ruby symbol for its use in the bottle stanza.

Closes Homebrew/homebrew#38235.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-03-31 18:53:26 +01:00
Shaun Jackman
1ad0de8660 pathname: Add [-0-9] to BOTTLE_EXTNAME_RX
Change [a-z_]+(32)? to [-a-z0-9_]+
The Linuxbrew bottle tag is x86_64-linux.

Closes Homebrew/homebrew#32687.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-03-31 15:07:46 +01:00
Jack Nagel
96f7a8015f Pass around only pathname objects 2015-03-26 22:22:45 -04:00
Jack Nagel
3721e0be6f Always yield a path from install_p extension 2015-03-26 22:22:45 -04:00
Jack Nagel
380b8ce46d Combine assignments 2015-03-25 20:26:04 -04:00
Jack Nagel
1351f67e91 Make install_p and install_symlink_p private 2015-03-24 21:08:12 -04:00
Jack Nagel
ab3d622da2 Always pass basename to install_symlink_p 2015-03-24 21:06:19 -04:00
Jack Nagel
6f0efd6f3d Always pass basename to install_p
Currently, when called with one argument, dst is set to self, i.e. the
directory into which the source file should be moved.

When called with a second argument (for renames), dst is the full path,
including the basename, to the moved file.

Instead, let's always pass the full path, which means we can remove the
branching logic around computing dst.
2015-03-24 21:03:45 -04:00
Jack Nagel
86006ba36b Go through regular logic when installing a file 2015-03-23 21:01:50 -04:00
Xu Cheng
144453368e test-bot pathname: use Utils.popen_read instead of backticks
Closes Homebrew/homebrew#37418.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-03-06 22:19:24 +08:00
Xu Cheng
328fa80f41 pathname: skip directory in env_script_all_files
Closes Homebrew/homebrew#37180.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-02-25 20:17:22 +08:00