Class | RuGPost::Project |
In: |
lib/rugpost/project.rb
|
Parent: | Object |
# File lib/rugpost/project.rb, line 10 def Project.add_repo(args=[],ops={}) raise "Must supply repo name" unless args.size == 1 raise "Site repo already exists" if File.exist?(args[0]) # create repository structure puts "Adding new site repository: #{args[0]}..." repo = args[0] Dir.mkdir(repo) Dir.mkdir(repo/'drafts') Dir.mkdir(repo/'published') Dir.mkdir(repo/'published/source') Dir.mkdir(repo/'published/output') end
# File lib/rugpost/project.rb, line 23 def Project.config(args=[],ops={}) # load configuration as hash config = YAML.load_file( CONFIG ) # set key config.merge!(ops) # hash to config File.open( CONFIG,'w' ) {|f| f.write( config.to_yaml )} end