Class: Mutant::License::Subscription::Opensource::Repository Private
- Inherits:
-
Object
- Object
- Mutant::License::Subscription::Opensource::Repository
- Defined in:
- lib/mutant/license/subscription/opensource.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- REMOTE_REGEXP =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
/\A[^\t]+\t(?<url>[^ ]+) \((?:fetch|push)\)\n\z/.freeze
- GIT_SSH_REGEXP =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
%r{\A[^@]+@(?<host>[^:/]+)[:/](?<path>.+?)(?:\.git)?\z}.freeze
- GIT_HTTPS_REGEXP =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
%r{\Ahttps://(?<host>[^/]+)/(?<path>.+?)(?:\.git)?\z}.freeze
Class Method Summary collapse
- .parse(input) ⇒ Object private
Instance Method Summary collapse
- #allow?(other) ⇒ Boolean private
- #to_s ⇒ Object private
Class Method Details
.parse(input) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 |
# File 'lib/mutant/license/subscription/opensource.rb', line 20 def self.parse(input) new(*input.split('/', 2).map(&:downcase)) end |
Instance Method Details
#allow?(other) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
43 44 45 |
# File 'lib/mutant/license/subscription/opensource.rb', line 43 def allow?(other) other.host.eql?(host) && path_match?(other.path) end |
#to_s ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 |
# File 'lib/mutant/license/subscription/opensource.rb', line 16 def to_s [host, path].join('/') end |