lib/attractor/reporters/sinatra_reporter.rb in attractor-0.4.2 vs lib/attractor/reporters/sinatra_reporter.rb in attractor-0.4.3

- old
+ new

@@ -11,23 +11,21 @@ def initialize(reporter) super @reporter = reporter end - get '/javascripts/index.js' do - @serve_static = false - @values = @reporter.values - erb File.read(File.expand_path('../../../app/assets/javascripts/index.js.erb', __dir__)), content_type: 'text/javascript' - end - enable :static set :public_folder, File.expand_path('../../../app/assets', __dir__) get '/' do erb File.read(File.expand_path('../../../app/views/index.html.erb', __dir__)) end + get '/file_prefix' do + { file_prefix: @reporter.file_prefix }.to_json + end + get '/values' do @reporter.values.to_json end get '/suggestions' do @@ -35,10 +33,10 @@ @reporter.suggestions(threshold).to_json end end # serving the HTML locally - class SinatraReporter < Reporter + class SinatraReporter < BaseReporter def report super app = AttractorApp.new(self)