spandx 0.13.1 → 0.13.2

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: 288989db458fbe8da46cf782ab6d0410dbcfe5f167a4fa258b2fb0bdd819b2c3
4
- data.tar.gz: 3df236283d2d8149bb9c6c9633969540147cd31cc6dfdabb4c26b56d3a6d5b92
3
+ metadata.gz: e89b8200563a7e8d6499790a3cec3673744cb46be6f3eb4a279cb28c311bc9cd
4
+ data.tar.gz: 2f33ec62f37e65a69e77872cef146c988f41bf7b9832ddd97cb7454ae2dd0281
5
5
  SHA512:
6
- metadata.gz: 7c6bb83298a7298814f484236df79234aac9710cf990eb728db53465e1ec82943085a9057bc7d29e8f49ce74e76a6229606f1392bb13835db13ebbbfa18f173d
7
- data.tar.gz: a95189cec4d7b0d5f4a6e8007bb79b805fe5072bf5a502c995140cfa5b495fb774e9e36fc2c6dbc17190ce8641fc9eb4ca1485e8dd033c70fce7960382a5d346
6
+ metadata.gz: dd107af13cc5a9acf8e5f915f01f1be6e687e3322ed3a2bdb499ab03ffed7b287b0424aa1682cd97212fe9206e51ff6a4e4f2773a1ce5d2f434c23a410c8472d
7
+ data.tar.gz: f984aed0d5db9ff517fffb491f9be9794419795186fbc9b9e9287529ecd286e0876f7f97588bc31b264c10d02049e56d125bea565e3579cc4c8ce7ff1eae3858
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- Version 0.13.1
1
+ Version 0.13.2
2
2
 
3
3
  # Changelog
4
4
 
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.13.2] - 2020-05-17
13
+ ### Fixed
14
+ - Detect licenses when provided as an array.
15
+ - Skip empty lockfiles.
16
+
12
17
  ## [0.13.1] - 2020-05-16
13
18
  ### Fixed
14
19
  - Add `ext/**/*.c` and `ext/**/*.h` to list of files.
data/ext/spandx/spandx.c CHANGED
@@ -20,7 +20,7 @@ static VALUE parse(VALUE self, VALUE line)
20
20
 
21
21
  const VALUE items = rb_ary_new2(3);
22
22
  const char *s, *n;
23
- const int len = RSTRING_LEN(line);
23
+ const long len = RSTRING_LEN(line);
24
24
  enum { open, closed } state = closed;
25
25
 
26
26
  for (int i = 0; i < len && *p; i++) {
@@ -42,7 +42,5 @@ module Spandx
42
42
  end
43
43
  end
44
44
  end
45
-
46
- Database = Git
47
45
  end
48
46
  end
@@ -10,7 +10,14 @@ module Spandx
10
10
  end
11
11
 
12
12
  def license_for(raw)
13
- raw.is_a?(Hash) ? from_hash(raw) : from_string(raw)
13
+ case raw
14
+ when Hash
15
+ from_hash(raw)
16
+ when Array
17
+ from_array(raw)
18
+ else
19
+ from_string(raw)
20
+ end
14
21
  end
15
22
 
16
23
  private
@@ -21,6 +28,10 @@ module Spandx
21
28
  unknown(hash[:name] || hash[:url])
22
29
  end
23
30
 
31
+ def from_array(array)
32
+ from_string(array.join(' AND '))
33
+ end
34
+
24
35
  def from_string(raw)
25
36
  return if raw.nil?
26
37
 
@@ -21,6 +21,8 @@ module Spandx
21
21
  include Registerable
22
22
 
23
23
  def for(path)
24
+ return UNKNOWN if !File.exist?(path) || File.size(path).zero?
25
+
24
26
  find { |x| x.matches?(File.basename(path)) } || UNKNOWN
25
27
  end
26
28
  end
@@ -96,7 +96,5 @@ module Spandx
96
96
  Nokogiri::HTML(http.get(url).body)
97
97
  end
98
98
  end
99
-
100
- PyPI = Pypi
101
99
  end
102
100
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spandx
4
- VERSION = '0.13.1'
4
+ VERSION = '0.13.2'
5
5
  end
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.13.1
4
+ version: 0.13.2
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-05-17 00:00:00.000000000 Z
12
+ date: 2020-05-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable