class Sign::Fetcher

Public Class Methods

get_list(list) click to toggle source
# File lib/sign/fetcher.rb, line 4
def self.get_list(list)
  Dir["#{$LOAD_PATH[2]}/licenses/*.txt"].select do |file|
    if File.file?(file)
      name = File.basename(file, ".txt")
      info = File.open(file){ |file| file.readline }.downcase.strip.gsub(/[^-a-z0-9\s]/, "")
      list[name] = info unless list.has_key?(name)
    end
  end
end

Public Instance Methods

get_license(license) click to toggle source
# File lib/sign/fetcher.rb, line 14
def get_license(license)      
  file_name = "#{license}.txt"
  File.open("#{license_path}/#{file_name}")
end
license_path() click to toggle source
# File lib/sign/fetcher.rb, line 19
def license_path
  File.expand_path("#{$LOAD_PATH[2]}/licenses", __dir__)
end