Sha256: 40c2e8e307298fef7fef1aceb0e20c881f7ae884b51ab5fa6d62f78b8cde75a5

Contents?: true

Size: 973 Bytes

Versions: 5

Compression:

Stored size: 973 Bytes

Contents

require 'awestruct'
require 'awestruct/commands/manifest'


module Awestruct
  module Commands
    class Init

      BASE_MANIFEST = Manifest.new {
        mkdir( '_config' )
        mkdir( '_layouts' )
        mkdir( '_ext' )
        copy_file( '_ext/pipeline.rb', File.join( File.dirname(__FILE__), 'base_pipeline.rb' ) )
        mkdir( 'stylesheets' )
      }

      def initialize(dir=Dir.pwd,framework='compass',scaffold=true)
        @dir       = dir
        @framework = framework
        @scaffold  = scaffold
      end

      def run()
        manifest = Manifest.new( BASE_MANIFEST )
        manifest.install_compass( @framework )
        if ( @scaffold )
          manifest.copy_file( '_layouts/base.html.haml', File.join( File.dirname(__FILE__), '/base_layout.html.haml' ) )
          manifest.copy_file( 'index.html.haml', File.join( File.dirname(__FILE__), '/base_index.html.haml' ) )
        end
        manifest.perform( @dir )
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
awestruct-0.0.5 lib/awestruct/commands/init.rb
awestruct-0.0.4 lib/awestruct/commands/init.rb
awestruct-0.0.3 lib/awestruct/commands/init.rb
awestruct-0.0.2 lib/awestruct/commands/init.rb
awestruct-0.0.1 lib/awestruct/commands/init.rb