module Projectr
Constants
- PROJECT_PATH
- VERSION
Public Class Methods
list()
click to toggle source
# File lib/projectr.rb, line 7 def self.list dirs = Dir.glob("#{PROJECT_PATH}/*") .select { |f|File.directory? f } .map { |p| p.split('/').last } dirs.each { |dir| puts dir } end
load(name, dest_path = Dir.pwd)
click to toggle source
# File lib/projectr.rb, line 13 def self.load(name, dest_path = Dir.pwd) src_path = "#{PROJECT_PATH}/#{name}" raise "#{name} is not a valid project" if !File.exist?(src_path) FileUtils.cp_r(Dir.glob("#{src_path}/{*,.*}"), dest_path) projectrfile_path = "#{dest_path}/Projectrfile" if File.exist?(projectrfile_path) FileUtils.chmod('+x', projectrfile_path) system "#{projectrfile_path}" FileUtils.rm(projectrfile_path) end end