capistrano-git-submodule-strategy 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "capistrano-git-submodule-strategy"
7
- gem.version = '0.1.3'
7
+ gem.version = '0.1.4'
8
8
  gem.authors = ["Boris Gorbylev"]
9
9
  gem.email = ["ekho@ekho.name"]
10
10
  gem.description = %q{Git submodule support for Capistrano 3}
@@ -10,7 +10,15 @@ class Capistrano::Git
10
10
  end
11
11
 
12
12
  def check
13
- test! :git, :'ls-remote', repo_url
13
+ unless test!(:git, :'ls-remote', repo_url)
14
+ context.error "Repo `#{repo_url}` does not exists"
15
+ return false
16
+ end
17
+
18
+ if context.capture(:git, :'ls-remote', repo_url).split("\n").select{ |i| i.include?("refs/heads/#{fetch(:branch)}") }.empty?
19
+ context.error "Branch `#{fetch(:branch)}` not found in repo `#{repo_url}`"
20
+ return false
21
+ end
14
22
  end
15
23
 
16
24
  def clone
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-git-submodule-strategy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-09 00:00:00.000000000 Z
12
+ date: 2014-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano