lib/damagecontrol/directories.rb in damagecontrol-0.5.0 vs lib/damagecontrol/directories.rb in damagecontrol-0.5.0.1391

- old
+ new

@@ -4,21 +4,27 @@ module DamageControl # This class knows about locations of various files and directories. # + # TODO: Add templates, logs(global) module Directories include FileUtils def project_names - result = Dir["#{basedir}/*/project.yaml"].collect do |f| + result = Dir["#{basedir}/projects/*/project.yaml"].collect do |f| File.basename(File.dirname(f)) end result.sort end module_function :project_names + def project_dir(project_name) + "#{basedir}/projects/#{project_name}" + end + module_function :project_dir + def checkout_dir(project_name) "#{project_dir(project_name)}/checkout" end module_function :checkout_dir @@ -102,14 +108,9 @@ def project_config_file(project_name) "#{project_dir(project_name)}/project.yaml" end module_function :project_config_file - - def project_dir(project_name) - "#{basedir}/#{project_name}" - end - module_function :project_dir def basedir if(ENV['DAMAGECONTROL_HOME']) ENV['DAMAGECONTROL_HOME'] elsif(WINDOWS) \ No newline at end of file