Sha256: fc332ffc689d524aa45e7ca502b36550ae21759eb22a8b9662fd2ec927ca86a6
Contents?: true
Size: 1.25 KB
Versions: 9
Compression:
Stored size: 1.25 KB
Contents
module Plezi module Base module Builder GEM_ROOT = ::File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..')) def self.write_files files, parent = "." if files.is_a? Hash files.each do |k, v| if v.is_a? Hash begin Dir.mkdir k puts " created #{parent}/#{k}".green rescue => e puts " exists #{parent}/#{k}".red end Dir.chdir k write_files v, (parent + "/" + k) Dir.chdir ".." elsif v.is_a? String if ::File.exists? k if false #%w{Gemfile rakefile.rb}.include? k # old = IO.read k # old = (old.lines.map {|l| "\##{l}"}).join # IO.write k, "#####################\n#\n# OLD DATA COMMENTED OUT - PLEASE REVIEW\n#\n##{old}\n#{v}" # puts " #{parent}/#{k} WAS OVERWRITTEN, old data was preserved by comenting it out.".pink # puts " #{parent}/#{k} PLEASE REVIEW.".pink # @end_comments << "#{parent}/#{k} WAS OVERWRITTEN, old data was preserved by comenting it out. PLEASE REVIEW." else puts " EXISTS(!) #{parent}/#{k}".red end else IO.write k, v puts " wrote #{parent}/#{k}".yellow end end end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems