Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ext/string.rb

Constant Summary collapse

REPO_REGEX =
/\/(.*).git$/

Instance Method Summary collapse

Instance Method Details

#repo_dirObject



3
4
5
# File 'lib/ext/string.rb', line 3

def repo_dir
  self =~ REPO_REGEX ? $1 : self
end

#repo_url?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/ext/string.rb', line 7

def repo_url?
  !!(self =~ REPO_REGEX)
end