license_scout 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e473b91a8ecd48f0f275b6d5e9ac7093adcafb244ab1237b5b5474f4fce24d8
4
- data.tar.gz: 6a376513496e154780cae375fac9aa6b897117dcd418f847e84225eacdc46b68
3
+ metadata.gz: 02430edc2ee6cbf3fd57c4dd7048b79b96d2beae7819d97aca2cee02c7af47de
4
+ data.tar.gz: 3300b012f31cedfec976bd63668ceca809ef227b8550849770fcf687968ca4df
5
5
  SHA512:
6
- metadata.gz: 9ba5829b5be0cda80d42b58c2f09151ccf592b3006699d49edf790aa2a6d6aea41b696293e60992055c995ad4c1ef97c8804804e50ab30ffe25f17248466ed2b
7
- data.tar.gz: 3dbc221cc0f6c2bd9dbdecd96c1c539c0188e43d8bf55ce791a5854bc9766b6d8a1b0feb324bdaa91e8d19521ae3a3d85b94a02fc9acc0701034e4c7363b9dd0
6
+ metadata.gz: 0555665a7c23cef578a0ba945f3eb41d2cef091355b6245cbde76da1735970cdc718d68a95b1e018304b39d0dee9f54039b2c1f282fa68522781a9befc596dde
7
+ data.tar.gz: d623ac0b7b744c1f014cbadf1d432c694acfff968e02149e037f684a52491c116dbff70070af7e7f24d70bebcd7a009ea21f0b64bfdd3e1f11fa8fae17bd7e42
@@ -17,6 +17,17 @@
17
17
 
18
18
  require "licensee"
19
19
  require "license_scout/dependency"
20
+ require "license_scout/exceptions"
21
+
22
+ require "bundler"
23
+ require "ffi_yajl"
24
+ require "net/http"
25
+ require "mixlib/shellout"
26
+ require "pathname"
27
+ require "psych"
28
+ require "set"
29
+ require "toml-rb"
30
+ require "yaml"
20
31
 
21
32
  module LicenseScout
22
33
  # The DependencyManager module (or more accurately, implementations of it) are responsible for recognizing
@@ -17,11 +17,6 @@
17
17
 
18
18
  require "license_scout/dependency_manager/base"
19
19
 
20
- require "bundler"
21
- require "mixlib/shellout"
22
- require "ffi_yajl"
23
- require "pathname"
24
-
25
20
  module LicenseScout
26
21
  module DependencyManager
27
22
  class Bundler < Base
@@ -17,10 +17,6 @@
17
17
 
18
18
  require "license_scout/dependency_manager/base"
19
19
 
20
- require "ffi_yajl"
21
- require "psych"
22
- require "mixlib/shellout"
23
-
24
20
  module LicenseScout
25
21
  module DependencyManager
26
22
  class Cpanm < Base
@@ -15,9 +15,6 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "ffi_yajl"
19
- require "yaml"
20
- require "toml-rb"
21
18
  require "license_scout/dependency_manager/base"
22
19
 
23
20
  module LicenseScout
@@ -15,7 +15,6 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "psych"
19
18
  require "license_scout/dependency_manager/base"
20
19
 
21
20
  module LicenseScout
@@ -15,7 +15,6 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "ffi_yajl"
19
18
  require "license_scout/dependency_manager/base"
20
19
 
21
20
  module LicenseScout
@@ -16,10 +16,6 @@
16
16
  #
17
17
 
18
18
  require "license_scout/dependency_manager/base"
19
- require "license_scout/exceptions"
20
-
21
- require "net/http"
22
- require "mixlib/shellout"
23
19
 
24
20
  module LicenseScout
25
21
  module DependencyManager
@@ -16,10 +16,6 @@
16
16
  #
17
17
 
18
18
  require "license_scout/dependency_manager/base"
19
- require "license_scout/exceptions"
20
-
21
- require "mixlib/shellout"
22
- require "ffi_yajl"
23
19
 
24
20
  module LicenseScout
25
21
  module DependencyManager
@@ -95,10 +91,19 @@ module LicenseScout
95
91
  end
96
92
 
97
93
  def hex_info(package_name)
98
- FFI_Yajl::Parser.parse(open("https://hex.pm/api/packages/#{package_name}").read)
99
- rescue OpenURI::HTTPError
100
- LicenseScout::Log.debug("[elixir] Unable to download hex.pm info for #{package_name}")
101
- {}
94
+ response = Net::HTTP.get_response(URI("https://hex.pm/api/packages/#{package_name}"))
95
+
96
+ if response.is_a?(Net::HTTPSuccess)
97
+ FFI_Yajl::Parser.parse(response.body)
98
+ else
99
+ case response.code
100
+ when "404"
101
+ LicenseScout::Log.debug("[elixir] Unable to download hex.pm info for #{package_name}")
102
+ {}
103
+ else
104
+ raise LicenseScout::Exceptions::UpstreamFetchError.new("Received \"#{response.code} #{response.msg}\" when attempting to fetch package information for the #{package_name} Hex package")
105
+ end
106
+ end
102
107
  end
103
108
  end
104
109
  end
@@ -15,8 +15,6 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "set"
19
- require "ffi_yajl"
20
18
  require "license_scout/dependency_manager/base"
21
19
 
22
20
  module LicenseScout
@@ -16,10 +16,6 @@
16
16
  #
17
17
 
18
18
  require "license_scout/dependency_manager/base"
19
- require "license_scout/exceptions"
20
-
21
- require "mixlib/shellout"
22
- require "ffi_yajl"
23
19
 
24
20
  module LicenseScout
25
21
  module DependencyManager
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module LicenseScout
19
- VERSION = "2.1.2"
19
+ VERSION = "2.1.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.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serdar Sutay