class Dicker::Build
Public Class Methods
new(project, source_dir)
click to toggle source
# File lib/dicker/build.rb, line 5 def initialize(project, source_dir) @project = project @source_dir = source_dir end
Public Instance Methods
build()
click to toggle source
# File lib/dicker/build.rb, line 10 def build self.copy_files self.init_git end
copy_files()
click to toggle source
# File lib/dicker/build.rb, line 20 def copy_files Find.find("#{@source_dir}") do |source| target = source.sub(/^#{@source_dir}/, @project) if File.directory? source Find.prune if File.basename(source) == '.git' FileUtils.mkdir target unless File.exists? target else FileUtils.copy source, target puts "Copying #{source}" end end end
init_git()
click to toggle source
# File lib/dicker/build.rb, line 15 def init_git Dir.chdir @project system('git init') end