spandx 0.15.0 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -2
- data/ext/spandx/spandx.c +2 -0
- data/lib/spandx/cli/commands/pull.rb +33 -4
- data/lib/spandx/cli/printers/table.rb +4 -3
- data/lib/spandx/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: 120ae97e54f2a138b7d1053d9e71c8b702174cf70fbac0fc861b8971f4aec0bd
|
4
|
+
data.tar.gz: c89d3ffe76d00d0a6fb18e91b5cdd3ef1487a826047213dd264be3d59796d188
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab85f497f8ce4fe46a03b31d25ffa07816975dcbcb91a1438cf09bcd38f857ed652a1003569e2a8cbb091c5fb5b5b88a52043f4a61eec71337eff58107c75737
|
7
|
+
data.tar.gz: e73a923228358065c7d67bdfa8aaea328657269758f2c2d664621b5e6dd6da449b1d585655ae351e0edd99dbd155ef2efa24f0e37c95cd24c75f85da517503af
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Version 0.15.
|
1
|
+
Version 0.15.1
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
9
9
|
|
10
10
|
## [Unreleased]
|
11
11
|
|
12
|
+
## [0.15.1] - 2020-11-18
|
13
|
+
### Fixed
|
14
|
+
- Rebuild index after pulling latest cache.
|
15
|
+
|
12
16
|
## [0.15.0] - 2020-11-18
|
13
17
|
### Added
|
14
18
|
- Parse `/var/lib/dpkg/status` file.
|
@@ -207,7 +211,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
207
211
|
### Added
|
208
212
|
- Provide ruby API to the latest SPDX catalogue.
|
209
213
|
|
210
|
-
[Unreleased]: https://github.com/spandx/spandx/compare/v0.15.
|
214
|
+
[Unreleased]: https://github.com/spandx/spandx/compare/v0.15.1...HEAD
|
215
|
+
[0.15.1]: https://github.com/spandx/spandx/compare/v0.15.0...v0.15.1
|
211
216
|
[0.15.0]: https://github.com/spandx/spandx/compare/v0.14.0...v0.15.0
|
212
217
|
[0.14.0]: https://github.com/spandx/spandx/compare/v0.13.5...v0.14.0
|
213
218
|
[0.13.5]: https://github.com/spandx/spandx/compare/v0.13.4...v0.13.5
|
data/ext/spandx/spandx.c
CHANGED
@@ -8,12 +8,41 @@ module Spandx
|
|
8
8
|
@options = options
|
9
9
|
end
|
10
10
|
|
11
|
-
def execute(output: $
|
11
|
+
def execute(output: $stderr)
|
12
|
+
sync(output)
|
13
|
+
build(output, ::Spandx::Core::Dependency::PACKAGE_MANAGERS.values.uniq)
|
14
|
+
output.puts 'OK'
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def sync(output)
|
12
20
|
Spandx.git.each_value do |db|
|
13
|
-
|
14
|
-
|
21
|
+
with_spinner("Updating #{db.url}...", output: output) do
|
22
|
+
db.update!
|
23
|
+
end
|
15
24
|
end
|
16
|
-
|
25
|
+
end
|
26
|
+
|
27
|
+
def build(output, sources)
|
28
|
+
index_path = Spandx.git[:cache].root.join('.index')
|
29
|
+
|
30
|
+
with_spinner('Rebuilding index...', output: output) do
|
31
|
+
sources.each do |source|
|
32
|
+
Spandx::Core::Cache
|
33
|
+
.new(source, root: index_path)
|
34
|
+
.rebuild_index
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def with_spinner(message, output:)
|
40
|
+
spinner = TTY::Spinner.new("[:spinner] #{message}", output: output)
|
41
|
+
spinner.auto_spin
|
42
|
+
yield
|
43
|
+
spinner.success('(done)')
|
44
|
+
ensure
|
45
|
+
spinner.stop
|
17
46
|
end
|
18
47
|
end
|
19
48
|
end
|
@@ -6,8 +6,9 @@ module Spandx
|
|
6
6
|
class Table < Printer
|
7
7
|
HEADINGS = ['Name', 'Version', 'Licenses', 'Location'].freeze
|
8
8
|
|
9
|
-
def initialize
|
10
|
-
@spinner = TTY::Spinner.new(output:
|
9
|
+
def initialize(output: $stderr)
|
10
|
+
@spinner = TTY::Spinner.new('[:spinner] Scanning...', output: output, clear: true, format: :dots)
|
11
|
+
@spinner.auto_spin
|
11
12
|
end
|
12
13
|
|
13
14
|
def match?(format)
|
@@ -16,7 +17,6 @@ module Spandx
|
|
16
17
|
|
17
18
|
def print_header(_io)
|
18
19
|
@dependencies = SortedSet.new
|
19
|
-
@spinner.auto_spin
|
20
20
|
end
|
21
21
|
|
22
22
|
def print_line(dependency, _io)
|
@@ -25,6 +25,7 @@ module Spandx
|
|
25
25
|
|
26
26
|
def print_footer(io)
|
27
27
|
@spinner.stop
|
28
|
+
@spinner.reset
|
28
29
|
io.puts(to_table(@dependencies.map(&:to_a)))
|
29
30
|
end
|
30
31
|
|
data/lib/spandx/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spandx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Can Eldem
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-11-
|
12
|
+
date: 2020-11-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|