File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,34 @@ def uncache *gems
111
111
end
112
112
end
113
113
114
+ desc 'gems' , 'Cache documentation for installed gems'
115
+ option :rebuild , type : :boolean , desc : 'Rebuild existing documentation' , default : false
116
+ # @return [void]
117
+ def gems *names
118
+ if names . empty?
119
+ Gem ::Specification . to_a . each do |spec |
120
+ next unless options . rebuild || !Yardoc . cached? ( spec )
121
+
122
+ puts "Processing gem: #{ spec . name } #{ spec . version } "
123
+ pins = GemPins . build ( spec )
124
+ Cache . save ( 'gems' , "#{ spec . name } -#{ spec . version } .ser" , pins )
125
+ end
126
+ else
127
+ names . each do |name |
128
+ spec = Gem ::Specification . find_by_name ( name )
129
+ if spec
130
+ next unless options . rebuild || !Yardoc . cached? ( spec )
131
+
132
+ puts "Processing gem: #{ spec . name } #{ spec . version } "
133
+ pins = GemPins . build ( spec )
134
+ Cache . save ( 'gems' , "#{ spec . name } -#{ spec . version } .ser" , pins )
135
+ else
136
+ warn "Gem '#{ name } ' not found"
137
+ end
138
+ end
139
+ end
140
+ end
141
+
114
142
desc 'reporters' , 'Get a list of diagnostics reporters'
115
143
# @return [void]
116
144
def reporters
You can’t perform that action at this time.
0 commit comments