Skip to content

Commit

Permalink
DRY up tmp directory location
Browse files Browse the repository at this point in the history
  • Loading branch information
deadprogram committed Jan 24, 2011
1 parent fa36904 commit da7089a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/models/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ def default_code
end

def default_kid_code_location
"#{File.dirname(__FILE__)}/../../tmp/kidcode.rb"
"#{tmp_dir}/kidcode.rb"
end

def ensure_tmp_dir
Qt::Dir.mkdir("#{File.dirname(__FILE__)}/../../tmp") unless Qt::Dir.new("#{File.dirname(__FILE__)}/../../tmp").exists
Qt::Dir.mkdir(tmp_dir) unless Qt::Dir.new(tmp_dir).exists
end

def tmp_dir
"#{File.dirname(__FILE__)}/../../tmp"
end
end

0 comments on commit da7089a

Please sign in to comment.