File tree 2 files changed +16
-10
lines changed
2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -25,16 +25,6 @@ def broken?
25
25
requires . any? ( &:broken? )
26
26
end
27
27
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
-
38
28
module ClassMethods
39
29
def extension_name
40
30
self [ :latest ] &.extension_name
Original file line number Diff line number Diff line change @@ -42,6 +42,22 @@ def description
42
42
end
43
43
44
44
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
45
61
path = "#{ self . source . to_s } "
46
62
[ "LICENSE" , "license" , "License" ] . each do |fn |
47
63
if File . exist? ( "#{ path } /#{ fn } " )
You can’t perform that action at this time.
0 commit comments