Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

56 lines (42 sloc) 1.174 kb
module LicenseFinder
class Dependency < LicenseFinder::Persistence::Dependency
def approved
return super if super
self.approved = config.whitelist.include?(license)
end
def license_files
super || (self.license_files = [])
end
def readme_files
super || (self.readme_files = [])
end
def bundler_groups
super || (self.bundler_groups = [])
end
def children
super || (self.children = [])
end
def parents
super || (self.parents = [])
end
def approve!
self.approved = true
save
end
def license_url
LicenseFinder::LicenseUrl.find_by_name license
end
def merge(other)
raise "Cannot merge dependencies with different names. Expected #{name}, was #{other.name}." unless other.name == name
new_attributes = other.attributes.merge("notes" => notes)
if other.license == license || other.license == 'other'
new_attributes["approved"] = approved
new_attributes["license"] = license
else
new_attributes["approved"] = nil
end
update_attributes new_attributes
self
end
end
end
Jump to Line
Something went wrong with that request. Please try again.