licensed 2.3.0 → 2.3.1

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: fb25b0f6171f25264970c95ae18b301c44400343
4
- data.tar.gz: 945252932681b87f622fb9d065afae70af33ca0d
3
+ metadata.gz: b184dfa3d4dce1ea45476c3c6100c8cdfaf1fb2d
4
+ data.tar.gz: f7c2ecdf054be1bdc2d98efb8e268e0b89f37e01
5
5
  SHA512:
6
- metadata.gz: d771ab002291e816f84b43eb66dc011f62ac6e3e0e4de2dfa82b869b19d60a3f584bc1cefbdd99798e14dec14310f7a447a522ff4ab0efbf6d73c9a661295811
7
- data.tar.gz: 56877626264a91d6afd66740818b010655c1f9d5b0e9eb757c559f7092c3b2ef7962b12ed9d8284f4363e7e2ea7040199a86bd5cff855417b3243acebcb871d0
6
+ metadata.gz: 99f503908e8528098546f02466407022e708b1f8c8d2245ebf8eb104d3ba0652c7b8c1902a45348bf927c610a418cf3ee3f905f652264ec3e9769c06121d24a0
7
+ data.tar.gz: 256031960285da88bf28b3b1493a5f4bcc290a7776467e01820a83f339ce91751678bc21d046439912446ef4feece006a05f2d6aa0b410c22488d51ad4b44cff
@@ -47,7 +47,19 @@ matrix:
47
47
  node_js: "8"
48
48
  before_script: ./script/source-setup/npm
49
49
  script: ./script/test npm
50
- env: NAME="npm"
50
+ env: NAME="npm 8"
51
+
52
+ - language: node_js
53
+ node_js: "10"
54
+ before_script: ./script/source-setup/npm
55
+ script: ./script/test npm
56
+ env: NAME="npm 10"
57
+
58
+ - language: node_js
59
+ node_js: "12"
60
+ before_script: ./script/source-setup/npm
61
+ script: ./script/test npm
62
+ env: NAME="npm 12"
51
63
 
52
64
  # bower tests
53
65
  - language: node_js
@@ -6,7 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- ## 2.1.0 - 2019-04-16
9
+ ## 2.3.1 - 2019-08-20
10
+
11
+ ### Changed
12
+ - Using the npm source with yarn, "missing" dependencies are no longer considered errors (:tada: @krzysztof-pawlik-gat https://github.com/github/licensed/pull/170)
13
+ - The bundler source now calls `gem specification` with dependency version requirements (https://github.com/github/licensed/pull/173)
14
+
15
+ ## 2.3.0 - 2019-05-19
10
16
 
11
17
  ### Added
12
18
  - New Pipenv dependency source enumerator (:tada: @krzysztof-pawlik-gat https://github.com/github/licensed/pull/167)
@@ -167,4 +173,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
167
173
 
168
174
  Initial release :tada:
169
175
 
170
- [Unreleased]: https://github.com/github/licensed/compare/2.3.0...HEAD
176
+ [Unreleased]: https://github.com/github/licensed/compare/2.3.1...HEAD
@@ -151,7 +151,7 @@ module Licensed
151
151
  spec = definition.resolve.find { |s| s.satisfies?(dependency) }
152
152
 
153
153
  # a nil spec should be rare, generally only seen from bundler
154
- return matching_spec(dependency) || bundle_exec_gem_spec(dependency.name) if spec.nil?
154
+ return matching_spec(dependency) || bundle_exec_gem_spec(dependency.name, dependency.requirement) if spec.nil?
155
155
 
156
156
  # try to find a non-lazy specification that matches `spec`
157
157
  # spec.source.specs gives access to specifications with more
@@ -166,7 +166,7 @@ module Licensed
166
166
 
167
167
  # if the specification file doesn't exist, get the specification using
168
168
  # the bundler and gem CLI
169
- bundle_exec_gem_spec(dependency.name)
169
+ bundle_exec_gem_spec(dependency.name, dependency.requirement)
170
170
  end
171
171
 
172
172
  # Returns whether a dependency should be included in the final
@@ -200,7 +200,7 @@ module Licensed
200
200
 
201
201
  # Load a gem specification from the YAML returned from `gem specification`
202
202
  # This is a last resort when licensed can't obtain a specification from other means
203
- def bundle_exec_gem_spec(name)
203
+ def bundle_exec_gem_spec(name, requirement)
204
204
  # `gem` must be available to run `gem specification`
205
205
  return unless Licensed::Shell.tool_available?("gem")
206
206
 
@@ -209,11 +209,12 @@ module Licensed
209
209
  begin
210
210
  ::Bundler.with_original_env do
211
211
  ::Bundler.rubygems.clear_paths
212
- yaml = Licensed::Shell.execute(*ruby_command_args("gem", "specification", name))
212
+ yaml = Licensed::Shell.execute(*ruby_command_args("gem", "specification", name, "-v", requirement.to_s))
213
213
  spec = Gem::Specification.from_yaml(yaml)
214
214
  # this is horrible, but it will cache the gem_dir using the clean env
215
- # so that it can be used outside of this block
216
- spec.gem_dir
215
+ # so that it can be used outside of this block when running from
216
+ # the ruby packer executable environment
217
+ spec.gem_dir if ruby_packer?
217
218
  spec
218
219
  end
219
220
  rescue Licensed::Shell::Error
@@ -13,6 +13,7 @@ module Licensed
13
13
  end
14
14
 
15
15
  def enumerate_dependencies
16
+ @yarn_lock_present = File.exist?(@config.pwd.join("yarn.lock"))
16
17
  packages.map do |name, package|
17
18
  path = package["path"]
18
19
  Dependency.new(
@@ -48,6 +49,7 @@ module Licensed
48
49
  # package name to it's metadata
49
50
  def recursive_dependencies(dependencies, result = {})
50
51
  dependencies.each do |name, dependency|
52
+ next if @yarn_lock_present && dependency["missing"]
51
53
  (result[name] ||= []) << dependency
52
54
  recursive_dependencies(dependency["dependencies"] || {}, result)
53
55
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Licensed
3
- VERSION = "2.3.0".freeze
3
+ VERSION = "2.3.1".freeze
4
4
 
5
5
  def self.previous_major_versions
6
6
  major_version = Gem::Version.new(Licensed::VERSION).segments.first
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: licensed
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-19 00:00:00.000000000 Z
11
+ date: 2019-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: licensee