diff --git a/lib/dashing/app.rb b/lib/dashing/app.rb index d5d58ab..b5888aa 100644 --- a/lib/dashing/app.rb +++ b/lib/dashing/app.rb @@ -43,7 +43,7 @@ def authenticated?(token) set :auth_token, nil set :template_languages, %i[html erb] -if File.exists?(settings.history_file) +if File.exist?(settings.history_file) set :history, YAML.load_file(settings.history_file) else set :history, {} @@ -171,7 +171,7 @@ def require_glob(relative_glob) end settings_file = File.join(settings.root, 'config/settings.rb') -require settings_file if File.exists?(settings_file) +require settings_file if File.exist?(settings_file) {}.to_json # Forces your json codec to initialize (in the event that it is lazily loaded). Does this before job threads start. job_path = ENV["JOB_PATH"] || 'jobs' diff --git a/test/app_test.rb b/test/app_test.rb index ee38232..40e8b62 100644 --- a/test/app_test.rb +++ b/test/app_test.rb @@ -160,6 +160,11 @@ def with_generated_project app.settings.public_folder = File.join(dir, 'new_project/public') app.settings.views = File.join(dir, 'new_project/dashboards') app.settings.root = File.join(dir, 'new_project') + + app.settings.raise_errors = true + app.settings.dump_errors = false + app.settings.show_exceptions = false + yield app.settings.root end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 0b719f5..24e45b4 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -33,7 +33,7 @@ def temp yield path ensure Dir.chdir WORKING_DIRECTORY - FileUtils.rm_rf(path) if File.exists?(path) + FileUtils.rm_rf(path) if File.exist?(path) end module Dashing