Merge pull request #2699 from mistydemeo/fix_boolean_types
Fix boolean types
This commit is contained in:
commit
a4aacbc15e
@ -54,7 +54,7 @@ module Hbc
|
|||||||
|
|
||||||
class FromURILoader < FromPathLoader
|
class FromURILoader < FromPathLoader
|
||||||
def self.can_load?(ref)
|
def self.can_load?(ref)
|
||||||
ref.to_s =~ ::URI.regexp
|
ref.to_s.match?(::URI.regexp)
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(url)
|
def initialize(url)
|
||||||
@ -80,7 +80,7 @@ module Hbc
|
|||||||
|
|
||||||
class FromTapLoader < FromPathLoader
|
class FromTapLoader < FromPathLoader
|
||||||
def self.can_load?(ref)
|
def self.can_load?(ref)
|
||||||
ref.to_s =~ HOMEBREW_TAP_CASK_REGEX
|
ref.to_s.match?(HOMEBREW_TAP_CASK_REGEX)
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(tapped_name)
|
def initialize(tapped_name)
|
||||||
|
|||||||
@ -15,7 +15,7 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.abstract?
|
def self.abstract?
|
||||||
name.split("::").last =~ /^Abstract[^a-z]/
|
name.split("::").last.match?(/^Abstract[^a-z]/)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.visible
|
def self.visible
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
|
# Contains backports from newer versions of Ruby
|
||||||
|
require_relative "../vendor/backports/string"
|
||||||
|
|
||||||
class String
|
class String
|
||||||
def undent
|
def undent
|
||||||
gsub(/^[ \t]{#{(slice(/^[ \t]+/) || '').length}}/, "")
|
gsub(/^[ \t]{#{(slice(/^[ \t]+/) || '').length}}/, "")
|
||||||
|
|||||||
26
Library/Homebrew/vendor/README.md
vendored
26
Library/Homebrew/vendor/README.md
vendored
@ -5,6 +5,8 @@ Vendored Dependencies
|
|||||||
|
|
||||||
* [ruby-macho](https://github.com/Homebrew/ruby-macho), version 1.1.0
|
* [ruby-macho](https://github.com/Homebrew/ruby-macho), version 1.1.0
|
||||||
|
|
||||||
|
* [backports](https://github.com/marcandre/backports), version 3.8.0
|
||||||
|
|
||||||
## Licenses:
|
## Licenses:
|
||||||
|
|
||||||
### plist
|
### plist
|
||||||
@ -52,3 +54,27 @@ Vendored Dependencies
|
|||||||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
> THE SOFTWARE.
|
> THE SOFTWARE.
|
||||||
|
|
||||||
|
### backports
|
||||||
|
|
||||||
|
> Copyright (c) 2009 Marc-Andre Lafortune
|
||||||
|
|
||||||
|
> Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
> a copy of this software and associated documentation files (the
|
||||||
|
> "Software"), to deal in the Software without restriction, including
|
||||||
|
> without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
> distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
> permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
> the following conditions:
|
||||||
|
|
||||||
|
> The above copyright notice and this permission notice shall be
|
||||||
|
> included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|||||||
12
Library/Homebrew/vendor/backports/string.rb
vendored
Normal file
12
Library/Homebrew/vendor/backports/string.rb
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Taken from https://github.com/marcandre/backports/blob/v3.8.0/lib/backports/2.4.0/string/match.rb
|
||||||
|
unless String.method_defined? :match?
|
||||||
|
class String
|
||||||
|
def match?(*args)
|
||||||
|
# Fiber to avoid setting $~
|
||||||
|
f = Fiber.new do
|
||||||
|
!match(*args).nil?
|
||||||
|
end
|
||||||
|
f.resume
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user