Sha256: 151e3e7a197f00f7f51e85a4f5ae9aab9011934e23bc80226397557919f1ce58

Contents?: true

Size: 679 Bytes

Versions: 31

Compression:

Stored size: 679 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

31 entries across 31 versions & 1 rubygems

Version Path
roo_on_rails-1.12.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.11.1 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.11.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.10.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.9.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.8.1 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.8.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.7.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.6.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.5.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.4.0 lib/roo_on_rails/checks/git/origin.rb