Sha256: 433e40bc501643124d8cd48c52a188d58c5e84f1991f043f13d3b8cfe59d17ff

Contents?: true

Size: 1.13 KB

Versions: 26

Compression:

Stored size: 1.13 KB

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__), 'frameworks/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 )
        scaffold_name = ( @framework == 'compass' ? 'blueprint' : @framework )
        if ( @scaffold )
          manifest.copy_file( '_layouts/base.html.haml', File.join( File.dirname(__FILE__), "/frameworks/#{scaffold_name}/base_layout.html.haml" ) )
          manifest.copy_file( 'index.html.haml', File.join( File.dirname(__FILE__), "/frameworks/base_index.html.haml" ) )
          manifest.touch_file( '_config/site.yml' )
        end
        manifest.perform( @dir )
      end

    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
awestruct-0.2.13 lib/awestruct/commands/init.rb
awestruct-0.2.12 lib/awestruct/commands/init.rb
awestruct-0.2.11 lib/awestruct/commands/init.rb
awestruct-0.2.10 lib/awestruct/commands/init.rb
awestruct-0.2.9 lib/awestruct/commands/init.rb
awestruct-0.2.8 lib/awestruct/commands/init.rb
awestruct-0.2.7 lib/awestruct/commands/init.rb
awestruct-0.2.6 lib/awestruct/commands/init.rb
awestruct-0.2.5 lib/awestruct/commands/init.rb
awestruct-0.2.4 lib/awestruct/commands/init.rb
awestruct-0.2.3 lib/awestruct/commands/init.rb
awestruct-0.2.2 lib/awestruct/commands/init.rb
awestruct-0.2.1 lib/awestruct/commands/init.rb
awestruct-0.2.0 lib/awestruct/commands/init.rb
awestruct-0.1.9 lib/awestruct/commands/init.rb
awestruct-0.1.8 lib/awestruct/commands/init.rb
awestruct-0.1.7 lib/awestruct/commands/init.rb
awestruct-0.1.6 lib/awestruct/commands/init.rb
awestruct-0.1.5 lib/awestruct/commands/init.rb
awestruct-0.1.4 lib/awestruct/commands/init.rb