license_finder 2.1.0.rc2 → 2.1.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ODI1N2UxNjA0NjVkOWE0MDQ3YTkzY2ZmMDBiNzcwMmNhYzllZDk3NQ==
5
- data.tar.gz: !binary |-
6
- M2ViZWI5ZGNhOWJhMDkxMTU2YTcyOWIyZDgwYTk3MzA1NzQ0NTJlYw==
2
+ SHA1:
3
+ metadata.gz: 554dcf10a176408392e1f259852f218803beff8f
4
+ data.tar.gz: 53c9a69a3779906d601903a6286d23237e156784
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ODFiNjY1NjdiYzA0MDA3MGMyZTc0NmExNTNjYjNlNDMxMTUwOWQxZTIxM2Mx
10
- MWY0MmMzNzBkM2E3NjJhMjcxMjQwOGI3MDQ1OWI1MDFjZWFiZDM1MDUwMTYx
11
- ZTRhMTNkNmM4ZDAxNDkzNGRlZjgyZWIyZWNiOTQ5MDYzMjg4MDE=
12
- data.tar.gz: !binary |-
13
- Nzg0M2E4OGM1NDUyMTJlODllNDgyNDQ3YjgzMmI3NzY1NzRmZGVlNDQ1MzYw
14
- ODRiMDA2NmUzNzRkODVkNTU2Y2IxMWIwOTIxYzNmYjRhYmZhOWFhNTNiMzJk
15
- OTk0ZTc5MmVkMTk0MzI1YWQ2YzYxOGI0OGUxNTNiMzZhMWY4OTI=
6
+ metadata.gz: 116aacdfab302a9ff712635bfc24068cea34a291d3b0c0308c8c2a6d4517eb95fd81d367a45157b7256829bcf851dd21fbfe697c1a554797e49677cf41e9f6d0
7
+ data.tar.gz: 169660177ad51b1a710c48f0264161eb6337d333655c50614bee3c27db2d4f58ad8bcb8d8bcc6f74b69be40fb910fa925753019670e5b2fd7f0dac20c8e6b607
@@ -1,3 +1,9 @@
1
+ === 2.1.0.rc3 / 2016-01-22
2
+
3
+ * Features
4
+ * Godep dependencies can display the full commit SHA with `--go-full-version`
5
+
6
+
1
7
  === 2.1.0.rc2 / 2015-12-31
2
8
 
3
9
  * Features
@@ -28,6 +28,7 @@ module LicenseFinder
28
28
  extract_options(
29
29
  :project_path,
30
30
  :decisions_file,
31
+ :go_full_version,
31
32
  :gradle_command,
32
33
  :rebar_command,
33
34
  :rebar_deps_dir,
@@ -20,6 +20,7 @@ module LicenseFinder
20
20
  class_option :format, desc: "The desired output format.", default: 'text', enum: FORMATS.keys
21
21
  class_option :columns, type: :array, desc: "For CSV reports, which columns to print. Pick from: #{CsvReport::AVAILABLE_COLUMNS}", default: %w[name version licenses]
22
22
  class_option :save, desc: "Save report to a file. Default: 'license_report.csv' in project root.", lazy_default: "license_report"
23
+ class_option :go_full_version, desc: "Whether dependency version should include full version. Only meaningful if used with a Go project. Defaults to false."
23
24
  class_option :gradle_command, desc: "Command to use when fetching gradle packages. Only meaningful if used with a Java/gradle project. Defaults to 'gradlew' / 'gradlew.bat' if the wrapper is present, otherwise to 'gradle'."
24
25
  class_option :rebar_command, desc: "Command to use when fetching rebar packages. Only meaningful if used with a Erlang/rebar project. Defaults to 'rebar'."
25
26
  class_option :rebar_deps_dir, desc: "Path to rebar dependencies directory. Only meaningful if used with a Erlang/rebar project. Defaults to 'deps'."
@@ -35,6 +35,10 @@ module LicenseFinder
35
35
  )
36
36
  end
37
37
 
38
+ def go_full_version
39
+ get(:go_full_version)
40
+ end
41
+
38
42
  def rebar_command
39
43
  get(:rebar_command) || 'rebar'
40
44
  end
@@ -64,6 +64,7 @@ module LicenseFinder
64
64
  logger: logger,
65
65
  project_path: config.project_path,
66
66
  ignore_groups: decisions.ignored_groups,
67
+ go_full_version: config.go_full_version,
67
68
  gradle_command: config.gradle_command,
68
69
  rebar_command: config.rebar_command,
69
70
  rebar_deps_dir: config.rebar_deps_dir,
@@ -2,9 +2,15 @@ require 'json'
2
2
 
3
3
  module LicenseFinder
4
4
  class GoDep < PackageManager
5
+
6
+ def initialize(options={})
7
+ super
8
+ @full_version = options[:go_full_version]
9
+ end
10
+
5
11
  def current_packages
6
12
  json = JSON.parse(package_path.read)
7
- json['Deps'].map { |dep| GoPackage.from_dependency(dep, install_prefix) }
13
+ json['Deps'].map { |dep| GoPackage.from_dependency(dep, install_prefix, @full_version) }
8
14
  end
9
15
 
10
16
  def package_path
@@ -4,9 +4,9 @@ module LicenseFinder
4
4
  LicenseFinder::Package.new(name, 'unknown', {install_path: install_path(path)})
5
5
  end
6
6
 
7
- def self.from_dependency(hash, prefix)
7
+ def self.from_dependency(hash, prefix,full_version)
8
8
  name = hash['ImportPath']
9
- version = hash['Rev'][0..6]
9
+ version = full_version ? hash['Rev'] : hash['Rev'][0..6]
10
10
  LicenseFinder::Package.new(name, version, {install_path: install_path(prefix.join(name))})
11
11
  end
12
12
 
@@ -4,10 +4,15 @@ module LicenseFinder
4
4
  class GoWorkspace < PackageManager
5
5
  Submodule = Struct.new :path, :revision
6
6
 
7
+ def initialize(options={})
8
+ super
9
+ @full_version = options[:go_full_version]
10
+ end
11
+
7
12
  def current_packages
8
13
  submodules.map do |submodule|
9
14
  import_path = Pathname.new(submodule.path).relative_path_from(project_src)
10
- GoPackage.from_dependency({'ImportPath' => import_path.to_s, 'Rev' => submodule.revision}, project_src)
15
+ GoPackage.from_dependency({'ImportPath' => import_path.to_s, 'Rev' => submodule.revision}, project_src, @full_version)
11
16
  end
12
17
  end
13
18
 
@@ -1,3 +1,3 @@
1
1
  module LicenseFinder
2
- VERSION = "2.1.0.rc2"
2
+ VERSION = "2.1.0.rc3"
3
3
  end
@@ -27,6 +27,7 @@ module LicenseFinder
27
27
  logger: logger,
28
28
  project_path: configuration.project_path,
29
29
  ignore_groups: Set.new,
30
+ go_full_version: nil,
30
31
  gradle_command: configuration.gradle_command,
31
32
  rebar_command: configuration.rebar_command,
32
33
  rebar_deps_dir: configuration.rebar_deps_dir
@@ -2,7 +2,9 @@ require 'spec_helper'
2
2
 
3
3
  module LicenseFinder
4
4
  describe GoDep do
5
- subject { GoDep.new(project_path: Pathname('/fake/path')) }
5
+ let(:options) { {} }
6
+ subject { GoDep.new(options.merge(project_path: Pathname('/fake/path'))) }
7
+
6
8
 
7
9
  it_behaves_like 'a PackageManager'
8
10
 
@@ -44,6 +46,15 @@ module LicenseFinder
44
46
  expect(packages[0].install_path).to eq('/fake/path/Godeps/_workspace/src/github.com/pivotal/foo')
45
47
  expect(packages[1].install_path).to eq('/fake/path/Godeps/_workspace/src/github.com/pivotal/bar')
46
48
  end
49
+
50
+ context 'when requesting the full version' do
51
+ let(:options) { { go_full_version:true } }
52
+ it 'list the dependencies with full version' do
53
+ expect(subject.current_packages.map(&:version)).to eq [
54
+ "61164e49940b423ba1f12ddbdf01632ac793e5e9",
55
+ "3245708abcdef234589450649872346783298736"]
56
+ end
57
+ end
47
58
  end
48
59
 
49
60
  context 'when dependencies are not vendored' do
@@ -2,8 +2,9 @@ require 'spec_helper'
2
2
 
3
3
  module LicenseFinder
4
4
  describe GoWorkspace do
5
+ let(:options) { {} }
5
6
  let(:logger) { double(:logger, active: nil) }
6
- subject { GoWorkspace.new(project_path: Pathname('/Users/pivotal/workspace/loggregator'), logger: logger) }
7
+ subject { GoWorkspace.new(options.merge(project_path: Pathname('/Users/pivotal/workspace/loggregator'), logger: logger)) }
7
8
 
8
9
  describe '#current_packages' do
9
10
  let(:content) {
@@ -53,6 +54,13 @@ module LicenseFinder
53
54
  expect { subject.current_packages }.to raise_exception(/git submodule status failed/)
54
55
  end
55
56
  end
57
+
58
+ context 'when requesting the full version' do
59
+ let(:options) { { go_full_version:true } }
60
+ it 'list the dependencies with full version' do
61
+ expect(subject.current_packages.map(&:version)).to eq ["b8a35001b773c267e"]
62
+ end
63
+ end
56
64
  end
57
65
 
58
66
  describe '#package_path' do
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.rc2
4
+ version: 2.1.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Maine
@@ -20,179 +20,181 @@ authors:
20
20
  autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
- date: 2015-12-31 00:00:00.000000000 Z
23
+ date: 2016-01-22 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
27
  requirement: !ruby/object:Gem::Requirement
28
28
  requirements:
29
- - - ! '>='
29
+ - - ">="
30
30
  - !ruby/object:Gem::Version
31
31
  version: '0'
32
32
  type: :runtime
33
33
  prerelease: false
34
34
  version_requirements: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - ! '>='
36
+ - - ">="
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: thor
41
41
  requirement: !ruby/object:Gem::Requirement
42
42
  requirements:
43
- - - ! '>='
43
+ - - ">="
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
49
49
  requirements:
50
- - - ! '>='
50
+ - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: httparty
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - ! '>='
57
+ - - ">="
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  type: :runtime
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - ! '>='
64
+ - - ">="
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: xml-simple
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - ! '>='
71
+ - - ">="
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  type: :runtime
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - ! '>='
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rake
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - ! '>='
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - ! '>='
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: rspec-its
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - ! '>='
99
+ - - ">="
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - ! '>='
106
+ - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: fakefs
111
111
  requirement: !ruby/object:Gem::Requirement
112
112
  requirements:
113
- - - ! '>='
113
+ - - ">="
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  type: :development
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - ! '>='
120
+ - - ">="
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  - !ruby/object:Gem::Dependency
124
124
  name: pry
125
125
  requirement: !ruby/object:Gem::Requirement
126
126
  requirements:
127
- - - ! '>='
127
+ - - ">="
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  type: :development
131
131
  prerelease: false
132
132
  version_requirements: !ruby/object:Gem::Requirement
133
133
  requirements:
134
- - - ! '>='
134
+ - - ">="
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: rspec
139
139
  requirement: !ruby/object:Gem::Requirement
140
140
  requirements:
141
- - - ~>
141
+ - - "~>"
142
142
  - !ruby/object:Gem::Version
143
143
  version: '3'
144
144
  type: :development
145
145
  prerelease: false
146
146
  version_requirements: !ruby/object:Gem::Requirement
147
147
  requirements:
148
- - - ~>
148
+ - - "~>"
149
149
  - !ruby/object:Gem::Version
150
150
  version: '3'
151
151
  - !ruby/object:Gem::Dependency
152
152
  name: capybara
153
153
  requirement: !ruby/object:Gem::Requirement
154
154
  requirements:
155
- - - ~>
155
+ - - "~>"
156
156
  - !ruby/object:Gem::Version
157
157
  version: 2.0.0
158
158
  type: :development
159
159
  prerelease: false
160
160
  version_requirements: !ruby/object:Gem::Requirement
161
161
  requirements:
162
- - - ~>
162
+ - - "~>"
163
163
  - !ruby/object:Gem::Version
164
164
  version: 2.0.0
165
165
  - !ruby/object:Gem::Dependency
166
166
  name: webmock
167
167
  requirement: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - ~>
169
+ - - "~>"
170
170
  - !ruby/object:Gem::Version
171
171
  version: '1.13'
172
172
  type: :development
173
173
  prerelease: false
174
174
  version_requirements: !ruby/object:Gem::Requirement
175
175
  requirements:
176
- - - ~>
176
+ - - "~>"
177
177
  - !ruby/object:Gem::Version
178
178
  version: '1.13'
179
179
  - !ruby/object:Gem::Dependency
180
180
  name: mime-types
181
181
  requirement: !ruby/object:Gem::Requirement
182
182
  requirements:
183
- - - <
183
+ - - "<"
184
184
  - !ruby/object:Gem::Version
185
185
  version: '3.0'
186
186
  type: :development
187
187
  prerelease: false
188
188
  version_requirements: !ruby/object:Gem::Requirement
189
189
  requirements:
190
- - - <
190
+ - - "<"
191
191
  - !ruby/object:Gem::Version
192
192
  version: '3.0'
193
- description: ! " LicenseFinder works with your package managers to find\n dependencies,
194
- detect the licenses of the packages in them, compare\n those licenses against
195
- a user-defined whitelist, and give you an\n actionable exception report.\n"
193
+ description: |2
194
+ LicenseFinder works with your package managers to find
195
+ dependencies, detect the licenses of the packages in them, compare
196
+ those licenses against a user-defined whitelist, and give you an
197
+ actionable exception report.
196
198
  email:
197
199
  - commoncode@pivotalabs.com
198
200
  executables:
@@ -201,14 +203,14 @@ executables:
201
203
  extensions: []
202
204
  extra_rdoc_files: []
203
205
  files:
204
- - .force-build
205
- - .gitignore
206
- - .rspec
207
- - .travis.yml
208
- - .travis/install_bower.sh
209
- - .travis/install_godep.sh
210
- - .travis/install_gradle.sh
211
- - .travis/install_rebar.sh
206
+ - ".force-build"
207
+ - ".gitignore"
208
+ - ".rspec"
209
+ - ".travis.yml"
210
+ - ".travis/install_bower.sh"
211
+ - ".travis/install_godep.sh"
212
+ - ".travis/install_gradle.sh"
213
+ - ".travis/install_rebar.sh"
212
214
  - CHANGELOG.rdoc
213
215
  - CONTRIBUTING.md
214
216
  - Gemfile
@@ -446,12 +448,12 @@ require_paths:
446
448
  - lib
447
449
  required_ruby_version: !ruby/object:Gem::Requirement
448
450
  requirements:
449
- - - ! '>='
451
+ - - ">="
450
452
  - !ruby/object:Gem::Version
451
453
  version: 1.9.3
452
454
  required_rubygems_version: !ruby/object:Gem::Requirement
453
455
  requirements:
454
- - - ! '>'
456
+ - - ">"
455
457
  - !ruby/object:Gem::Version
456
458
  version: 1.3.1
457
459
  requirements: []