license_scout 2.0.2 → 2.0.3
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/lib/license_scout/dependency_manager/npm.rb +14 -3
- data/lib/license_scout/license.rb +10 -0
- data/lib/license_scout/version.rb +1 -1
- metadata +2 -11
- data/native_parsers/mix_lock_json/README.md +0 -21
- data/native_parsers/mix_lock_json/lib/mix_lock_json.ex +0 -20
- data/native_parsers/mix_lock_json/mix.exs +0 -31
- data/native_parsers/mix_lock_json/mix.lock +0 -3
- data/native_parsers/rebar_lock_json/README.md +0 -17
- data/native_parsers/rebar_lock_json/rebar.config +0 -19
- data/native_parsers/rebar_lock_json/rebar.lock +0 -36
- data/native_parsers/rebar_lock_json/src/rebar_lock_json.app.src +0 -17
- data/native_parsers/rebar_lock_json/src/rebar_lock_json.erl +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07f7bba2a32cc6e4697c45e42c401b7298e13a473e27e91ad42eaed08d2e8bee
|
4
|
+
data.tar.gz: 59c5fa80345ad053a54061901e8f6eb25458858ff0c4f4224110c43b9ba5f819
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ca283049b83fa99b661622cedb194d805eb11119f2fe96e10a260a2dd638d20b103cb1186c5ca0d4721a1f29b952933abe9aa64ab123e45e66af633a437a6b6
|
7
|
+
data.tar.gz: e720c9970dfab3978c02be6dc85d9fb2f204c4c05553341e3a361515f4bfaab7f5159cb8cb493f7b9c019e84a266b78c31fdf9aae19e0e6afb46abef7ba97fc8
|
@@ -55,11 +55,22 @@ module LicenseScout
|
|
55
55
|
|
56
56
|
dependency = new_dependency(dep_name, dep_version, dep_path)
|
57
57
|
|
58
|
-
|
58
|
+
license_info = pkg_info["license"] || pkg_info["licenses"]
|
59
|
+
|
60
|
+
case license_info
|
59
61
|
when String
|
60
|
-
dependency.add_license(
|
62
|
+
dependency.add_license(license_info, "package.json")
|
61
63
|
when Hash
|
62
|
-
dependency.add_license(
|
64
|
+
dependency.add_license(license_info["type"], "package.json", license_info["url"])
|
65
|
+
when Array
|
66
|
+
license_info.each do |license|
|
67
|
+
case license
|
68
|
+
when String
|
69
|
+
dependency.add_license(license, "package.json")
|
70
|
+
when Hash
|
71
|
+
dependency.add_license(license["type"], "package.json", license["url"])
|
72
|
+
end
|
73
|
+
end
|
63
74
|
end
|
64
75
|
|
65
76
|
uniq_deps << dependency
|
@@ -110,6 +110,16 @@ module LicenseScout
|
|
110
110
|
rescue OpenURI::HTTPError
|
111
111
|
LicenseScout::Log.warn("[license] Unable to download license for #{license_id} from #{new_url}")
|
112
112
|
nil
|
113
|
+
rescue RuntimeError => e
|
114
|
+
if e.message =~ /redirection forbidden/
|
115
|
+
m = /redirection forbidden:\s+(.+)\s+->\s+(.+)/.match(e.message)
|
116
|
+
new_https_url = m[2].gsub("http://", "https://")
|
117
|
+
|
118
|
+
LicenseScout::Log.debug("[license] Retrying download of #{license_id} from #{new_https_url}")
|
119
|
+
license_content(license_id, new_https_url)
|
120
|
+
else
|
121
|
+
raise e
|
122
|
+
end
|
113
123
|
end
|
114
124
|
end
|
115
125
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: license_scout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Serdar Sutay
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-04-
|
12
|
+
date: 2018-04-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi-yajl
|
@@ -304,15 +304,6 @@ files:
|
|
304
304
|
- lib/license_scout/reporter.rb
|
305
305
|
- lib/license_scout/spdx.rb
|
306
306
|
- lib/license_scout/version.rb
|
307
|
-
- native_parsers/mix_lock_json/README.md
|
308
|
-
- native_parsers/mix_lock_json/lib/mix_lock_json.ex
|
309
|
-
- native_parsers/mix_lock_json/mix.exs
|
310
|
-
- native_parsers/mix_lock_json/mix.lock
|
311
|
-
- native_parsers/rebar_lock_json/README.md
|
312
|
-
- native_parsers/rebar_lock_json/rebar.config
|
313
|
-
- native_parsers/rebar_lock_json/rebar.lock
|
314
|
-
- native_parsers/rebar_lock_json/src/rebar_lock_json.app.src
|
315
|
-
- native_parsers/rebar_lock_json/src/rebar_lock_json.erl
|
316
307
|
homepage: https://github.com/chef/license_scout
|
317
308
|
licenses:
|
318
309
|
- Apache-2.0
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# MixLockJson
|
2
|
-
|
3
|
-
**TODO: Add description**
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
|
8
|
-
by adding `mix_lock_json` to your list of dependencies in `mix.exs`:
|
9
|
-
|
10
|
-
```elixir
|
11
|
-
def deps do
|
12
|
-
[
|
13
|
-
{:mix_lock_json, "~> 0.1.0"}
|
14
|
-
]
|
15
|
-
end
|
16
|
-
```
|
17
|
-
|
18
|
-
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
|
19
|
-
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
|
20
|
-
be found at [https://hexdocs.pm/mix_lock_json](https://hexdocs.pm/mix_lock_json).
|
21
|
-
|
@@ -1,20 +0,0 @@
|
|
1
|
-
defmodule MixLockJson.CLI do
|
2
|
-
def main(mix_lock_path \\ "") do
|
3
|
-
mix_lock_path
|
4
|
-
|> parse_mix_lock
|
5
|
-
|> IO.puts
|
6
|
-
end
|
7
|
-
|
8
|
-
defp parse_mix_lock(mix_lock_path) do
|
9
|
-
{:ok, lockfile} = File.read(mix_lock_path)
|
10
|
-
{lock_deps, _} = lockfile |> Code.eval_string
|
11
|
-
|
12
|
-
Poison.encode!(Enum.reduce(lock_deps, [], fn(i, acc) ->
|
13
|
-
case i do
|
14
|
-
{name, {_, _, version, _hash, _, _child_deps, _}} -> [%{name => version} | acc]
|
15
|
-
{name, {:git, _path, hash, _}} -> [%{name => hash} | acc]
|
16
|
-
_ -> acc
|
17
|
-
end
|
18
|
-
end))
|
19
|
-
end
|
20
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
defmodule MixLockJson.MixProject do
|
2
|
-
use Mix.Project
|
3
|
-
|
4
|
-
def project do
|
5
|
-
[
|
6
|
-
app: :mix_lock_json,
|
7
|
-
version: "0.1.0",
|
8
|
-
escript: escript(),
|
9
|
-
deps: deps()
|
10
|
-
]
|
11
|
-
end
|
12
|
-
|
13
|
-
def application do
|
14
|
-
[applications: []]
|
15
|
-
end
|
16
|
-
|
17
|
-
defp escript do
|
18
|
-
[
|
19
|
-
main_module: MixLockJson.CLI,
|
20
|
-
path: "../../bin/mix_lock_json",
|
21
|
-
app: nil,
|
22
|
-
embed_elixir: true
|
23
|
-
]
|
24
|
-
end
|
25
|
-
|
26
|
-
defp deps do
|
27
|
-
[
|
28
|
-
{:poison, "~> 3.1"}
|
29
|
-
]
|
30
|
-
end
|
31
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
rebar_lock_json
|
2
|
-
===============
|
3
|
-
|
4
|
-
A minimal escript converting a rebar.lock file to json output.
|
5
|
-
|
6
|
-
Should work with any version of rebar (2 or 3)'s rebar.lock file.
|
7
|
-
|
8
|
-
Build
|
9
|
-
-----
|
10
|
-
|
11
|
-
$ rebar3 escriptize # this also copies the escript file to bin/
|
12
|
-
|
13
|
-
Run
|
14
|
-
---
|
15
|
-
|
16
|
-
$ bin/rebar_lock_json path/to/rebar.lock
|
17
|
-
{"amqp_client":{"type":"git","git_url":"git:\/\/github.com\/seth\/amqp_client.git","git_ref":"7622ad8093a41b7288a1aa44dd16d3e92ce8f833"}}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
{erl_opts, [no_debug_info]}.
|
2
|
-
{deps, [
|
3
|
-
jsone,
|
4
|
-
{rebar3, {git, "https://github.com/erlang/rebar3", {branch, "master"}}}
|
5
|
-
]}.
|
6
|
-
|
7
|
-
{escript_incl_apps,
|
8
|
-
[rebar_lock_json]}.
|
9
|
-
{escript_main_app, rebar_lock_json}.
|
10
|
-
{escript_name, rebar_lock_json}.
|
11
|
-
{escript_emu_args, "%%! +sbtu +A0\n"}.
|
12
|
-
|
13
|
-
{post_hooks, [
|
14
|
-
{escriptize, "cp $REBAR_BUILD_DIR/bin/rebar_lock_json ../../bin/"}
|
15
|
-
]}.
|
16
|
-
|
17
|
-
{profiles, [{test,
|
18
|
-
[{erl_opts, [debug_info]}
|
19
|
-
]}]}.
|
@@ -1,36 +0,0 @@
|
|
1
|
-
{"1.1.0",
|
2
|
-
[{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.3.0">>},1},
|
3
|
-
{<<"certifi">>,{pkg,<<"certifi">>,<<"0.4.0">>},1},
|
4
|
-
{<<"cf">>,{pkg,<<"cf">>,<<"0.2.2">>},1},
|
5
|
-
{<<"cth_readable">>,{pkg,<<"cth_readable">>,<<"1.2.3">>},1},
|
6
|
-
{<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"1.0.0">>},1},
|
7
|
-
{<<"eunit_formatters">>,{pkg,<<"eunit_formatters">>,<<"0.3.1">>},1},
|
8
|
-
{<<"getopt">>,{pkg,<<"getopt">>,<<"0.8.2">>},1},
|
9
|
-
{<<"jiffy">>,{pkg,<<"jiffy">>,<<"0.14.11">>},0},
|
10
|
-
{<<"jsone">>,{pkg,<<"jsone">>,<<"1.4.1">>},0},
|
11
|
-
{<<"providers">>,{pkg,<<"providers">>,<<"1.6.0">>},1},
|
12
|
-
{<<"rebar">>,
|
13
|
-
{git,"https://github.com/erlang/rebar3",
|
14
|
-
{ref,"86e883b8d8d1d16487e245fff02eba8c83da2cdd"}},
|
15
|
-
0},
|
16
|
-
{<<"rebar3">>,
|
17
|
-
{git,"https://github.com/erlang/rebar3",
|
18
|
-
{ref,"cb743f76cbc26ac780066d285329e8a6c8330605"}},
|
19
|
-
0},
|
20
|
-
{<<"relx">>,{pkg,<<"relx">>,<<"3.22.2">>},1},
|
21
|
-
{<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.1">>},1}]}.
|
22
|
-
[
|
23
|
-
{pkg_hash,[
|
24
|
-
{<<"bbmustache">>, <<"2010ADAE78830992A4C69680115ECD7D475DD03A72C076BBADDCCBF2D4B32035">>},
|
25
|
-
{<<"certifi">>, <<"A7966EFB868B179023618D29A407548F70C52466BF1849B9E8EBD0E34B7EA11F">>},
|
26
|
-
{<<"cf">>, <<"7F2913FFF90ABCABD0F489896CFEB0B0674F6C8DF6C10B17A83175448029896C">>},
|
27
|
-
{<<"cth_readable">>, <<"293120673DFF82F0768612C5282E35C40CACC1B6F94FE99077438FD3749D0E27">>},
|
28
|
-
{<<"erlware_commons">>, <<"087467DE5833C0BB5B3CCDD387F9E9C1FB816A75B7A709629BF24B5ED3246C51">>},
|
29
|
-
{<<"eunit_formatters">>, <<"7A6FC351EB5B873E2356B8852EB751E20C13A72FBCA03393CF682B8483509573">>},
|
30
|
-
{<<"getopt">>, <<"B17556DB683000BA50370B16C0619DF1337E7AF7ECBF7D64FBF8D1D6BCE3109B">>},
|
31
|
-
{<<"jiffy">>, <<"919A87D491C5A6B5E3BBC27FAFEDC3A0761CA0B4C405394F121F582FD4E3F0E5">>},
|
32
|
-
{<<"jsone">>, <<"10ECFB2E2FD216D6451AF71CF14F276E063A096E15B685DE7535FD680466C9B5">>},
|
33
|
-
{<<"providers">>, <<"DB0E2F9043AE60C0155205FCD238D68516331D0E5146155E33D1E79DC452964A">>},
|
34
|
-
{<<"relx">>, <<"AEE2EF6E9AC6D21D6661133B7A0BE6E81424DE9CDCA0012FC008BC677297C469">>},
|
35
|
-
{<<"ssl_verify_fun">>, <<"28A4D65B7F59893BC2C7DE786DEC1E1555BD742D336043FE644AE956C3497FBE">>}]}
|
36
|
-
].
|
@@ -1,17 +0,0 @@
|
|
1
|
-
{application, rebar_lock_json,
|
2
|
-
[{description, "An escript util returning json representation of rebar.lock"},
|
3
|
-
{vsn, "0.1.0"},
|
4
|
-
{registered, []},
|
5
|
-
{applications,
|
6
|
-
[kernel,
|
7
|
-
stdlib,
|
8
|
-
rebar,
|
9
|
-
jsone
|
10
|
-
]},
|
11
|
-
{env,[]},
|
12
|
-
{modules, []},
|
13
|
-
|
14
|
-
{maintainers, []},
|
15
|
-
{licenses, []},
|
16
|
-
{links, []}
|
17
|
-
]}.
|
@@ -1,20 +0,0 @@
|
|
1
|
-
-module(rebar_lock_json).
|
2
|
-
|
3
|
-
-export([main/1]).
|
4
|
-
|
5
|
-
main([LockPath|_]) ->
|
6
|
-
Deps = rebar_config:consult_lock_file(LockPath),
|
7
|
-
Ejson = lists:map(fun dep_to_ejson/1, Deps),
|
8
|
-
io:format("~s~n", [jsone:encode({Ejson})]).
|
9
|
-
|
10
|
-
dep_to_ejson({Name, {pkg, PkgName, PkgVersion, Hash}, Lvl}) ->
|
11
|
-
{Name, {[{<<"type">>, <<"pkg">>},
|
12
|
-
{<<"level">>, Lvl},
|
13
|
-
{<<"pkg_name">>, PkgName},
|
14
|
-
{<<"pkg_version">>, PkgVersion},
|
15
|
-
{<<"pkg_hash">>, Hash}]}};
|
16
|
-
dep_to_ejson({Name, {git, GitUrl, {ref, GitRef}}, Lvl}) ->
|
17
|
-
{Name, {[{<<"type">>, <<"git">>},
|
18
|
-
{<<"level">>, Lvl},
|
19
|
-
{<<"git_url">>, erlang:iolist_to_binary(GitUrl)},
|
20
|
-
{<<"git_ref">>, erlang:iolist_to_binary(GitRef)}]}}.
|