lib/dashing/app.rb in smashing-1.1.0 vs lib/dashing/app.rb in smashing-1.2.0
- old
+ new
@@ -42,11 +42,11 @@
set :default_dashboard, nil
set :auth_token, nil
set :template_languages, %i[html erb]
if File.exist?(settings.history_file)
- set :history, YAML.load_file(settings.history_file)
+ set :history, YAML.load_file(settings.history_file, fallback: {})
else
set :history, {}
end
%w(javascripts stylesheets fonts images).each do |path|
@@ -151,10 +151,10 @@
str << "event: #{name}\n" if name
str << "data: #{body}\n\n"
end
def latest_events
- settings.history.inject("") do |str, (id, body)|
+ settings.history.inject("") do |str, (_id, body)|
str << body
end
end
def first_dashboard