lib/attractor/reporters/sinatra_reporter.rb in attractor-2.0.3 vs lib/attractor/reporters/sinatra_reporter.rb in attractor-2.0.4
- old
+ new
@@ -30,11 +30,12 @@
@reporter.values(type: type).to_json
end
get '/suggestions' do
threshold = params[:t] || 95
- @reporter.suggestions(threshold).to_json
+ type = params[:type] || 'rb'
+ @reporter.suggestions(quantile: threshold, type: type).to_json
end
error NoMethodError do
{ error: env['sinatra.error'].message }.to_json
end
@@ -67,15 +68,8 @@
Launchy.open('http://localhost:7890')
puts "Opening browser window..."
end
Rack::Handler::WEBrick.run Rack::LiveReload.new(app), Port: 7890
- end
-
- def values(type: 'rb')
- @values = @calculators[type].calculate
- @values
- rescue NoMethodError => e
- puts "No calculator for type #{type}"
end
end
end