summaryrefslogtreecommitdiff
path: root/lib/environment.rb
diff options
context:
space:
mode:
authormr <mr@mrautenberg.de>2010-01-25 15:24:31 +0100
committermr <mr@mrautenberg.de>2010-01-25 15:24:31 +0100
commit2187b121ddb95a6ef5de59ac1c72427b4294d9be (patch)
tree73971965ebc5342911457b7a81192bac9982829f /lib/environment.rb
parenta165822a7bd663916cff9484a76e6bb6bcf9a353 (diff)
ensure that minimum 1 user is in users.yaml
Diffstat (limited to 'lib/environment.rb')
-rw-r--r--lib/environment.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/environment.rb b/lib/environment.rb
index ee36366..354190c 100644
--- a/lib/environment.rb
+++ b/lib/environment.rb
@@ -25,8 +25,11 @@ else
puts "Please edit #{user_file} and restart your application."
exit
end
-if @@users.length < 1 or !@@users
- puts "Please edit #{user_file} and restart your application."
+
+begin
+ 0 < @@users[:users].keys.length
+rescue
+ puts "Please edit #{user_file} and restart your application. Create at least one user with password."
exit
end