Sha256: 47c0ba5a8238c896085162ff5ef49d944857bbf5464d546a1c22ce28ba5cfac2

Contents?: true

Size: 598 Bytes

Versions: 16

Compression:

Stored size: 598 Bytes

Contents

module Bonsai
  class Generate  
    def initialize(path)
      @path = path
    
      Bonsai.log "Planting your bonsai '#{path}'"
      copy_templates
      create_directories
    end
  
    private  
    def create_directories
      %w(content content/index public/css public/js).each do |dir|
        Bonsai.log "\tcreate\t#{dir}"
        FileUtils.mkdir_p(File.join(@path, dir))
      end
    end
  
    def copy_templates
      # Using system call because fileutils is inadequate
      system("cp -fR '#{File.expand_path("#{File.dirname(__FILE__)}/templates")}' '#{@path}'")
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
bonsai-1.4.9 lib/bonsai/generate.rb
bonsai-1.4.8 lib/bonsai/generate.rb
bonsai-1.4.7 lib/bonsai/generate.rb
bonsai-1.4.6 lib/bonsai/generate.rb
bonsai-1.4.5 lib/bonsai/generate.rb
bonsai-1.4.4 lib/bonsai/generate.rb
bonsai-1.4.3 lib/bonsai/generate.rb
bonsai-1.4.2 lib/bonsai/generate.rb
bonsai-1.4.1 lib/bonsai/generate.rb
bonsai-1.3.2 lib/bonsai/generate.rb
bonsai-1.3.1 lib/bonsai/generate.rb
bonsai-1.3.0 lib/bonsai/generate.rb
bonsai-1.2.0 lib/bonsai/generate.rb
bonsai-1.1.6 lib/bonsai/generate.rb
bonsai-1.1.5 lib/bonsai/generate.rb
bonsai-1.1.4 lib/bonsai/generate.rb