Pathname: remove trailing spaces
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
5cc4b1c991
commit
212927ee54
@ -84,7 +84,7 @@ class Pathname
|
|||||||
raise unless e.errno == Errno::ENOTEMPTY::Errno or e.errno == Errno::EACCES::Errno
|
raise unless e.errno == Errno::ENOTEMPTY::Errno or e.errno == Errno::EACCES::Errno
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
def chmod_R perms
|
def chmod_R perms
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
FileUtils.chmod_R perms, to_s
|
FileUtils.chmod_R perms, to_s
|
||||||
@ -139,7 +139,7 @@ class Pathname
|
|||||||
# eg. ruby-1.9.1-p243
|
# eg. ruby-1.9.1-p243
|
||||||
/-((\d+\.)*\d\.\d+-(p|rc|RC)?\d+)$/.match stem
|
/-((\d+\.)*\d\.\d+-(p|rc|RC)?\d+)$/.match stem
|
||||||
return $1 if $1
|
return $1 if $1
|
||||||
|
|
||||||
# eg. lame-398-1
|
# eg. lame-398-1
|
||||||
/-((\d)+-\d)/.match stem
|
/-((\d)+-\d)/.match stem
|
||||||
return $1 if $1
|
return $1 if $1
|
||||||
@ -185,7 +185,7 @@ class Pathname
|
|||||||
|
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def incremental_hash(hasher)
|
def incremental_hash(hasher)
|
||||||
incr_hash = hasher.new
|
incr_hash = hasher.new
|
||||||
self.open('r') do |f|
|
self.open('r') do |f|
|
||||||
@ -200,12 +200,12 @@ class Pathname
|
|||||||
require 'digest/md5'
|
require 'digest/md5'
|
||||||
incremental_hash(Digest::MD5)
|
incremental_hash(Digest::MD5)
|
||||||
end
|
end
|
||||||
|
|
||||||
def sha1
|
def sha1
|
||||||
require 'digest/sha1'
|
require 'digest/sha1'
|
||||||
incremental_hash(Digest::SHA1)
|
incremental_hash(Digest::SHA1)
|
||||||
end
|
end
|
||||||
|
|
||||||
def sha2
|
def sha2
|
||||||
require 'digest/sha2'
|
require 'digest/sha2'
|
||||||
incremental_hash(Digest::SHA2)
|
incremental_hash(Digest::SHA2)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user