Sha256: 399fe269b27959e410f3e8c9c6e56e7d2d095a1c945997232f747cf69678df26

Contents?: true

Size: 601 Bytes

Versions: 8

Compression:

Stored size: 601 Bytes

Contents

module EacLauncher
  module Stereotypes
    class GitSubrepo
      include EacLauncher::Stereotype

      class << self
        def match?(path)
          File.exist?(path.real.subpath('.gitrepo')) && subrepo_url(path.real) != 'none'
        end

        def color
          :light_cyan
        end

        def subrepo_url(path)
          File.read(path.subpath('.gitrepo')).each_line do |l|
            m = /remote\s*=\s(.+)/.match(l)
            return m[1] if m
          end
          raise ::EacLauncher::Git::Error.new(path, '"remote = ... " not found')
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
eac_launcher-0.5.1 lib/eac_launcher/stereotypes/git_subrepo.rb
eac_launcher-0.5.0 lib/eac_launcher/stereotypes/git_subrepo.rb
eac_launcher-0.4.0 lib/eac_launcher/stereotypes/git_subrepo.rb
eac_launcher-0.3.2 lib/eac_launcher/stereotypes/git_subrepo.rb
eac_launcher-0.3.1 lib/eac_launcher/stereotypes/git_subrepo.rb
eac_launcher-0.3.0 lib/eac_launcher/stereotypes/git_subrepo.rb
eac_launcher-0.2.2 lib/eac_launcher/stereotypes/git_subrepo.rb
eac_launcher-0.2.1 lib/eac_launcher/stereotypes/git_subrepo.rb