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-2.2.2 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-2.2.1 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-2.2.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-2.1.2 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-2.1.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-2.0.0.pre.pre.2 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-2.0.0.pre.pre.1 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.22.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.21.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.20.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.19.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.18.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.17.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.16.2 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.16.1 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.16.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.15.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.14.0 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.13.1 lib/roo_on_rails/checks/git/origin.rb
roo_on_rails-1.13.0 lib/roo_on_rails/checks/git/origin.rb