license_finder 6.0.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -2
  3. data/Dockerfile +3 -3
  4. data/README.md +1 -1
  5. data/Rakefile +1 -1
  6. data/VERSION +1 -1
  7. data/ci/pipelines/release.yml.erb +10 -23
  8. data/ci/scripts/run-rubocop.sh +1 -0
  9. data/lib/license_finder/package_manager.rb +17 -17
  10. data/lib/license_finder/package_managers/bower.rb +2 -2
  11. data/lib/license_finder/package_managers/bundler.rb +1 -1
  12. data/lib/license_finder/package_managers/cargo.rb +2 -2
  13. data/lib/license_finder/package_managers/carthage.rb +1 -1
  14. data/lib/license_finder/package_managers/cocoa_pods.rb +1 -1
  15. data/lib/license_finder/package_managers/composer.rb +1 -1
  16. data/lib/license_finder/package_managers/dep.rb +1 -1
  17. data/lib/license_finder/package_managers/dotnet.rb +2 -2
  18. data/lib/license_finder/package_managers/glide.rb +1 -1
  19. data/lib/license_finder/package_managers/go_15vendorexperiment.rb +1 -1
  20. data/lib/license_finder/package_managers/go_dep.rb +1 -1
  21. data/lib/license_finder/package_managers/go_workspace.rb +1 -1
  22. data/lib/license_finder/package_managers/govendor.rb +1 -1
  23. data/lib/license_finder/package_managers/gvt.rb +1 -1
  24. data/lib/license_finder/package_managers/mix.rb +6 -6
  25. data/lib/license_finder/package_managers/npm.rb +2 -2
  26. data/lib/license_finder/package_managers/nuget.rb +6 -6
  27. data/lib/license_finder/package_managers/pip.rb +5 -7
  28. data/lib/license_finder/package_managers/rebar.rb +2 -2
  29. data/lib/license_finder/package_managers/yarn.rb +1 -1
  30. data/lib/license_finder/scanner.rb +1 -1
  31. data/license_finder.gemspec +10 -9
  32. metadata +39 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f844205631f75e79fa841f51845a3a93691016c21fc0e3abbeb971ea8b8c4108
4
- data.tar.gz: 2844a248508124b47ad59556878101b1ee793be082da8af1281bdb69e8478e2e
3
+ metadata.gz: 4322a68abdac0f37598d3a7e9329592a6aadc106d26dddab5228df56947161b4
4
+ data.tar.gz: 9cdde6b3fe4f113c7877a0bbb56ff74127155a4e00c1919dc2f40ea717fa2dc0
5
5
  SHA512:
6
- metadata.gz: 4621032a4fdb55cb82c81733fca9d7dbee7d900013e1d74dbf633a6be189892121b2afe975ce93f6c465ba5697de11b7b5ad6a40420bd365083db17c587a4ed5
7
- data.tar.gz: c13feb27fdd90a93abc444e0ed7ae08292ac742944e9de35f77b4f838cc2d705ee2c203e0743a0d805f7e070ea19e7cfe8cbea4b02b2d627cfe6ef5cedbcbfc1
6
+ metadata.gz: '09ed394388a18eeb7e60d6f8d685c77a00b3769a933b48f4a75a8bbdd224b9534696de6c8bec9db9bd7c8a8f3ac0176805123c2c36f445ca8cdb0cf3ae473144'
7
+ data.tar.gz: b8acbb67e9cb67facb22ba808e592fb8b14384aac588040fbe00524ad25d86cd958fbc001c8b8b069dc40de014ac9455017c302f04faf022f92d4f16eca78739
data/CHANGELOG.md CHANGED
@@ -1,12 +1,22 @@
1
+ # [6.1.0] / 2020-02-21
2
+
3
+ ### Fixed
4
+ * Testing dsl now correctly creates gem project - [6158d767](https://github.com/pivotal/LicenseFinder/commit/6158d76758f4232f3efd652729a83aa632a67dee) - Jeff Jun
5
+
6
+ ### Changed
7
+ * Upgrade golang version to 1.13.3 - [51ecbcbc](https://github.com/pivotal/LicenseFinder/commit/51ecbcbc7992366c1baed2e8b805a7f820f70160)
8
+ * Uses correct package management command for pip based on options that are passed in - [3f4034ab](https://github.com/pivotal/LicenseFinder/commit/3f4034ab3479da23088174ad8cf56828b3cda9ad)
9
+
1
10
  # [6.0.0] / 2020-01-22
2
11
 
3
12
  ### Added
4
13
  * License Finder now recognizes pip requirement markers - [99fbc184](https://github.com/pivotal/LicenseFinder/commit/99fbc18463ef45f920ad506a72dc0b3a93d0f5bf) - Jason Smith
14
+ * Add ruby 2.7.0 and update to latest patch levels - [65efe96](https://github.com/pivotal/LicenseFinder/commit/65efe96aeef600a398f1465c01ed28b51bda456a) - mokhan
15
+ * Add support for Pipfile.lock - [566fb39c](https://github.com/pivotal/LicenseFinder/commit/566fb39c4077fb5271707a94894998a585cde8dd) - mokhan
5
16
 
6
17
  ### Fixed
7
18
  * Bundler ignored groups failure - [bf2c03e3](https://github.com/pivotal/LicenseFinder/commit/bf2c03e375e91e8418967a593362313487f2f0d0)
8
19
  * No longer crashes when python package requirement is missing - [80e4b360](https://github.com/pivotal/LicenseFinder/commit/80e4b360b95de126e7dc139c25de56c948a01f1e) - Jason Smith
9
-
10
20
  * Longest common paths returning incorrect single directory [#169276334] - [f1d5423b](https://github.com/pivotal/LicenseFinder/commit/f1d5423b04f892d1d1e0595993c9bebb0a7c1b6d)
11
21
  * python 2 projects using incorrect CLI command - [5655f60e](https://github.com/pivotal/LicenseFinder/commit/5655f60e671dc4c247bb05138ed35b05cda9cdc7)
12
22
 
@@ -16,8 +26,10 @@
16
26
  * Bump to openjdk 11 - [499f8ab3](https://github.com/pivotal/LicenseFinder/commit/499f8ab3af7cd8ca37e429f2ed78323ad796d123) - Debbie Chen
17
27
  * Bump to openjdk 12 - [09c781a7](https://github.com/pivotal/LicenseFinder/commit/09c781a70787d9461722d5d03d1bc624b644311a) - Debbie Chen
18
28
  * Bundler prepare commands with now exclude dependencies in the ignored groups [#169611326] - [e58b2870](https://github.com/pivotal/LicenseFinder/commit/e58b2870b64d2c88be7027b152a423fdb921baca)
19
-
20
29
  * Change version to be required for dependency add and updated cli options [#168705017] - [b10383d3](https://github.com/pivotal/LicenseFinder/commit/b10383d3d1990b6ad0d608044511352f13924be3) - Debbie Chen
30
+ * Ensure composer always installs the packages - [70b5e7a](https://github.com/pivotal/LicenseFinder/commit/70b5e7a42943c85bbd1d2825b2ffe94eec89020f) - kaystrobach
31
+
32
+ * **BREAKING:** Replaced whitelist/blacklist terminology with permitted_licenses/restricted_licenses - [a40b22f](https://github.com/pivotal/LicenseFinder/commit/a40b22fda11b3a0efbb3c0a021381534bc998dd9) - grantbdev
21
33
 
22
34
  ### Deprecated
23
35
  * Remove support for jruby 9.1* [#169590215] - [81e75f8c](https://github.com/pivotal/LicenseFinder/commit/81e75f8cd61ca35e30562352dee2579b1b6c991e)
@@ -797,3 +809,4 @@ Bugfixes:
797
809
  [5.11.0]: https://github.com/pivotal/LicenseFinder/compare/v5.10.2...v5.11.0
798
810
  [5.11.1]: https://github.com/pivotal/LicenseFinder/compare/v5.11.0...v5.11.1
799
811
  [6.0.0]: https://github.com/pivotal/LicenseFinder/compare/v5.11.1...v6.0.0
812
+ [6.1.0]: https://github.com/pivotal/LicenseFinder/compare/v6.0.0...v6.1.0
data/Dockerfile CHANGED
@@ -3,7 +3,7 @@ FROM ubuntu:xenial
3
3
  # Versioning
4
4
  ENV PIP_INSTALL_VERSION 19.0.2
5
5
  ENV PIP3_INSTALL_VERSION 8.1.1
6
- ENV GO_LANG_VERSION 1.11.5
6
+ ENV GO_LANG_VERSION 1.13.3
7
7
  ENV MAVEN_VERSION 3.6.0
8
8
  ENV SBT_VERSION 1.3.3
9
9
  ENV GRADLE_VERSION 5.6.4
@@ -51,7 +51,7 @@ RUN apt-get install -y python rebar
51
51
 
52
52
  # install and update python-pip
53
53
  RUN apt-get install -y python-pip python3-pip && \
54
- pip install --upgrade pip==$PIP_INSTALL_VERSION && \
54
+ pip2 install --upgrade pip==$PIP_INSTALL_VERSION && \
55
55
  pip3 install --upgrade pip==$PIP3_INSTALL_VERSION
56
56
 
57
57
  # install maven
@@ -149,7 +149,7 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4F4EA0AAE5
149
149
  apt-get update &&\
150
150
  apt-get install -y php7.1-cli &&\
151
151
  php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" &&\
152
- php -r "if (hash_file('sha384', 'composer-setup.php') === 'c5b9b6d368201a9db6f74e2611495f369991b72d9c8cbd3ffbc63edff210eb73d46ffbfce88669ad33695ef77dc76976') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" &&\
152
+ php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" &&\
153
153
  php composer-setup.php &&\
154
154
  php -r "unlink('composer-setup.php');" &&\
155
155
  mv composer.phar /usr/bin/composer
data/README.md CHANGED
@@ -31,7 +31,7 @@ and give you an actionable exception report.
31
31
  | ------------ | --------------- | -------:|
32
32
  | Ruby Gems | bundler | 1.16.6 |
33
33
  | Python 2.7 Eggs | pip2 | 19.0.2 |
34
- | Python 3.5 Eggs | pip3 | 8.1.1 |
34
+ | Python 3.5 Eggs | pip3 | 19.0.2 |
35
35
  | Node.js | npm | 6.4.1 |
36
36
  | Bower | bower | 1.8.4 |
37
37
  | Nuget (without license discovery) | nuget | 4.7.1.5393 |
data/Rakefile CHANGED
@@ -47,7 +47,7 @@ task :check_dependencies do
47
47
  require './lib/license_finder'
48
48
  satisfied = true
49
49
  LicenseFinder::Scanner::PACKAGE_MANAGERS.each do |package_manager|
50
- satisfied = false unless package_manager.installed?(LicenseFinder::Logger.new(LicenseFinder::Logger::MODE_INFO))
50
+ satisfied = false unless package_manager.new(project_path: Pathname.new('')).installed?(LicenseFinder::Logger.new(LicenseFinder::Logger::MODE_INFO))
51
51
  end
52
52
  STDOUT.flush
53
53
  exit 1 unless satisfied
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.0.0
1
+ 6.1.0
@@ -17,7 +17,7 @@ resources:
17
17
  uri: git@github.com:pivotal/LicenseFinder.git
18
18
  private_key: ((CfOslBot.private_key))
19
19
  branch: master
20
- ignore_paths: [VERSION]
20
+ ignore_paths: [VERSION, CHANGELOG.md]
21
21
 
22
22
  - name: lf-git-version
23
23
  type: git
@@ -26,14 +26,6 @@ resources:
26
26
  private_key: ((CfOslBot.private_key))
27
27
  branch: master
28
28
 
29
- - name: git-master-dockerfile
30
- type: git
31
- source:
32
- uri: git@github.com:pivotal/LicenseFinder.git
33
- private_key: ((CfOslBot.private_key))
34
- branch: master
35
- paths: [Dockerfile, Gemfile, license_finder.gemspec]
36
-
37
29
  - name: semver-version
38
30
  type: semver
39
31
  source:
@@ -80,13 +72,13 @@ jobs:
80
72
  - name: build-docker-image
81
73
  public: true
82
74
  plan:
83
- - get: git-master-dockerfile
75
+ - get: lf-git
84
76
  tags: ["private-worker"]
85
77
  trigger: true
86
78
  - put: dockerhub-edge
87
79
  tags: ["private-worker"]
88
80
  params:
89
- build: git-master-dockerfile
81
+ build: lf-git
90
82
 
91
83
  <% ruby_versions.each do |ruby_version| %>
92
84
  - name: ruby-<%= ruby_version %>
@@ -99,7 +91,7 @@ jobs:
99
91
  - get: LicenseFinder
100
92
  tags: ["private-worker"]
101
93
  resource: lf-git
102
- trigger: true
94
+ passed: [build-docker-image]
103
95
  version: every
104
96
  - task: ruby-<%= ruby_version %>
105
97
  tags: ["private-worker"]
@@ -108,6 +100,7 @@ jobs:
108
100
  file: LicenseFinder/ci/tasks/run-tests.yml
109
101
  params:
110
102
  RUBY_VERSION_UNDER_TEST: <%= ruby_version %>
103
+
111
104
  <% if setup_slack %>
112
105
  on_failure:
113
106
  put: slack-alert
@@ -129,8 +122,8 @@ jobs:
129
122
  - get: LicenseFinder
130
123
  tags: ["private-worker"]
131
124
  resource: lf-git
132
- trigger: true
133
125
  version: every
126
+ passed: [build-docker-image]
134
127
  - task: run-rubocop
135
128
  tags: ["private-worker"]
136
129
  privileged: true
@@ -139,39 +132,33 @@ jobs:
139
132
 
140
133
  - name: bump-major
141
134
  plan:
142
- - get: lf-git
143
- tags: ["private-worker"]
144
- passed: [<%= ruby_versions.map{ |version| "ruby-#{version}"}.join(', ') %>]
145
135
  - put: semver-version
146
136
  tags: ["private-worker"]
147
137
  params: {bump: major}
148
138
 
149
139
  - name: bump-minor
150
140
  plan:
151
- - get: lf-git
152
- tags: ["private-worker"]
153
- passed: [<%= ruby_versions.map{ |version| "ruby-#{version}"}.join(', ') %>]
154
141
  - put: semver-version
155
142
  tags: ["private-worker"]
156
143
  params: {bump: minor}
157
144
 
158
145
  - name: bump-patch
159
146
  plan:
160
- - get: lf-git
161
- tags: ["private-worker"]
162
- passed: [<%= ruby_versions.map{ |version| "ruby-#{version}"}.join(', ') %>]
163
147
  - put: semver-version
164
148
  tags: ["private-worker"]
165
149
  params: {bump: patch}
166
150
 
167
151
  - name: release
152
+ disable_manual_trigger: true
168
153
  plan:
154
+ - get: lf-git
155
+ tags: ["private-worker"]
156
+ passed: [<%= "#{ruby_versions.map{ |version| "ruby-#{version}"}.join(', ')}, rubocop" %>]
169
157
  - get: lf-git-version
170
158
  tags: ["private-worker"]
171
159
  - get: semver-version
172
160
  tags: ["private-worker"]
173
161
  trigger: true
174
- passed: [bump-major, bump-minor, bump-patch]
175
162
  - get: dockerhub
176
163
  tags: ["private-worker"]
177
164
  params:
@@ -2,6 +2,7 @@
2
2
 
3
3
  cd LicenseFinder
4
4
 
5
+ gem update --system
5
6
  bundle install --without runtime default
6
7
 
7
8
  rubocop_version=`cat Gemfile.lock | grep ' rubocop' | awk -F'[\(*\)]' '{print $2;exit}'`
@@ -22,24 +22,24 @@ module LicenseFinder
22
22
  def takes_priority_over
23
23
  nil
24
24
  end
25
+ end
25
26
 
26
- def installed?(logger = Core.default_logger)
27
- if package_management_command.nil?
28
- logger.debug self, 'no command defined' # TODO: comment me out
29
- true
30
- elsif command_exists?(package_management_command)
31
- logger.debug self, 'is installed', color: :green
32
- true
33
- else
34
- logger.info self, 'is not installed', color: :red
35
- false
36
- end
27
+ def installed?(logger = Core.default_logger)
28
+ if package_management_command.nil?
29
+ logger.debug self.class, 'no command defined' # TODO: comment me out
30
+ true
31
+ elsif command_exists?(package_management_command)
32
+ logger.debug self.class, 'is installed', color: :green
33
+ true
34
+ else
35
+ logger.info self.class, 'is not installed', color: :red
36
+ false
37
37
  end
38
+ end
38
39
 
39
- # see class description
40
- def package_management_command
41
- nil
42
- end
40
+ # see class description
41
+ def package_management_command
42
+ nil
43
43
  end
44
44
 
45
45
  # see class description
@@ -47,7 +47,7 @@ module LicenseFinder
47
47
  nil
48
48
  end
49
49
 
50
- def self.command_exists?(command)
50
+ def command_exists?(command)
51
51
  _stdout, _stderr, status =
52
52
  if LicenseFinder::Platform.windows?
53
53
  Cmd.run("where #{command}")
@@ -128,7 +128,7 @@ module LicenseFinder
128
128
  FileUtils.mkdir_p @log_directory
129
129
 
130
130
  # replace whitespace with underscores and remove slashes
131
- log_file_name = self.class.package_management_command&.gsub(/\s/, '_')&.gsub(%r{/}, '')
131
+ log_file_name = package_management_command&.gsub(/\s/, '_')&.gsub(%r{/}, '')
132
132
  log_file = File.join(@log_directory, "prepare_#{log_file_name || 'errors'}.log")
133
133
 
134
134
  File.open(log_file, 'w') do |f|
@@ -10,7 +10,7 @@ module LicenseFinder
10
10
  end
11
11
  end
12
12
 
13
- def self.package_management_command
13
+ def package_management_command
14
14
  'bower'
15
15
  end
16
16
 
@@ -25,7 +25,7 @@ module LicenseFinder
25
25
  private
26
26
 
27
27
  def bower_output
28
- command = "#{Bower.package_management_command} list --json -l action --allow-root"
28
+ command = "#{package_management_command} list --json -l action --allow-root"
29
29
  stdout, stderr, status = Dir.chdir(project_path) { Cmd.run(command) }
30
30
  raise "Command '#{command}' failed to execute: #{stderr}" unless status.success?
31
31
 
@@ -19,7 +19,7 @@ module LicenseFinder
19
19
  end
20
20
  end
21
21
 
22
- def self.package_management_command
22
+ def package_management_command
23
23
  'bundle'
24
24
  end
25
25
 
@@ -10,7 +10,7 @@ module LicenseFinder
10
10
  end
11
11
  end
12
12
 
13
- def self.package_management_command
13
+ def package_management_command
14
14
  'cargo'
15
15
  end
16
16
 
@@ -25,7 +25,7 @@ module LicenseFinder
25
25
  private
26
26
 
27
27
  def cargo_output
28
- command = "#{Cargo.package_management_command} metadata --format-version=1"
28
+ command = "#{package_management_command} metadata --format-version=1"
29
29
 
30
30
  stdout, stderr, status = Dir.chdir(project_path) { Cmd.run(command) }
31
31
  raise "Command '#{command}' failed to execute: #{stderr}" unless status.success?
@@ -20,7 +20,7 @@ module LicenseFinder
20
20
  end
21
21
  end
22
22
 
23
- def self.package_management_command
23
+ def package_management_command
24
24
  LicenseFinder::Platform.darwin? ? 'carthage' : nil
25
25
  end
26
26
 
@@ -21,7 +21,7 @@ module LicenseFinder
21
21
  end
22
22
  end
23
23
 
24
- def self.package_management_command
24
+ def package_management_command
25
25
  LicenseFinder::Platform.darwin? ? 'pod' : nil
26
26
  end
27
27
 
@@ -24,7 +24,7 @@ module LicenseFinder
24
24
  raise "Prepare command '#{Composer.prepare_command}' failed" unless @prepare_no_fail
25
25
  end
26
26
 
27
- def self.package_management_command
27
+ def package_management_command
28
28
  'composer'
29
29
  end
30
30
 
@@ -31,7 +31,7 @@ module LicenseFinder
31
31
  'dep ensure -vendor-only'
32
32
  end
33
33
 
34
- def self.package_management_command
34
+ def package_management_command
35
35
  'dep'
36
36
  end
37
37
  end
@@ -71,12 +71,12 @@ module LicenseFinder
71
71
  Dir[project_path.join('**/project.assets.json')]
72
72
  end
73
73
 
74
- def self.package_management_command
74
+ def package_management_command
75
75
  'dotnet'
76
76
  end
77
77
 
78
78
  def prepare_command
79
- "#{Dotnet.package_management_command} restore"
79
+ "#{package_management_command} restore"
80
80
  end
81
81
  end
82
82
  end
@@ -30,7 +30,7 @@ module LicenseFinder
30
30
  Go15VendorExperiment
31
31
  end
32
32
 
33
- def self.package_management_command
33
+ def package_management_command
34
34
  'glide'
35
35
  end
36
36
 
@@ -42,7 +42,7 @@ module LicenseFinder
42
42
  end
43
43
  end
44
44
 
45
- def self.package_management_command
45
+ def package_management_command
46
46
  'go'
47
47
  end
48
48
 
@@ -22,7 +22,7 @@ module LicenseFinder
22
22
  [project_path.join('Godeps/Godeps.json')]
23
23
  end
24
24
 
25
- def self.package_management_command
25
+ def package_management_command
26
26
  'godep'
27
27
  end
28
28
 
@@ -15,7 +15,7 @@ module LicenseFinder
15
15
  @strict_matching = options[:strict_matching]
16
16
  end
17
17
 
18
- def self.package_management_command
18
+ def package_management_command
19
19
  'go'
20
20
  end
21
21
 
@@ -25,7 +25,7 @@ module LicenseFinder
25
25
  Go15VendorExperiment
26
26
  end
27
27
 
28
- def self.package_management_command
28
+ def package_management_command
29
29
  'govendor'
30
30
  end
31
31
 
@@ -9,7 +9,7 @@ module LicenseFinder
9
9
  [Pathname(potential_path)]
10
10
  end
11
11
 
12
- def self.package_management_command
12
+ def package_management_command
13
13
  'gvt'
14
14
  end
15
15
 
@@ -4,7 +4,7 @@ module LicenseFinder
4
4
  class Mix < PackageManager
5
5
  def initialize(options = {})
6
6
  super
7
- @command = options[:mix_command] || Mix.package_management_command
7
+ @command = options[:mix_command] || package_management_command
8
8
  @elixir_command = options[:elixir_command] || 'elixir'
9
9
  @deps_path = Pathname(options[:mix_deps_dir] || 'deps')
10
10
  end
@@ -26,7 +26,7 @@ module LicenseFinder
26
26
  licenses_by_package.fetch(name, ['license is not in deps'])
27
27
  end
28
28
 
29
- def self.package_management_command
29
+ def package_management_command
30
30
  'mix'
31
31
  end
32
32
 
@@ -42,15 +42,15 @@ module LicenseFinder
42
42
  [project_path.join('mix.exs')]
43
43
  end
44
44
 
45
- def self.installed?(logger = Core.default_logger)
45
+ def installed?(logger = Core.default_logger)
46
46
  if package_management_command.nil?
47
- logger.debug self, 'no command defined'
47
+ logger.debug self.class, 'no command defined'
48
48
  true
49
49
  elsif command_exists?('elixir') && command_exists?('mix')
50
- logger.debug self, 'is installed', color: :green
50
+ logger.debug self.class, 'is installed', color: :green
51
51
  true
52
52
  else
53
- logger.info self, '(elixir) is not installed', color: :red
53
+ logger.info self.class, '(elixir) is not installed', color: :red
54
54
  false
55
55
  end
56
56
  end
@@ -9,7 +9,7 @@ module LicenseFinder
9
9
  NpmPackage.packages_from_json(npm_json, detected_package_path)
10
10
  end
11
11
 
12
- def self.package_management_command
12
+ def package_management_command
13
13
  'npm'
14
14
  end
15
15
 
@@ -34,7 +34,7 @@ module LicenseFinder
34
34
  private
35
35
 
36
36
  def npm_json
37
- command = "#{NPM.package_management_command} list --json --long#{production_flag}"
37
+ command = "#{package_management_command} list --json --long#{production_flag}"
38
38
  stdout, stderr, status = Dir.chdir(project_path) { Cmd.run(command) }
39
39
  # we can try and continue if we got an exit status 1 - unmet peer dependency
40
40
  raise "Command '#{command}' failed to execute: #{stderr}" if !status.success? && status.exitstatus != 1
@@ -71,27 +71,27 @@ module LicenseFinder
71
71
  assemblies.flat_map(&:dependencies)
72
72
  end
73
73
 
74
- def self.package_management_command
74
+ def package_management_command
75
75
  return 'nuget' if LicenseFinder::Platform.windows?
76
76
 
77
77
  'mono /usr/local/bin/nuget.exe'
78
78
  end
79
79
 
80
80
  def prepare_command
81
- "#{Nuget.package_management_command} restore"
81
+ "#{package_management_command} restore"
82
82
  end
83
83
 
84
- def self.installed?(logger = Core.default_logger)
84
+ def installed?(logger = Core.default_logger)
85
85
  _stdout, _stderr, status = Cmd.run(nuget_check)
86
86
  if status.success?
87
- logger.debug self, 'is installed', color: :green
87
+ logger.debug self.class, 'is installed', color: :green
88
88
  else
89
- logger.info self, 'is not installed', color: :red
89
+ logger.info self.class, 'is not installed', color: :red
90
90
  end
91
91
  status.success?
92
92
  end
93
93
 
94
- def self.nuget_check
94
+ def nuget_check
95
95
  return 'where nuget' if LicenseFinder::Platform.windows?
96
96
 
97
97
  'which mono && ls /usr/local/bin/nuget.exe'
@@ -4,10 +4,12 @@ require 'json'
4
4
 
5
5
  module LicenseFinder
6
6
  class Pip < PackageManager
7
+ DEFAULT_VERSION = '2'
8
+
7
9
  def initialize(options = {})
8
10
  super
9
11
  @requirements_path = options[:pip_requirements_path] || Pathname('requirements.txt')
10
- @python_version = options[:python_version] || '2'
12
+ @python_version = options[:python_version] || DEFAULT_VERSION
11
13
  raise "Invalid python version \'#{@python_version}\'. Valid versions are '2' or '3'." unless %w[2 3].include?(@python_version)
12
14
  end
13
15
 
@@ -24,12 +26,8 @@ module LicenseFinder
24
26
  end
25
27
  end
26
28
 
27
- # Used to detect if installed, but this is a static method and the options aren't passed
28
- # so we don't know which python version was specified. Will fail later if the expected version
29
- # isn't installed. The Dockerfile now installs both versions so using the image is safe.
30
- # TODO: Refactor PackageManager.installed?() to pass in the options?
31
- def self.package_management_command
32
- 'pip2'
29
+ def package_management_command
30
+ "pip#{@python_version}"
33
31
  end
34
32
 
35
33
  def prepare_command
@@ -4,7 +4,7 @@ module LicenseFinder
4
4
  class Rebar < PackageManager
5
5
  def initialize(options = {})
6
6
  super
7
- @command = options[:rebar_command] || Rebar.package_management_command
7
+ @command = options[:rebar_command] || package_management_command
8
8
  @deps_path = Pathname(options[:rebar_deps_dir] || 'deps')
9
9
  end
10
10
 
@@ -20,7 +20,7 @@ module LicenseFinder
20
20
  end
21
21
  end
22
22
 
23
- def self.package_management_command
23
+ def package_management_command
24
24
  'rebar'
25
25
  end
26
26
 
@@ -51,7 +51,7 @@ module LicenseFinder
51
51
  NPM
52
52
  end
53
53
 
54
- def self.package_management_command
54
+ def package_management_command
55
55
  'yarn'
56
56
  end
57
57
 
@@ -32,7 +32,7 @@ module LicenseFinder
32
32
 
33
33
  def active_packages
34
34
  package_managers = active_package_managers
35
- installed_package_managers = package_managers.select { |pm| pm.class.installed?(@logger) }
35
+ installed_package_managers = package_managers.select { |pm| pm.installed?(@logger) }
36
36
  installed_package_managers.flat_map(&:current_packages_with_relations)
37
37
  end
38
38
 
@@ -26,7 +26,8 @@ Gem::Specification.new do |s|
26
26
  'David Dening',
27
27
  'Geoff Pleiss',
28
28
  'Mike Chinigo',
29
- 'Mike Dalessio'
29
+ 'Mike Dalessio',
30
+ 'Jeff Jun'
30
31
  ]
31
32
 
32
33
  s.email = ['labs-commoncode@pivotal.io']
@@ -42,28 +43,28 @@ Gem::Specification.new do |s|
42
43
 
43
44
  s.license = 'MIT'
44
45
 
45
- s.add_dependency 'bundler'
46
+ s.add_dependency 'bundler', '~> 2.1.0'
46
47
  s.add_dependency 'rubyzip', '>=1', '<3'
47
- s.add_dependency 'thor'
48
+ s.add_dependency 'thor', '~> 1.0.1'
48
49
  s.add_dependency 'toml', '0.2.0'
49
50
  s.add_dependency 'with_env', '1.1.0'
50
- s.add_dependency 'xml-simple'
51
+ s.add_dependency 'xml-simple', '~> 1.1.5'
51
52
 
52
53
  s.add_development_dependency 'addressable', '2.7.0'
53
54
  s.add_development_dependency 'capybara', '~> 3.15.0'
54
55
  s.add_development_dependency 'cocoapods', '>= 1.0.0' if RUBY_PLATFORM =~ /darwin/
55
56
  s.add_development_dependency 'fakefs', '~> 1.0.0'
56
57
  s.add_development_dependency 'mime-types', '3.3.1'
57
- s.add_development_dependency 'pry'
58
- s.add_development_dependency 'rake'
58
+ s.add_development_dependency 'pry', '~> 0.12.2'
59
+ s.add_development_dependency 'rake', '~> 13.0.1'
59
60
  s.add_development_dependency 'rspec', '~> 3'
60
- s.add_development_dependency 'rspec-its'
61
+ s.add_development_dependency 'rspec-its', '~> 1.3.0'
61
62
  s.add_development_dependency 'rubocop', '~> 0.79.0'
62
63
  s.add_development_dependency 'rubocop-performance', '~> 1.5.0'
63
64
  s.add_development_dependency 'webmock', '~> 3.5'
64
65
 
65
- s.add_development_dependency 'rack', '> 1.6'
66
- s.add_development_dependency 'rack-test', '> 0.7'
66
+ s.add_development_dependency 'rack', '~> 2.0.7', '> 1.6'
67
+ s.add_development_dependency 'rack-test', '~> 1.1.0', '> 0.7'
67
68
 
68
69
  s.files = `git ls-files`.split("\n").reject { |f| f.start_with?('spec', 'features') }
69
70
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
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: 6.0.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Collins
@@ -23,25 +23,26 @@ authors:
23
23
  - Geoff Pleiss
24
24
  - Mike Chinigo
25
25
  - Mike Dalessio
26
+ - Jeff Jun
26
27
  autorequire:
27
28
  bindir: bin
28
29
  cert_chain: []
29
- date: 2020-01-22 00:00:00.000000000 Z
30
+ date: 2020-02-21 00:00:00.000000000 Z
30
31
  dependencies:
31
32
  - !ruby/object:Gem::Dependency
32
33
  name: bundler
33
34
  requirement: !ruby/object:Gem::Requirement
34
35
  requirements:
35
- - - ">="
36
+ - - "~>"
36
37
  - !ruby/object:Gem::Version
37
- version: '0'
38
+ version: 2.1.0
38
39
  type: :runtime
39
40
  prerelease: false
40
41
  version_requirements: !ruby/object:Gem::Requirement
41
42
  requirements:
42
- - - ">="
43
+ - - "~>"
43
44
  - !ruby/object:Gem::Version
44
- version: '0'
45
+ version: 2.1.0
45
46
  - !ruby/object:Gem::Dependency
46
47
  name: rubyzip
47
48
  requirement: !ruby/object:Gem::Requirement
@@ -66,16 +67,16 @@ dependencies:
66
67
  name: thor
67
68
  requirement: !ruby/object:Gem::Requirement
68
69
  requirements:
69
- - - ">="
70
+ - - "~>"
70
71
  - !ruby/object:Gem::Version
71
- version: '0'
72
+ version: 1.0.1
72
73
  type: :runtime
73
74
  prerelease: false
74
75
  version_requirements: !ruby/object:Gem::Requirement
75
76
  requirements:
76
- - - ">="
77
+ - - "~>"
77
78
  - !ruby/object:Gem::Version
78
- version: '0'
79
+ version: 1.0.1
79
80
  - !ruby/object:Gem::Dependency
80
81
  name: toml
81
82
  requirement: !ruby/object:Gem::Requirement
@@ -108,16 +109,16 @@ dependencies:
108
109
  name: xml-simple
109
110
  requirement: !ruby/object:Gem::Requirement
110
111
  requirements:
111
- - - ">="
112
+ - - "~>"
112
113
  - !ruby/object:Gem::Version
113
- version: '0'
114
+ version: 1.1.5
114
115
  type: :runtime
115
116
  prerelease: false
116
117
  version_requirements: !ruby/object:Gem::Requirement
117
118
  requirements:
118
- - - ">="
119
+ - - "~>"
119
120
  - !ruby/object:Gem::Version
120
- version: '0'
121
+ version: 1.1.5
121
122
  - !ruby/object:Gem::Dependency
122
123
  name: addressable
123
124
  requirement: !ruby/object:Gem::Requirement
@@ -178,30 +179,30 @@ dependencies:
178
179
  name: pry
179
180
  requirement: !ruby/object:Gem::Requirement
180
181
  requirements:
181
- - - ">="
182
+ - - "~>"
182
183
  - !ruby/object:Gem::Version
183
- version: '0'
184
+ version: 0.12.2
184
185
  type: :development
185
186
  prerelease: false
186
187
  version_requirements: !ruby/object:Gem::Requirement
187
188
  requirements:
188
- - - ">="
189
+ - - "~>"
189
190
  - !ruby/object:Gem::Version
190
- version: '0'
191
+ version: 0.12.2
191
192
  - !ruby/object:Gem::Dependency
192
193
  name: rake
193
194
  requirement: !ruby/object:Gem::Requirement
194
195
  requirements:
195
- - - ">="
196
+ - - "~>"
196
197
  - !ruby/object:Gem::Version
197
- version: '0'
198
+ version: 13.0.1
198
199
  type: :development
199
200
  prerelease: false
200
201
  version_requirements: !ruby/object:Gem::Requirement
201
202
  requirements:
202
- - - ">="
203
+ - - "~>"
203
204
  - !ruby/object:Gem::Version
204
- version: '0'
205
+ version: 13.0.1
205
206
  - !ruby/object:Gem::Dependency
206
207
  name: rspec
207
208
  requirement: !ruby/object:Gem::Requirement
@@ -220,16 +221,16 @@ dependencies:
220
221
  name: rspec-its
221
222
  requirement: !ruby/object:Gem::Requirement
222
223
  requirements:
223
- - - ">="
224
+ - - "~>"
224
225
  - !ruby/object:Gem::Version
225
- version: '0'
226
+ version: 1.3.0
226
227
  type: :development
227
228
  prerelease: false
228
229
  version_requirements: !ruby/object:Gem::Requirement
229
230
  requirements:
230
- - - ">="
231
+ - - "~>"
231
232
  - !ruby/object:Gem::Version
232
- version: '0'
233
+ version: 1.3.0
233
234
  - !ruby/object:Gem::Dependency
234
235
  name: rubocop
235
236
  requirement: !ruby/object:Gem::Requirement
@@ -276,6 +277,9 @@ dependencies:
276
277
  name: rack
277
278
  requirement: !ruby/object:Gem::Requirement
278
279
  requirements:
280
+ - - "~>"
281
+ - !ruby/object:Gem::Version
282
+ version: 2.0.7
279
283
  - - ">"
280
284
  - !ruby/object:Gem::Version
281
285
  version: '1.6'
@@ -283,6 +287,9 @@ dependencies:
283
287
  prerelease: false
284
288
  version_requirements: !ruby/object:Gem::Requirement
285
289
  requirements:
290
+ - - "~>"
291
+ - !ruby/object:Gem::Version
292
+ version: 2.0.7
286
293
  - - ">"
287
294
  - !ruby/object:Gem::Version
288
295
  version: '1.6'
@@ -290,6 +297,9 @@ dependencies:
290
297
  name: rack-test
291
298
  requirement: !ruby/object:Gem::Requirement
292
299
  requirements:
300
+ - - "~>"
301
+ - !ruby/object:Gem::Version
302
+ version: 1.1.0
293
303
  - - ">"
294
304
  - !ruby/object:Gem::Version
295
305
  version: '0.7'
@@ -297,6 +307,9 @@ dependencies:
297
307
  prerelease: false
298
308
  version_requirements: !ruby/object:Gem::Requirement
299
309
  requirements:
310
+ - - "~>"
311
+ - !ruby/object:Gem::Version
312
+ version: 1.1.0
300
313
  - - ">"
301
314
  - !ruby/object:Gem::Version
302
315
  version: '0.7'