licenserec 1.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: cf10778baa2d790da8589208710ca311c45c3f1bddedb25eba71d04763378982
4
+ data.tar.gz: 78bc30cb7ba9ece5e745ec352c20d7e371d193b46dce040a53d081c53d691b10
5
+ SHA512:
6
+ metadata.gz: 8474896f69db3fedb7c32f3b0ac407d4c4dabe4caf284d89dc855f193f9bfc40794dbcdd2131b2d17fbec989784256e3506f74c6ee86abccc79f3ef869364cb0
7
+ data.tar.gz: eb56fbc4c8d1bb273a339148eba03a1f949faa8f3d0fc043f647ea958899bd3b19038b9bbb211ce20b4e4ff641ead41a9d23709dbd521226b79e4bd6c834493c
data/.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
@@ -0,0 +1,50 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$">
8
+ <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
+ <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
+ </content>
12
+ <orderEntry type="inheritedJdk" />
13
+ <orderEntry type="sourceFolder" forTests="false" />
14
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.3.17, ruby-2.4.5-p335) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="childprocess (v4.1.0, ruby-2.4.5-p335) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, ruby-2.4.5-p335) [gem]" level="application" />
17
+ </component>
18
+ <component name="RakeTasksCache">
19
+ <option name="myRootTask">
20
+ <RakeTaskImpl id="rake">
21
+ <subtasks>
22
+ <RakeTaskImpl description="Build licenserec-0.1.0.gem into the pkg directory" fullCommand="build" id="build" />
23
+ <RakeTaskImpl id="build">
24
+ <subtasks>
25
+ <RakeTaskImpl description="Generate SHA512 checksum if licenserec-0.1.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
26
+ </subtasks>
27
+ </RakeTaskImpl>
28
+ <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
29
+ <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
30
+ <RakeTaskImpl description="Build and install licenserec-0.1.0.gem into system gems" fullCommand="install" id="install" />
31
+ <RakeTaskImpl id="install">
32
+ <subtasks>
33
+ <RakeTaskImpl description="Build and install licenserec-0.1.0.gem into system gems without network access" fullCommand="install:local" id="local" />
34
+ </subtasks>
35
+ </RakeTaskImpl>
36
+ <RakeTaskImpl description="Create tag v0.1.0 and build and push licenserec-0.1.0.gem to TODO: Set to your gem server 'https://example.com'" fullCommand="release[remote]" id="release[remote]" />
37
+ <RakeTaskImpl description="" fullCommand="default" id="default" />
38
+ <RakeTaskImpl description="" fullCommand="release" id="release" />
39
+ <RakeTaskImpl id="release">
40
+ <subtasks>
41
+ <RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
42
+ <RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
43
+ <RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
44
+ </subtasks>
45
+ </RakeTaskImpl>
46
+ </subtasks>
47
+ </RakeTaskImpl>
48
+ </option>
49
+ </component>
50
+ </module>
data/.idea/misc.xml ADDED
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="ruby-2.4.5-p335" project-jdk-type="RUBY_SDK" />
4
+ </project>
data/.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/licenserec.iml" filepath="$PROJECT_DIR$/.idea/licenserec.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in licenserec.rb.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "childprocess", "~> 4.1"
data/Gemfile.lock ADDED
@@ -0,0 +1,21 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ licenserec (1.0.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ childprocess (4.1.0)
10
+ rake (13.0.6)
11
+
12
+ PLATFORMS
13
+ x64-mingw32
14
+
15
+ DEPENDENCIES
16
+ childprocess (~> 4.1)
17
+ licenserec!
18
+ rake (~> 13.0)
19
+
20
+ BUNDLED WITH
21
+ 2.3.17
data/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # Licenserec
2
+
3
+ Licenserec是一个用于开源许可证选择的ruby库,提供许可证兼容性查询、许可证兼容性检查、项目兼容许可证筛选、许可证条款特征查询、许可证条款特征对比、许可证类型选择观点、许可证关键条款解读等功能。
4
+
5
+ NOTE: 本工具基于osslab-pku提供的开源许可证知识库,其提供的信息不代表律师的法律建议,若有需要请咨询专业律师。
6
+
7
+ ## Installation
8
+
9
+ Install the gem and add to the application's Gemfile by executing:
10
+
11
+ $ bundle add licenserec
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ $ gem install licenserec
16
+
17
+ ## Usage
18
+ ### 运行环境
19
+ Ruby2.4.5
20
+ Perl5
21
+ 第三方工具Ninka部署:
22
+ 下载许可证识别工具Ninka(https://github.com/osslab-pku/OSSLSelection/tree/main/OSSLSelection/ninka-tool/)并解压,将ninka-master\lib中的文件复制到C:\Strawberry\perl\lib,将ninka-master\bin中的文件复制到C:\Strawberry\perl\bin,ninka-master\comments文件夹复制到制到C:\Strawberry\perl\,cd到comments\,执行nmake;
23
+ 测试:cd到perl\bin\,执行perl ninka [filename],查看是否filename的许可信息。
24
+
25
+ ### 开源许可证范围
26
+ 本工具的知识库支持63种常见开源许可证,使用SPDX短标识符表示:0BSD, AAL, AFL-3.0, AGPL-3.0, AGPL-3.0+, Apache-2.0, Artistic-2.0, BSD-1-Clause, BSD-2-Clause, BSD-2-Clause-Patent, BSD-3-Clause, BSD-3-Clause-Clear, BSD-4-Clause, BSL-1.0, CC0-1.0, CC-BY-4.0, CC-BY-SA-4.0, CDDL-1.0, CECILL-2.1, ClArtistic, CPAL-1.0, ECL-2.0, EFL-2.0, EPL-1.0, EPL-2.0, EUPL-1.1, EUPL-1.2, Fair, FSFAP, GPL-2.0, GPL-2.0+, GPL-3.0, GPL-3.0+, Imlib2, ISC, LGPL-2.1, LGPL-2.1+, LGPL-3.0, LGPL-3.0+, LiLiQ-P-1.1, LiLiQ-R-1.1, LiLiQ-Rplus-1.1, MirOS, MIT, MIT-0, MPL-2.0, MS-PL, MS-RL, MulanPSL-2.0, MulanPubL-2.0, NCSA, NOSL, NPOSL-3.0, NTP, OGTSL, OSL-3.0, RPL-1.5, Ruby, SimPL-2.0, UPL-1.0, Unlicense, WTFPL, Zlib
27
+
28
+ 其中广泛流行的许可证有20种:MIT, Apache-2.0, GPL-3.0, BSD-3-Clause, GPL-2.0, AGPL-3.0, MPL-2.0, LGPL-3.0, BSD-2-Clause, Unlicense, ISC, EPL-1.0, CC0-1.0, LGPL-2.1, WTFPL, Zlib, EPL-2.0, Artistic-2.0, MulanPSL-2.0, MulanPubL-2.0。
29
+
30
+ ### 开源许可证兼容性知识库
31
+ 开源许可证兼容性是指将不同开源许可证下的作品(无论是否经过修改)进行组合(包括但不限于通过接口文件等方式进行链接)后合法地形成衍生作品,并合法地进行再分发的可行性。需要注意的是,通常说的许可证兼容是有方向的,许可证A授权的作品与许可证B授权的作品组合后,所产生的衍生作品可以使用许可证B进行分发,则认为A可以兼容B——但反之不一定成立。
32
+
33
+ 当组合不同开源许可证授权的作品或变更某一开源项目许可证时,需要对开源许可证的兼容性进行判定:任何集成或衍生项目的许可证满足所复用的开源组件许可证或原项目许可证的要求。
34
+ 常见的兼容性场景有:
35
+ - 一是次级兼容,开源许可证A授权的作品(无论是否经过修改)与开源许可证B授权的作品组合,所产生的衍生作品整体可合法地使用开源许可证B重新授权时,则认为开源许可证A次级兼容开源许可证B。本知识库中使用‘1’表示次级兼容。
36
+ - 二是组合兼容,开源许可证A授权的作品(无论是否经过修改)可以与开源许可证B授权的作品可以合法地组合而不违反任一开源许可证时,可以认为开源许可证A组合兼容开源许可证B。本知识库中使用‘2’表示组合兼容。
37
+ - 不满足次级兼容或组合兼容的条件时,则为不兼容。
38
+
39
+ ### 开源许可证条款要素知识库
40
+ 开源许可证的条款特征包括19个要素维度,具体要素名称及含义如下:
41
+ - 基本信息(info),是指许可证名称及版本号、发布日期、许可证版权声明及许可证原文链接地址等信息。‘1’表示明确包含该条款,‘0’表示未提及。
42
+ - 序言(preamble),对许可证的适用场景或适用条件、条款接受说明、以及目的宗旨等进行说明,如GPL序言。‘1’表示明确包含该条款,‘0’表示未提及。
43
+ - 定义(define),对许可证条款中的特定术语进行说明,便于用户理解许可证内容。‘1’表示明确包含该条款,‘0’表示未提及。
44
+ - 版权许可(copyright),对许可证授予的版权范围进行说明。‘-1’表示放弃版权投入公共领域,‘1’表示明确授予版权,‘0’表示模糊授予版权。。
45
+ - 专利许可(patent),对许可证授予的专利权范围进行说明。‘-1’表示不授予专利权,‘1’表示明确授予专利权,‘0’表示未提及。
46
+ - 商标权说明(trademark),对许可证不授予商标权进行说明。‘1’表示明确不授予商标权,‘0’表示未提及。
47
+ - 分发限制性(copyleft),一种授权条件,即衍生作品分发的再授权方式,其中“无限制”表示衍生作品可以使用其他许可证授权分发;“文件级弱限制”表示衍生作品可以使用其他许可证授权分发,只要确保衍生作品中该文件级弱限制许可证授权的文件及其修改仍然遵循该许可证,如MPL-2.0;“库级弱限制”表示衍生作品可以使用其他许可证授权分发,只要确保衍生作品中该库级弱限制许可证授权的库及其修改仍然遵循该许可证,如LGPL-2.1;“强限制”表示衍生作品的整体及其部分都必须按照该许可证授权分发。‘0’表示无限制,‘1’表示文件级弱限制,‘2’表示库级弱限制,‘3’表示强限制。
48
+ - 网络部署(interaction),一种授权条件,是指使用原创作品或衍生作品,通过网络向用户提供服务等行为,须按照该许可证公开源码的要求。‘1’表示明确包含该条款,‘0’表示未提及。
49
+ - 修改声明(modification),一种授权条件,是指分发衍生作品,须添加修改声明(如修改者、修改时间、修改内容等)的要求。‘1’表示明确包含该条款,‘0’表示未提及。
50
+ - 保留归属(retain_attr),一种授权条件,是指原创作品或衍生作品的分发,须保留原归属信息(如版权声明等)的要求。‘1’表示明确包含该条款,‘0’表示未提及。
51
+ - 增强归属(enhance_attr),一种授权条件,是指原创作品或衍生作品的分发,除了要求保留归属外,还须以某种特定的形式声明软件的版权信息和作者的要求。‘1’表示明确包含该条款,‘0’表示未提及。
52
+ - 明确接受许可(acceptance),一种授权条件,是指原创作品或衍生作品的分发,必须做出合理的努力,以获得接收人对该许可证条款的明确同意的要求。‘1’表示明确包含该条款,‘0’表示未提及。
53
+ - 专利诉讼终止(patent_term),是指禁止任何人对该许可证授权的作品发起专利诉讼(否则终止其在该作品或该许可证下的专利授权)的要求。‘1’表示明确包含该条款,‘0’表示未提及。
54
+ - 违约终止(vio_term),是指许可证中可能包含的因违约而终止授权的条件或补救条件。‘1’表示明确包含该条款,‘0’表示未提及。
55
+ - 免责声明(disclaimer),对不提供担保进行澄清声明。‘1’表示明确包含该条款,‘0’表示未提及。
56
+ - 准据法(law),对许可证对应的准据法进行说明,用于处理许可证的解释和争议问题。‘1’表示明确包含该条款,‘0’表示未提及。
57
+ - 使用说明(instruction),提供许可证应用模板及明确模板放置位置。‘1’表示包含使用说明,‘0’表示未提及。
58
+ - 兼容版本(compatible_version),是对于后续可能发布的更多版本的兼容性进行说明,以便用户可以在后续版本下分发许可作品和衍生作品。逗号分隔的许可证SPDX字符串。
59
+ - 兼容次级许可证(secondary_license),是对于现有的其他开源许可证的兼容性进行说明,以便用户可以在次级许可证下分发许可作品和衍生作品。逗号分隔的许可证SPDX字符串。
60
+ - gpl组合兼容(gpl_combine):是GPL类许可证中关于能否与其他GPL许可证组合的说明。逗号分隔的许可证SPDX字符串。
61
+
62
+ ### 方法&描述
63
+
64
+
65
+ | 序号 | 类 | 方法 | 描述 |
66
+ | ------ | ------ | ------ | ------ |
67
+ | 1 | CompatibilityFilter | ninka_process(filepath,ninka_path) | 第三方工具Ninka识别文件许可证,一个文件可能包含多个许可证。输入1为文件的路径(String),输入2为ninka.pl的路径(String);输出为许可证列表(Array)。 |
68
+ | 2 | | license_detection(repo_path,ninka_path) | 识别项目所包含的许可证,输入1为项目路径(String),输入2为ninka.pl的路径(String);输出1为文件路径及对应许可证信息的哈希表(Hash),输出2为项目包含的许可证集合(Set)。 |
69
+ | 3 | | compatibility_lookup(licenseA,licenseB) | 兼容性查询,输入1为许可证A(String),通常指项目中第三方组件的许可证,输入2为许可证B(String),通常指项目许可证;输出为(String),其中"0"(不兼容)、"1"(次级兼容)、"2"(组合兼容)、"1,2"(次级兼容或组合兼容)。 |
70
+ | 4 | | compatibility_filter(repo_path,ninka_path,recommand_scale) | 兼容许可证筛选,输入1为项目路径(String),输入2为ninka.pl的路径(String),输入3为许可证推荐范围(String),其中“popular”包含MIT等20种常见开源许可证,“all”包含本知识库支持的6种开源许可证;输出1为仅满足次级兼容的许可证列表(Array),输出2为仅满足组合兼容的许可证列表(Array),输出3为既满足次级兼容又满足组合兼容的许可证列表(Array)。 |
71
+ | 5 | CompatibilityCheck | compatibilitycheck(repo_path,ninka_path) | 兼容性检查,输入1为项目路径(String),输入2为ninka.pl路径(String);输出为“OK”(String),或项目种包含互不兼容许可证的提示信息的集合(Set)和对应文件路径的列表(Array)。 |
72
+ | 6 | Termschoice | important_terms_instruction() | 开源许可证关键条款及说明。 |
73
+ | 7 | | license_term_lookup(one_license,one_term) | 查询某个开源许可证的某个条款要素的值。输入1为许可证的SPDX(String),输入2为条款要素名称(String);输出为要素值(String),其中--。 |
74
+ | 8 | | license_term_choice(one_term,recommended_licenses,term_option) | 根据条款要素值,从推荐许可证列表中,筛选符合要求的许可证,输出更新的推荐许可证列表。输入1为条款要素名称(String),输入2为推荐许可证列表(Array),输入3为条款要素值(String);输出为recommand_license中符合该要素条件的许可证列表(Array)。 |
75
+ | 9 | LicensetypeGuide | os_style_guide() | 个人开源风格方面,选择开源许可证类型的观点(Hash)。 |
76
+ | 10 | | os_business_guide() | 开源商业模式方面,选择开源许可证类型的观点(Hash)。 |
77
+ | 11 | | os_community_guide() | 项目社区发展方面,选择开源许可证类型的观点(Hash)。 |
78
+ | 12 | | business_model_feature() | 常见的开源商业模式及特点(Hash)。 |
79
+ | 13 | TermsCompare | licenses_term_compare(licenses_list) | 输入为许可证列表,输出列表中的许可证的条款要素值(Hash),key为许可证SPDX(String),value为要素值列表(Array)。 |
80
+ | 14 | LicenseSort | csv_to_hash(csv_table,header=true,i=0,j=1) | 将csv转为哈希值。输入1为csv表,输入2为是否包含首行(默认包含),输入3为列数i(转为hash的key),输入4为列数j(转为hash的value);输出为哈希表。 |
81
+ | 15 | | sortvalue_lookup(one_license,sort_hash) | 从排序哈希表中查询排序值。输入1为许可证SPDX,输入2为参照排序哈希表;输出为该许可证的排序值。 |
82
+ | 16 | | license_sort(license_list,desc=true,sort_hash=LicenseSort.csv_to_hash("lib\\license_readability.csv",header=true,i=0,j=4)) | 对指定许可证列表进行排序。输入1为指定的许可证列表,输入2为升降序(默认降序),输入3为参照排序哈希表(key为许可证SPDX,value为参照值,默认按文本复杂度);输出排序后的许可证列表。 |
83
+
84
+
85
+
86
+ ## Contributing
87
+
88
+ Bug reports and pull requests are welcome on GitHub at https://github.com/osslab-pku/licenserec.
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ task default: %i[]
data/bin/licenserec.rb ADDED
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'licenserec'
4
+ require 'licensecompatibility'
5
+ require 'licensesort'
6
+ require 'licensecompare'
7
+ require 'licensetypeguide'
8
+ require 'licensetermchoice'
9
+ require 'set'
10
+
11
+ puts "这是一个简单的 Ruby 库"
12
+
13
+ # # licensecompatibility测试
14
+ # hh = Licenserec::CompatibilityFilter.compatibility_meaning()
15
+ # hh.each { |kk,vv| puts kk+'---'+vv }
16
+ # l1,l2 = Licenserec::CompatibilityFilter.license_detection("E:\\OSSLSelection\\OSSLSelection\\test\\license-test\\license_test","C:\\Strawberry\\perl\\bin\\ninka.pl")
17
+ # puts l1
18
+ # l2.each do |ii|
19
+ # puts ii
20
+ # end
21
+ # puts Licenserec::CompatibilityFilter.compatibility_lookup('Apache-2.0','GPL-3.0')
22
+ # l1,l2,l3,_ = Licenserec::CompatibilityFilter.compatibility_filter("E:\\OSSLSelection\\OSSLSelection\\test\\license-master1","C:\\Strawberry\\perl\\bin\\ninka.pl","popular")
23
+ # puts "---------"
24
+ # puts l1.empty?
25
+ # puts l1
26
+ # puts l2.empty?
27
+ # puts l2
28
+ # puts l3.empty?
29
+ # puts l3
30
+ # puts Licenserec::CompatibilityCheck.compatibilitycheck("E:\\OSSLSelection\\OSSLSelection\\test\\license-test\\license_test","C:\\Strawberry\\perl\\bin\\ninka.pl")
31
+
32
+ # # licensetyoeguide测试
33
+ # hh = Licenserec::LicensetypeGuide.business_model_feature()
34
+ # hh.each { |kk,vv| puts kk + '----' + vv }
35
+
36
+
37
+ # # licensetermchoice测试
38
+ # hash_meaning = Licenserec::TermsChoice.important_terms_instruction()
39
+ # hash_meaning.each { |kk,vv| puts kk + "----" + vv }
40
+ # puts Licenserec::TermsChoice.license_term_lookup("GPL-3.0","copyleft")
41
+ # ll = Licenserec::TermsChoice.license_term_choice("patent",['MIT','GPL-2.0'],1)
42
+ # ll.each { |l| puts l }
43
+ # puts ll.empty?
44
+
45
+ # # licensecompare测试
46
+ # hh = Licenserec::TermsCompare.licenses_term_compare(['MIT','Apache-2.0','MulanPSL-2.0','GPL-2.0','GPL-3.0'])
47
+ # hh.each { |kk,vv|
48
+ # puts kk
49
+ # puts vv[18].class
50
+ # }
51
+ # puts hh
52
+
53
+ # # licensesort测试
54
+ # sort_hash = Licenserec::LicenseSort.csv_to_hash("lib\\license_readability.csv",header=true,0,4)
55
+ # puts Licenserec::LicenseSort.sortvalue_lookup("GPL-2.0",sort_hash)
56
+ # puts Licenserec::LicenseSort.license_sort(["MIT","GPL-2.0","Apache-2.0"],desc=false, sort_hash)
data/exe/licenserec.rb ADDED
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'licenserec'
4
+ require 'licensecompatibility'
5
+ require 'licensesort'
6
+ require 'licensecompare'
7
+ require 'licensetypeguide'
8
+ require 'licensetermchoice'
9
+ require 'set'
10
+
11
+ puts "这是一个简单的 Ruby 库"
12
+
13
+ # # licensecompatibility测试
14
+ # hh = Licenserec::CompatibilityFilter.compatibility_meaning()
15
+ # hh.each { |kk,vv| puts kk+'---'+vv }
16
+ # l1,l2 = Licenserec::CompatibilityFilter.license_detection("E:\\OSSLSelection\\OSSLSelection\\test\\license-test\\license_test","C:\\Strawberry\\perl\\bin\\ninka.pl")
17
+ # puts l1
18
+ # l2.each do |ii|
19
+ # puts ii
20
+ # end
21
+ # puts Licenserec::CompatibilityFilter.compatibility_lookup('Apache-2.0','GPL-3.0')
22
+ # l1,l2,l3,_ = Licenserec::CompatibilityFilter.compatibility_filter("E:\\OSSLSelection\\OSSLSelection\\test\\license-master1","C:\\Strawberry\\perl\\bin\\ninka.pl","popular")
23
+ # puts "---------"
24
+ # puts l1.empty?
25
+ # puts l1
26
+ # puts l2.empty?
27
+ # puts l2
28
+ # puts l3.empty?
29
+ # puts l3
30
+ # puts Licenserec::CompatibilityCheck.compatibilitycheck("E:\\OSSLSelection\\OSSLSelection\\test\\license-test\\license_test","C:\\Strawberry\\perl\\bin\\ninka.pl")
31
+
32
+ # # licensetyoeguide测试
33
+ # hh = Licenserec::LicensetypeGuide.business_model_feature()
34
+ # hh.each { |kk,vv| puts kk + '----' + vv }
35
+
36
+
37
+ # # licensetermchoice测试
38
+ # hash_meaning = Licenserec::TermsChoice.important_terms_instruction()
39
+ # hash_meaning.each { |kk,vv| puts kk + "----" + vv }
40
+ # puts Licenserec::TermsChoice.license_term_lookup("GPL-3.0","copyleft")
41
+ # ll = Licenserec::TermsChoice.license_term_choice("patent",['MIT','GPL-2.0'],1)
42
+ # ll.each { |l| puts l }
43
+ # puts ll.empty?
44
+
45
+ # # licensecompare测试
46
+ # hh = Licenserec::TermsCompare.licenses_term_compare(['MIT','Apache-2.0','MulanPSL-2.0','GPL-2.0','GPL-3.0'])
47
+ # hh.each { |kk,vv|
48
+ # puts kk
49
+ # puts vv[18].class
50
+ # }
51
+ # puts hh
52
+
53
+ # # licensesort测试
54
+ # sort_hash = Licenserec::LicenseSort.csv_to_hash("lib\\license_readability.csv",header=true,0,4)
55
+ # puts Licenserec::LicenseSort.sortvalue_lookup("GPL-2.0",sort_hash)
56
+ # puts Licenserec::LicenseSort.license_sort(["MIT","GPL-2.0","Apache-2.0"],desc=false, sort_hash)
@@ -0,0 +1,64 @@
1
+ license,CC0-1.0,Unlicense,WTFPL,0BSD,MIT-0,Fair,MIT,ISC,FSFAP,Imlib2,BSD-1-Clause,BSD-2-Clause,BSD-2-Clause-Patent,BSD-3-Clause,BSD-3-Clause-Clear,NCSA,BSL-1.0,NTP,Ruby,UPL-1.0,EFL-2.0,MirOS,CC-BY-4.0,ClArtistic,Zlib,LiLiQ-P-1.1,MulanPSL-2.0,Apache-2.0,Artistic-2.0,ECL-2.0,AFL-3.0,BSD-4-Clause,AAL,CDDL-1.0,CPAL-1.0,EPL-2.0,LiLiQ-R-1.1,MPL-2.0,MS-RL,NOSL,OGTSL,MS-PL,CC-BY-SA-4.0,CECILL-2.1,EPL-1.0,EUPL-1.1,EUPL-1.2,LGPL-2.1+,LGPL-2.1,LGPL-3.0+,LGPL-3.0,GPL-2.0+,GPL-2.0,GPL-3.0+,GPL-3.0,AGPL-3.0+,AGPL-3.0,SimPL-2.0,LiLiQ-Rplus-1.1,RPL-1.5,NPOSL-3.0,MulanPubL-2.0,OSL-3.0
2
+ CC0-1.0,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3
+ Unlicense,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
4
+ WTFPL,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
5
+ 0BSD,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
6
+ MIT-0,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
7
+ Fair,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
8
+ MIT,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
9
+ ISC,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
10
+ FSFAP,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
11
+ Imlib2,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
12
+ BSD-1-Clause,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
13
+ BSD-2-Clause,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
14
+ BSD-2-Clause-Patent,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
15
+ BSD-3-Clause,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
16
+ BSD-3-Clause-Clear,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
17
+ NCSA,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
18
+ BSL-1.0,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
19
+ NTP,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
20
+ Ruby,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
21
+ UPL-1.0,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
22
+ EFL-2.0,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
23
+ MirOS,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2","1,2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
24
+ CC-BY-4.0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,"1,2","1,2","1,2","1,2",2,"1,2","1,2","1,2","1,2",2,2,"1,2","1,2",2,"1,2",2,2,"1,2",1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1
25
+ ClArtistic,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,"1,2","1,2","1,2","1,2",2,"1,2","1,2","1,2","1,2",2,2,"1,2","1,2",2,"1,2",2,2,"1,2",1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1
26
+ Zlib,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,"1,2","1,2","1,2","1,2",2,"1,2","1,2","1,2","1,2",2,2,"1,2","1,2",2,"1,2",2,2,"1,2",1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1
27
+ LiLiQ-P-1.1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,"1,2","1,2","1,2","1,2",2,"1,2","1,2","1,2","1,2",2,2,"1,2","1,2",2,"1,2",2,2,"1,2",1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1
28
+ MulanPSL-2.0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,"1,2","1,2","1,2","1,2","1,2",2,2,"1,2","1,2","1,2",2,"1,2","1,2","1,2",0,1,0,0,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,1
29
+ Apache-2.0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,"1,2","1,2","1,2","1,2",2,2,"1,2","1,2",2,2,2,2,"1,2",0,0,0,0,1,0,0,0,0,1,1,0,0,1,1,1,1,0,0,1,1,0,1
30
+ Artistic-2.0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2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PL-2.0,1027
10
+ LGPL-3.0,912
11
+ BSD-2-Clause,884
12
+ Unlicense,777
13
+ ISC,623
14
+ EPL-1.0,421
15
+ CC0-1.0,376
16
+ LGPL-2.1,310
17
+ WTFPL,184
18
+ CC-BY-SA-4.0,168
19
+ Zlib,139
20
+ EPL-2.0,138
21
+ OFL-1.1,111
22
+ CC-BY-4.0,109
23
+ BSL-1.0,63
24
+ Artistic-2.0,43
25
+ LPPL-1.3c,41
26
+ 0BSD,36
27
+ MS-PL,31
28
+ OSL-3.0,25
29
+ BSD-3-Clause-Clear,19
30
+ PostgreSQL,16
31
+ EUPL-1.2,14
32
+ MIT-0,10
33
+ ODbL-1.0,9
34
+ UPL-1.0,8
35
+ AFL-3.0,7
36
+ BSD-4-Clause,7
37
+ EUPL-1.1,3
38
+ NCSA,3
39
+ ECL-2.0,1
40
+ MS-RL,1
@@ -0,0 +1,65 @@
1
+ license,FOG,ARI,CLI,mean
2
+ FSFAP,20.66,21.9,14.69,19.08333333
3
+ Fair,22.57,23.6,14.46,20.21
4
+ WTFPL,34.13,38.5,11.8,28.14333333
5
+ 0BSD,47.66,56.9,13.48,39.34666667
6
+ NTP,46.4,57.6,17.89,40.63
7
+ ISC,50.88,61.7,13.83,42.13666667
8
+ Zlib,59.63,72.8,13.25,48.56
9
+ EFL-2.0,61.22,74.9,14.53,50.21666667
10
+ MirOS,63.28,74.4,13.19,50.29
11
+ MIT-0,62.88,75.9,13.66,50.81333333
12
+ BSD-1-Clause,70.84,86.7,15.28,57.60666667
13
+ MIT,74.06,90.6,14.06,59.57333333
14
+ Unlicense,83.88,101.4,12.79,66.02333333
15
+ BSD-2-Clause,82.43,101.6,15.8,66.61
16
+ BSL-1.0,88.57,108.9,14.24,70.57
17
+ BSD-3-Clause,94.4,116.7,15.75,75.61666667
18
+ BSD-4-Clause,102.04,126.1,16.22,81.45333333
19
+ BSD-3-Clause-Clear,103.98,129.1,16.16,83.08
20
+ NCSA,104.96,130.7,16.16,83.94
21
+ UPL-1.0,122.36,150.3,13.32,95.32666667
22
+ Imlib2,131.47,162.2,14.19,102.62
23
+ Ruby,137.04,170,13.95,106.9966667
24
+ AAL,154.11,191.3,16.1,120.5033333
25
+ BSD-2-Clause-Patent,154.8,193.7,16.85,121.7833333
26
+ MS-PL,164.57,206.5,14.65,128.5733333
27
+ SimPL-2.0,175.07,216.6,11.23,134.3
28
+ MS-RL,191.29,239.6,14.24,148.3766667
29
+ MulanPSL-2.0,307.08,384.2,15.29,235.5233333
30
+ OGTSL,336.24,418.7,14.36,256.4333333
31
+ LiLiQ-P-1.1,399.66,499.8,14.36,304.6066667
32
+ ClArtistic,411.42,513.6,13.66,312.8933333
33
+ CC0-1.0,431.13,537.4,14.82,327.7833333
34
+ LGPL-3.0,496.1,619,12.27,375.79
35
+ LiLiQ-Rplus-1.1,505.81,632.7,14.19,384.2333333
36
+ LiLiQ-R-1.1,524.94,656.8,14.24,398.66
37
+ MulanPubL-2.0,538.65,674.5,15.87,409.6733333
38
+ Artistic-2.0,550.32,688.3,14.24,417.62
39
+ Apache-2.0,635.75,794.5,14.94,481.73
40
+ OSL-3.0,657.99,821.4,13.84,497.7433333
41
+ AFL-3.0,658.42,822,13.84,498.0866667
42
+ UCL-1.0,670.75,837.6,14.01,507.4533333
43
+ EPL-1.0,681.58,853.1,15.98,516.8866667
44
+ ECL-2.0,684.44,855.6,15.11,518.3833333
45
+ NPOSL-3.0,747.31,933.6,13.9,564.9366667
46
+ EUPL-1.1,845.61,1056.2,13.66,638.49
47
+ EPL-2.0,854.3,1068.9,15.58,646.26
48
+ EUPL-1.2,898.05,1121.2,13.03,677.4266667
49
+ MPL-2.0,940.42,1175.7,13.95,710.0233333
50
+ CAL-1.0,1010.84,1263.5,14.19,762.8433333
51
+ CDDL-1.0,1018.2,1273.7,14.53,768.81
52
+ CC-BY-4.0,1031.77,1290.5,15.11,779.1266667
53
+ CC-BY-SA-4.0,1109.21,1387.6,15.17,837.3266667
54
+ GPL-2.0,1187.78,1483.4,12.16,894.4466667
55
+ CECILL-2.0,1328.61,1660.4,13.95,1000.986667
56
+ CECILL-B,1329.58,1661.7,14.3,1001.86
57
+ CECILL-C,1363.42,1704.1,14.19,1027.236667
58
+ CECILL-2.1,1372.19,1715,14.01,1033.733333
59
+ NOSL,1522.77,1904.2,13.78,1146.916667
60
+ LGPL-2.1,1748.66,2184.8,12.1,1315.186667
61
+ CPAL-1.0,1765,2207.4,14.01,1328.803333
62
+ RPL-1.5,1983.01,2479.6,14.59,1492.4
63
+ AGPL-3.0,2216.48,2770.2,13.08,1666.586667
64
+ GPL-3.0,2260.45,2825.1,12.97,1699.506667
65
+ APL-1.0,2851.33,3566.2,14.3,2143.943333
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "licenserec/version"
4
+ require 'csv'
5
+
6
+
7
+ module Licenserec
8
+ class TermsCompare
9
+ def initialize()
10
+
11
+ end
12
+
13
+ # 输入为许可证列表,输出列表中的许可证的条款要素值。
14
+ def self.licenses_term_compare(licenses_list)
15
+ license_terms_hash = Hash.new
16
+ license_terms_hash.store("license",["info","preamble","define","copyright patent", "trademark", "copyleft", "interaction", "modification", "retain_attr", "enhance_attr", "acceptance", "patent_term", "vio_term", "disclaimer", "law", "instruction", "compatible_version", "secondary_license", "gpl_combine"])
17
+ c_table = CSV.read("lib\\licenses_terms_63.csv",headers:true)
18
+ CSV.foreach("lib\\licenses_terms_63.csv") do |row|
19
+ licenses_list.each do |one_license|
20
+ if row[0] == one_license
21
+ no_row = $.
22
+ license_terms_hash.store(one_license,c_table[no_row-2])
23
+ end
24
+ end
25
+ end
26
+ return license_terms_hash
27
+ end
28
+
29
+ end
30
+ end