Module: StaticMatic::SetupMixin

Included in:
Base
Defined in:
lib/staticmatic/mixins/setup.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/staticmatic/mixins/setup.rb', line 3

def setup
  Dir.mkdir(@base_dir) unless File.exists?(@base_dir)
  
  Dir[File.join(File.dirname(__FILE__), "..", "templates", "project", "*")].each do |template|
    begin
      FileUtils.cp_r(template, @base_dir)
    rescue Errno::EEXIST
      # ignore - template exists
    end
  end

  puts "Done"
end