Sha256: 3258ef78ed4b0355d422c3bd7cc61e13bf36e98d86a4d42179f1ded8564ce167

Contents?: true

Size: 1.09 KB

Versions: 9

Compression:

Stored size: 1.09 KB

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'templater'

module Generators
  extend Templater::Manifold
  desc "Generator for streamlining staticmatic"

  class NewSite < Templater::Generator
    desc "Creates a new middleman scaffold."
    first_argument :location, :required => true, :desc => "Project location"
    
    option :css_dir, :desc => 'The path to the css files'
    option :js_dir, :desc => 'The path to the javascript files'
    option :images_dir, :desc => 'The path to the image files'

    def destination_root
      File.expand_path(location)
    end

    def self.source_root
      File.join(File.dirname(__FILE__), '..', 'lib', 'middleman', 'template')
    end
    
    template :init, "init.rb"
    glob! :views
    glob! :public
    
    empty_directory :stylesheets, "public/stylesheets"#, File.join("public", css_dir)
    empty_directory :javascripts, "public/javascripts"#, File.join("public", js_dir)
    empty_directory :images, "public/images"#,      File.join("public", images_dir)
  end

  add :setup, NewSite
end

Generators.run_cli(Dir.pwd, 'mm-init', 1, %w(setup).concat(ARGV))

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
middleman-0.11.4 bin/mm-init
middleman-0.11.3 bin/mm-init
middleman-0.11.2 bin/mm-init
middleman-0.11.1 bin/mm-init
middleman-0.11.0 bin/mm-init
middleman-0.10.17 bin/mm-init
middleman-0.10.16 bin/mm-init
middleman-0.10.15 bin/mm-init
middleman-0.10.14 bin/mm-init