aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/pathname.rb
AgeCommit message (Collapse)Author
2015-04-26Add support for extracting LHA archivesMisty De Meo
2015-04-07pathname: prune unnecessary whitespaceDominyk Tiller
Closes #38413. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-03-31pathname: remove hyphen from BOTTLE_EXTNAME_RXShaun Jackman
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 #38235. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-03-31pathname: Add [-0-9] to BOTTLE_EXTNAME_RXShaun Jackman
Change [a-z_]+(32)? to [-a-z0-9_]+ The Linuxbrew bottle tag is x86_64-linux. Closes #32687. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-03-26Pass around only pathname objectsJack Nagel
2015-03-26Always yield a path from install_p extensionJack Nagel
2015-03-25Combine assignmentsJack Nagel
2015-03-24Make install_p and install_symlink_p privateJack Nagel
2015-03-24Always pass basename to install_symlink_pJack Nagel
2015-03-24Always pass basename to install_pJack Nagel
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-23Go through regular logic when installing a fileJack Nagel
2015-03-06test-bot pathname: use Utils.popen_read instead of backticksXu Cheng
Closes #37418. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-02-25pathname: skip directory in env_script_all_filesXu Cheng
Closes #37180. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-01-05Buffer 16K at a timeJack Nagel
2014-12-09Recognize rpm file magicJack Nagel
2014-11-09Pull initialization code out of begin blockJack Nagel
2014-09-20Make Pathname#atomic_write truly atomicJack Nagel
As we know, files cannot be moved across filesystems atomically. In that case, FileUtils.mv will make a copy. But if we create the temp file in the same directory as the target, we can avoid this and use File.rename directly. Additionally, the rename should be the absolute last step, so that the original file is preserved if altering ownership and permissions fails.
2014-08-26etc.install: handle recursive directory installs.Mike McQuaid
We need to install the helper module not just on `etc` but also on all subdirectories of it too. Also, handle the case where we install a subdirectory with etc.install. Closes #26145.
2014-07-29Pathname.binreadAdam Vandenberg
2014-07-27backport binwrite from Ruby 2.1+Adam Vandenberg
2014-07-27Rename write_binary to binwriteAdam Vandenberg
2014-07-27add Pathname.write_binaryAdam Vandenberg
2014-07-13nudge formattingAdam Vandenberg
Needed for Emacs' ruby highlighting to work past this point in the file.
2014-07-10Raise Errno::ENOENT instead of RuntimeError from Pathname#installJack Nagel
2014-07-10Make comment in Pathname#install more accurateJack Nagel
2014-07-05Remove a RUBY_VERSION check, add a FIXME commentJack Nagel
2014-06-17Add explicit mkpath to Pathname#write_env_scriptJack Nagel
2014-06-17Add explicit mkpath to Pathname#write_jar_scriptJack Nagel
2014-06-17Add explicit mkpath to Pathname#write_exec_scriptJack Nagel
2014-06-17Make signature of Pathname#write compatible with Ruby 2.1+Jack Nagel
2014-06-12Deprecate Pathname#cp and Pathname#chmod_RJack Nagel
As far as I can tell these methods have only ever been used in the test suite. Since Formula includes FileUtils, it is generally simpler (and in the case of cp, more readable) to use the FileUtils methods directly. Closes #30081.
2014-06-12Deprecate Pathname#/ with non-string/non-pathname argumentsJack Nagel
Ruby 2.2 will define Pathname#/ as a simple alias of Pathname#+. In practice, this means that it will raise a TypeError unless the argument responds to to_path or to_str. Currently we blindly convert the argument to a string using to_s, so deprecate this in the interest of matching the upstream behavior. In the future we can replace this with alias_method :/, :+ unless method_defined?(:/) Closes #30079.
2014-06-11Use Digest#file if it's availableJack Nagel
2014-06-09Stop joining symbols to pathnamesJack Nagel
Ruby 2.2's native Pathname#/ accepts only string-like objects.
2014-06-08Just access the ivar directlyJack Nagel
2014-06-08Work around encoding issue in Pathname#inspect on Ruby 2.0Jack Nagel
Pathname#inspect on Ruby 2.0 throws away the encoding of the object's underlying string and returns a string tagged as ASCII-8BIT. If you simply write puts Pathname.new("some string with non-ascii bytes").inspect no error will be raised, because the implementation of Pathname#inspect does not call into Object#inspect. However, if you wrap that pathname object in an array first, then puts [Pathname.new("some string with non-ascii bytes")].inspect will raise Encoding::CompatibilityError: "inspected result must be ASCII only or use the same encoding with default external". Raising an error in this codepath is new in Ruby 2.0, and this specific bug is fixed in Ruby 2.1. I've opened a bug upstream: https://bugs.ruby-lang.org/issues/9915 Fixes #29947.
2014-06-07metafiles: simplify #copy? furtherJack Nagel
2014-06-07Simplify Pathname#install_metafilesJack Nagel
2014-06-07Eliminate FORMULA_META_FILES constantJack Nagel
2014-05-31Use Pathname.glob when we want pathname objectsJack Nagel
2014-05-05Add a method_defined? guard for Pathname#/Jack Nagel
This was added to the stdlib in https://github.com/ruby/ruby/commit/391fc2eeecfc2f0d0f851b0c27ba02e041fe2cd9.
2014-05-05Use #+ instead of #join to define Pathname#/Alexey Muranov
See also https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/45826/diff/ext/pathname/lib/pathname.rb Closes #28972. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-05-03Suppress a warning on Ruby 2.1+Jack Nagel
2014-04-25Yield absolute paths from find_formulaJack Nagel
2014-04-21Rework make_relative_symlink error handling and move it into kegJack Nagel
2014-04-14Use quiet_system to silence some useless warningsJack Nagel
2014-04-14Remove overzealous exceptionsJack Nagel
2014-04-06Recognize and extract xar filesJack Nagel
2014-04-06pathname: use ln_sf in install_symlink.Mike McQuaid
Closes #28136.
2014-04-06Handle untarred bzip2 filesJack Nagel
Fixes #28187.