license_finder 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.rdoc +12 -0
- data/README.md +6 -6
- data/lib/license_finder/package_managers/go_workspace.rb +7 -3
- data/lib/license_finder/package_managers/nuget.rb +7 -1
- data/lib/license_finder/version.rb +1 -1
- data/spec/lib/license_finder/package_managers/go_workspace_spec.rb +4 -2
- data/spec/lib/license_finder/package_managers/nuget_spec.rb +32 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97a98ebf99d7ffa7add150f9535d3470c19ca3b7
|
4
|
+
data.tar.gz: 556f7292ccfc2680808fe56e640b6f796ca6cf7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0479b1b8712313d04e79f4e67fd8907ecb4bd8c56a9e4f0135894fdff6ce6973b4e6d153bc34341bc6442d7b9ebb07f542d66d3893122d8547b4bcf01fe014ef
|
7
|
+
data.tar.gz: feabe7ffe099290471374e30a5db5997446e7dc6a3bfeee9be2efa4c0cf71f5fb4195c3e9a45f8e0eaa32102ba910aaf4377399684f67160cc5c79e6b28be2f3
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
=== 2.1.1 / 2016-06-09
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
* GoWorkspace now detects some non-standard package names with only two path parts. (#226)
|
6
|
+
|
7
|
+
Bugfixes:
|
8
|
+
|
9
|
+
* NuGet now appropriately returns a Pathname from #package_path (previously was a String) (#227)
|
10
|
+
* NuGet now correctly chooses a directory with vendored .nupkg packages
|
11
|
+
|
12
|
+
|
1
13
|
=== 2.1.0 / 2016-04-01
|
2
14
|
|
3
15
|
* Features
|
data/README.md
CHANGED
@@ -20,17 +20,17 @@ report.
|
|
20
20
|
* Python Eggs (via `pip`)
|
21
21
|
* Node.js (via `npm`)
|
22
22
|
* Bower
|
23
|
+
* Nuget (without license discovery)
|
24
|
+
* Godep
|
25
|
+
* Go workspace (via a `.envrc` file)
|
26
|
+
* Go submodules
|
27
|
+
* Java (via `maven`)
|
28
|
+
* Java (via `gradle`)
|
23
29
|
|
24
30
|
### Experimental project types
|
25
31
|
|
26
|
-
* Java (via `maven`)
|
27
|
-
* Java (via `gradle`)
|
28
32
|
* Erlang (via `rebar`)
|
29
33
|
* Objective-C (+ CocoaPods)
|
30
|
-
* Nuget (without license discovery)
|
31
|
-
* Godep
|
32
|
-
* Go workspace (via a `.envrc` file)
|
33
|
-
|
34
34
|
|
35
35
|
## Installation
|
36
36
|
|
@@ -13,6 +13,8 @@ module LicenseFinder
|
|
13
13
|
def current_packages
|
14
14
|
go_list_packages = go_list
|
15
15
|
git_modules.map do |submodule|
|
16
|
+
# We are filtering the non-standard packages because the word "net"
|
17
|
+
# seems to be common that can give false positive when filtering the git submodules
|
16
18
|
import_path = go_list_packages.select { |gp|
|
17
19
|
submodule.install_path =~ /#{repo_name(gp)}$/
|
18
20
|
}.first
|
@@ -69,9 +71,11 @@ module LicenseFinder
|
|
69
71
|
ENV['GOPATH'] = nil
|
70
72
|
val = capture('go list -f \'{{join .Deps "\n"}}\' ./...')
|
71
73
|
raise 'go list failed' unless val.last
|
72
|
-
# Select non-standard packages.
|
73
|
-
#
|
74
|
-
|
74
|
+
# Select non-standard packages. Non-standard packages typically
|
75
|
+
# have a period somewhere in the namespace (github.com, gopkg.in,
|
76
|
+
# etc.).
|
77
|
+
#
|
78
|
+
val.first.lines.map(&:strip).select { |l| l =~ /.+\..+\// }
|
75
79
|
end
|
76
80
|
end
|
77
81
|
|
@@ -4,7 +4,13 @@ require 'zip'
|
|
4
4
|
module LicenseFinder
|
5
5
|
class Nuget < PackageManager
|
6
6
|
def package_path
|
7
|
-
project_path.join(
|
7
|
+
path = project_path.join("**/*.nupkg")
|
8
|
+
nuget_dir = Dir[path].map{|pkg| File.dirname(pkg)}.uniq
|
9
|
+
if nuget_dir.length == 0
|
10
|
+
project_path.join(".nuget")
|
11
|
+
else
|
12
|
+
Pathname(nuget_dir.first)
|
13
|
+
end
|
8
14
|
end
|
9
15
|
|
10
16
|
def assemblies
|
@@ -35,6 +35,7 @@ module LicenseFinder
|
|
35
35
|
let(:go_list_output) {
|
36
36
|
<<HERE
|
37
37
|
encoding/json
|
38
|
+
gopkg.in/yaml.v2
|
38
39
|
github.com/onsi/ginkgo
|
39
40
|
HERE
|
40
41
|
}
|
@@ -54,8 +55,9 @@ HERE
|
|
54
55
|
it 'returns the skip the standard libs and return lines of the output' do
|
55
56
|
allow(subject).to receive(:capture).with('go list -f \'{{join .Deps "\n"}}\' ./...').and_return([go_list_output, true])
|
56
57
|
packages = subject.send(:go_list)
|
57
|
-
expect(packages.count).to eq(
|
58
|
-
expect(packages
|
58
|
+
expect(packages.count).to eq(2)
|
59
|
+
expect(packages).to include 'github.com/onsi/ginkgo'
|
60
|
+
expect(packages).to include 'gopkg.in/yaml.v2'
|
59
61
|
end
|
60
62
|
|
61
63
|
it 'sets gopath to the envrc path' do
|
@@ -3,6 +3,10 @@ require 'fakefs/spec_helpers'
|
|
3
3
|
require 'zip'
|
4
4
|
|
5
5
|
module LicenseFinder
|
6
|
+
def self.broken_fakefs?
|
7
|
+
RUBY_PLATFORM =~ /java/ || RUBY_VERSION =~ /^(1\.9|2\.0)/
|
8
|
+
end
|
9
|
+
|
6
10
|
describe Nuget do
|
7
11
|
|
8
12
|
it_behaves_like "a PackageManager"
|
@@ -36,6 +40,23 @@ module LicenseFinder
|
|
36
40
|
expect(nuget.assemblies.map(&:name)).to include('.nuget')
|
37
41
|
end
|
38
42
|
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
describe "#package_path" do
|
47
|
+
include FakeFS::SpecHelpers
|
48
|
+
|
49
|
+
context 'when .nupkg files exist, but are not in .nuget directory' do
|
50
|
+
before do
|
51
|
+
FileUtils.mkdir_p 'app/vendor'
|
52
|
+
FileUtils.touch 'app/vendor/package.nupkg'
|
53
|
+
end
|
54
|
+
|
55
|
+
it "returns vendored director" do
|
56
|
+
nuget = Nuget.new project_path: Pathname.new("app")
|
57
|
+
expect(nuget.package_path).to eq Pathname('/app/vendor')
|
58
|
+
end
|
59
|
+
end
|
39
60
|
end
|
40
61
|
|
41
62
|
describe "#current_packages" do
|
@@ -91,18 +112,18 @@ module LicenseFinder
|
|
91
112
|
end
|
92
113
|
|
93
114
|
# cannot run on JRuby due to https://github.com/fakefs/fakefs/issues/303
|
94
|
-
context 'when there is a .nupkg file', :skip =>
|
115
|
+
context 'when there is a .nupkg file', :skip => LicenseFinder.broken_fakefs? do
|
95
116
|
before do
|
96
|
-
obscure_dependency_nuspec = <<-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
117
|
+
obscure_dependency_nuspec = <<-EOXML
|
118
|
+
<?xml version="1.0"?>
|
119
|
+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
120
|
+
<metadata>
|
121
|
+
<id>ObscureDependency</id>
|
122
|
+
<version>1.3.15</version>
|
123
|
+
<licenseUrl>http://www.opensource.org/licenses/mit-license.php</licenseUrl>
|
124
|
+
</metadata>
|
125
|
+
</package>
|
126
|
+
EOXML
|
106
127
|
File.write("app/packages/ObscureDependency.nuspec", obscure_dependency_nuspec)
|
107
128
|
Dir.chdir 'app/packages' do
|
108
129
|
Zip::File.open('ObscureDependency.1.3.15.nupkg', Zip::File::CREATE) do |zipfile|
|
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.
|
4
|
+
version: 2.1.1
|
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-
|
23
|
+
date: 2016-06-09 00:00:00.000000000 Z
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|