Covers all the domains and the actions that are taken on all domains at once.
# File lib/ymdp/compiler/domains.rb, line 20 def initialize(options=nil) @options = options @servers = @options[:servers] @domains = @options[:domain] || all_domains @domains = @domains.to_a @message = @options[:message] commit if @options[:commit] end
Returns all domains.
# File lib/ymdp/compiler/domains.rb, line 42 def all_domains servers.servers.keys end
Perform a block, starting with a clean ‘tmp’ directory and ending with one.
# File lib/ymdp/compiler/domains.rb, line 69 def clean_tmp_dir system "rm -rf #{TMP_PATH}" system "mkdir #{TMP_PATH}" yield system "rm -rf #{TMP_PATH}" system "mkdir #{TMP_PATH}" end
Commit to git and store the hash of the commit.
# File lib/ymdp/compiler/domains.rb, line 48 def commit @git = YMDP::GitHelper.new @git.do_commit(@message) @git_hash = git.get_hash(options[:branch]) end
Compile the source code for all domains into their usable destination files.
# File lib/ymdp/compiler/domains.rb, line 32 def compile Timer.new(:title => "YMDP").time do clean_tmp_dir do process_domains end end end
Process source code for each domain in turn.
# File lib/ymdp/compiler/domains.rb, line 56 def process_domains domains.each do |domain| params = options params[:host] = configuration.host params[:server] = servers[domain]["server"] compiler = YMDP::Compiler::Base.new(domain, git_hash, params) compiler.process_all end end