Commit 9c8369ad0ac747bad5a3042ea47218745d519e70

Authored by Antonio Terceiro
1 parent 463516e7

Create tmp/ if necessary

Showing 1 changed file with 4 additions and 1 deletions   Show diff stats
config/environment.rb
@@ -19,7 +19,10 @@ extra_controller_dirs = %w[ @@ -19,7 +19,10 @@ extra_controller_dirs = %w[
19 ].map {|item| File.join(RAILS_ROOT, item) } 19 ].map {|item| File.join(RAILS_ROOT, item) }
20 20
21 def noosfero_session_secret 21 def noosfero_session_secret
22 - file = File.join(File.dirname(__FILE__), '/../tmp/session.secret') 22 + require 'fileutils'
  23 + target_dir = File.join(File.dirname(__FILE__), '/../tmp')
  24 + FileUtils.mkdir_p(target_dir)
  25 + file = File.join(target_dir, 'session.secret')
23 if !File.exists?(file) 26 if !File.exists?(file)
24 secret = (1..128).map { %w[0 1 2 3 4 5 6 7 8 9 a b c d e f][rand(16)] }.join('') 27 secret = (1..128).map { %w[0 1 2 3 4 5 6 7 8 9 a b c d e f][rand(16)] }.join('')
25 File.open(file, 'w') do |f| 28 File.open(file, 'w') do |f|