Class: Licenserec::TermsCompare
- Inherits:
-
Object
- Object
- Licenserec::TermsCompare
- Defined in:
- lib/licensecompare.rb
Class Method Summary collapse
-
.licenses_term_compare(licenses_list) ⇒ Object
输入为许可证列表,输出列表中的许可证的条款要素值。.
Instance Method Summary collapse
-
#initialize ⇒ TermsCompare
constructor
A new instance of TermsCompare.
Constructor Details
#initialize ⇒ TermsCompare
Returns a new instance of TermsCompare.
9 10 11 |
# File 'lib/licensecompare.rb', line 9 def initialize() end |
Class Method Details
.licenses_term_compare(licenses_list) ⇒ Object
输入为许可证列表,输出列表中的许可证的条款要素值。
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/licensecompare.rb', line 14 def self.licenses_term_compare(licenses_list) license_terms_hash = Hash.new 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"]) cur_path=String(Pathname.new(File.dirname(__FILE__)).realpath) c_table = CSV.read(cur_path+"\\licenses_terms_63.csv",headers:true) CSV.foreach(cur_path+"\\licenses_terms_63.csv") do |row| licenses_list.each do |one_license| if row[0] == one_license no_row = $. license_terms_hash.store(one_license,c_table[no_row-2]) end end end return license_terms_hash end |