Ability to create a bare project by passing the --bare option to the create command.

This commit is contained in:
Chris Eppstein 2009-10-24 15:21:08 -07:00
parent 853e97f2e4
commit f9c5644dcc
5 changed files with 84 additions and 22 deletions

View File

@ -63,11 +63,11 @@ Feature: Command Line
When I run: compass create bare_project --bare
Then a directory bare_project/ is created
And a configuration file bare_project/config.rb is created
And a directory custom_project/src/ is created
And a directory custom_project/stylesheets/ is not created
And a directory bare_project/src/ is created
And a directory bare_project/stylesheets/ is not created
And I am congratulated
And I am told where to place stylesheets
And how to compile them
And I am told that I can place stylesheets in the src subdirectory
And I am told how to compile my sass stylesheets
Scenario: Creating a bare project with a framework
When I run: compass create bare_project --using blueprint --bare

View File

@ -62,14 +62,14 @@ end
Then /^I am congratulated$/ do
pending
@last_result.should =~ /Congratulations!/
end
Then /^I am told where to place stylesheets$/ do
pending
Then /^I am told that I can place stylesheets in the ([^\s]+) subdirectory$/ do |subdir|
@last_result.should =~ /You may now add sass stylesheets to the #{subdir} subdirectory of your project./
end
Then /^how to compile them$/ do
pending
Then /^I am told how to compile my sass stylesheets$/ do
@last_result.should =~ /You must compile your sass stylesheets into CSS when they change.\nThis can be done in one of the following ways:/
end

View File

@ -47,16 +47,29 @@ module Compass
if options[:create]
puts <<-NEXTSTEPS
Congratulations! Your compass project has been created.
You must recompile your sass stylesheets when they change.
This can be done in one of the following ways:
1. From within your project directory run:
compass
2. From any directory run:
compass -u path/to/project
3. To monitor your project for changes and automatically recompile:
compass --watch [path/to/project]
NEXTSTEPS
*********************************************************************
Congratulations! Your compass project has been created.
You may now add and edit sass stylesheets in the #{Compass.configuration.sass_dir} subdirectory of your project.
Sass files beginning with an underscore are called partials and won't be
compiled to CSS, but they can be imported into other sass stylesheets.
You can configure your project by editing the config.rb configuration file.
You must compile your sass stylesheets into CSS when they change.
This can be done in one of the following ways:
1. To compile on demand:
compass compile [path/to/project]
2. To monitor your project for changes and automatically recompile:
compass watch [path/to/project]
More Resources:
* Wiki: http://wiki.github.com/chriseppstein/compass
* Sass: http://sass-lang.com
* Community: http://groups.google.com/group/compass-users/
NEXTSTEPS
end
if manifest.has_stylesheet?
puts "\nTo import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:"

View File

@ -2,12 +2,61 @@ module Compass
module Installers
class BareInstaller < Base
def prepare
def default_configuration
Compass::Configuration::Data.new.extend(Compass::AppIntegration::StandAlone::ConfigurationDefaults)
end
def completed_configuration
nil
end
def init
directory targetize("")
directory targetize(Compass.configuration.sass_dir)
end
def prepare
end
def install
# directory
config_file ||= targetize('config.rb')
write_file config_file, config_contents
end
def config_contents
project_path, Compass.configuration.project_path = Compass.configuration.project_path, nil
Compass.configuration.serialize
ensure
Compass.configuration.project_path = project_path
end
def finalize(options = {})
puts <<-NEXTSTEPS
*********************************************************************
Congratulations! Your compass project has been created.
You may now add sass stylesheets to the #{Compass.configuration.sass_dir} subdirectory of your project.
Sass files beginning with an underscore are called partials and won't be
compiled to CSS, but they can be imported into other sass stylesheets.
You can configure your project by editing the config.rb configuration file.
You must compile your sass stylesheets into CSS when they change.
This can be done in one of the following ways:
1. To compile on demand:
compass compile [path/to/project]
2. To monitor your project for changes and automatically recompile:
compass watch [path/to/project]
More Resources:
* Wiki: http://wiki.github.com/chriseppstein/compass
* Sass: http://sass-lang.com
* Community: http://groups.google.com/group/compass-users/
NEXTSTEPS
end
end
end
end

View File

@ -46,7 +46,7 @@ module Compass
# The default finalize method -- it is a no-op.
# This could print out a message or something.
def finalize
def finalize(options = {})
end
def compilation_required?