jekyll-spdx_licenses 0.3.1 → 0.4.0
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 +9 -2
- data/lib/jekyll/spdx_licenses.rb +1 -3
- data/lib/jekyll/spdx_licenses/spdx_filter.rb +23 -0
- data/lib/jekyll/spdx_licenses/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adc19ad5992f4bbf911b42daf5e92d78bc5bd5d8b4eab31bb599fb448856c376
|
4
|
+
data.tar.gz: 69514878274391a5097782515225537f177085a4271a7169656521397b223086
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e682bf03b18f3889855312706dcb616793504df41093a12f15603a649fcabff0195b4003904d6add1035f0aad1a4975d92c84549cbe9431ac29eaa71685beef5
|
7
|
+
data.tar.gz: 3949765722f6a44089c90fdfec16e38855581d90c9556d039ded56674ffd6138f001ac3353b5a1468c3d01ff0122cc8039c393a6cf3b00ba9a84ae8fbcba018d
|
data/README.md
CHANGED
@@ -25,17 +25,24 @@ Or install it yourself as:
|
|
25
25
|
To convert a SPDX license ID to its full name:
|
26
26
|
|
27
27
|
```
|
28
|
-
{
|
28
|
+
{{ Apache-2.0 | spdx_name }}
|
29
29
|
=> Apache License 2.0
|
30
30
|
```
|
31
31
|
|
32
32
|
To convert the SPDX license ID to a link:
|
33
33
|
|
34
34
|
```
|
35
|
-
{
|
35
|
+
{{ Apache-2.0 | spdx_link_name }}
|
36
36
|
=> <a href="https://spdx.org/licenses/Apache-2.0">Apache License 2.0</a>
|
37
37
|
```
|
38
38
|
|
39
|
+
To convert the SPDX license ID to a link, with just the ID:
|
40
|
+
|
41
|
+
```
|
42
|
+
{{ Apache-2.0 | spdx_link_id }}
|
43
|
+
=> <a href="https://spdx.org/licenses/Apache-2.0">Apache-2.0</a>
|
44
|
+
```
|
45
|
+
|
39
46
|
## Development
|
40
47
|
|
41
48
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/jekyll/spdx_licenses.rb
CHANGED
@@ -10,6 +10,4 @@ module Jekyll
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
Liquid::Template.
|
14
|
-
Liquid::Template.register_tag('spdx_link_id', Jekyll::SpdxLicenses::SpdxLinkIdTag)
|
15
|
-
Liquid::Template.register_tag('spdx_name', Jekyll::SpdxLicenses::SpdxNameTag)
|
13
|
+
Liquid::Template.register_filter(Jekyll::SpdxLicenses::SpdxFilter)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Jekyll
|
2
|
+
module SpdxLicenses
|
3
|
+
class SpdxFilter
|
4
|
+
def spdx_link_id(license_id)
|
5
|
+
license = ::SpdxLicenses.lookup(license_id)
|
6
|
+
raise 'License ID not valid according to SPDX licenses' unless license
|
7
|
+
"<a href=\"https://spdx.org/licenses/#{license.id}.html\">#{license.id}</a>"
|
8
|
+
end
|
9
|
+
|
10
|
+
def spdx_link_name(license_id)
|
11
|
+
license = ::SpdxLicenses.lookup(license_id)
|
12
|
+
raise 'License ID not valid according to SPDX licenses' unless license
|
13
|
+
"<a href=\"https://spdx.org/licenses/#{license.id}.html\">#{license.name}</a>"
|
14
|
+
end
|
15
|
+
|
16
|
+
def spdx_name(license_id)
|
17
|
+
license = ::SpdxLicenses.lookup(license_id)
|
18
|
+
raise 'License ID not valid according to SPDX licenses' unless license
|
19
|
+
license.name
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-spdx_licenses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Tanna
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -99,6 +99,7 @@ files:
|
|
99
99
|
- jekyll-spdx_licenses.gemspec
|
100
100
|
- lib/jekyll-spdx_licenses.rb
|
101
101
|
- lib/jekyll/spdx_licenses.rb
|
102
|
+
- lib/jekyll/spdx_licenses/spdx_filter.rb
|
102
103
|
- lib/jekyll/spdx_licenses/spdx_link_id_tag.rb
|
103
104
|
- lib/jekyll/spdx_licenses/spdx_link_tag.rb
|
104
105
|
- lib/jekyll/spdx_licenses/spdx_name_tag.rb
|