Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 56 lines (41 sloc) 1.15 kB
344522f generate dependency from bundler gemspec, save/load from yml
David Goudreau & Kurtis Seebaldt authored
1 module LicenseFinder
381fb71 @moonmaster9000 persistence is now an injectable dependency
moonmaster9000 authored
2 class Dependency < LicenseFinder::Persistence::Dependency
0cccbad license_finder --approve some_gem
Matthew Kane Parker and Paul Meskers authored
3 def approved
381fb71 @moonmaster9000 persistence is now an injectable dependency
moonmaster9000 authored
4 return super unless super.nil?
0cccbad license_finder --approve some_gem
Matthew Kane Parker and Paul Meskers authored
5
381fb71 @moonmaster9000 persistence is now an injectable dependency
moonmaster9000 authored
6 self.approved = LicenseFinder.config.whitelist.include?(license)
0cccbad license_finder --approve some_gem
Matthew Kane Parker and Paul Meskers authored
7 end
8
9 def license_files
381fb71 @moonmaster9000 persistence is now an injectable dependency
moonmaster9000 authored
10 super || (self.license_files = [])
0cccbad license_finder --approve some_gem
Matthew Kane Parker and Paul Meskers authored
11 end
12
13 def readme_files
381fb71 @moonmaster9000 persistence is now an injectable dependency
moonmaster9000 authored
14 super || (self.readme_files = [])
0cccbad license_finder --approve some_gem
Matthew Kane Parker and Paul Meskers authored
15 end
16
17 def bundler_groups
381fb71 @moonmaster9000 persistence is now an injectable dependency
moonmaster9000 authored
18 super || (self.bundler_groups = [])
0cccbad license_finder --approve some_gem
Matthew Kane Parker and Paul Meskers authored
19 end
20
21 def children
381fb71 @moonmaster9000 persistence is now an injectable dependency
moonmaster9000 authored
22 super || (self.children = [])
0cccbad license_finder --approve some_gem
Matthew Kane Parker and Paul Meskers authored
23 end
24
25 def parents
381fb71 @moonmaster9000 persistence is now an injectable dependency
moonmaster9000 authored
26 super || (self.parents = [])
0cccbad license_finder --approve some_gem
Matthew Kane Parker and Paul Meskers authored
27 end
28
29 def approve!
d52d6d7 @moonmaster9000 refactor responsibilities out of DependencyList
moonmaster9000 authored
30 self.approved = true
efa0d25 license_finder -l MIT some_gem
Matthew Kane Parker and Paul Meskers authored
31 save
0cccbad license_finder --approve some_gem
Matthew Kane Parker and Paul Meskers authored
32 end
33
12597db link license names to license urls in html report
Matthew Kane Parker authored
34 def license_url
35 LicenseFinder::LicenseUrl.find_by_name license
36 end
37
18c67c2 Moved dependency merge logic into `Dependency`
Ian Lesperance and Matthew Kane Parker authored
38 def merge(other)
39 raise "Cannot merge dependencies with different names. Expected #{name}, was #{other.name}." unless other.name == name
40
921bfee @moonmaster9000 replace dep list merge with source sync
moonmaster9000 authored
41 new_attributes = other.attributes.merge(:notes => notes)
18c67c2 Moved dependency merge logic into `Dependency`
Ian Lesperance and Matthew Kane Parker authored
42
921bfee @moonmaster9000 replace dep list merge with source sync
moonmaster9000 authored
43 if other.license == license || other.license == 'other'
44 new_attributes[:approved] = approved
18c67c2 Moved dependency merge logic into `Dependency`
Ian Lesperance and Matthew Kane Parker authored
45 else
921bfee @moonmaster9000 replace dep list merge with source sync
moonmaster9000 authored
46 new_attributes[:approved] = nil
18c67c2 Moved dependency merge logic into `Dependency`
Ian Lesperance and Matthew Kane Parker authored
47 end
48
921bfee @moonmaster9000 replace dep list merge with source sync
moonmaster9000 authored
49 update_attributes new_attributes
50
51 self
18c67c2 Moved dependency merge logic into `Dependency`
Ian Lesperance and Matthew Kane Parker authored
52 end
344522f generate dependency from bundler gemspec, save/load from yml
David Goudreau & Kurtis Seebaldt authored
53 end
54 end
55
Something went wrong with that request. Please try again.