133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
# File 'lib/roda/plugins/sprockets.rb', line 133
def sprockets
get self.roda_class.sprockets_regexp do |path|
options = scope.sprockets_options
env_sprockets = scope.request.env.dup
env_sprockets['PATH_INFO'] = path
status, , response = options[:sprockets].call env_sprockets
if (300..399).include? status
.delete("Content-type")
end
scope.response.status = status
scope.response..merge!
response.is_a?(Array) ? response.join('\n') : response.to_s
end
end
|