license_finder 5.3.0 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/Dockerfile +21 -3
- data/ci/scripts/containerize-tests.sh +1 -1
- data/ci/scripts/pushscript.sh +4 -0
- data/ci/scripts/run-tests.sh +28 -20
- data/ci/scripts/updateChangelog.sh +1 -1
- data/lib/license_finder/package_managers/nuget.rb +31 -0
- data/lib/license_finder/package_managers/pip.rb +8 -2
- data/lib/license_finder/package_utils/license_files.rb +1 -1
- data/lib/license_finder/platform.rb +3 -1
- data/lib/license_finder/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27bf5ceddaefdfaf96e14aa2021ca620e94b5f4923983638fbfce367271143c2
|
4
|
+
data.tar.gz: 7e6a9f084d74919d7cbf2be27038ba3ad529ef7431b3691f33aa1d5d03822c2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0e9016bfd2140a346748d7ecee8653e7f79b32a970be8ff6b82db77065c1aa355257e4ae526b930c2b2bbe15b976e19b8d5971708b258f6c61e245df49633bc
|
7
|
+
data.tar.gz: d008902c7f2e66e24243f805ddfef304c9861556351819f51cef627500aefbbffd6ff0a58ffb4a58a01888bb15de405433bfba98aa285b8aa8ebe9f091e20d73
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# [5.3.0] / 2018-06-05
|
2
|
+
|
3
|
+
### Added
|
4
|
+
* Experimental support for Rust dependencies with Cargo - [2ef3129](https://github.com/pivotal-legacy/LicenseFinder/commit/2ef31290f7abf51db5b7173302d1e535508bbd7a)
|
5
|
+
* Add project roots command to list paths to scan - [b7a22ea](https://github.com/pivotal-legacy/LicenseFinder/commit/b7a22eacfac0e1b9334998de606df69ec3156f77)
|
6
|
+
|
7
|
+
### Removed
|
8
|
+
* Remove HTTParty dependency - [c52d014](https://github.com/pivotal-legacy/LicenseFinder/commit/c52d014df1ca9cd3838d03c60daa6fad954c5579)
|
9
|
+
|
1
10
|
# [5.2.3] / 2018-05-14
|
2
11
|
|
3
12
|
# [5.2.1] / 2018-05-14
|
@@ -598,3 +607,4 @@ Bugfixes:
|
|
598
607
|
[5.2.0]: https://github.com/pivotal-legacy/LicenseFinder/compare/v5.1.1...v5.2.0
|
599
608
|
[5.2.1]: https://github.com/pivotal-legacy/LicenseFinder/compare/v5.2.0...v5.2.1
|
600
609
|
[5.2.3]: https://github.com/pivotal-legacy/LicenseFinder/compare/v5.2.1...v5.2.3
|
610
|
+
[5.3.0]: https://github.com/pivotal-legacy/LicenseFinder/compare/v5.2.3...v5.3.0
|
data/Dockerfile
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
FROM ubuntu:
|
2
|
-
RUN apt-get update && apt-get install -y curl git-core build-essential wget unzip
|
1
|
+
FROM ubuntu:xenial
|
3
2
|
|
4
3
|
# Versioning
|
5
4
|
ENV PIP_INSTALL_VERSION 10.0.1
|
@@ -10,6 +9,15 @@ ENV GRADLE_VERSION 4.2
|
|
10
9
|
ENV RUBY_VERSION 2.5.1
|
11
10
|
ENV MIX_VERSION 1.0
|
12
11
|
|
12
|
+
# programs needed for building
|
13
|
+
RUN apt-get update && apt-get install -y \
|
14
|
+
build-essential \
|
15
|
+
curl \
|
16
|
+
git-core \
|
17
|
+
sudo \
|
18
|
+
unzip \
|
19
|
+
wget
|
20
|
+
|
13
21
|
# nodejs seems to be required for the one of the gems
|
14
22
|
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
|
15
23
|
apt-get -y install nodejs
|
@@ -49,7 +57,7 @@ RUN apt-get install -y python-pip && \
|
|
49
57
|
pip install --upgrade pip==$PIP_INSTALL_VERSION
|
50
58
|
|
51
59
|
# install maven
|
52
|
-
RUN curl -O
|
60
|
+
RUN curl -O https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz && \
|
53
61
|
tar -xf apache-maven-$MAVEN_VERSION-bin.tar.gz; rm -rf apache-maven-$MAVEN_VERSION-bin.tar.gz && \
|
54
62
|
mv apache-maven-$MAVEN_VERSION /usr/local/lib/maven && \
|
55
63
|
ln -s /usr/local/lib/maven/bin/mvn /usr/local/bin/mvn
|
@@ -91,6 +99,7 @@ RUN mkdir /gopath && \
|
|
91
99
|
go get github.com/golang/dep/cmd/dep
|
92
100
|
|
93
101
|
# Fix the locale
|
102
|
+
RUN apt-get install -y locales
|
94
103
|
RUN locale-gen en_US.UTF-8
|
95
104
|
ENV LANG=en_US.UTF-8
|
96
105
|
ENV LANGUAGE=en_US:en
|
@@ -119,6 +128,15 @@ RUN apt-get install -y python-dev && \
|
|
119
128
|
# install Cargo
|
120
129
|
RUN curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --disable-sudo
|
121
130
|
|
131
|
+
# install NuGet (w. mono)
|
132
|
+
# https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools#macoslinux
|
133
|
+
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF &&\
|
134
|
+
echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list &&\
|
135
|
+
apt-get update &&\
|
136
|
+
apt-get install -y mono-complete &&\
|
137
|
+
curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe &&\
|
138
|
+
echo "alias nuget=\"mono /usr/local/bin/nuget.exe\"" >> ~/.bash_aliases
|
139
|
+
|
122
140
|
# install license_finder
|
123
141
|
COPY . /LicenseFinder
|
124
142
|
RUN bash -lc "cd /LicenseFinder && bundle install -j4 && rake install"
|
@@ -10,5 +10,5 @@ pushd LicenseFinder
|
|
10
10
|
docker build . -t licensefinder/license_finder
|
11
11
|
|
12
12
|
docker run -v $PWD:/lf -it licensefinder/license_finder /bin/bash \
|
13
|
-
-
|
13
|
+
-exli /lf/ci/scripts/run-tests.sh "$RUBY_VERSION_UNDER_TEST"
|
14
14
|
popd
|
data/ci/scripts/pushscript.sh
CHANGED
@@ -10,6 +10,10 @@ built_gem="pkg/license_finder-$build_version.gem"
|
|
10
10
|
git config --global user.email $GIT_EMAIL
|
11
11
|
git config --global user.name $GIT_USERNAME
|
12
12
|
|
13
|
+
git config --global push.default simple
|
14
|
+
|
15
|
+
git checkout master
|
16
|
+
|
13
17
|
mkdir ~/.ssh
|
14
18
|
ssh-keyscan github.com >> ~/.ssh/known_hosts
|
15
19
|
eval "$(ssh-agent -s)"
|
data/ci/scripts/run-tests.sh
CHANGED
@@ -1,30 +1,38 @@
|
|
1
1
|
#!/bin/bash -elx
|
2
|
+
|
3
|
+
set -o pipefail
|
4
|
+
|
5
|
+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
6
|
+
PROJECT_ROOT="$( dirname "$( dirname $DIR )" )"
|
7
|
+
|
2
8
|
RUBY_VERSION_UNDER_TEST=$1
|
3
|
-
rvm install --default $RUBY_VERSION_UNDER_TEST
|
4
|
-
ruby --version
|
5
9
|
|
6
|
-
|
7
|
-
export RUBYOPT='-E utf-8'
|
10
|
+
pushd "$PROJECT_ROOT"
|
8
11
|
|
9
|
-
|
10
|
-
|
11
|
-
bundle install
|
12
|
+
rvm install --default $RUBY_VERSION_UNDER_TEST
|
13
|
+
ruby --version
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
then
|
16
|
-
bundle update rack
|
17
|
-
apt-get -y install software-properties-common
|
18
|
-
add-apt-repository -y ppa:webupd8team/java
|
19
|
-
apt-get update
|
20
|
-
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
|
21
|
-
apt -y install oracle-java8-set-default
|
22
|
-
fi
|
15
|
+
export GOPATH=$HOME/go
|
16
|
+
export RUBYOPT='-E utf-8'
|
23
17
|
|
18
|
+
gem update --system
|
19
|
+
gem install bundler
|
20
|
+
bundle install
|
24
21
|
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
# jruby-9 specific: requires >= rack 2.x
|
23
|
+
if [ "$RUBY_VERSION_UNDER_TEST" == "jruby-9.0.4.0" ]
|
24
|
+
then
|
25
|
+
bundle update rack
|
26
|
+
apt-get -y install software-properties-common
|
27
|
+
add-apt-repository -y ppa:webupd8team/java
|
28
|
+
apt-get update
|
29
|
+
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
|
30
|
+
apt-get -y install oracle-java8-set-default
|
31
|
+
fi
|
28
32
|
|
29
33
|
|
34
|
+
bundle exec rake install
|
35
|
+
bundle exec rake spec
|
36
|
+
bundle exec rake features
|
30
37
|
|
38
|
+
popd
|
@@ -8,7 +8,7 @@ CHANGELOG_FILE="CHANGELOG.md"
|
|
8
8
|
COMMIT_URL="https://github.com/pivotal-legacy/LicenseFinder/commit/"
|
9
9
|
|
10
10
|
TAGS=( "Added" "ADDED" "Fixed" "FIXED" "Changed" "CHANGED" "Deprecated" "DEPRECATED" "Removed" "REMOVED" "Security" "SECURITY" )
|
11
|
-
CONTRIBUTORS=( "Shane Lattanzio" "
|
11
|
+
CONTRIBUTORS=( "Shane Lattanzio" "Li Tai" "Vikram Yadav" "Mark Fiorvanti" "Serafima Ostrovskaya" "Yoon Jean Kim" "Tony Wong" "Parv Mital" )
|
12
12
|
|
13
13
|
OLD="v$(cat ./lf-release/version)"
|
14
14
|
VERSION="$(ruby -r ./lf-git-changed/lib/license_finder/version.rb -e "puts LicenseFinder::VERSION")"
|
@@ -5,6 +5,7 @@ module LicenseFinder
|
|
5
5
|
class Nuget < PackageManager
|
6
6
|
class Assembly
|
7
7
|
attr_reader :name, :path
|
8
|
+
|
8
9
|
def initialize(path, name)
|
9
10
|
@path = path
|
10
11
|
@name = name
|
@@ -26,7 +27,13 @@ module LicenseFinder
|
|
26
27
|
path = project_path.join('vendor/*.nupkg')
|
27
28
|
nuget_dir = Dir[path].map { |pkg| File.dirname(pkg) }.uniq
|
28
29
|
|
30
|
+
# Presence of a .sln is a good indicator for a dotnet solution
|
31
|
+
# cf.: https://docs.microsoft.com/en-us/nuget/tools/cli-ref-restore#remarks
|
32
|
+
path = project_path.join('*.sln')
|
33
|
+
solution_file = Dir[path].first
|
34
|
+
|
29
35
|
possible_paths = [project_path.join('packages.config'), project_path.join('.nuget')]
|
36
|
+
possible_paths.unshift(Pathname(solution_file)) unless solution_file.nil?
|
30
37
|
possible_paths.unshift(Pathname(nuget_dir.first)) unless nuget_dir.empty?
|
31
38
|
possible_paths
|
32
39
|
end
|
@@ -61,5 +68,29 @@ module LicenseFinder
|
|
61
68
|
def dependencies
|
62
69
|
assemblies.flat_map(&:dependencies)
|
63
70
|
end
|
71
|
+
|
72
|
+
def self.package_management_command
|
73
|
+
return 'nuget' if LicenseFinder::Platform.windows?
|
74
|
+
'mono /usr/local/bin/nuget.exe'
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.prepare_command
|
78
|
+
"#{package_management_command} restore"
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.installed?(logger = Core.default_logger)
|
82
|
+
_stdout, _stderr, status = Cmd.run(nuget_check)
|
83
|
+
if status.success?
|
84
|
+
logger.debug self, 'is installed', color: :green
|
85
|
+
else
|
86
|
+
logger.info self, 'is not installed', color: :red
|
87
|
+
end
|
88
|
+
status.success?
|
89
|
+
end
|
90
|
+
|
91
|
+
def self.nuget_check
|
92
|
+
return 'where nuget' if LicenseFinder::Platform.windows?
|
93
|
+
'which mono && ls /usr/local/bin/nuget.exe'
|
94
|
+
end
|
64
95
|
end
|
65
96
|
end
|
@@ -55,11 +55,17 @@ module LicenseFinder
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def pypi_def(name, version)
|
58
|
-
|
58
|
+
response = pypi_request("https://pypi.org/pypi/#{name}/#{version}/json")
|
59
|
+
response.is_a?(Net::HTTPSuccess) ? JSON.parse(response.body).fetch('info', {}) : {}
|
60
|
+
end
|
61
|
+
|
62
|
+
def pypi_request(location, limit = 10)
|
63
|
+
uri = URI(location)
|
59
64
|
http = Net::HTTP.new(uri.host, uri.port)
|
60
65
|
http.use_ssl = true
|
61
66
|
response = http.get(uri.request_uri).response
|
62
|
-
|
67
|
+
|
68
|
+
response.is_a?(Net::HTTPRedirection) && limit > 0 ? pypi_request(response['location'], limit - 1) : response
|
63
69
|
end
|
64
70
|
end
|
65
71
|
end
|
@@ -2,7 +2,7 @@ require 'license_finder/package_utils/possible_license_file'
|
|
2
2
|
|
3
3
|
module LicenseFinder
|
4
4
|
class LicenseFiles
|
5
|
-
CANDIDATE_FILE_NAMES = %w[LICENSE License Licence COPYING README Readme ReadMe].freeze
|
5
|
+
CANDIDATE_FILE_NAMES = %w[LICENSE License LICENCE Licence COPYING README Readme ReadMe].freeze
|
6
6
|
CANDIDATE_PATH_WILDCARD = "*{#{CANDIDATE_FILE_NAMES.join(',')}}*".freeze
|
7
7
|
|
8
8
|
def self.find(install_path, options = {})
|
@@ -5,7 +5,9 @@ module LicenseFinder
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def self.windows?
|
8
|
-
|
8
|
+
# SO: What is the correct way to detect if ruby is running on Windows?,
|
9
|
+
# cf. https://stackoverflow.com/a/21468976/2592915
|
10
|
+
Gem.win_platform? || RUBY_PLATFORM =~ /mswin|cygwin|mingw/
|
9
11
|
end
|
10
12
|
end
|
11
13
|
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: 5.
|
4
|
+
version: 5.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Collins
|
@@ -27,7 +27,7 @@ authors:
|
|
27
27
|
autorequire:
|
28
28
|
bindir: bin
|
29
29
|
cert_chain: []
|
30
|
-
date: 2018-
|
30
|
+
date: 2018-08-20 00:00:00.000000000 Z
|
31
31
|
dependencies:
|
32
32
|
- !ruby/object:Gem::Dependency
|
33
33
|
name: bundler
|