File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -25,16 +25,6 @@ def broken?
2525 requires . any? ( &:broken? )
2626 end
2727
28- def license
29- path = "#{ self . source . to_s } "
30- [ "LICENSE" , "license" , "License" ] . each do |fn |
31- if File . exist? ( "#{ path } /#{ fn } " )
32- return File . read ( "#{ path } /#{ fn } " )
33- end
34- end
35- nil
36- end
37-
3828 module ClassMethods
3929 def extension_name
4030 self [ :latest ] &.extension_name
Original file line number Diff line number Diff line change @@ -42,6 +42,22 @@ def description
4242 end
4343
4444 def license
45+ if provides_pgxn_meta_json?
46+ lic = pgxn_meta_json [ "license" ]
47+ case lic
48+ when Hash
49+ lic . keys . join ( " or " )
50+ when Array
51+ lic . join ( " or " )
52+ when String
53+ lic
54+ end
55+ else
56+ super
57+ end
58+ end
59+
60+ def license_text
4561 path = "#{ self . source . to_s } "
4662 [ "LICENSE" , "license" , "License" ] . each do |fn |
4763 if File . exist? ( "#{ path } /#{ fn } " )
You can’t perform that action at this time.
0 commit comments