Class: Hub::Context::Remote

Inherits:
Struct
  • Object
show all
Defined in:
lib/hub/context.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



231
232
233
# File 'lib/hub/context.rb', line 231

def ==(other)
  other.respond_to?(:to_str) ? name == other.to_str : super
end

#projectObject



235
236
237
238
239
# File 'lib/hub/context.rb', line 235

def project
  if urls.find { |u| u =~ %r{\bgithub\.com[:/](.+)/(.+).git$} }
    GithubProject.new local_repo, $1, $2
  end
end

#urlsObject



241
242
243
# File 'lib/hub/context.rb', line 241

def urls
  @urls ||= local_repo.git_config("remote.#{name}.url", :all).to_s.split("\n")
end