right_scraper 5.2.4 → 5.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72742c44a4b3b388890b5b5cfeca507fd73f1378
4
- data.tar.gz: a105f03f00ecfdda21074cfd95833555f4c8f8bc
3
+ metadata.gz: 1154c162499f75a8304bcbb3ce686e071750be25
4
+ data.tar.gz: 817e562768facce3d8d56f82fd2cc152a99d3c33
5
5
  SHA512:
6
- metadata.gz: 4f7e803cab8c2a9bfe872e80280bf5aa3af99adbd9531b4a821f4ebc0e2c04db5db64bdca1970376ef967703977eb72a3f3216f6cf76695f60d1c907f139a8cd
7
- data.tar.gz: fc00f4ecc3f8f9cdf53dc5d75c693a42abbf31f107b592f41ae49a01a667218210337b518141f85c2b7f6eb07668e4d85d0dfc3919f2e838ebc5c69c3eded083
6
+ metadata.gz: 3c9b09ecb6077caddb0d14e6c7f707c51e6610cb594789f4fe42ef5837eb8281762ae17699fe35ca2c01a44c747d5e7cf1d2148c8e92418da714c60b7dd0d750
7
+ data.tar.gz: e8bbe7fcd4f632cab82457ff09daf93c8ab8f65731e3be4ce1b741a07b25154a031f194f9021b46cac4d8f9404384c19dc5a36ed2746677b86066db9c9d545b8
@@ -58,6 +58,7 @@ begin
58
58
  # remove any credentials from repository after retrieval; not needed in
59
59
  # order to run scanners subsequently.
60
60
  %w(first_credential second_credential).each { |k| repository.delete(k) }
61
+ repository['tag'] = retrieved[:repository].revision # send back commit SHA, if any, for comparison
61
62
  retrieved[:repository] = repository
62
63
  retrieved[:warnings] = main.warnings unless main.warnings.empty?
63
64
  $stdout.puts(::JSON.generate(retrieved))
@@ -131,8 +131,14 @@ module RightScraper
131
131
  def retrieve(repo)
132
132
  errorlen = errors.size
133
133
  unless repo.kind_of?(::RightScraper::Repositories::Base)
134
- repo = RightScraper::Repositories::Base.from_hash(::RightSupport::Data::Mash.new(repo))
134
+ repo = ::RightSupport::Data::Mash.new(repo)
135
+ repository_hash = repo.delete(:repository_hash) # optional
136
+ repo = RightScraper::Repositories::Base.from_hash(repo)
137
+ if repository_hash && repository_hash != repo.repository_hash
138
+ raise RightScraper::Error, "Repository hash mismatch: #{repository_hash} != #{repo.repository_hash}"
139
+ end
135
140
  end
141
+
136
142
  retriever = nil
137
143
 
138
144
  # 1. Retrieve the files
@@ -170,7 +176,12 @@ module RightScraper
170
176
  options = ::RightSupport::Data::Mash.new(@options).merge(retrieved)
171
177
  repo = options[:repository]
172
178
  unless repo.kind_of?(::RightScraper::Repositories::Base)
173
- repo = RightScraper::Repositories::Base.from_hash(::RightSupport::Data::Mash.new(repo))
179
+ repo = ::RightSupport::Data::Mash.new(repo)
180
+ repository_hash = repo.delete(:repository_hash) # optional
181
+ repo = RightScraper::Repositories::Base.from_hash(repo)
182
+ if repository_hash && repository_hash != repo.repository_hash
183
+ raise RightScraper::Error, "Repository hash mismatch: #{repository_hash} != #{repo.repository_hash}"
184
+ end
174
185
  options[:repository] = repo
175
186
  end
176
187
  @logger.operation(:scraping, options[:repo_dir]) do
@@ -23,7 +23,7 @@
23
23
 
24
24
  module RightScraper
25
25
  # for gemspec, etc.
26
- GEM_VERSION = '5.2.4'
26
+ GEM_VERSION = '5.2.5'
27
27
 
28
28
  # (Fixnum) protocol versioning scheme; prepended to hashes to
29
29
  # prevent collisions.
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: 5.2.4
4
+ version: 5.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raphael Simon
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-03-23 00:00:00.000000000 Z
13
+ date: 2016-03-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: right_aws