Class: EacLauncher::Stereotypes::GitSubtree
- Inherits:
-
Object
- Object
- EacLauncher::Stereotypes::GitSubtree
show all
- Includes:
- EacLauncher::Stereotype
- Defined in:
- lib/eac_launcher/stereotypes/git_subtree.rb,
lib/eac_launcher/stereotypes/git_subtree/warp.rb,
lib/eac_launcher/stereotypes/git_subtree/publish.rb
Defined Under Namespace
Classes: Publish, Warp
Class Method Summary
collapse
included, nogit_stereotypes
Class Method Details
.color ⇒ Object
16
17
18
|
# File 'lib/eac_launcher/stereotypes/git_subtree.rb', line 16
def color
:green
end
|
.match?(path) ⇒ Boolean
7
8
9
10
11
12
13
14
|
# File 'lib/eac_launcher/stereotypes/git_subtree.rb', line 7
def match?(path)
return false if ::EacLauncher::Stereotypes::Git.match?(path) ||
::EacLauncher::Stereotypes::GitSubrepo.match?(path)
return false unless other_nogit_stereotype?(path)
parent = parent_git(path.parent)
return false unless parent
::Git.open(parent).remote(File.basename(path)).url ? true : false
end
|
.other_nogit_stereotype?(path) ⇒ Boolean
.parent_git(p) ⇒ Object
20
21
22
23
|
# File 'lib/eac_launcher/stereotypes/git_subtree.rb', line 20
def parent_git(p)
return nil unless p
::EacLauncher::Stereotypes::Git.match?(p) ? p : parent_git(p.parent)
end
|