spdx 4.0.0 → 4.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/lib/spdx/version.rb +1 -1
- data/lib/spdx_parser.rb +1 -0
- data/spec/spdx_spec.rb +22 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b14167134c0066ee60871b43ae1c92508f21f923ff46c6bc71a14a556b3ed73
|
4
|
+
data.tar.gz: dcb5aa6f11173a6f88cd036911e1f97211043a8f012984fc8bc0a40311f4886b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4d00a4d70c1e83b0d5c2f3703c7037fa0f28febf7d1990b6a1e685a3237b4127cc2645e093592809c33eaff33940d83a690e14dedb0f3b19f38263de975ecaf
|
7
|
+
data.tar.gz: 0a64315cec604a279b1f8be2f1d646341e9e9a62471cb3e4d9a2bfdf4fe15a307403ecc8fe8a182a67114731a05c333e25e0a424016bae0e920151a9c69b4fc0
|
data/lib/spdx/version.rb
CHANGED
data/lib/spdx_parser.rb
CHANGED
data/spec/spdx_spec.rb
CHANGED
@@ -4,6 +4,28 @@ require "spec_helper"
|
|
4
4
|
|
5
5
|
describe Spdx do
|
6
6
|
context "spdx parsing" do
|
7
|
+
context "parse" do
|
8
|
+
it "handles bad input" do
|
9
|
+
expect { Spdx.parse(nil) }.to raise_error(SpdxGrammar::SpdxParseError)
|
10
|
+
expect { Spdx.parse("") }.to raise_error(SpdxGrammar::SpdxParseError)
|
11
|
+
end
|
12
|
+
it "parses into respective classes" do
|
13
|
+
expect(Spdx.parse("MIT")).to be_an_instance_of(SpdxGrammar::License)
|
14
|
+
expect(Spdx.parse("MIT AND Apache-2.0")).to be_an_instance_of(SpdxGrammar::LogicalAnd)
|
15
|
+
expect(Spdx.parse("(MIT AND Apache-2.0)")).to be_an_instance_of(SpdxGrammar::LogicalAnd)
|
16
|
+
expect(Spdx.parse("MIT OR Apache-2.0")).to be_an_instance_of(SpdxGrammar::LogicalOr)
|
17
|
+
expect(Spdx.parse("MIT AND Apache-2.0").left).to be_an_instance_of(SpdxGrammar::License)
|
18
|
+
expect(Spdx.parse("MIT AND Apache-2.0").right).to be_an_instance_of(SpdxGrammar::License)
|
19
|
+
expect(Spdx.parse("MIT+")).to be_an_instance_of(SpdxGrammar::LicensePlus)
|
20
|
+
expect(Spdx.parse("LicenseRef-MIT-style-1")).to be_an_instance_of(SpdxGrammar::LicenseRef)
|
21
|
+
expect(Spdx.parse("DocumentRef-something-1:LicenseRef-MIT-style-1")).to be_an_instance_of(SpdxGrammar::DocumentRef)
|
22
|
+
expect(Spdx.parse("GPL-2.0-only WITH Classpath-exception-2.0")).to be_an_instance_of(SpdxGrammar::With)
|
23
|
+
expect(Spdx.parse("GPL-2.0-only WITH Classpath-exception-2.0").license).to be_an_instance_of(SpdxGrammar::License)
|
24
|
+
expect(Spdx.parse("GPL-2.0-only WITH Classpath-exception-2.0").exception).to be_an_instance_of(SpdxGrammar::LicenseException)
|
25
|
+
expect(Spdx.parse("NONE")).to be_an_instance_of(SpdxGrammar::None)
|
26
|
+
expect(Spdx.parse("NOASSERTION")).to be_an_instance_of(SpdxGrammar::NoAssertion)
|
27
|
+
end
|
28
|
+
end
|
7
29
|
context "valid?" do
|
8
30
|
it "returns false for invalid spdx" do
|
9
31
|
expect(Spdx.valid?("AND AND")).to be false
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spdx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tidelift, Inc.
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
150
|
+
rubygems_version: 3.0.8
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: A SPDX license parser
|