Class: Licenserec::TermsCompare

Inherits:
Object
  • Object
show all
Defined in:
lib/licensecompare.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTermsCompare

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