lib/patchmaster/web/sinatra_app.rb in patchmaster-1.0.0 vs lib/patchmaster/web/sinatra_app.rb in patchmaster-1.1.2

- old
+ new

@@ -15,11 +15,11 @@ def pm @pm ||= PM::SinatraApp.instance.pm end -def return_status(opts = nil) +def return_status(opts={}) pm = pm() status = { :lists => pm.song_lists.map(&:name), :list => pm.song_list.name, :songs => pm.song_list.songs.map(&:name), @@ -49,13 +49,11 @@ } end } end end - status.merge(opts) if opts - - json status + json status.merge(opts) end # ================================================================ # URL handlers # ================================================================ @@ -123,8 +121,13 @@ set(:port, @port) if @port @pm.start ensure @pm.stop @pm.close_debug_file + end + + # Public method callable by triggers + def refresh + # FIXME end end end