Class: RooOnRails::Checks::Git::Origin

Inherits:
Base
  • Object
show all
Defined in:
lib/roo_on_rails/checks/git/origin.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, requires, #run

Methods included from Helpers

#bold, included

Constructor Details

This class inherits a constructor from RooOnRails::Checks::Base

Instance Method Details

#callObject



14
15
16
17
18
19
20
21
22
# File 'lib/roo_on_rails/checks/git/origin.rb', line 14

def call
  status, url = shell.run "git config remote.origin.url"
  fail! "Origin does not seem to be configured." unless status

  org, repo = url.strip.sub(%r{\.git$}, '').split(%r{[:/]}).last(2)
  context.git_org  = org
  context.git_repo = repo
  pass "organisation #{bold org}, repository: #{bold repo}"
end

#introObject

Output context:

  • git_org (string)

  • git_repo (string)



10
11
12
# File 'lib/roo_on_rails/checks/git/origin.rb', line 10

def intro
  "Checking your Git origin remote..."
end