Sha256: d4b4fd9a7ae1b24b318f736623995bb078023a657160486a83c5db8f9266f93d

Contents?: true

Size: 1.17 KB

Versions: 14

Compression:

Stored size: 1.17 KB

Contents

require 'fileutils'
require File.join(File.dirname(__FILE__), 'base')
require File.join(File.dirname(__FILE__), 'update_project')
require File.join(Compass.lib_directory, 'compass', 'installers')

module Compass
  module Commands
    class CreateProject < ProjectBase

      include Compass::Installers

      attr_accessor :installer

      def initialize(working_path, options)
        super(working_path, options)
        installer_args = [project_template_directory, project_directory, self.options]
        @installer = case options[:project_type]
        when :stand_alone
          StandAloneInstaller.new *installer_args
        when :rails
          RailsInstaller.new *installer_args
        else
          raise "Unknown project type: #{project_type}"
        end
      end
      
      # all commands must implement perform
      def perform
        installer.init
        installer.run(:skip_finalization => true)
        UpdateProject.new(working_path, options).perform if installer.compilation_required?
        installer.finalize(:create => true)
      end

      def project_template_directory
        File.join(framework.templates_directory, "project")
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 5 rubygems

Version Path
bsherman-compass-0.5.2 lib/compass/commands/create_project.rb
chriseppstein-compass-0.4.0 lib/compass/commands/create_project.rb
chriseppstein-compass-0.4.1 lib/compass/commands/create_project.rb
chriseppstein-compass-0.4.2 lib/compass/commands/create_project.rb
chriseppstein-compass-0.5.0 lib/compass/commands/create_project.rb
chriseppstein-compass-0.5.1 lib/compass/commands/create_project.rb
chriseppstein-compass-0.5.2 lib/compass/commands/create_project.rb
chriseppstein-compass-0.5.3 lib/compass/commands/create_project.rb
chriseppstein-compass-0.5.4 lib/compass/commands/create_project.rb
chriseppstein-compass-0.5.5 lib/compass/commands/create_project.rb
jsmestad-compass-0.4.2.1 lib/compass/commands/create_project.rb
jwhitmire-compass-0.5.1.1 lib/compass/commands/create_project.rb
jwhitmire-compass-0.5.1.2 lib/compass/commands/create_project.rb
merbjedi-compass-0.5.0 lib/compass/commands/create_project.rb