Sha256: 207ec5680411e8e94e49dd412ebaef4db94a9c797e398f99767be53ffd30db36

Contents?: true

Size: 690 Bytes

Versions: 4

Compression:

Stored size: 690 Bytes

Contents

require 'roo_on_rails/checks/base'

module RooOnRails
  module Checks
    module Git
      class Origin < Base
        # Output context:
        # - git_org (string)
        # - git_repo (string)
        def intro
          "Checking your Git origin remote..."
        end

        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
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
roo_on_rails-1.3.1 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.3.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.2.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.1.0 lib/roo_on_rails/checks/git/origin.rb