gem_collector 1.1.1 → 1.2.0

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
  SHA256:
3
- metadata.gz: 36194b17fc2fa5c04f8ef352b3b5104eb3ddad6c092ada41cf345ce10c54beff
4
- data.tar.gz: 30e9448687f5d3590a1fcf8a3dbc81e9372be51fe0bb8ace5d1d74d0c01ee640
3
+ metadata.gz: f62c3065898613d6ad21af8ceee702138929a5016a1f36baa3f8944491eca5ab
4
+ data.tar.gz: 414aef8ebb73504c71ef93ab3091d8b9ae1ebbc6c113fb548358483fa3f543bf
5
5
  SHA512:
6
- metadata.gz: 822ce5abdc809653d0a2de9bfdd28206c8abba90815095890fe7abf90f74b55379bc76da959722c8256acf1943ec6777c45a0073737126a87856c6b34a96fa2e
7
- data.tar.gz: 84582ae7409da59b2097ea1c9bd1adc72b770da216e82331bf37462a8ebf8b800996ce8d501e66338d2c6ac35c1bf57731b126a9ada603d0cefa156c9d71b078
6
+ metadata.gz: 64a6c803cd6a95402b0adf9724d6c48d33b3a3d33b66e2f2fd6625597c95a6e41ca2b777381d43ad1619115a93869f82b6207fbeebc5ecd08560f2392278bc91
7
+ data.tar.gz: 1a1b404f03b8a5c592eb2d7bc02076b69e34d437ae8e158d31244a7da74e425600fbd0a38f4bb56b8f1557bcfb6e2b01e3c1d375e9973e918394737c60fc5c87
@@ -61,7 +61,7 @@ class GemCollector::RepositoriesController < GemCollector::ApplicationController
61
61
 
62
62
  # https://developer.github.com/webhooks/securing/
63
63
  def has_valid_signature?(site)
64
- secret = Rails.application.config.octokit.fetch(site)['webhook_secret']
64
+ secret = Rails.application.config.octokit.fetch(site.to_sym)[:webhook_secret]
65
65
  if secret
66
66
  request.body.rewind
67
67
  payload_body = request.body.read
@@ -1,10 +1,10 @@
1
1
  module GemCollector::OctokitProvider
2
2
  def self.get(site)
3
- conf = Rails.application.config.octokit.fetch(site)
3
+ conf = Rails.application.config.octokit.fetch(site.to_sym)
4
4
  Octokit::Client.new(
5
- api_endpoint: conf['api_endpoint'],
6
- web_endpoint: conf['web_endpoint'],
7
- access_token: conf['access_token'],
5
+ api_endpoint: conf[:api_endpoint],
6
+ web_endpoint: conf[:web_endpoint],
7
+ access_token: conf[:access_token],
8
8
  )
9
9
  end
10
10
  end
@@ -55,7 +55,15 @@ class GemCollector::UpdateGemfile
55
55
  end
56
56
 
57
57
  def update_gemfile_lock(repository, dir, path)
58
- lockfile_parser = Bundler::LockfileParser.new(path.read)
58
+ content = path.read
59
+ lockfile_parser =
60
+ begin
61
+ Bundler::LockfileParser.new(content)
62
+ rescue Bundler::LockfileError
63
+ # Try to parse (possibly) incompatible lockfile
64
+ content.sub!(/(^BUNDLED WITH\n\s*)[0-9.]+$/) { "#{$1}#{Bundler::VERSION}" }
65
+ Bundler::LockfileParser.new(content)
66
+ end
59
67
  lock_path = path.relative_path_from(dir).to_s
60
68
  records = lockfile_parser.specs.map do |spec|
61
69
  repository.repository_gems.build(path: lock_path, name: spec.name, version: spec.version.to_s)
@@ -1,3 +1,3 @@
1
1
  module GemCollector
2
- VERSION = '1.1.1'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kohei Suzuki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-15 00:00:00.000000000 Z
11
+ date: 2019-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-import
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 5.1.3
89
+ version: 6.0.1
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 5.1.3
96
+ version: 6.0.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec-rails
99
99
  requirement: !ruby/object:Gem::Requirement