right_scraper 1.0.13 → 1.0.15
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/right_scraper/scrapers/git_scraper.rb +6 -4
- data/right_scraper.gemspec +1 -1
- data/spec/__destdir/test +1 -0
- metadata +2 -1
@@ -61,16 +61,18 @@ module RightScale
|
|
61
61
|
if !is_tag && !is_branch
|
62
62
|
current_sha = `git rev-parse HEAD`.chomp
|
63
63
|
if current_sha == @repo.tag
|
64
|
-
@callback.call("Nothing to update: already using #{repo.tag}", is_step=false) if @callback
|
64
|
+
@callback.call("Nothing to update: already using #{@repo.tag}", is_step=false) if @callback
|
65
65
|
return true
|
66
|
+
else
|
67
|
+
@callback.call("Current HEAD (#{current_sha}) differs from #{@repo.tag}, falling back to cloning", is_step=false) if @callback
|
66
68
|
end
|
67
69
|
end
|
68
70
|
if is_tag && is_branch
|
69
71
|
@errors << 'Repository tag ambiguous: could be git tag or git branch'
|
70
|
-
elsif !on_branch
|
72
|
+
elsif is_branch && !on_branch
|
71
73
|
res = `git checkout #{@repo.tag} 2>&1`
|
72
74
|
if $? != 0
|
73
|
-
@callback.call("Failed to checkout #{tag}: #{res}, falling back to cloning", is_step=false) if @callback
|
75
|
+
@callback.call("Failed to checkout #{@repo.tag}: #{res}, falling back to cloning", is_step=false) if @callback
|
74
76
|
FileUtils.rm_rf(@current_repo_dir)
|
75
77
|
@incremental = false
|
76
78
|
end
|
@@ -215,7 +217,7 @@ module RightScale
|
|
215
217
|
if succeeded? && (!update || @incremental)
|
216
218
|
is_tag = `git tag`.split("\n").include?(@repo.tag)
|
217
219
|
is_branch = `git branch -r`.split("\n").map { |t| t.strip }.include?("origin/#{@repo.tag}")
|
218
|
-
on_branch = is_branch &&
|
220
|
+
on_branch = is_branch && !!`git branch`.split("\n").include?("* #{@repo.tag}")
|
219
221
|
end
|
220
222
|
{ :tag => is_tag, :branch => is_branch, :on_branch => on_branch }
|
221
223
|
end
|
data/right_scraper.gemspec
CHANGED
@@ -23,7 +23,7 @@ require 'rubygems'
|
|
23
23
|
|
24
24
|
spec = Gem::Specification.new do |spec|
|
25
25
|
spec.name = 'right_scraper'
|
26
|
-
spec.version = '1.0.
|
26
|
+
spec.version = '1.0.15'
|
27
27
|
spec.authors = ['Raphael Simon']
|
28
28
|
spec.email = 'raphael@rightscale.com'
|
29
29
|
spec.homepage = 'https://github.com/rightscale/right_scraper'
|
data/spec/__destdir/test
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
MORE THAN 2 CHARS
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: right_scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raphael Simon
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- lib/right_scraper/watcher.rb
|
37
37
|
- lib/right_scraper/win32/process_monitor.rb
|
38
38
|
- right_scraper.gemspec
|
39
|
+
- spec/__destdir/test
|
39
40
|
- spec/download_scraper_spec.rb
|
40
41
|
- spec/git_scraper_spec.rb
|
41
42
|
- spec/rcov.opts
|