Class: EacLauncher::Stereotypes::GitSubrepo

Inherits:
Object
  • Object
show all
Includes:
EacLauncher::Stereotype
Defined in:
lib/eac_launcher/stereotypes/git_subrepo.rb,
lib/eac_launcher/stereotypes/git_subrepo/warp.rb,
lib/eac_launcher/stereotypes/git_subrepo/publish.rb

Defined Under Namespace

Classes: Publish, Warp

Class Method Summary collapse

Methods included from EacLauncher::Stereotype

included, nogit_stereotypes

Class Method Details

.colorObject



11
12
13
# File 'lib/eac_launcher/stereotypes/git_subrepo.rb', line 11

def color
  :light_cyan
end

.match?(path) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/eac_launcher/stereotypes/git_subrepo.rb', line 7

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

.subrepo_url(path) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/eac_launcher/stereotypes/git_subrepo.rb', line 15

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 "\"remote = ... \" not found (Path: #{path})"
end