license_finder 2.1.0.rc5 → 2.1.0.rc6

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: 8f2e99eaffffaa4d029d0d4d3971a71d3bb2105a
4
- data.tar.gz: 5dfcf808d965a35a662a0d18d49b6386aecfd6d2
3
+ metadata.gz: bbf949d7115f817832bcf5c25f76c57c8f43ca4f
4
+ data.tar.gz: 1edbbb2de90eaa0d57791b3f560ec28efdc7fcb2
5
5
  SHA512:
6
- metadata.gz: 3832445531340ec5402915b366caa853e874a9193103b2519bda9cce2f27151d314d18b56daf74af7d1aadee446cb60269e71438758f15067d9000a109a944e2
7
- data.tar.gz: 1d062154252007749613893853b18ab205e83e03e4e28334424d2af99f61e34aad5baeb0844a1509f90781ce2f8ba2306d186b715b708dd3d6c226be2e464fa4
6
+ metadata.gz: 0c97e33455a8a162d0c44182fbfebccbabe11b4e76eab9c5871b594f016158041f52688b2165a48773d82a4c49b0910f00ede7255d3be6eef1a219a9a058e58b
7
+ data.tar.gz: dd33c7312b0d2c1ef4f8cfcfafac5ddbbc7dc719388cfd4a153634a5594eec6e1c8fc30e194be25189c52ae9836aa87c8807fc0181ef35ae53b5f357c4feafad
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,12 @@
1
+ === 2.1.0.rc6 / 2016-03-11
2
+
3
+ * Features
4
+ * detect GO15VENDOREXPERIMENT as evidence of a go workspace project
5
+
6
+ * Bugfixes
7
+ * deep npm dependency trees no longer result in some packages having no metadata (#211)
8
+
9
+
1
10
  === 2.1.0.rc5 / 2016-02-19
2
11
 
3
12
  * Features
@@ -3,6 +3,7 @@ require 'json'
3
3
  module LicenseFinder
4
4
  class GoWorkspace < PackageManager
5
5
  Submodule = Struct.new :install_path, :revision
6
+ ENVRC_REGEXP = /GOPATH|GO15VENDOREXPERIMENT/
6
7
 
7
8
  def initialize(options={})
8
9
  super
@@ -32,7 +33,7 @@ module LicenseFinder
32
33
  def active?
33
34
  go_dep = LicenseFinder::GoDep.new({project_path: Pathname(project_path), logger: logger})
34
35
  return if go_dep.package_path.exist?
35
- active = !!envrc_path && IO.read(envrc_path).include?('GOPATH')
36
+ active = !! (envrc_path && ENVRC_REGEXP.match(IO.read(envrc_path)))
36
37
  active.tap { |is_active| logger.active self.class, is_active }
37
38
  end
38
39
 
@@ -10,7 +10,12 @@ module LicenseFinder
10
10
  group_name = dep[:group]
11
11
  walk_dependency_tree(dep[:name]) do |dependency|
12
12
  package_id = dependency["name"]
13
- packages[package_id] ||= NpmPackage.new(dependency, logger: logger)
13
+ if packages[package_id] && packages[package_id].version.nil? && dependency["version"]
14
+ old_package = packages[package_id]
15
+ packages[package_id] = NpmPackage.new(dependency, logger: logger, groups: old_package.groups)
16
+ else
17
+ packages[package_id] ||= NpmPackage.new(dependency, logger: logger)
18
+ end
14
19
  packages[package_id].groups << group_name unless packages[package_id].groups.include?(group_name)
15
20
  end
16
21
  end
@@ -1,3 +1,3 @@
1
1
  module LicenseFinder
2
- VERSION = "2.1.0.rc5"
2
+ VERSION = "2.1.0.rc6"
3
3
  end
@@ -198,7 +198,13 @@ HERE
198
198
  expect(subject.active?).to eq(true)
199
199
  end
200
200
 
201
- it 'returns false when .envrc does not contain GOPATH' do
201
+ it 'returns true when .envrc contains GO15VENDOREXPERIMENT' do
202
+ allow(FileTest).to receive(:exist?).with(envrc).and_return(true)
203
+ allow(IO).to receive(:read).with(Pathname(envrc)).and_return('export GO15VENDOREXPERIMENT=1')
204
+ expect(subject.active?).to eq(true)
205
+ end
206
+
207
+ it 'returns false when .envrc does not contain GOPATH or GO15VENDOREXPERIMENT' do
202
208
  allow(FileTest).to receive(:exist?).with(envrc).and_return(true)
203
209
  allow(IO).to receive(:read).with(Pathname(envrc)).and_return('this is not an envrc file')
204
210
  expect(subject.active?).to eq(false)
@@ -132,6 +132,26 @@ module LicenseFinder
132
132
  allow(npm).to receive(:capture).with(/npm/).and_return('{"foo":"bar"}', false).once
133
133
  silence_stderr { npm.current_packages }
134
134
  end
135
+
136
+ context "npm recursive dependency edge case - GH#211" do
137
+ let(:package_json) do
138
+ FakeFS.without do
139
+ File.read fixture_path "npm-recursive-dependencies/package.json"
140
+ end
141
+ end
142
+ let(:dependency_json) do
143
+ FakeFS.without do
144
+ File.read fixture_path "npm-recursive-dependencies/npm-list.json"
145
+ end
146
+ end
147
+
148
+ describe ".current_packages" do
149
+ it "correctly navigates the dependencies tree and pulls out valid information" do
150
+ expect(npm.current_packages.find { |p| p.name == "pui-react-alerts" }.version).to eq("3.0.0-alpha.2")
151
+ expect(npm.current_packages.find { |p| p.name == "pui-react-media" }.version).to eq("3.0.0-alpha.2")
152
+ end
153
+ end
154
+ end
135
155
  end
136
156
  end
137
157
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: license_finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.rc5
4
+ version: 2.1.0.rc6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Maine
@@ -20,7 +20,7 @@ authors:
20
20
  autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
- date: 2016-02-19 00:00:00.000000000 Z
23
+ date: 2016-03-11 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler