spdx 3.0.0 → 3.0.1
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/README.md +15 -5
- data/lib/spdx.rb +0 -2
- data/lib/spdx/version.rb +1 -1
- data/spdx.gemspec +1 -2
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc59812be37956f04cda92f9f96ca4ecd86fcff8af570215464fbdfbef2ed2e7
|
4
|
+
data.tar.gz: 212505c4074311fed3bcd13b2cc89b618c64e3a4525e124152d3ecb234581f41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35ed0504a7b247f40d8cdac9ebe8a3f71af8feb526efe960a1bbb09252006d70d6295e35af83d7e17bdf21116823d18133a7e4c91779408111083ceff5cc80b0
|
7
|
+
data.tar.gz: b2076f1d6bb44ec96899c008487f13da44737a97840ef44bb0c27d8050943df39d47f065d0ea2b6429486eb0b5b546d2d97385c40df57439efa09aca0651f703
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
# [Spdx](http://libraries.io/rubygems/spdx) - A SPDX license
|
2
|
-
|
3
|
-
This gem allows you to find the closest match using [FuzzyMatch](https://github.com/seamusabshere/fuzzy_match) in the [spdx-licenses](https://github.com/domcleal/spdx-licenses) list for similar (not necessarily exact) license names.
|
1
|
+
# [Spdx](http://libraries.io/rubygems/spdx) - A SPDX license parser
|
4
2
|
|
3
|
+
This gem allows you validate and parse spdx expressions. It also contains (relatively) up to date license and license exception lists from https://github.com/spdx/license-list-data/tree/master/json
|
5
4
|
## Installation
|
6
5
|
|
7
6
|
Add this line to your application's Gemfile:
|
@@ -21,14 +20,25 @@ Or install it yourself as:
|
|
21
20
|
## Usage
|
22
21
|
|
23
22
|
```ruby
|
24
|
-
Spdx.
|
23
|
+
Spdx.valid_spdx?("(MIT OR AGPL-3.0+)")
|
24
|
+
=> true
|
25
|
+
```
|
26
|
+
```ruby
|
27
|
+
Spdx.parse_spdx("(MIT OR AGPL-3.0+)")
|
28
|
+
=> CompoundExpression+CompoundExpression0 offset=0, "((MIT OR AGPL-3.0+))" (body):
|
29
|
+
Body offset=1, "(MIT OR AGPL-3.0+)":
|
30
|
+
CompoundExpression+CompoundExpression0 offset=1, "(MIT OR AGPL-3.0+)" (body):
|
31
|
+
Body offset=2, "MIT OR AGPL-3.0+":
|
32
|
+
License+License0 offset=2, "MIT"
|
33
|
+
LogicalOr+Or0 offset=5, " OR " (space1,space2)
|
34
|
+
License+License0 offset=9, "AGPL-3.0+"
|
25
35
|
```
|
26
36
|
|
27
37
|
## Testing
|
28
38
|
|
29
39
|
Run the tests with:
|
30
40
|
|
31
|
-
$ bundle exec
|
41
|
+
$ bundle exec rspec
|
32
42
|
|
33
43
|
## Contributing
|
34
44
|
|
data/lib/spdx.rb
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "spdx/version"
|
4
|
-
require "fuzzy_match"
|
5
4
|
require "spdx_parser"
|
6
5
|
require "json"
|
7
6
|
require_relative "exception"
|
8
7
|
require_relative "license"
|
9
8
|
|
10
|
-
# Fuzzy matcher for licenses to SPDX standard licenses
|
11
9
|
module Spdx
|
12
10
|
def self.names
|
13
11
|
(licenses.keys + licenses.map { |_k, v| v["name"] }).sort
|
data/lib/spdx/version.rb
CHANGED
data/spdx.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.version = Spdx::VERSION
|
10
10
|
spec.authors = ["Tidelift, Inc."]
|
11
11
|
spec.email = ["support@tidelift.com"]
|
12
|
-
spec.summary = "A SPDX license
|
12
|
+
spec.summary = "A SPDX license parser"
|
13
13
|
spec.homepage = "https://github.com/librariesio/spdx"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -18,7 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "fuzzy_match", "~> 2.1"
|
22
21
|
spec.add_dependency "treetop", "~> 1.6"
|
23
22
|
spec.add_development_dependency "bundler"
|
24
23
|
spec.add_development_dependency "pry"
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spdx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tidelift, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: fuzzy_match
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.1'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2.1'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: treetop
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,7 +150,7 @@ requirements: []
|
|
164
150
|
rubygems_version: 3.0.8
|
165
151
|
signing_key:
|
166
152
|
specification_version: 4
|
167
|
-
summary: A SPDX license
|
153
|
+
summary: A SPDX license parser
|
168
154
|
test_files:
|
169
155
|
- spec/spdx_spec.rb
|
170
156
|
- spec/spec_helper.rb
|