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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b68d1311c50cda672da2ff036a9933a38d45e7a79e8a9c40352d839ba818186
4
- data.tar.gz: 5efda8ed1041680fb943017f5f6015765ef33a77fffb428e0c402fb685778446
3
+ metadata.gz: 07f7bba2a32cc6e4697c45e42c401b7298e13a473e27e91ad42eaed08d2e8bee
4
+ data.tar.gz: 59c5fa80345ad053a54061901e8f6eb25458858ff0c4f4224110c43b9ba5f819
5
5
  SHA512:
6
- metadata.gz: 0cfac147a17d18bba538ce8152015c9fea05c7b8956d3a9db6beb0bcea990951bd19d7fb855fef4f4a03a02f2ea71e09608192c6ea882a0b92045f8967da702e
7
- data.tar.gz: c337a0bd8b8aa6906a5ed992012df0de3a42fe190dc63fce545c6a1407a4f818f5dccc6abd69304aec334c1ecb3749057605d31404720986b30169ba4ec6042c
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
- case pkg_info["license"]
58
+ license_info = pkg_info["license"] || pkg_info["licenses"]
59
+
60
+ case license_info
59
61
  when String
60
- dependency.add_license(pkg_info["license"], "package.json")
62
+ dependency.add_license(license_info, "package.json")
61
63
  when Hash
62
- dependency.add_license(pkg_info["license"]["type"], "package.json", pkg_info["license"]["url"])
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
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module LicenseScout
19
- VERSION = "2.0.2"
19
+ VERSION = "2.0.3"
20
20
  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.2
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-13 00:00:00.000000000 Z
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,3 +0,0 @@
1
- %{
2
- "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"},
3
- }
@@ -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)}]}}.