Merge branch 'edge'

* edge: (118 commits)
  Make the tests pass in ruby 1.9
  Fix a bug in FSSM for ruby 1.9. Closes GH-48.
  Version bump to 0.9.4
  Update the TODO.
  If a template provides a haml file, it can have compass-enabled sass filters within it.
  Allow vendored frameworks to override built-in frameworks to enable
  [Rails] Allow compass extensions to be stored in the vendor/plugins/compass/extensions directory.
  Fix some issues regarding how the project type configuration gets applied.
  Don't leave directories around after testing.
  Name all configuration sources for debugging purposes.
  [Command Line] Primary commands get special status in the initial help output.
  [Command Line] Access the Sass Repl (sass -i) with the compass environment loaded.
  Separate the project type default configuration from the installer.
  Add config/compass.rb as a known config location. Default to config/compass.rb as the configuration file for rails projects.
  Fix a bug when the welcome message was not provided by an extension template.
  Version bump to 0.9.3
  Starting work on the changelog for 0.10
  Stuff that needs to be done before the next release.
  Help for each template that ships with compass.
  Allow the welcome message to replace the default one instead of just augment it.
  ...

Conflicts:
	CHANGELOG.markdown
	VERSION.yml
	compass.gemspec
	lib/compass/configuration.rb
	lib/vendor/fssm.rb
	lib/vendor/fssm/state.rb
This commit is contained in:
Chris Eppstein 2009-11-19 10:53:20 -08:00
commit 04f14eb514
235 changed files with 5769 additions and 2966 deletions

2
.gitignore vendored
View File

@ -3,6 +3,7 @@ tmp/*
examples/*/stylesheets/* examples/*/stylesheets/*
examples/*/*.html examples/*/*.html
examples/*/*/*.html examples/*/*/*.html
examples/*/extensions/*
examples/*/src/.sass-cache examples/*/src/.sass-cache
test/tmp test/tmp
test/fixtures/stylesheets/*/tmp test/fixtures/stylesheets/*/tmp
@ -10,3 +11,4 @@ test/fixtures/stylesheets/*/saved
test/fixtures/stylesheets/empty test/fixtures/stylesheets/empty
test/fixtures/stylesheets/*/sass/.sass-cache test/fixtures/stylesheets/*/sass/.sass-cache
pkg/* pkg/*
coverage*

View File

@ -1,6 +1,130 @@
COMPASS CHANGELOG COMPASS CHANGELOG
================= =================
0.10.0 (UNRELEASED)
------------
Command-Line:
* The compass command-line tool has been re-written to allow be easier to
use and be more flexible. The old command line is still supported at
this time. "compass help" will get you started on using the new
command line syntax.
* Allow specification of a height for the grid image
* For the truly hardcore compass users, you may now create a
compass project using "compass create my_project --bare"
and you'll have a completely bare project created for you with no
sass files provided for you.
* Get stats on your compass project with "compass stats". You'll
need to install the "css_parser" ruby gem to get stats on your
css files.
Configuration:
* The entire configuration infrastructure has been re-written to make it
easier to support the various sources of configuration data (project type,
config file, command line, and hard coded defaults)
* Whether to generate relative links to assets is now controlled by a
separate boolean configuration flag called `relative_assets` in the
configuration file and `--relative-assets` on the command line.
Setting `http_images_path` to `:relative` is deprecated.
* You may now configure the http locations for your project by simply setting
`http_path` for the top level path of the project. You
may also set `http_images_dir`, `http_stylesheets_dir`, and
`http_javascripts_dir` relative to the `http_path` instead of
setting the absolute `http_XXX_path` counterparts.
Compass Core:
* A new helper function `stylesheet_url(path)` can now be used to refer
to assets that are relative to the css directory.
* Compass sprite mixins are now more flexible and feature rich.
* Fixed the append_selector function to allow comma-delimited selectors
for both arguments instead of just the first
* There is no longer any outline on unstyled links in the :active and :focused states.
* IE6 bug fixes for sticky-footer
* New CSS3 Compatibility Mixins. You can import them all with `@import compass/css3`
* `+opacity(amount)` where amount should be between 0 and 1, where 0 is transparent and 1 is opaque.
* `+opaque` and `+transparent` mixins for convenience. Built on top of the opacity mixin.
* `+border-radius(amount)` as well as the following convenience mixins:
* `+border-top-left-radius(amount)`
* `+border-top-right-radius(amount)`
* `+border-top-right-radius(amount)`,
* `+border-bottom-left-radius(amount)`
* `+border-bottom-right-radius(amount)`
* `+border-top-radius(amount)`
* `+border-right-radius(amount)`
* `+border-left-radius(amount)`
* `+border-bottom-radius(amount)`
* `+box-shadow(!horiz_offset, !vert_offset, !blur, !color)`
* `+box-sizing(!sizing_mode)`
* Column support via the following mixins:
* `+column-count`
* `+column-gap`
* `+column-width`
* `+column-rule-width`
* `+column-rule-style`
* `+column-rule-color`
* `+column-rule`
* The import for `+inline-block` has moved from compass/utilities/general/inline_block
to compass/css3/inline_block
* The import for `+opacity` has moved from compass/utilities/general/opacity
to compass/css3/opacity
* Note: If you are using the `+opacity` or `+inline-block` mixins,
you may need to update your imports.
Blueprint:
* Make the primary blueprint mixins easier to use by allowing them to be nested when passing true as the first argument.
The old approach of passing a selector as the first argument is now deprecated in favor of a simple flag to indicate nesting or not.
YUI:
* YUI was upgraded to 2.7.0
* Yahoo has deprecated the YUI CSS framework, as such YUI has been extracted to a plugin.
If you use it, please install it with: `sudo gem install compass-yui`
Extensions:
* Extensions can now be installed locally by unpacking them into a project's
"extensions" directory. Rails projects use "vendor/plugins/compass/extenstions".
* Extensions can deliver html to projects if they like. The html can be in
haml and will be transformed to html and can contain inline, compass-enabled
sass.
* All files can be processed using ERB before being copied into the user's
project.
* Compass extensions can now add support for other application frameworks.
These extensions can help compass understand the project structure of that
framework as well as provide runtime integration for ruby-based apps.
Contact me if you plan to do this -- the first couple times may be a little
rough.
* Compass extensions can now add new command line commands. Contact me if you
plan to do this -- the first couple times may be a little rough.
* Extensions can now provide help documentation just after a project is
created and on demand when the user uses the command line help system.
This can be done via the manifest file or by adding a USAGE.markdown file
at the top level of the framework template.
Miscellaneous:
* The compass configuration object is no longer a singleton, this makes it
possible for other ruby software to manage multiple compass projects at a
time.
* Compass no longer requires rubygems in order to work, this is a ruby
best-practice.
* All sass provided by compass now uses css-style property syntax.
* The command line tool is now tested using the cucumber testing framework.
Many thanks to the following Contributors:
* Brandon Mathis - CSS3 (+opacity, +border-radius) and sprites
* Eric Meyer - CSS3 (+box-shadow, +columns, +box-sizing)
* Jacques Crocker - Merb Compatibility fixes
* Gabriel Mansour - Fixes to +unstyled-link
* John Debs - IE6 Fixes for +sticky-footer
* Brian Johnson - Upgraded to YUI 2.7.0
* Beau Smith - fixing my dyslexia.
0.8.17 (September 24, 2009) 0.8.17 (September 24, 2009)
--------------------------- ---------------------------

View File

@ -5,6 +5,7 @@ A [Sass][sass]-based CSS Meta-Framework that allows you to mix and match any of
- [Blueprint][blueprint_website] - [Wiki Documentation][bleuprint_wiki] - [Blueprint][blueprint_website] - [Wiki Documentation][bleuprint_wiki]
- [YUI][yui_website] - [Wiki Documentation][yui_wiki] - [YUI][yui_website] - [Wiki Documentation][yui_wiki]
- [960][ninesixty_website] - [Wiki Documentation][ninesixty_wiki] - [960][ninesixty_website] - [Wiki Documentation][ninesixty_wiki]
- New frameworks and extensions are [tracked on the wiki][plugins_wiki] as they are created.
- Other frameworks can be added relatively easily. Create your own! - Other frameworks can be added relatively easily. Create your own!
## Compass Provides ## Compass Provides
@ -25,13 +26,14 @@ Copyright (c) 2008-2009 Christopher M. Eppstein<br>
All Rights Reserved.<br> All Rights Reserved.<br>
Released under a [slightly modified MIT License][license]. Released under a [slightly modified MIT License][license].
[sass]: http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html "Syntactically Awesome StyleSheets" [sass]: http://sass-lang.com/ "Syntactically Awesome StyleSheets"
[compass_core_website]: http://github.com/chriseppstein/compass/tree/master/frameworks/compass [compass_core_website]: http://github.com/chriseppstein/compass/tree/master/frameworks/compass
[compass_core_wiki]: http://github.com/chriseppstein/compass/wikis/compass-core-documentation [compass_core_wiki]: http://github.com/chriseppstein/compass/wikis/compass-core-documentation
[blueprint_website]: http://blueprintcss.org/ [blueprint_website]: http://blueprintcss.org/
[bleuprint_wiki]: http://github.com/chriseppstein/compass/wikis/blueprint-documentation [bleuprint_wiki]: http://github.com/chriseppstein/compass/wikis/blueprint-documentation
[yui_website]: http://developer.yahoo.com/yui/grids/ [yui_website]: http://developer.yahoo.com/yui/grids/
[yui_wiki]: http://github.com/chriseppstein/compass/wikis/yui-documentation [yui_wiki]: http://github.com/chriseppstein/compass/wikis/yui-documentation
[plugins_wiki]: http://github.com/chriseppstein/compass/wikis/compass-plugins
[ninesixty_website]: http://960.gs/ [ninesixty_website]: http://960.gs/
[ninesixty_wiki]: http://github.com/chriseppstein/compass/wikis/960gs-documentation [ninesixty_wiki]: http://github.com/chriseppstein/compass/wikis/960gs-documentation
[command_line_wiki]: http://wiki.github.com/chriseppstein/compass/command-line-tool [command_line_wiki]: http://wiki.github.com/chriseppstein/compass/command-line-tool

View File

@ -12,7 +12,9 @@ end
require 'rubygems' require 'rubygems'
require 'rake' require 'rake'
require 'lib/compass' $:.unshift File.join(File.dirname(__FILE__), 'lib')
require 'compass'
require 'rcov/rcovtask'
# ----- Default: Testing ------ # ----- Default: Testing ------
@ -23,6 +25,7 @@ require 'fileutils'
Rake::TestTask.new :run_tests do |t| Rake::TestTask.new :run_tests do |t|
t.libs << 'lib' t.libs << 'lib'
t.libs << 'test'
t.libs << 'haml/lib' if ENV["RUN_CODE_RUN"] t.libs << 'haml/lib' if ENV["RUN_CODE_RUN"]
test_files = FileList['test/**/*_test.rb'] test_files = FileList['test/**/*_test.rb']
test_files.exclude('test/rails/*', 'test/haml/*') test_files.exclude('test/rails/*', 'test/haml/*')
@ -58,12 +61,13 @@ begin
gemspec.files += Dir.glob("examples/**/*.*") gemspec.files += Dir.glob("examples/**/*.*")
gemspec.files -= Dir.glob("examples/**/*.css") gemspec.files -= Dir.glob("examples/**/*.css")
gemspec.files -= Dir.glob("examples/**/*.html") gemspec.files -= Dir.glob("examples/**/*.html")
gemspec.files += Dir.glob("frameworks/**/*.*") gemspec.files -= Dir.glob("examples/*/extensions/**")
gemspec.files += Dir.glob("lib/**/*") gemspec.files += Dir.glob("lib/**/*")
gemspec.files += Dir.glob("test/**/*.*") gemspec.files += Dir.glob("test/**/*.*")
gemspec.files -= Dir.glob("test/fixtures/stylesheets/*/saved/**/*.*") gemspec.files -= Dir.glob("test/fixtures/stylesheets/*/saved/**/*.*")
gemspec.test_files = Dir.glob("test/**/*.*") gemspec.test_files = Dir.glob("test/**/*.*")
gemspec.test_files -= Dir.glob("test/fixtures/stylesheets/*/saved/**/*.*") gemspec.test_files -= Dir.glob("test/fixtures/stylesheets/*/saved/**/*.*")
gemspec.test_files += Dir.glob("features/**/*.*")
end end
rescue LoadError rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
@ -89,6 +93,8 @@ end
task :release => :commit_revision task :release => :commit_revision
task :gem => :build
desc "Compile Examples into HTML and CSS" desc "Compile Examples into HTML and CSS"
task :examples do task :examples do
linked_haml = "tests/haml" linked_haml = "tests/haml"
@ -105,6 +111,10 @@ task :examples do
next unless File.directory?(example) next unless File.directory?(example)
puts "\nCompiling #{example}" puts "\nCompiling #{example}"
puts "=" * "Compiling #{example}".length puts "=" * "Compiling #{example}".length
Dir.chdir example do
load "bootstrap.rb" if File.exists?("bootstrap.rb")
Compass::Exec::SwitchUI.new(["--force"]).run!
end
# compile any haml templates to html # compile any haml templates to html
FileList["#{example}/**/*.haml"].each do |haml_file| FileList["#{example}/**/*.haml"].each do |haml_file|
basename = haml_file[0..-6] basename = haml_file[0..-6]
@ -114,9 +124,6 @@ task :examples do
output.write(engine.render) output.write(engine.render)
output.close output.close
end end
Dir.chdir example do
Compass::Exec::Compass.new(["--force"]).run!
end
end end
end end
@ -125,3 +132,34 @@ namespace :git do
sh "git", "clean", "-fdx" sh "git", "clean", "-fdx"
end end
end end
require 'cucumber/rake/task'
namespace :rcov do
Cucumber::Rake::Task.new(:cucumber) do |t|
t.rcov = true
t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/,features\/ --aggregate coverage.data}
t.rcov_opts << %[-o "coverage"]
end
Rcov::RcovTask.new(:units) do |rcov|
rcov.libs << 'lib'
rcov.libs << 'haml/lib' if ENV["RUN_CODE_RUN"]
test_files = FileList['test/**/*_test.rb']
test_files.exclude('test/rails/*', 'test/haml/*')
rcov.pattern = test_files
rcov.output_dir = 'coverage'
rcov.verbose = true
rcov.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/,features\/ --aggregate coverage.data}
rcov.rcov_opts << %[-o "coverage" --sort coverage]
end
desc "Run both specs and features to generate aggregated coverage"
task :all do |t|
rm "coverage.data" if File.exist?("coverage.data")
Rake::Task["rcov:units"].invoke
Rake::Task["rcov:cucumber"].invoke
end
end

7
TODO.md Normal file
View File

@ -0,0 +1,7 @@
MUST:
* A proper welcome page for blueprint projects (or delete it)
NICE:
* some extension commands
* Better help for commands and patterns

View File

@ -1,4 +1,5 @@
--- ---
:patch: 17 :patch: 0
:major: 0 :major: 0
:minor: 8 :minor: 10
:build: 0

View File

@ -1,8 +1,26 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# The compass command line utility # The compass command line utility
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'compass')) # This allows compass to run easily from a git checkout without install.
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'compass', 'exec')) def fallback_load_path(path)
retried = false
begin
yield
rescue LoadError
unless retried
$: << path
retried = true
retry
end
raise
end
end
command = Compass::Exec::Compass.new(ARGV) fallback_load_path(File.join(File.dirname(__FILE__), '..', 'lib')) do
exit command.run! require 'compass'
require 'compass/exec'
end
command_line_class = Compass::Exec::Helpers.select_appropriate_command_line_ui(ARGV)
exit command_line_class.new(ARGV).run!

View File

@ -1,3 +1,6 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
Gem::Specification.new do |s| Gem::Specification.new do |s|
@ -13,326 +16,367 @@ Gem::Specification.new do |s|
s.executables = ["compass"] s.executables = ["compass"]
s.extra_rdoc_files = [ s.extra_rdoc_files = [
"LICENSE.markdown", "LICENSE.markdown",
"README.markdown" "README.markdown"
] ]
s.files = [ s.files = [
"CHANGELOG.markdown", "CHANGELOG.markdown",
"LICENSE.markdown", "LICENSE.markdown",
"README.markdown", "README.markdown",
"REVISION", "REVISION",
"Rakefile", "Rakefile",
"VERSION.yml", "VERSION.yml",
"bin/compass", "bin/compass",
"deps.rip", "deps.rip",
"examples/README.markdown", "examples/README.markdown",
"examples/blueprint_default/config.rb", "examples/blueprint_default/config.rb",
"examples/blueprint_default/images/grid.png", "examples/blueprint_default/images/grid.png",
"examples/blueprint_default/index.html.haml", "examples/blueprint_default/index.html.haml",
"examples/blueprint_default/parts/elements.html.haml", "examples/blueprint_default/parts/elements.html.haml",
"examples/blueprint_default/parts/forms.html.haml", "examples/blueprint_default/parts/forms.html.haml",
"examples/blueprint_default/parts/grid.html.haml", "examples/blueprint_default/parts/grid.html.haml",
"examples/blueprint_default/parts/test-small.jpg", "examples/blueprint_default/parts/test-small.jpg",
"examples/blueprint_default/parts/test.jpg", "examples/blueprint_default/parts/test.jpg",
"examples/blueprint_default/parts/valid.png", "examples/blueprint_default/parts/valid.png",
"examples/blueprint_default/src/ie.sass", "examples/blueprint_default/src/ie.sass",
"examples/blueprint_default/src/images/grid.png", "examples/blueprint_default/src/images/grid.png",
"examples/blueprint_default/src/print.sass", "examples/blueprint_default/src/print.sass",
"examples/blueprint_default/src/screen.sass", "examples/blueprint_default/src/screen.sass",
"examples/blueprint_plugins/config.rb", "examples/blueprint_plugins/config.rb",
"examples/blueprint_plugins/images/buttons/cross.png", "examples/blueprint_plugins/images/buttons/cross.png",
"examples/blueprint_plugins/images/buttons/key.png", "examples/blueprint_plugins/images/buttons/key.png",
"examples/blueprint_plugins/images/buttons/tick.png", "examples/blueprint_plugins/images/buttons/tick.png",
"examples/blueprint_plugins/images/grid.png", "examples/blueprint_plugins/images/grid.png",
"examples/blueprint_plugins/images/link_icons/doc.png", "examples/blueprint_plugins/images/link_icons/doc.png",
"examples/blueprint_plugins/images/link_icons/email.png", "examples/blueprint_plugins/images/link_icons/email.png",
"examples/blueprint_plugins/images/link_icons/external.png", "examples/blueprint_plugins/images/link_icons/external.png",
"examples/blueprint_plugins/images/link_icons/feed.png", "examples/blueprint_plugins/images/link_icons/feed.png",
"examples/blueprint_plugins/images/link_icons/im.png", "examples/blueprint_plugins/images/link_icons/im.png",
"examples/blueprint_plugins/images/link_icons/pdf.png", "examples/blueprint_plugins/images/link_icons/pdf.png",
"examples/blueprint_plugins/images/link_icons/visited.png", "examples/blueprint_plugins/images/link_icons/visited.png",
"examples/blueprint_plugins/images/link_icons/xls.png", "examples/blueprint_plugins/images/link_icons/xls.png",
"examples/blueprint_plugins/images/test-small.jpg", "examples/blueprint_plugins/images/test-small.jpg",
"examples/blueprint_plugins/images/test.jpg", "examples/blueprint_plugins/images/test.jpg",
"examples/blueprint_plugins/images/valid.png", "examples/blueprint_plugins/images/valid.png",
"examples/blueprint_plugins/index.html.haml", "examples/blueprint_plugins/index.html.haml",
"examples/blueprint_plugins/plugins/buttons.html.haml", "examples/blueprint_plugins/plugins/buttons.html.haml",
"examples/blueprint_plugins/plugins/fancy_type.html.haml", "examples/blueprint_plugins/plugins/fancy_type.html.haml",
"examples/blueprint_plugins/plugins/link_icons.html.haml", "examples/blueprint_plugins/plugins/link_icons.html.haml",
"examples/blueprint_plugins/plugins/rtl.html.haml", "examples/blueprint_plugins/plugins/rtl.html.haml",
"examples/blueprint_plugins/src/buttons.sass", "examples/blueprint_plugins/src/buttons.sass",
"examples/blueprint_plugins/src/ie.sass", "examples/blueprint_plugins/src/ie.sass",
"examples/blueprint_plugins/src/images/grid.png", "examples/blueprint_plugins/src/images/grid.png",
"examples/blueprint_plugins/src/link_icons.sass", "examples/blueprint_plugins/src/link_icons.sass",
"examples/blueprint_plugins/src/print.sass", "examples/blueprint_plugins/src/print.sass",
"examples/blueprint_plugins/src/rtl_screen.sass", "examples/blueprint_plugins/src/rtl_screen.sass",
"examples/blueprint_plugins/src/screen.sass", "examples/blueprint_plugins/src/screen.sass",
"examples/blueprint_scoped/images/grid.png", "examples/blueprint_scoped/images/grid.png",
"examples/blueprint_scoped/src/ie.sass", "examples/blueprint_scoped/src/ie.sass",
"examples/blueprint_scoped/src/print.sass", "examples/blueprint_scoped/src/print.sass",
"examples/blueprint_scoped/src/screen.sass", "examples/blueprint_scoped/src/screen.sass",
"examples/blueprint_scoped_form/images/grid.png", "examples/blueprint_scoped_form/images/grid.png",
"examples/blueprint_scoped_form/src/ie.sass", "examples/blueprint_scoped_form/src/ie.sass",
"examples/blueprint_scoped_form/src/print.sass", "examples/blueprint_scoped_form/src/print.sass",
"examples/blueprint_scoped_form/src/screen.sass", "examples/blueprint_scoped_form/src/screen.sass",
"examples/blueprint_semantic/config.rb", "examples/blueprint_semantic/config.rb",
"examples/blueprint_semantic/images/grid.png", "examples/blueprint_semantic/images/grid.png",
"examples/blueprint_semantic/index.html.haml", "examples/blueprint_semantic/index.html.haml",
"examples/blueprint_semantic/parts/fancy_type.html.haml", "examples/blueprint_semantic/parts/fancy_type.html.haml",
"examples/blueprint_semantic/parts/liquid.html.haml", "examples/blueprint_semantic/parts/liquid.html.haml",
"examples/blueprint_semantic/parts/test-small.jpg", "examples/blueprint_semantic/parts/test-small.jpg",
"examples/blueprint_semantic/parts/test.jpg", "examples/blueprint_semantic/parts/test.jpg",
"examples/blueprint_semantic/parts/valid.png", "examples/blueprint_semantic/parts/valid.png",
"examples/blueprint_semantic/src/ie.sass", "examples/blueprint_semantic/src/ie.sass",
"examples/blueprint_semantic/src/images/grid.png", "examples/blueprint_semantic/src/images/grid.png",
"examples/blueprint_semantic/src/liquid.sass", "examples/blueprint_semantic/src/liquid.sass",
"examples/blueprint_semantic/src/print.sass", "examples/blueprint_semantic/src/print.sass",
"examples/blueprint_semantic/src/screen.sass", "examples/blueprint_semantic/src/screen.sass",
"examples/compass/compass.html.haml", "examples/compass/compass.html.haml",
"examples/compass/config.rb", "examples/compass/config.rb",
"examples/compass/images/blue_arrow.gif", "examples/compass/images/blue_arrow.gif",
"examples/compass/src/compass.sass", "examples/compass/src/compass.sass",
"examples/compass/src/images/blue_arrow.gif", "examples/compass/src/images/blue_arrow.gif",
"examples/compass/src/sticky_footer.sass", "examples/compass/src/sticky_footer.sass",
"examples/compass/src/utilities.sass", "examples/compass/src/utilities.sass",
"examples/compass/sticky_footer.html.haml", "examples/compass/sticky_footer.html.haml",
"examples/compass/utilities.html.haml", "examples/compass/utilities.html.haml",
"examples/logo/logo.html.haml", "examples/downloader.rb",
"examples/logo/src/ie.sass", "examples/logo/logo.html.haml",
"examples/logo/src/print.sass", "examples/logo/src/ie.sass",
"examples/logo/src/screen.sass", "examples/logo/src/print.sass",
"examples/yui/divisions.html.haml", "examples/logo/src/screen.sass",
"examples/yui/index.html.haml", "examples/ninesixty/bootstrap.rb",
"examples/yui/src/screen.sass", "examples/ninesixty/config.rb",
"examples/yui/sub_divisions.html.haml", "examples/ninesixty/extensions/ninesixty/README.mkdn",
"examples/yui/templates.html.haml", "examples/ninesixty/extensions/ninesixty/compass-960-plugin.gemspec",
"examples/yui/test.jpg", "examples/ninesixty/extensions/ninesixty/lib/ninesixty.rb",
"examples/yui/typography.html.haml", "examples/ninesixty/extensions/ninesixty/lib/ninesixty/compass_plugin.rb",
"frameworks/blueprint.rb", "examples/ninesixty/extensions/ninesixty/sass/960/_grid.sass",
"frameworks/blueprint/stylesheets/_blueprint.sass", "examples/ninesixty/extensions/ninesixty/sass/960/_text.sass",
"frameworks/blueprint/stylesheets/blueprint/_ie.sass", "examples/ninesixty/extensions/ninesixty/templates/project/grid.sass",
"frameworks/blueprint/stylesheets/blueprint/_print.sass", "examples/ninesixty/extensions/ninesixty/templates/project/manifest.rb",
"frameworks/blueprint/stylesheets/blueprint/_reset.sass", "examples/ninesixty/extensions/ninesixty/templates/project/text.sass",
"frameworks/blueprint/stylesheets/blueprint/_screen.sass", "examples/ninesixty/src/grid.sass",
"frameworks/blueprint/stylesheets/blueprint/modules/_buttons.sass", "examples/ninesixty/src/text.sass",
"frameworks/blueprint/stylesheets/blueprint/modules/_colors.sass", "examples/yui/bootstrap.rb",
"frameworks/blueprint/stylesheets/blueprint/modules/_debug.sass", "examples/yui/divisions.html.haml",
"frameworks/blueprint/stylesheets/blueprint/modules/_fancy_type.sass", "examples/yui/extensions/yui/stylesheets/_yui.sass",
"frameworks/blueprint/stylesheets/blueprint/modules/_form.sass", "examples/yui/extensions/yui/stylesheets/yui/modules/_base.sass",
"frameworks/blueprint/stylesheets/blueprint/modules/_grid.sass", "examples/yui/extensions/yui/stylesheets/yui/modules/_fonts.sass",
"frameworks/blueprint/stylesheets/blueprint/modules/_interaction.sass", "examples/yui/extensions/yui/stylesheets/yui/modules/_grids.sass",
"frameworks/blueprint/stylesheets/blueprint/modules/_link_icons.sass", "examples/yui/extensions/yui/stylesheets/yui/modules/_reset.sass",
"frameworks/blueprint/stylesheets/blueprint/modules/_liquid.sass", "examples/yui/extensions/yui/templates/project/manifest.rb",
"frameworks/blueprint/stylesheets/blueprint/modules/_reset.sass", "examples/yui/extensions/yui/templates/project/screen.sass",
"frameworks/blueprint/stylesheets/blueprint/modules/_rtl.sass", "examples/yui/index.html.haml",
"frameworks/blueprint/stylesheets/blueprint/modules/_scaffolding.sass", "examples/yui/src/screen.sass",
"frameworks/blueprint/stylesheets/blueprint/modules/_typography.sass", "examples/yui/sub_divisions.html.haml",
"frameworks/blueprint/stylesheets/blueprint/modules/_utilities.sass", "examples/yui/templates.html.haml",
"frameworks/blueprint/templates/buttons/buttons.sass", "examples/yui/test.jpg",
"frameworks/blueprint/templates/buttons/buttons/cross.png", "examples/yui/typography.html.haml",
"frameworks/blueprint/templates/buttons/buttons/key.png", "lib/compass.rb",
"frameworks/blueprint/templates/buttons/buttons/tick.png", "lib/compass/actions.rb",
"frameworks/blueprint/templates/buttons/manifest.rb", "lib/compass/app_integration.rb",
"frameworks/blueprint/templates/link_icons/link_icons.sass", "lib/compass/app_integration/merb.rb",
"frameworks/blueprint/templates/link_icons/link_icons/doc.png", "lib/compass/app_integration/merb/runtime.rb",
"frameworks/blueprint/templates/link_icons/link_icons/email.png", "lib/compass/app_integration/rails.rb",
"frameworks/blueprint/templates/link_icons/link_icons/external.png", "lib/compass/app_integration/rails/action_controller.rb",
"frameworks/blueprint/templates/link_icons/link_icons/feed.png", "lib/compass/app_integration/rails/configuration_defaults.rb",
"frameworks/blueprint/templates/link_icons/link_icons/im.png", "lib/compass/app_integration/rails/installer.rb",
"frameworks/blueprint/templates/link_icons/link_icons/pdf.png", "lib/compass/app_integration/rails/runtime.rb",
"frameworks/blueprint/templates/link_icons/link_icons/visited.png", "lib/compass/app_integration/rails/sass_plugin.rb",
"frameworks/blueprint/templates/link_icons/link_icons/xls.png", "lib/compass/app_integration/rails/templates/compass-install-rails.rb",
"frameworks/blueprint/templates/link_icons/manifest.rb", "lib/compass/app_integration/rails/urls.rb",
"frameworks/blueprint/templates/project/grid.png", "lib/compass/app_integration/stand_alone.rb",
"frameworks/blueprint/templates/project/ie.sass", "lib/compass/app_integration/stand_alone/configuration_defaults.rb",
"frameworks/blueprint/templates/project/manifest.rb", "lib/compass/app_integration/stand_alone/installer.rb",
"frameworks/blueprint/templates/project/partials/_base.sass", "lib/compass/commands.rb",
"frameworks/blueprint/templates/project/print.sass", "lib/compass/commands/base.rb",
"frameworks/blueprint/templates/project/screen.sass", "lib/compass/commands/create_project.rb",
"frameworks/compass.rb", "lib/compass/commands/generate_grid_background.rb",
"frameworks/compass/stylesheets/_compass.sass", "lib/compass/commands/help.rb",
"frameworks/compass/stylesheets/compass/_layout.sass", "lib/compass/commands/installer_command.rb",
"frameworks/compass/stylesheets/compass/_misc.sass", "lib/compass/commands/list_frameworks.rb",
"frameworks/compass/stylesheets/compass/_reset.sass", "lib/compass/commands/print_version.rb",
"frameworks/compass/stylesheets/compass/_utilities.sass", "lib/compass/commands/project_base.rb",
"frameworks/compass/stylesheets/compass/layout/_sticky_footer.sass", "lib/compass/commands/project_stats.rb",
"frameworks/compass/stylesheets/compass/utilities/_general.sass", "lib/compass/commands/registry.rb",
"frameworks/compass/stylesheets/compass/utilities/_links.sass", "lib/compass/commands/stamp_pattern.rb",
"frameworks/compass/stylesheets/compass/utilities/_lists.sass", "lib/compass/commands/update_project.rb",
"frameworks/compass/stylesheets/compass/utilities/_print.sass", "lib/compass/commands/validate_project.rb",
"frameworks/compass/stylesheets/compass/utilities/_sprites.sass", "lib/compass/commands/watch_project.rb",
"frameworks/compass/stylesheets/compass/utilities/_tables.sass", "lib/compass/commands/write_configuration.rb",
"frameworks/compass/stylesheets/compass/utilities/_text.sass", "lib/compass/compiler.rb",
"frameworks/compass/stylesheets/compass/utilities/general/_clearfix.sass", "lib/compass/configuration.rb",
"frameworks/compass/stylesheets/compass/utilities/general/_float.sass", "lib/compass/configuration/adapters.rb",
"frameworks/compass/stylesheets/compass/utilities/general/_hacks.sass", "lib/compass/configuration/comments.rb",
"frameworks/compass/stylesheets/compass/utilities/general/_inline_block.sass", "lib/compass/configuration/data.rb",
"frameworks/compass/stylesheets/compass/utilities/general/_reset.sass", "lib/compass/configuration/defaults.rb",
"frameworks/compass/stylesheets/compass/utilities/general/_tabs.sass", "lib/compass/configuration/helpers.rb",
"frameworks/compass/stylesheets/compass/utilities/general/_tag_cloud.sass", "lib/compass/configuration/inheritance.rb",
"frameworks/compass/stylesheets/compass/utilities/links/_hover_link.sass", "lib/compass/configuration/serialization.rb",
"frameworks/compass/stylesheets/compass/utilities/links/_link_colors.sass", "lib/compass/core_ext.rb",
"frameworks/compass/stylesheets/compass/utilities/links/_unstyled_link.sass", "lib/compass/dependencies.rb",
"frameworks/compass/stylesheets/compass/utilities/lists/_bullets.sass", "lib/compass/errors.rb",
"frameworks/compass/stylesheets/compass/utilities/lists/_horizontal_list.sass", "lib/compass/exec.rb",
"frameworks/compass/stylesheets/compass/utilities/lists/_inline_list.sass", "lib/compass/exec/command_option_parser.rb",
"frameworks/compass/stylesheets/compass/utilities/sprites/_sprite_img.sass", "lib/compass/exec/global_options_parser.rb",
"frameworks/compass/stylesheets/compass/utilities/tables/_alternating_rows_and_columns.sass", "lib/compass/exec/helpers.rb",
"frameworks/compass/stylesheets/compass/utilities/tables/_borders.sass", "lib/compass/exec/project_options_parser.rb",
"frameworks/compass/stylesheets/compass/utilities/tables/_scaffolding.sass", "lib/compass/exec/sub_command_ui.rb",
"frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.sass", "lib/compass/exec/switch_ui.rb",
"frameworks/compass/stylesheets/compass/utilities/text/_nowrap.sass", "lib/compass/frameworks.rb",
"frameworks/compass/stylesheets/compass/utilities/text/_replacement.sass", "lib/compass/frameworks/blueprint/stylesheets/_blueprint.sass",
"frameworks/compass/templates/ellipsis/ellipsis.sass", "lib/compass/frameworks/blueprint/stylesheets/blueprint/_ie.sass",
"frameworks/compass/templates/ellipsis/manifest.rb", "lib/compass/frameworks/blueprint/stylesheets/blueprint/_print.sass",
"frameworks/compass/templates/ellipsis/xml/ellipsis.xml", "lib/compass/frameworks/blueprint/stylesheets/blueprint/_reset.sass",
"frameworks/compass/templates/project/ie.sass", "lib/compass/frameworks/blueprint/stylesheets/blueprint/_screen.sass",
"frameworks/compass/templates/project/manifest.rb", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_buttons.sass",
"frameworks/compass/templates/project/print.sass", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_colors.sass",
"frameworks/compass/templates/project/screen.sass", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_debug.sass",
"frameworks/yui.rb", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_fancy_type.sass",
"frameworks/yui/stylesheets/_yui.sass", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_form.sass",
"frameworks/yui/stylesheets/yui/modules/_base.sass", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_grid.sass",
"frameworks/yui/stylesheets/yui/modules/_fonts.sass", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_interaction.sass",
"frameworks/yui/stylesheets/yui/modules/_grids.sass", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_link_icons.sass",
"frameworks/yui/stylesheets/yui/modules/_reset.sass", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_liquid.sass",
"frameworks/yui/templates/project/manifest.rb", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_reset.sass",
"frameworks/yui/templates/project/screen.sass", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_rtl.sass",
"lib/compass.rb", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_scaffolding.sass",
"lib/compass/actions.rb", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_typography.sass",
"lib/compass/app_integration.rb", "lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_utilities.sass",
"lib/compass/app_integration/merb.rb", "lib/compass/frameworks/blueprint/templates/buttons/buttons.sass",
"lib/compass/app_integration/rails.rb", "lib/compass/frameworks/blueprint/templates/buttons/buttons/cross.png",
"lib/compass/app_integration/rails/action_controller.rb", "lib/compass/frameworks/blueprint/templates/buttons/buttons/key.png",
"lib/compass/app_integration/rails/sass_plugin.rb", "lib/compass/frameworks/blueprint/templates/buttons/buttons/tick.png",
"lib/compass/app_integration/rails/templates/compass-install-rails.rb", "lib/compass/frameworks/blueprint/templates/buttons/manifest.rb",
"lib/compass/app_integration/rails/urls.rb", "lib/compass/frameworks/blueprint/templates/link_icons/link_icons.sass",
"lib/compass/commands/base.rb", "lib/compass/frameworks/blueprint/templates/link_icons/link_icons/doc.png",
"lib/compass/commands/create_project.rb", "lib/compass/frameworks/blueprint/templates/link_icons/link_icons/email.png",
"lib/compass/commands/generate_grid_background.rb", "lib/compass/frameworks/blueprint/templates/link_icons/link_icons/external.png",
"lib/compass/commands/installer_command.rb", "lib/compass/frameworks/blueprint/templates/link_icons/link_icons/feed.png",
"lib/compass/commands/list_frameworks.rb", "lib/compass/frameworks/blueprint/templates/link_icons/link_icons/im.png",
"lib/compass/commands/print_version.rb", "lib/compass/frameworks/blueprint/templates/link_icons/link_icons/pdf.png",
"lib/compass/commands/project_base.rb", "lib/compass/frameworks/blueprint/templates/link_icons/link_icons/visited.png",
"lib/compass/commands/stamp_pattern.rb", "lib/compass/frameworks/blueprint/templates/link_icons/link_icons/xls.png",
"lib/compass/commands/update_project.rb", "lib/compass/frameworks/blueprint/templates/link_icons/manifest.rb",
"lib/compass/commands/validate_project.rb", "lib/compass/frameworks/blueprint/templates/project/grid.png",
"lib/compass/commands/watch_project.rb", "lib/compass/frameworks/blueprint/templates/project/ie.sass",
"lib/compass/commands/write_configuration.rb", "lib/compass/frameworks/blueprint/templates/project/manifest.rb",
"lib/compass/compiler.rb", "lib/compass/frameworks/blueprint/templates/project/partials/_base.sass",
"lib/compass/configuration.rb", "lib/compass/frameworks/blueprint/templates/project/print.sass",
"lib/compass/core_ext.rb", "lib/compass/frameworks/blueprint/templates/project/screen.sass",
"lib/compass/dependencies.rb", "lib/compass/frameworks/blueprint/templates/project/welcome.html.haml",
"lib/compass/errors.rb", "lib/compass/frameworks/compass/stylesheets/_compass.sass",
"lib/compass/exec.rb", "lib/compass/frameworks/compass/stylesheets/compass/_layout.sass",
"lib/compass/frameworks.rb", "lib/compass/frameworks/compass/stylesheets/compass/_misc.sass",
"lib/compass/grid_builder.rb", "lib/compass/frameworks/compass/stylesheets/compass/_reset.sass",
"lib/compass/installers.rb", "lib/compass/frameworks/compass/stylesheets/compass/_utilities.sass",
"lib/compass/installers/base.rb", "lib/compass/frameworks/compass/stylesheets/compass/layout/_sticky_footer.sass",
"lib/compass/installers/manifest.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/_css3.sass",
"lib/compass/installers/rails.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/_general.sass",
"lib/compass/installers/stand_alone.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/_links.sass",
"lib/compass/logger.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/_lists.sass",
"lib/compass/sass_extensions.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/_print.sass",
"lib/compass/sass_extensions/functions.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/_sprites.sass",
"lib/compass/sass_extensions/functions/display.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/_tables.sass",
"lib/compass/sass_extensions/functions/enumerate.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/_text.sass",
"lib/compass/sass_extensions/functions/inline_image.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_border_radius.sass",
"lib/compass/sass_extensions/functions/selectors.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_box_shadow.sass",
"lib/compass/sass_extensions/functions/urls.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_box_sizing.sass",
"lib/compass/sass_extensions/monkey_patches.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_columns.sass",
"lib/compass/sass_extensions/monkey_patches/stylesheet_updating.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_inline_block.sass",
"lib/compass/test_case.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_opacity.sass",
"lib/compass/validator.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.sass",
"lib/compass/version.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_float.sass",
"lib/vendor/fssm.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_hacks.sass",
"lib/vendor/fssm/backends/fsevents.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_reset.sass",
"lib/vendor/fssm/backends/polling.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_tabs.sass",
"lib/vendor/fssm/cache.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_tag_cloud.sass",
"lib/vendor/fssm/ext.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_hover_link.sass",
"lib/vendor/fssm/fsevents.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_link_colors.sass",
"lib/vendor/fssm/monitor.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_unstyled_link.sass",
"lib/vendor/fssm/path.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.sass",
"lib/vendor/fssm/state.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal_list.sass",
"lib/vendor/fssm/support.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/lists/_inline_list.sass",
"lib/vendor/fssm/tree.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite_img.sass",
"test/command_line_helper.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/tables/_alternating_rows_and_columns.sass",
"test/command_line_test.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/tables/_borders.sass",
"test/compass_test.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/tables/_scaffolding.sass",
"test/configuration_test.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.sass",
"test/fixtures/stylesheets/blueprint/config.rb", "lib/compass/frameworks/compass/stylesheets/compass/utilities/text/_nowrap.sass",
"test/fixtures/stylesheets/blueprint/css/typography.css", "lib/compass/frameworks/compass/stylesheets/compass/utilities/text/_replacement.sass",
"test/fixtures/stylesheets/blueprint/images/grid.png", "lib/compass/frameworks/compass/templates/ellipsis/ellipsis.sass",
"test/fixtures/stylesheets/blueprint/sass/ie.sass", "lib/compass/frameworks/compass/templates/ellipsis/manifest.rb",
"test/fixtures/stylesheets/blueprint/sass/print.sass", "lib/compass/frameworks/compass/templates/ellipsis/xml/ellipsis.xml",
"test/fixtures/stylesheets/blueprint/sass/screen.sass", "lib/compass/frameworks/compass/templates/extension/manifest.rb",
"test/fixtures/stylesheets/blueprint/sass/typography.sass", "lib/compass/frameworks/compass/templates/extension/stylesheets/main.sass",
"test/fixtures/stylesheets/compass/config.rb", "lib/compass/frameworks/compass/templates/extension/templates/project/manifest.rb",
"test/fixtures/stylesheets/compass/css/layout.css", "lib/compass/frameworks/compass/templates/extension/templates/project/screen.sass",
"test/fixtures/stylesheets/compass/css/print.css", "lib/compass/frameworks/compass/templates/project/ie.sass",
"test/fixtures/stylesheets/compass/css/reset.css", "lib/compass/frameworks/compass/templates/project/manifest.rb",
"test/fixtures/stylesheets/compass/css/utilities.css", "lib/compass/frameworks/compass/templates/project/print.sass",
"test/fixtures/stylesheets/compass/sass/layout.sass", "lib/compass/frameworks/compass/templates/project/screen.sass",
"test/fixtures/stylesheets/compass/sass/print.sass", "lib/compass/grid_builder.rb",
"test/fixtures/stylesheets/compass/sass/reset.sass", "lib/compass/installers.rb",
"test/fixtures/stylesheets/compass/sass/utilities.sass", "lib/compass/installers/bare_installer.rb",
"test/fixtures/stylesheets/image_urls/config.rb", "lib/compass/installers/base.rb",
"test/fixtures/stylesheets/image_urls/css/screen.css", "lib/compass/installers/manifest.rb",
"test/fixtures/stylesheets/image_urls/images/grid.png", "lib/compass/installers/manifest_installer.rb",
"test/fixtures/stylesheets/image_urls/sass/screen.sass", "lib/compass/installers/template_context.rb",
"test/fixtures/stylesheets/yui/config.rb", "lib/compass/logger.rb",
"test/fixtures/stylesheets/yui/css/mixins.css", "lib/compass/sass_extensions.rb",
"test/fixtures/stylesheets/yui/sass/base.sass", "lib/compass/sass_extensions/functions.rb",
"test/fixtures/stylesheets/yui/sass/fonts.sass", "lib/compass/sass_extensions/functions/display.rb",
"test/fixtures/stylesheets/yui/sass/grids.sass", "lib/compass/sass_extensions/functions/enumerate.rb",
"test/fixtures/stylesheets/yui/sass/mixins.sass", "lib/compass/sass_extensions/functions/inline_image.rb",
"test/rails_integration_test.rb", "lib/compass/sass_extensions/functions/selectors.rb",
"test/sass_extensions_test.rb", "lib/compass/sass_extensions/functions/urls.rb",
"test/test_case_helper.rb", "lib/compass/sass_extensions/monkey_patches.rb",
"test/test_helper.rb", "lib/compass/sass_extensions/monkey_patches/stylesheet_updating.rb",
"test/test_rails_helper.rb" "lib/compass/sass_extensions/monkey_patches/traversal.rb",
"lib/compass/stats.rb",
"lib/compass/test_case.rb",
"lib/compass/validator.rb",
"lib/compass/version.rb",
"lib/vendor/fssm.rb",
"lib/vendor/fssm/backends/fsevents.rb",
"lib/vendor/fssm/backends/polling.rb",
"lib/vendor/fssm/ext.rb",
"lib/vendor/fssm/monitor.rb",
"lib/vendor/fssm/path.rb",
"lib/vendor/fssm/state.rb",
"lib/vendor/fssm/support.rb",
"test/command_line_helper.rb",
"test/command_line_test.rb",
"test/compass_test.rb",
"test/configuration_test.rb",
"test/fixtures/stylesheets/blueprint/config.rb",
"test/fixtures/stylesheets/blueprint/css/typography.css",
"test/fixtures/stylesheets/blueprint/images/grid.png",
"test/fixtures/stylesheets/blueprint/sass/ie.sass",
"test/fixtures/stylesheets/blueprint/sass/print.sass",
"test/fixtures/stylesheets/blueprint/sass/screen.sass",
"test/fixtures/stylesheets/blueprint/sass/typography.sass",
"test/fixtures/stylesheets/compass/config.rb",
"test/fixtures/stylesheets/compass/css/layout.css",
"test/fixtures/stylesheets/compass/css/print.css",
"test/fixtures/stylesheets/compass/css/reset.css",
"test/fixtures/stylesheets/compass/css/utilities.css",
"test/fixtures/stylesheets/compass/sass/layout.sass",
"test/fixtures/stylesheets/compass/sass/print.sass",
"test/fixtures/stylesheets/compass/sass/reset.sass",
"test/fixtures/stylesheets/compass/sass/utilities.sass",
"test/fixtures/stylesheets/image_urls/config.rb",
"test/fixtures/stylesheets/image_urls/css/screen.css",
"test/fixtures/stylesheets/image_urls/images/grid.png",
"test/fixtures/stylesheets/image_urls/sass/screen.sass",
"test/io_helper.rb",
"test/rails_helper.rb",
"test/rails_integration_test.rb",
"test/sass_extensions_test.rb",
"test/test_case_helper.rb",
"test/test_helper.rb",
"test/test_rails_helper.rb"
] ]
s.homepage = %q{http://compass-style.org} s.homepage = %q{http://compass-style.org}
s.rdoc_options = ["--charset=UTF-8"] s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"] s.require_paths = ["lib"]
s.rubyforge_project = %q{compass} s.rubyforge_project = %q{compass}
s.rubygems_version = %q{1.3.3} s.rubygems_version = %q{1.3.5}
s.summary = %q{A Real Stylesheet Framework} s.summary = %q{A Real Stylesheet Framework}
s.test_files = [ s.test_files = [
"test/command_line_helper.rb", "test/command_line_helper.rb",
"test/command_line_test.rb", "test/command_line_test.rb",
"test/compass_test.rb", "test/compass_test.rb",
"test/configuration_test.rb", "test/configuration_test.rb",
"test/fixtures/stylesheets/blueprint/config.rb", "test/fixtures/stylesheets/blueprint/config.rb",
"test/fixtures/stylesheets/blueprint/css/typography.css", "test/fixtures/stylesheets/blueprint/css/typography.css",
"test/fixtures/stylesheets/blueprint/images/grid.png", "test/fixtures/stylesheets/blueprint/images/grid.png",
"test/fixtures/stylesheets/blueprint/sass/ie.sass", "test/fixtures/stylesheets/blueprint/sass/ie.sass",
"test/fixtures/stylesheets/blueprint/sass/print.sass", "test/fixtures/stylesheets/blueprint/sass/print.sass",
"test/fixtures/stylesheets/blueprint/sass/screen.sass", "test/fixtures/stylesheets/blueprint/sass/screen.sass",
"test/fixtures/stylesheets/blueprint/sass/typography.sass", "test/fixtures/stylesheets/blueprint/sass/typography.sass",
"test/fixtures/stylesheets/compass/config.rb", "test/fixtures/stylesheets/compass/config.rb",
"test/fixtures/stylesheets/compass/css/layout.css", "test/fixtures/stylesheets/compass/css/layout.css",
"test/fixtures/stylesheets/compass/css/print.css", "test/fixtures/stylesheets/compass/css/print.css",
"test/fixtures/stylesheets/compass/css/reset.css", "test/fixtures/stylesheets/compass/css/reset.css",
"test/fixtures/stylesheets/compass/css/utilities.css", "test/fixtures/stylesheets/compass/css/utilities.css",
"test/fixtures/stylesheets/compass/sass/layout.sass", "test/fixtures/stylesheets/compass/sass/layout.sass",
"test/fixtures/stylesheets/compass/sass/print.sass", "test/fixtures/stylesheets/compass/sass/print.sass",
"test/fixtures/stylesheets/compass/sass/reset.sass", "test/fixtures/stylesheets/compass/sass/reset.sass",
"test/fixtures/stylesheets/compass/sass/utilities.sass", "test/fixtures/stylesheets/compass/sass/utilities.sass",
"test/fixtures/stylesheets/image_urls/config.rb", "test/fixtures/stylesheets/image_urls/config.rb",
"test/fixtures/stylesheets/image_urls/css/screen.css", "test/fixtures/stylesheets/image_urls/css/screen.css",
"test/fixtures/stylesheets/image_urls/images/grid.png", "test/fixtures/stylesheets/image_urls/images/grid.png",
"test/fixtures/stylesheets/image_urls/sass/screen.sass", "test/fixtures/stylesheets/image_urls/sass/screen.sass",
"test/fixtures/stylesheets/yui/config.rb", "test/io_helper.rb",
"test/fixtures/stylesheets/yui/css/mixins.css", "test/rails_helper.rb",
"test/fixtures/stylesheets/yui/sass/base.sass", "test/rails_integration_test.rb",
"test/fixtures/stylesheets/yui/sass/fonts.sass", "test/sass_extensions_test.rb",
"test/fixtures/stylesheets/yui/sass/grids.sass", "test/test_case_helper.rb",
"test/fixtures/stylesheets/yui/sass/mixins.sass", "test/test_helper.rb",
"test/rails_integration_test.rb", "test/test_rails_helper.rb",
"test/sass_extensions_test.rb", "features/command_line.feature",
"test/test_case_helper.rb", "features/step_definitions/command_line_steps.rb"
"test/test_helper.rb",
"test/test_rails_helper.rb"
] ]
if s.respond_to? :specification_version then if s.respond_to? :specification_version then
@ -348,3 +392,4 @@ Gem::Specification.new do |s|
s.add_dependency(%q<haml>, [">= 2.2.0"]) s.add_dependency(%q<haml>, [">= 2.2.0"])
end end
end end

View File

@ -0,0 +1,68 @@
Compass Command Line Documentation
==================================
Extensions Commands
-------------------
# install a global extension. probably requires sudo.
compass extension install extension_name
# install an extension into a project
compass extension unpack extension_name [path/to/project]
# uninstall a local or global extension. global extensions will require sudo.
compass extension uninstall extension_name [path/to/project]
# list the extensions in the project
compass extensions list
# list the extensions available for install
compass extensions available
Project Commands
----------------
# Create a new compass project
compass create path/to/project [--using blueprint] [--sass-dir=sass ...] [--project-type=rails]
# Initialize an existing project to work with compass
compass init rails path/to/project [--using blueprint]
# Install a pattern from an extension into a project
compass install blueprint/buttons [path/to/project]
# Compile the project's sass files into css
compass compile [path/to/project]
# Watch the project for changes and compile whenever it does
compass watch [path/to/project]
# Emit a configuration file at the location specified.
compass config [path/to/config] [--sass-dir=sass --css-dir=css ...]
# Validate the generated CSS.
compass validate [path/to/project]
misc commands
-------------
# Generate a background image that can be used to verify grid alignment
compass grid-img W+GxH [path/to/grid.png]
# Emit the version of compass
compass version
# Get help on compass
compass help
# Get help on an extension
compass help extension_name
# Get help about an extension pattern
compass help extension_name/pattern_name
# Get help about a particular sub command
compass help command_name

183
docs/EXTENSIONS.markdown Normal file
View File

@ -0,0 +1,183 @@
Compass Extensions
==================
Compass, at its heart, is a framework upon which sass-based stylesheet frameworks are built. It provides the tools for building, installing and using reusable stylesheets that provide anything from full-fledged layout frameworks to designs for widgets or even full page designs. All using the power of sass to keep the semantic meaning of the html pages clear and free of design details.
This document describes the compass extension toolset so that you can build your own compass extension.
Basic Extension Layout
----------------------
<pre>
<strong>an_extension</strong>
|
|- <strong>stylesheets</strong> (this directory will be on the sass load path)
| |
| |- an_extension (not technically required, but it's good to scope imports by the name of the extension)
| | |
| | |- _module_one.sass (this file would be imported using <code>@import an_extension/module_one.sass</code>)
| | |- _module_two.sass (this file would be imported using <code>@import an_extension/module_two.sass</code>)
| | |- ...
| |
| |- _an_extension.sass (This file will import the entire extension using <code>@import an_extension.sass</code>)
|
|- <strong>templates</strong> (this is where templates/patterns go)
| |
| |- <strong>project</strong> (this should be provided if you'd like people to be able to base their project on the extension)
| | |
| | |- <strong>manifest.rb</strong> (this file should declare the contents of the template)
| | |- screen.sass (this would be the main stylesheet, importing from your extension and demonstrating its use)
| | |- print.sass (this file would set up basic print styles)
| | |- ie.sass (if you want, you can provide custom styles for IE)
| |
| |- some_pattern
| |
| |- <strong>manifest.rb</strong>
| |- some.sass (some sass is probably in order, always import from the extension library as much as possible)
| |- some_script.js (yes, you can provide javascript code)
| |- some_image.png (and images)
| |- some_content.html.haml (and even html and haml)
| |- some_other_file.txt (and other arbitrary files)
|
|- <strong>lib</strong> (optional ruby code)
|
|- <strong>an_extension.rb</strong> (this code can register your framework if you deviate from conventions and require sass extensions, etc.)
|
|- an_extension
|
|- sass_extensions.rb (this is the standard location to place sass functions)
</pre>
Names in <strong>bold</strong> are part of the extension naming convention.
Generating an Extension
-----------------------
If you want a leg up to get started working on your extension, you can use compass to generate an extension with the following command:
compass -p extension -n an_extension .
This will create a few basic files and folders to get you started, use the -n option to specify the name of your extension.
Advanced Layout Options
-----------------------
### Library File Location
The extension library file referenced above as `an_extension/lib/an_extension.rb` can actually be stored at any of the following three locations:
1. `an_extension/compass_init.rb`
2. `an_extension/lib/an_extension.rb`
3. `an_extension/an_extension.rb`
The first of those locations found (in the above order) will be loaded. The compass_init.rb file takes priority, so that extensions that want to work differently as compass extensions than they do as normal ruby libraries, have a way of targeting compass.
### Stylesheet and Template Locations
If you'd like to store your stylesheets and/or templates in a non-standard location within your extension,
you must provide a library file and register the extension explicitly like so:
base_directory = File.join(File.dirname(__FILE__), '..') # assuming you're in the lib directory
stylesheets_dir = File.join(base_directory, 'my', 'stylesheets') # always use File.join for support on unix and windows
templates_dir = File.join(base_directory, 'my', 'templates') # always use File.join for support on unix and windows
Compass::Frameworks.register('an_extension', :stylesheets_directory => stylesheets_dir, :templates_directory => templates_dir)
If you're following the standard naming convention, but the stylesheet and template directories are not at the top level, you can just do this instead:
base_directory = File.join(File.dirname(__FILE__), '..', 'compass') # path from the library file to where you're keeping your compass stuff.
Compass::Frameworks.register('an_extension', :path => base_directory)
Conventions to Follow
---------------------
The following are not required, but are standards that your framework should attempt to adhere to unless there's a good reason not to do so.
1. Have a single import for your framework.
2. Break up your framework into modules so that people can import just smaller pieces for faster load times when they're not using everything.
3. Use partials (files starting with an underscore) for stylesheets that are meant to be imported. If you do not Sass will generate css
files for your libaries in some configurations.
4. Provide a project template. If you do not, your project should only be providing widgets or page designs, etc.
Building a Template (a.k.a. Pattern)
====================================
Manifest Files
--------------
The manifest file declares the template contents and tells compass information about the files in the template.
### An Example Manifest File
stylesheet 'screen.sass', :media => 'screen, projection'
stylesheet 'partials/_base.sass'
stylesheet 'print.sass', :media => 'print'
stylesheet 'ie.sass', :media => 'screen, projection', :condition => "lt IE 8"
image 'grid.png'
javascript 'script.js'
html 'welcome.html.haml', :erb => true
file 'README'
### Manifest Declarations
There are five kinds of manifest declarations:
1. `stylesheet` - Declares a sass file.
2. `image` - Declares an image.
3. `javascript` - Declares a javascript file.
4. `html` - Declares an html file.
5. `file` - Decares a random file.
All declarations take the path to the file as their first argument. Note that the normal slash `/` can and should be used in a manifest. Compass will take care of the cross platform issues. The path to the file will be reproduced in the user's project, so please keep that in mind when creating folders. The location where files are going to be installed is dictated by the user's project configuration, however, a template can place things into subdirectories relative to
Common options:
* `:erb` - When set to true, the file will be processed via the ERB templating language. See the "Advanced Manifests" section below for more details.
* `:to` - The location where the file should be installed relative to the type-specific location.
* `:like` - Most often used with a `file` declaration, this option allows you to install into the location of another manifest type (and also :css). E.g. :like => :css
Stylesheet options:
* `:media` - this is used as a hint to the user about the media attribute of the stylesheet link tag.
* `:condition` - this is used to hint the user that a conditional comment should be used to import the stylesheet with the given condition.
HTML files:
You can provide html as haml or as plain html. If you provide haml, the haml will be converted to html when it is installed, unless the project allows haml files. Providing html files is usually done to demonstrate how to use a more complicated design and to get the user started off with working product.
### Advanced Manifests and Templates
* ERB Processing - This can be used to customize the contents of the file in an extension template. The template will be processed in the context of a TemplateContext instance, which gives you access to the full project configuration information as well as the command line options. Since it's unlikely many templates will need this functionality, I leave it as an exercise of the user to figure it out and if they can't to contact the compass-devs mailing list for assistance.
* `no_configuration_file!` - calling this method within the manifest will tell the installer to skip the creation of a configuration file.
* `skip_compilation!` - calling this method within the manifest will tell the installer to skip compilation of sass files to css.
Distributing Extensions as Ruby Gems
------------------------------------
How to build and distribute ruby gems is outside the scope of this document. But delivering an extension as a ruby gem makes it easier to manage software dependencies, install, and uninstall.
Tips for Developing Extensions
------------------------------
* If you're developing a simple extension, you may find it convenient to place your extension within an existing compass project in the extension folder.
Installing Extensions
---------------------
TBD: How to install extensions that are not managed via ruby gems and when there's no existing project. Maybe in ~/.compass/extensions?
TBD: How to install extensions for rails projects? Maybe in vendor/plugins/compass_extensions?
To install via ruby gems:
sudo gem install an-extension
compass -r `an_extension` -f an_extension my_project
To install into an existing project, simply place the extension into a project's extension directory. This could be done via a git clone or by extracting an archive.
To install via rubygems into an existing project:
sudo gem install an-extension
# edit the project configuration file and add:
require 'an_extension'

View File

@ -1,3 +1,4 @@
@import blueprint.sass @import blueprint.sass
+blueprint-ie("body.bp") body.bp
+blueprint-ie(true)

View File

@ -1,3 +1,4 @@
@import blueprint.sass @import blueprint.sass
+blueprint-print("body.bp") body.bp
+blueprint-print(true)

View File

@ -1,4 +1,5 @@
@import blueprint.sass @import blueprint.sass
@import compass/reset.sass @import compass/reset.sass
+blueprint("body.bp") body.bp
+blueprint(true)

View File

@ -37,7 +37,7 @@
%hr.space %hr.space
#main #main
%p %p
%img#test{ :src => "test.jpg", :alt => "test" } %img#test.left{ :src => "test.jpg", :alt => "test" }
Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet,
%em %em
consectetuer adipiscing elit consectetuer adipiscing elit

View File

@ -7,9 +7,8 @@
.container .container
+container +container
+blueprint-typography("body.blueprint")
body.blueprint body.blueprint
+blueprint-typography(true)
+blueprint-scaffolding-body +blueprint-scaffolding-body
hr hr
+colruler +colruler

View File

@ -3,9 +3,8 @@
@import blueprint/modules/scaffolding.sass @import blueprint/modules/scaffolding.sass
@import compass/reset.sass @import compass/reset.sass
+blueprint-typography("body.blueprint")
body.blueprint body.blueprint
+blueprint-typography(true)
+blueprint-scaffolding-body +blueprint-scaffolding-body
.container .container
+container +container

57
examples/downloader.rb Normal file
View File

@ -0,0 +1,57 @@
require 'net/http'
require 'fileutils'
require 'rubygems'
require 'zip/zip'
def fetch(uri_str, limit = 10)
raise ArgumentError, 'HTTP redirect too deep' if limit == 0
url = URI.parse(uri_str)
http = Net::HTTP.new(url.host, url.port)
http.open_timeout = 2
http.read_timeout = 30
response = http.start do |http|
puts "getting #{url.path}"
http.request_get(url.path)
end
case response
when Net::HTTPSuccess then response
when Net::HTTPRedirection then fetch(response['location'], limit - 1)
else
response.error!
end
end
def install_from_github(user, project, ext_name, working_directory = Dir.pwd)
download_link = "http://github.com/#{user}/#{project}/zipball/master"
extdir = File.join(working_directory,'extensions')
if !File.exists?(extdir)
begin
puts "Downloading the #{ext_name} plugin into #{extdir}."
FileUtils.mkdir(extdir)
zipfile = File.join(extdir, "#{ext_name}.zip")
open(zipfile, "wb") do |tgz|
tgz << fetch(download_link).body
end
puts "Unzipping the #{ext_name} plugin."
Zip::ZipFile::open(zipfile) { |zf|
zf.each { |e|
fpath = File.join(extdir, e.name)
FileUtils.mkdir_p(File.dirname(fpath))
zf.extract(e, fpath)
}
}
File.unlink(zipfile)
funky_directory = Dir.glob(File.join(extdir,"#{user}-#{project}-*"))[0]
FileUtils.mv(funky_directory, File.join(extdir, ext_name))
puts "#{ext_name} installed."
rescue Exception => e
FileUtils.rm_rf(extdir)
raise
end
end
end

View File

@ -0,0 +1,4 @@
require File.join(File.dirname(__FILE__), '..', 'downloader')
install_from_github('chriseppstein', 'compass-960-plugin', 'ninesixty')

View File

@ -0,0 +1,9 @@
project_type = :stand_alone
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "src"
images_dir = "images"
output_style = :compact
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true

View File

@ -0,0 +1,16 @@
/*
960 Grid System ~ Core CSS.
Learn more ~ http://960.gs/
Licensed under GPL and MIT.
@import compass/utilities/general/reset.sass
@import 960/grid.sass
+global-reset
.container_12
+grid-system(12)
.container_16
+grid-system(16)

View File

@ -0,0 +1,10 @@
/*
960 Grid System ~ Text CSS.
Learn more ~ http://960.gs/
Licensed under GPL and MIT.
@import 960/text.sass
+text

View File

@ -0,0 +1,3 @@
require File.join(File.dirname(__FILE__), '..', 'downloader')
install_from_github('chriseppstein', 'yui-compass-plugin', 'yui')

View File

@ -0,0 +1,226 @@
Feature: Command Line
In order to manage my stylesheets
As a user on the command line
I want to create a new project
Scenario: Install a project without a framework
When I create a project using: compass create my_project
Then a directory my_project/ is created
And a configuration file my_project/config.rb is created
And a sass file my_project/src/screen.sass is created
And a sass file my_project/src/print.sass is created
And a sass file my_project/src/ie.sass is created
And a sass file my_project/src/screen.sass is compiled
And a sass file my_project/src/print.sass is compiled
And a sass file my_project/src/ie.sass is compiled
And a css file my_project/stylesheets/screen.css is created
And a css file my_project/stylesheets/print.css is created
And a css file my_project/stylesheets/ie.css is created
And I am told how to link to /stylesheets/screen.css for media "screen, projection"
And I am told how to link to /stylesheets/print.css for media "print"
And I am told how to conditionally link "IE" to /stylesheets/ie.css for media "screen, projection"
Scenario: Install a project with blueprint
When I create a project using: compass create bp_project --using blueprint
Then a directory bp_project/ is created
And a configuration file bp_project/config.rb is created
And a sass file bp_project/src/screen.sass is created
And a sass file bp_project/src/print.sass is created
And a sass file bp_project/src/ie.sass is created
And a sass file bp_project/src/screen.sass is compiled
And a sass file bp_project/src/print.sass is compiled
And a sass file bp_project/src/ie.sass is compiled
And a css file bp_project/stylesheets/screen.css is created
And a css file bp_project/stylesheets/print.css is created
And a css file bp_project/stylesheets/ie.css is created
And an image file bp_project/images/grid.png is created
And I am told how to link to /stylesheets/screen.css for media "screen, projection"
And I am told how to link to /stylesheets/print.css for media "print"
And I am told how to conditionally link "lt IE 8" to /stylesheets/ie.css for media "screen, projection"
Scenario: Install a project with specific directories
When I create a project using: compass create custom_project --using blueprint --sass-dir sass --css-dir css --images-dir assets/imgs
Then a directory custom_project/ is created
And a directory custom_project/sass/ is created
And a directory custom_project/css/ is created
And a directory custom_project/assets/imgs/ is created
And a sass file custom_project/sass/screen.sass is created
And a css file custom_project/css/screen.css is created
And an image file custom_project/assets/imgs/grid.png is created
Scenario: Perform a dry run of creating a project
When I create a project using: compass create my_project --dry-run
Then a directory my_project/ is not created
But a configuration file my_project/config.rb is reported created
And a sass file my_project/src/screen.sass is reported created
And a sass file my_project/src/print.sass is reported created
And a sass file my_project/src/ie.sass is reported created
And I am told how to link to /stylesheets/screen.css for media "screen, projection"
And I am told how to link to /stylesheets/print.css for media "print"
And I am told how to conditionally link "IE" to /stylesheets/ie.css for media "screen, projection"
Scenario: Creating a bare project
When I create a project using: 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 bare_project/src/ is created
And a directory bare_project/stylesheets/ is not created
And I am congratulated
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 create a project using: compass create bare_project --using blueprint --bare
Then an error message is printed out: A bare project cannot be created when a framework is specified.
And the command exits with a non-zero error code
Scenario: Initializing a rails project
Given I'm in a newly created rails project: my_rails_project
When I initialize a project using: compass init rails --sass-dir app/stylesheets --css-dir public/stylesheets/compiled
Then a config file config/compass.rb is reported created
Then a config file config/compass.rb is created
And a sass file config/initializers/compass.rb is created
And a sass file app/stylesheets/screen.sass is created
And a sass file app/stylesheets/print.sass is created
And a sass file app/stylesheets/ie.sass is created
Scenario: Compiling an existing project.
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile
Then a directory tmp/ is created
And a sass file sass/layout.sass is reported compiled
And a sass file sass/print.sass is reported compiled
And a sass file sass/reset.sass is reported compiled
And a sass file sass/utilities.sass is reported compiled
And a css file tmp/layout.css is created
And a css file tmp/print.css is created
And a css file tmp/reset.css is created
And a css file tmp/utilities.css is created
Scenario: Compiling an existing project with a specified project
Given I am using the existing project in test/fixtures/stylesheets/compass
And I am in the parent directory
When I run: compass compile tmp_compass
Then a directory tmp_compass/tmp/ is created
And a sass file tmp_compass/sass/layout.sass is reported compiled
And a sass file tmp_compass/sass/print.sass is reported compiled
And a sass file tmp_compass/sass/reset.sass is reported compiled
And a sass file tmp_compass/sass/utilities.sass is reported compiled
And a css file tmp_compass/tmp/layout.css is created
And a css file tmp_compass/tmp/print.css is created
And a css file tmp_compass/tmp/reset.css is created
And a css file tmp_compass/tmp/utilities.css is created
Scenario: Recompiling a project with no changes
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile
And I run: compass compile
Then a sass file sass/layout.sass is reported unchanged
And a sass file sass/print.sass is reported unchanged
And a sass file sass/reset.sass is reported unchanged
And a sass file sass/utilities.sass is reported unchanged
Scenario: Installing a pattern into a project
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass install blueprint/buttons
Then a sass file sass/buttons.sass is created
And an image file images/buttons/cross.png is created
And an image file images/buttons/key.png is created
And an image file images/buttons/tick.png is created
And a css file tmp/buttons.css is created
@now
Scenario: Basic help
When I run: compass help
Then I should see the following "primary" commands:
| compile |
| create |
| init |
| watch |
And I should see the following "other" commands:
| config |
| grid-img |
| help |
| install |
| interactive |
| stats |
| validate |
| version |
Scenario: Recompiling a project with no material changes
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile
And I wait 1 second
And I touch sass/layout.sass
And I run: compass compile
Then a sass file sass/layout.sass is reported compiled
Then a css file tmp/layout.css is reported identical
And a sass file sass/print.sass is reported unchanged
And a sass file sass/reset.sass is reported unchanged
And a sass file sass/utilities.sass is reported unchanged
Scenario: Recompiling a project with changes
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile
And I wait 1 second
And I add some sass to sass/layout.sass
And I run: compass compile
Then a sass file sass/layout.sass is reported compiled
And a css file tmp/layout.css is reported overwritten
And a sass file sass/print.sass is reported unchanged
And a sass file sass/reset.sass is reported unchanged
And a sass file sass/utilities.sass is reported unchanged
Scenario: Watching a project for changes
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile
And I run in a separate process: compass watch
And I wait 1 second
And I touch sass/layout.sass
And I wait 2 seconds
And I shutdown the other process
Then a css file tmp/layout.css is reported identical
Scenario: Generating a grid image so that I can debug my grid alignments
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass grid-img 30+10x24
Then a png file images/grid.png is created
Scenario: Generating a grid image to a specified path with custom dimensions
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass grid-img 50+10x24 assets/wide_grid.png
Then a directory assets is created
Then a png file assets/wide_grid.png is created
Scenario: Generating a grid image with invalid dimensions
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass grid-img 50x24 assets/wide_grid.png
Then a directory assets is not created
And a png file assets/wide_grid.png is not created
Scenario: Generate a compass configuration file
Given I should clean up the directory: config
When I run: compass config config/compass.rb --sass-dir sass --css-dir assets/css
Then a configuration file config/compass.rb is created
And the following configuration properties are set in config/compass.rb:
| property | value |
| sass_dir | sass |
| css_dir | assets/css |
Scenario: Validate the generated CSS
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass validate
Then my css is validated
And I am informed that my css is valid.
Scenario: Get stats for my project
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass stats
Then I am told statistics for each file:
| Filename | Rules | Properties | Mixins Defs | Mixins Used | CSS Rules | CSS Properties |
| sass/layout.sass | 0 | 0 | 0 | 1 | 5 | 9 |
| sass/print.sass | 0 | 0 | 0 | 2 | 61 | 61 |
| sass/reset.sass | 4 | 1 | 0 | 2 | 191 | 665 |
| sass/utilities.sass | 2 | 0 | 0 | 2 | 5 | 11 |
| Total.* | 6 | 1 | 0 | 7 | 262 | 746 |

View File

@ -0,0 +1,20 @@
Feature: Extensions
In order to have an open source ecosystem for stylesheets
As a compass user
I can install extensions that others have created
And I can create and publish my own extensions
Scenario: Extensions directory for stand_alone projects
Given I am using the existing project in test/fixtures/stylesheets/compass
And the "extensions" directory exists
And and I have a fake extension at extensions/testing
When I run: compass --list-frameworks
Then the list of frameworks includes "testing"
Scenario: Extensions directory for rails projects
Given I'm in a newly created rails project: my_rails_project
And the "my_rails_project/vendor/plugins/compass/extensions" directory exists
And and I have a fake extension at my_rails_project/vendor/plugins/compass/extensions/testing
When I run: compass --list-frameworks
Then the list of frameworks includes "testing"

View File

@ -0,0 +1,223 @@
require 'spec/expectations'
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '../../test')))
require 'test_helper'
require 'compass/exec'
include Compass::CommandLineHelper
include Compass::IoHelper
include Compass::RailsHelper
Before do
Compass.reset_configuration!
@cleanup_directories = []
@original_working_directory = Dir.pwd
end
After do
Dir.chdir @original_working_directory
@cleanup_directories.each do |dir|
FileUtils.rm_rf dir
end
end
# Given Preconditions
Given %r{^I am using the existing project in ([^\s]+)$} do |project|
tmp_project = "tmp_#{File.basename(project)}"
@cleanup_directories << tmp_project
FileUtils.cp_r project, tmp_project
Dir.chdir tmp_project
end
Given %r{^I am in the parent directory$} do
Dir.chdir ".."
end
Given /^I'm in a newly created rails project: (.+)$/ do |project_name|
@cleanup_directories << project_name
begin
generate_rails_app project_name
Dir.chdir project_name
rescue LoadError
pending "Missing Ruby-on-rails gems: sudo gem install rails"
end
end
Given /^I should clean up the directory: (\w+)$/ do |directory|
@cleanup_directories << directory
end
# When Actions are performed
When /^I create a project using: compass create ([^\s]+) ?(.+)?$/ do |dir, args|
@cleanup_directories << dir
compass 'create', dir, *(args || '').split
end
When /^I initialize a project using: compass init ?(.+)?$/ do |args|
compass 'init', *(args || '').split
end
When /^I run: compass ([^\s]+) ?(.+)?$/ do |command, args|
compass command, *(args || '').split
end
When /^I run in a separate process: compass ([^\s]+) ?(.+)?$/ do |command, args|
unless @other_process = fork
@last_result = ''
@last_error = ''
Signal.trap("HUP") do
open('/tmp/last_result.compass_test.txt', 'w') do |file|
file.puts $stdout.string
end
open('/tmp/last_error.compass_test.txt', 'w') do |file|
file.puts @stderr.string
end
exit!
end
# this command will run forever
# we kill it with a HUP signal from the parent process.
args = (args || '').split
args << { :wait => 5 }
compass command, *args
exit!
end
end
When /^I shutdown the other process$/ do
Process.kill("HUP", @other_process)
Process.wait
@last_result = File.read('/tmp/last_result.compass_test.txt')
@last_error = File.read('/tmp/last_error.compass_test.txt')
end
When /^I touch ([^\s]+)$/ do |filename|
FileUtils.touch filename
end
When /^I wait ([\d.]+) seconds?$/ do |count|
sleep count.to_f
end
When /^I add some sass to ([^\s]+)$/ do |filename|
open(filename, "w+") do |file|
file.puts ".added .some .arbitrary"
file.puts " sass: code"
end
end
# Then postconditions
Then /^a directory ([^ ]+) is (not )?created$/ do |directory, negated|
File.directory?(directory).should == !negated
end
Then /an? \w+ file ([^ ]+) is (not )?created/ do |filename, negated|
File.exists?(filename).should == !negated
end
Then /an? \w+ file ([^ ]+) is reported created/ do |filename|
@last_result.should =~ /create #{Regexp.escape(filename)}/
end
Then /a \w+ file ([^ ]+) is (?:reported )?compiled/ do |filename|
@last_result.should =~ /compile #{Regexp.escape(filename)}/
end
Then /a \w+ file ([^ ]+) is reported unchanged/ do |filename|
@last_result.should =~ /unchanged #{Regexp.escape(filename)}/
end
Then /a \w+ file ([^ ]+) is reported identical/ do |filename|
@last_result.should =~ /identical #{Regexp.escape(filename)}/
end
Then /a \w+ file ([^ ]+) is reported overwritten/ do |filename|
@last_result.should =~ /overwrite #{Regexp.escape(filename)}/
end
Then /I am told how to link to ([^ ]+) for media "([^"]+)"/ do |stylesheet, media|
@last_result.should =~ %r{<link href="#{stylesheet}" media="#{media}" rel="stylesheet" type="text/css" />}
end
Then /I am told how to conditionally link "([^"]+)" to ([^ ]+) for media "([^"]+)"/ do |condition, stylesheet, media|
@last_result.should =~ %r{<!--\[if #{condition}\]>\s+<link href="#{stylesheet}" media="#{media}" rel="stylesheet" type="text/css" />\s+<!\[endif\]-->}mi
end
Then /^an error message is printed out: (.+)$/ do |error_message|
@last_error.should =~ Regexp.new(Regexp.escape(error_message))
end
Then /^the command exits with a non\-zero error code$/ do
@last_exit_code.should_not == 0
end
Then /^I am congratulated$/ do
@last_result.should =~ /Congratulations!/
end
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 /^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
Then /^I should be shown a list of "([^"]+)" commands$/ do |kind|
@last_result.should =~ /^#{kind.capitalize} Commands:$/
@last_command_list = []
found = false
indent = nil
@last_result.split("\n").each do |line|
if line =~ /^#{kind.capitalize} Commands:$/
found = true
elsif found && line =~ /^\s+/
@last_command_list << line
elsif found && line =~ /^$|^\w/
break
end
end
end
Then /^the list of commands should describe the ([^ ]+) command$/ do |command|
@last_result.should =~ /^\s+\* #{command}\s+- [A-Z].+$/
end
Then /^the following configuration properties are set in ([^ ]+):$/ do |config_file, table|
config = Compass::Configuration::Data.new_from_file(config_file)
table.hashes.each do |hash|
config.send(hash['property']).should == hash['value']
end
end
Then /^my css is validated$/ do
if @last_error =~ /The Compass CSS Validator could not be loaded/
pending "Missing Dependency: sudo gem install chriseppstein-compass-validator"
else
@last_result.should =~ /Compass CSS Validator/
end
end
Then /^I am informed that my css is valid.$/ do
@last_result.should =~ /Your CSS files are valid\./
end
Then /^I am told statistics for each file:$/ do |table|
# table is a Cucumber::Ast::Table
table.raw.each do |row|
re = Regexp.new row.join(' *\| *')
@last_result.should =~ re
end
end
Then /^I should see the following "([^"]+)" commands:$/ do |kind, table|
Then %Q{I should be shown a list of "#{kind}" commands}
commands = @last_command_list.map{|c| c =~ /^\s+\* ([^ ]+)\s+- [A-Z].+$/; [$1]}
table.diff!(commands)
end

View File

@ -0,0 +1,13 @@
Given /^the "([^\"]*)" directory exists$/ do |directory|
FileUtils.mkdir_p directory
end
Given /^and I have a fake extension at (.*)$/ do |directory|
FileUtils.mkdir_p File.join(directory, 'stylesheets')
FileUtils.mkdir_p File.join(directory, 'templates/project')
end
Then /^the list of frameworks includes "([^\"]*)"$/ do |framework|
@last_result.split("\n").map{|f| f.strip}.should include(framework)
end

View File

@ -1,2 +0,0 @@
blueprint_dir = File.join(Compass.base_directory, 'frameworks', 'blueprint')
Compass::Frameworks.register('blueprint', blueprint_dir)

View File

@ -1,93 +0,0 @@
// The blueprint IE mixins should be mixed into a stylesheet that gets conditionally included
// into IE like so:
// <!--[if IE]><link rel="stylesheet" href="ie.css"
// type="text/css" media="screen, projection"><![endif]-->
// The +blueprint-ie mixin must be mixed into the top level of your stylesheet.
// However, you can customize the body selector if you wish to control the scope
// of this mixin. Examples:
// Apply to any page including the stylesheet:
// +blueprint-ie
// Scoped by a single presentational body class:
// +blueprint-ie("body.blueprint")
// Semantically:
// +blueprint-ie("body#page-1, body#page-2, body.a-special-page-type")
// Alternatively, you can use the +blueprint-ie-body and +blueprint-ie-defaults
// mixins to construct your own semantic style rules.
=blueprint-ie(!body_selector = "body")
#{!body_selector}
+blueprint-ie-body
@if !body_selector != "body"
+blueprint-ie-defaults
@if !body_selector == "body"
+blueprint-ie-defaults
=blueprint-ie-body
:text-align center
+blueprint-ie-hacks
=blueprint-ie-hacks
* html &
legend
:margin 0px -8px 16px 0
:padding 0
html>&
p code
:*white-space normal
// Fixes for Blueprint "inline" forms in IE
=blueprint-inline-form-ie
div, p
:vertical-align middle
label
:position relative
:top -0.25em
input
&.checkbox, &.radio, &.button, button
:margin 0.5em 0
=blueprint-ie-defaults
.container
:text-align left
ol
:margin-left 2em
sup
:vertical-align text-top
sub
:vertical-align text-bottom
hr
:margin -8px auto 11px
img
:-ms-interpolation-mode bicubic
fieldset
:padding-top 0
input
&.text
:margin 0.5em 0
:background-color #fff
:border 1px solid #bbb
&:focus
:border 1px solid #666
&.title
:margin 0.5em 0
:background-color #fff
:border 1px solid #bbb
&:focus
:border 1px solid #666
&.checkbox
:position relative
:top 0.25em
&.radio
:position relative
:top 0.25em
&.button
:position relative
:top 0.25em
textarea
:margin 0.5em 0
select
:margin 0.5em 0
button
:position relative
:top 0.25em

View File

@ -1,83 +0,0 @@
@import modules/typography.sass
@import compass/utilities/general/float.sass
// The +blueprint-print mixin must be mixed into the top level of your stylesheet.
// However, you can customize the body selector if you wish to control the scope
// of this mixin. Examples:
// Apply to any page including the stylesheet:
// +blueprint-print
// Scoped by a single presentational body class:
// +blueprint-print("body.blueprint")
// Semantically:
// +blueprint-print("body#page-1, body#page-2, body.a-special-page-type")
// Alternatively, you can use the +blueprint-print-body and +blueprint-print-defaults
// mixins to construct your own semantic style rules.
=blueprint-print(!body_selector = "body")
#{!body_selector}
+blueprint-print-body
@if !body_selector != "body"
+blueprint-print-defaults
@if !body_selector == "body"
+blueprint-print-defaults
// This style is in blueprint, but I think it's annoying and it doesn't work in all browsers.
// Feel free to mix it into anchors where you want it.
=blueprint-show-link-urls
&:after
:content " (" attr(href) ")"
:font-size 90%
=blueprint-print-body
:line-height 1.5
:font-family= !blueprint_font_family
:color #000
:background none
:font-size 10pt
=blueprint-print-defaults
.container
:background none
hr
:background #ccc
:color #ccc
:width 100%
:height 2px
:margin 2em 0
:padding 0
:border none
&.space
:background #fff
:color #fff
h1, h2, h3, h4, h5, h6
:font-family= !blueprint_font_family
code
:font
:size .9em
:family= !blueprint_fixed_font_family
img
+float-left
:margin 1.5em 1.5em 1.5em 0
a
img
:border none
&:link,
&:visited
:background transparent
:font-weight 700
:text-decoration underline
p img.top
:margin-top 0
blockquote
:margin 1.5em
:padding 1em
:font-style italic
:font-size .9em
.small
:font-size .9em
.large
:font-size 1.1em
.quiet
:color #999
.hide
:display none

View File

@ -1,15 +0,0 @@
@import modules/colors.sass
@import modules/grid.sass
@import modules/typography.sass
@import modules/utilities.sass
@import modules/form.sass
@import modules/interaction.sass
@import modules/debug.sass
=blueprint(!body_selector = "body")
+blueprint-typography(!body_selector)
+blueprint-utilities
+blueprint-grid
+blueprint-debug
+blueprint-interaction
+blueprint-form

View File

@ -1,58 +0,0 @@
@import colors.sass
=blueprint-interaction
.error
+error
.notice
+notice
.success
+success
.hide
:display none
.highlight
+highlight
.added
+added
.removed
+removed
=feedback-base
:padding .8em
:margin-bottom 1em
:border= 2px "solid" !feedback_border_color
=error
+feedback-base
:background = !error_bg_color
:color = !error_color
:border-color = !error_border_color
a
:color = !error_color
=notice
+feedback-base
:background = !notice_bg_color
:color = !notice_color
:border-color = !notice_border_color
a
:color = !notice_color
=success
+feedback-base
:background = !success_bg_color
:color = !success_color
:border-color = !success_border_color
a
:color = !success_color
=highlight
:background = !highlight_color
=added
:background = !added_bg_color
:color = !added_color
=removed
:background = !removed_bg_color
:color = !removed_color

View File

@ -1,104 +0,0 @@
@import grid.sass
@import compass/utilities/general/float.sass
// Main layout grid, override these constants to build your grid and container sizes.
!blueprint_grid_columns ||= 24
!blueprint_grid_width ||= 30px
!blueprint_grid_margin ||= 10px
!blueprint_grid_outer_width = !blueprint_grid_width + !blueprint_grid_margin
!blueprint_container_size = !blueprint_grid_outer_width * !blueprint_grid_columns - !blueprint_grid_margin
// Columns
// Note: If you use this mixin without the class and want to support ie6
// you must set text-align left on your container element in an IE stylesheet.
=container
:width = !blueprint_container_size
:margin 0 auto
:direction rtl
+clearfix
// The last column in a row needs this mixin or it will end up on the next row.
// TODO add this to span mixin when we have optional arguments
=last
:margin-left 0
=column-base(!last = false)
+float-right
@if !last
+last
@else
:margin-left = !blueprint_grid_margin
* html &
:overflow-x hidden
// Mixin to a column to append n empty cols.
=append(!n)
:padding-left = (!blueprint_grid_outer_width) * !n
// Mixin to a column to prepend n empty cols.
=prepend(!n)
:padding-right = (!blueprint_grid_outer_width) * !n
// mixin to a column to move it n columns to the left
=pull(!n, !last = false)
:position relative
@if !last
:margin-right = (-!blueprint_grid_outer_width * !n) + !blueprint_grid_margin
@else
:margin-right = -!blueprint_grid_outer_width * !n
// mixin to a column to push it n columns to the right
=push(!n)
+float-right
:position relative
:margin
:top 0
:left = -!blueprint_grid_outer_width * !n
:bottom 1.5em
:right = !blueprint_grid_outer_width * !n
// Border on left hand side of a column.
=border
:padding-left = !blueprint_grid_margin / 2 - 1
:margin-left = !blueprint_grid_margin / 2
:border-left 1px solid #eee
// Border with more whitespace, spans one column.
=colborder
:padding-left= (!blueprint_grid_width - 2 * !blueprint_grid_margin - 1)/2
:margin-left= (!blueprint_grid_width - 2 * !blueprint_grid_margin)/2
:border-left 1px solid #eee
=rtl-typography(!body_selector = "body")
html #{!body_selector}
:font-family Arial, sans-serif
@if !body_selector != "body"
+rtl-typography-defaults
@if !body_selector == "body"
body
+rtl-typography-defaults
=rtl-typography-defaults
h1, h2, h3, h4, h5, h6
:font-family Arial, sans-serif
pre, code, tt
:font-family monospace
p
img.right
+float-left
:margin 1.5em 1.5em 1.5em 0
:padding 0
img.left
+float-right
:margin 1.5em 0 1.5em 1.5em
:padding 0
dd, ul, ol
:margin-left 0
:margin-right 1.5em
td, th
:text-align right

View File

@ -1,155 +0,0 @@
@import colors.sass
@import compass/utilities/links/link_colors.sass
@import compass/utilities/general/float.sass
!blueprint_font_family ||= "Helvetica Neue, Arial, Helvetica, sans-serif"
!blueprint_fixed_font_family ||= "'andale mono', 'lucida console', monospace"
!blueprint_font_size ||= 12px
// The +blueprint-typography mixin must be mixed into the top level of your stylesheet.
// However, you can customize the body selector if you wish to control the scope
// of this mixin. Examples:
// Apply to any page including the stylesheet:
// +blueprint-typography
// Scoped by a single presentational body class:
// +blueprint-typography("body.blueprint")
// Semantically:
// +blueprint-typography("body#page-1, body#page-2, body.a-special-page-type")
// Alternatively, you can use the +blueprint-typography-body and +blueprint-typography-defaults
// mixins to construct your own semantic style rules.
=blueprint-typography(!body_selector = "body")
#{!body_selector}
+blueprint-typography-body
@if !body_selector != "body"
+blueprint-typography-defaults
@if !body_selector == "body"
+blueprint-typography-defaults
=normal-text
:font-family= !blueprint_font_family
:color= !font_color
=fixed-width-text
:font= 1em !blueprint_fixed_font_family
:line-height 1.5
=header-text
:font-weight normal
:color= !header_color
=quiet
:color= !quiet_color
=loud
:color= !loud_color
=blueprint-typography-body(!font_size = !blueprint_font_size)
:line-height 1.5
+normal-text
:font-size= 100% * !font_size / 16px
=blueprint-typography-defaults
h1
+header-text
:font-size 3em
:line-height 1
:margin-bottom 0.5em
img
:margin 0
h2
+header-text
:font-size 2em
:margin-bottom 0.75em
h3
+header-text
:font-size 1.5em
:line-height 1
:margin-bottom 1em
h4
+header-text
:font-size 1.2em
:line-height 1.25
:margin-bottom 1.25em
h5
+header-text
:font-size 1em
:font-weight bold
:margin-bottom 1.5em
h6
+header-text
:font-size 1em
:font-weight bold
h2 img, h3 img, h4 img, h5 img, h6 img
:margin 0
p
:margin 0 0 1.5em
img.left
+float-left
:margin 1.5em 1.5em 1.5em 0
:padding 0
img.right
+float-right
:margin 1.5em 0 1.5em 1.5em
:padding 0
a
:text-decoration underline
+link-colors(!link_color, !link_hover_color, !link_active_color, !link_visited_color, !link_focus_color)
blockquote
:margin 1.5em
:color #666
:font-style italic
strong
:font-weight bold
em
:font-style italic
dfn
:font-style italic
:font-weight bold
sup, sub
:line-height 0
abbr, acronym
:border-bottom 1px dotted #666
address
:margin 0 0 1.5em
:font-style italic
del
:color #666
pre
:margin 1.5em 0
:white-space pre
pre, code, tt
+fixed-width-text
li ul, li ol
:margin 0 1.5em
ul
:margin 0 1.5em 1.5em 1.5em
:list-style-type disc
ol
:margin 0 1.5em 1.5em 1.5em
:list-style-type decimal
dl
:margin 0 0 1.5em 0
dt
:font-weight bold
dd
:margin-left 1.5em
table
:margin-bottom 1.4em
:width 100%
th
:font-weight bold
thead th
:background= !blueprint_table_header_color
th, td, caption
:padding 4px 10px 4px 5px
tr.even td
:background= !blueprint_table_stripe_color
tfoot
:font-style italic
caption
:background #eee
.quiet
+quiet
.loud
+loud

View File

@ -1,5 +0,0 @@
stylesheet 'buttons.sass', :media => 'screen, projection'
image 'buttons/cross.png'
image 'buttons/key.png'
image 'buttons/tick.png'

View File

@ -1,10 +0,0 @@
stylesheet "link_icons.sass", :media => 'screen, projection'
image 'link_icons/doc.png'
image 'link_icons/email.png'
image 'link_icons/external.png'
image 'link_icons/feed.png'
image 'link_icons/im.png'
image 'link_icons/pdf.png'
image 'link_icons/visited.png'
image 'link_icons/xls.png'

View File

@ -1,15 +0,0 @@
@import blueprint.sass
+blueprint-ie
// Note :
//
// Compass will center text to fix IE6 container centering.
// This means all your texts will be centered under all version of IE by default.
// Please don't forget to restore the correct behavior to your main container (but not the body tag!)
//
// Example :
//
// .container, .footer
// :text-align left

View File

@ -1,6 +0,0 @@
stylesheet 'screen.sass', :media => 'screen, projection'
stylesheet 'partials/_base.sass'
stylesheet 'print.sass', :media => 'print'
stylesheet 'ie.sass', :media => 'screen, projection', :condition => "lt IE 8"
image 'grid.png'

View File

@ -1,3 +0,0 @@
@import blueprint.sass
+blueprint-print

View File

@ -1,2 +0,0 @@
compass_dir = File.join(Compass.base_directory, 'frameworks', 'compass')
Compass::Frameworks.register('compass', compass_dir)

View File

@ -1 +0,0 @@
@import compass/utilities.sass

View File

@ -1,24 +0,0 @@
// Classes that are useful for controlling what gets printed.
// You must mix +print-utilities into your print stylesheet
// and +print-utilities("screen") into your screen stylesheet.
// Note: these aren't semantic.
=print-utilities(!media = "print")
@if !media == "print"
.noprint,
.no-print
:display none
address, blockquote, center, dir, div, dd, dl, dt,
fieldset, form, frameset, h1, h2, h3, h4, h5, h6, hr,
isindex, li, menu, noframes, noscript, ol, p, pre,
table, tbody, td, tfoot, th, thead, tr, ul
&.print-only
:display block
a, abbr, acronym, b, basefont, bdo, big, br, cite,
code, dfn, em, font, i, img, input, kbd, label, q, s,
samp, select, small, span, strike, strong, sub, sup,
textarea, tt, u, var
&.print-only
:display inline
@else
.print-only
:display none

View File

@ -1 +0,0 @@
@import sprites/sprite_img.sass

View File

@ -1,6 +0,0 @@
=inline-block
:zoom 1
:display inline
:display -moz-inline-box
:display inline-block
:vertical-align top

View File

@ -1,19 +0,0 @@
// Emits styles for a tag cloud
=tag-cloud(!base_size = 1em)
:font-size= !base_size
:line-height= 1.2 * !base_size
.xxs, .xs, .s, .l, .xl, .xxl
:line-height= 1.2 * !base_size
.xxs
:font-size= !base_size / 2.0
.xs
:font-size= 2.0 * !base_size / 3.0
.s
:font-size= 3.0 * !base_size / 4.0
.l
:font-size= 4.0 * !base_size / 3.0
.xl
:font-size= 3.0 * !base_size / 2.0
.xxl
:font-size= 2.0 * !base_size

View File

@ -1,5 +0,0 @@
// A link that looks and acts like the text it is contained within
=unstyled-link
:color inherit
:text-decoration inherit
:cursor inherit

View File

@ -1,12 +0,0 @@
!sprite_image_default_width ||= 32px
!sprite_image_default_height ||= 32px
!sprite_image_default_margin ||= 0px
// Simplest use: +sprite-img("icons-32.png", 1)
=sprite-img(!img, !col, !row = 1, !width = !sprite_image_default_width, !height = !sprite_image_default_height, !margin = !sprite_image_default_margin)
!x = ((!col - 1) * -!width) - ((!col - 1) * !margin)
!y = ((!row - 1) * -!height) - ((!row - 1) * !margin)
:background= image_url(!img) "no-repeat" !x !y
:width= !width
:height= !height
:overflow hidden

View File

@ -1,20 +0,0 @@
=alternating-rows-and-columns(!even_row_color, !odd_row_color, !dark_intersection, !header_color = #FFF, !footer_color = #FFF)
th
:background-color= !header_color
&.even
:background-color= !header_color - !dark_intersection
tr.odd
td
:background-color= !odd_row_color
&.even
:background-color= !odd_row_color - !dark_intersection
tr.even
td
:background-color= !even_row_color
&.even
:background-color= !even_row_color - !dark_intersection
tfoot
th, td
:background-color= !footer_color
&.even
:background-color= !footer_color - !dark_intersection

View File

@ -1,27 +0,0 @@
=outer-table-borders(!width = 2px, !color = black)
:border= !width "solid" !color
thead
th
:border-bottom= !width "solid" !color
tfoot
th, td
:border-top= !width "solid" !color
th
&:first-child
:border-right= !width "solid" !color
=inner-table-borders(!width = 2px, !color = black)
th, td
:border
:right= !width "solid" !color
:bottom= !width "solid" !color
:left-width 0px
:top-width 0px
&:last-child,
&.last
:border-right-width 0px
tbody, tfoot
tr:last-child,
tr.last
th, td
:border-bottom-width 0px

View File

@ -1,9 +0,0 @@
=table-scaffolding
th
:text-align center
:font-weight bold
td,
th
:padding 2px
&.numeric
:text-align right

View File

@ -1,2 +0,0 @@
file 'xml/ellipsis.xml', :like => :css
stylesheet 'ellipsis.sass'

View File

@ -1,2 +0,0 @@
yui_dir = File.join(Compass.base_directory, 'frameworks', 'yui')
Compass::Frameworks.register('yui', yui_dir)

View File

@ -1,15 +0,0 @@
Whatever parts of this port of YUI to Sass that are copyrightable, are Copyright (c) 2008, Christopher Eppstein. All Rights Reserved.
The original CSS required this copyright notice to be present in redistributions, so to be on the safe side:
Copyright (c) 2008, Yahoo! Inc.
All rights reserved.
Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Yahoo! Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Yahoo! Inc.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,7 +0,0 @@
@import yui/modules/base.sass
@import yui/modules/fonts.sass
@import yui/modules/grids.sass
=yui
+yui-base
+yui-base-fonts
+yui-grids

View File

@ -1,60 +0,0 @@
=yui-base
h1
:font-size 138.5%
h2
:font-size 123.1%
h3
:font-size 108%
h1, h2, h3
:margin 1em 0
h1,h2, h3, h4, h5, h6, strong
:font-weight bold
abbr, acronym
:border-bottom 1px dotted #000
:cursor help
em
:font-style italic
blockquote
:margin 1em
ul
:margin 1em
:margin-left 2em
li
:list-style disc outside
ol
:margin 1em
:margin-left 2em
li
:list-style decimal outside
dl
:margin 1em
:margin-left 2em
dd
:margin-left 1em
th
:border 1px solid #000
:padding .5em
:font-weight bold
:text-align center
td
:border 1px solid #000
:padding .5em
caption
:margin-bottom .5em
:text-align center
p, fieldset, table
:margin-bottom 1em

View File

@ -1,38 +0,0 @@
!yui_default_base_font_size ||= 13px
!yui_default_base_line_height ||= 1.231
!yui_default_font_family ||= "arial,helvetica,clean,sans-serif"
// Sets the font size specified in pixels using percents so that the base
// font size changes and 1em has the correct value. When nesting font size
// declarations, within the DOM tree, the base_font_size must be the parent's
// effective font-size in pixels.
// Usage Examples:
// .big
// +font-size(16px)
// .bigger
// +font-size(18px)
// .big .bigger
// +font-size(18px, 16px)
//
// For more information see the table found at http://developer.yahoo.com/yui/fonts/#fontsize
=font-size(!size, !base_font_size = !yui_default_base_font_size)
:font-size= percentage(!size / !base_font_size)
// Sets the base fonts for a page, this should be mixed into the top level of a stylesheet.
=yui-base-fonts(!family = !yui_default_font_family, !size = !yui_default_base_font_size, !line_height = !yui_default_base_line_height)
body
:font
:size= !size
:family= !family
:line-height= !line_height
:*font-size small
:*font x-small
table
:font-size inherit
:font 100%
pre, code, kbd, samp, tt
:font-family monospace
:*font-size 108%
:line-height 100%

View File

@ -1,341 +0,0 @@
// This is a port of YUI Grids version 2.6.0
// Note: This is not really tested yet. Use at your own risk.
@import compass/utilities/general/float.sass
@import fonts.sass
=yui-grids
+yui-grids-init
+yui-grid-templates
+yui-grid-divisions
=yui-grid-templates
#doc
+yui-document(750px)
#doc2
+yui-document(950px)
#doc3
+yui-document("fluid")
#doc4
+yui-document(974px)
.yui-t1
+yui-two-column-left-template(160px)
.yui-t2
+yui-two-column-left-template(180px)
.yui-t3
+yui-two-column-left-template(300px)
.yui-t4
+yui-two-column-right-template(180px)
.yui-t5
+yui-two-column-right-template(240px)
.yui-t6
+yui-two-column-right-template(300px)
=yui-grids-footer
clear: both
=yui-grids-body
+clearfix
=yui-grids-init(!footer = "#ft", !body = "#bd")
body
:text-align center
@if !footer
#{!footer}
+yui-grids-footer
@if !body
#{!body}
+yui-grids-body
=em-size(!style, !px_size, !base_font_size = !yui_default_base_font_size)
:#{!style}= 1em * !px_size / !base_font_size
=em-size-hacked(!style, !px_size, !base_font_size = !yui_default_base_font_size)
+em-size(!style, !px_size, !base_font_size)
+em-size("*"+!style, !px_size * 39 / 40, !base_font_size)
// All documents must have these styles. Setting a min-width is optional, but recommended. To omit it, pass false as the min_width value.
=yui-document-base(!min_width = 750px)
:margin auto
:text-align left
@if !min_width
:min-width= !min_width
=yui-block-base
:position relative
:_position static
=yui-main-block
:position static
:float none
:width auto
// Creates a fixed width document container
// Pass "fluid" for the width to create a document that grows with the width of the browser.
=yui-document(!width, !min_width = 750px, !base_font_size = !yui_default_base_font_size)
+yui-document-base(!min_width)
@if !width == "fluid"
:margin auto 10px
:width auto
@else
+em-size-hacked("width", !width, !base_font_size)
=yui-two-column-left-template(!column_width, !main_selector = "#yui-main", !block_selector = ".yui-b", !document_width = 750px, !min_width = 750px, !base_font_size = !yui_default_base_font_size)
+yui-document(!document_width, !min_width, !base_font_size)
#{!main_selector}
:width 100%
:float right
+em-size("margin-left", -!column_width - 10px, !base_font_size)
#{!block_selector}
+yui-main-block
+em-size-hacked("margin-left", !column_width, !base_font_size)
#{!block_selector}
+yui-block-base
:float left
+em-size-hacked("width", !column_width, !base_font_size)
=yui-two-column-right-template(!column_width, !main_selector = "#yui-main", !block_selector = ".yui-b", !document_width = 750px, !min_width = 750px, !base_font_size = !yui_default_base_font_size)
+yui-document(!document_width, !min_width, !base_font_size)
#{!main_selector}
:width 100%
:float left
+em-size("margin-right", -!column_width - 10px, !base_font_size)
#{!block_selector}
+yui-main-block
+em-size-hacked("margin-right", !column_width, !base_font_size)
#{!block_selector}
+yui-block-base
:float right
+em-size-hacked("width", !column_width, !base_font_size)
=yui-one-column-template(!main_selector = "#yui-main", !block_selector = ".yui-b", !document_width = 750px, !min_width = 750px, !base_font_size = !yui_default_base_font_size)
+yui-document(!document_width, !min_width, !base_font_size)
#{!main_selector}
:width 100%
#{!block_selector}
+yui-main-block
:display block
:margin 0 0 1em 0
#{!block_selector}
+yui-block-base
=yui-custom-template(!main_selector = "#yui-main", !block_selector = ".yui-b")
#{!main_selector}
:width 100%
#{!block_selector}
+yui-main-block
#{!block_selector}
+yui-block-base
=yui-grid-divisions(!unit = ".yui-u", !g_50_50 = ".yui-g", !g_33_33_33 = ".yui-gb", !g_67_33 = ".yui-gc", !g_33_67 = ".yui-gd", !g_75_25 = ".yui-ge", !g_25_75 = ".yui-gf")
#{nest(!g_50_50, !g_33_33_33, !unit)},
#{nest(!g_67_33, !unit)},
#{nest(!g_67_33, !g_50_50)},
#{nest(!g_33_67, !unit)},
#{nest(!g_33_33_33, !g_50_50)},
#{nest(!g_33_33_33, !g_33_33_33)},
#{nest(!g_33_33_33, !g_67_33)},
#{nest(!g_33_33_33, !g_33_67)},
#{nest(!g_33_33_33, !g_75_25)},
#{nest(!g_33_33_33, !g_25_75)},
#{nest(!g_33_33_33, !unit)}
float: left
margin-left: 2%
width: 32%
#{!g_33_33_33}
#{!g_33_33_33},
#{!g_67_33}
#{!unit}
*margin-left: 1.8%
_margin-left: 4%
#{nest(!g_50_50, !g_33_33_33, !unit)}
_margin-left: .8%
#{nest(!g_33_33_33, !unit)}
float: right
#{nest(!g_33_33_33, "div.first")}
margin-left: 0
float: left
#{!g_50_50},
#{!g_33_33_33}
#{!g_33_33_33}
div.first
*margin-right: 0
*width: 32%
_width: 31.7%
#{!g_33_33_33}
#{!g_67_33},
#{!g_33_67}
div.first
*margin-right: 0
#{nest(!g_33_33_33, !g_33_67, !unit)}
*width: 66%
_width: 61.2%
#{nest(!g_33_33_33, !g_33_67, "div.first")}
*width: 31%
_width: 29.5%
#{!g_50_50},
#{!g_33_33_33}
#{!g_67_33}
#{!unit}
width: 32%
_float: right
margin-right: 0
_margin-left: 0
#{nest(!g_33_33_33, !g_67_33, "div.first")}
width: 66%
*float: left
*margin-left: 0
#{!g_33_33_33}
#{!g_75_25},
#{!g_25_75}
#{!unit}
margin: 0
#{nest(!g_50_50, !unit)},
#{nest(!g_50_50, !g_50_50)},
#{nest(!g_50_50, !g_33_33_33)},
#{nest(!g_50_50, !g_67_33)},
#{nest(!g_50_50, !g_33_67)},
#{nest(!g_50_50, !g_75_25)},
#{nest(!g_50_50, !g_25_75)},
#{nest(!g_67_33, !unit)},
#{nest(!g_33_67, !g_50_50)},
#{nest(!g_50_50, !g_67_33, !unit)},
#{nest(!g_75_25, !unit)},
#{nest(!g_75_25, !g_50_50)},
#{nest(!g_25_75, !g_50_50)},
#{nest(!g_25_75, !unit)}
float: right
#{nest(!g_50_50, !g_67_33)},
#{nest(!g_50_50, !g_75_25)},
#{!g_50_50},
#{!g_67_33},
#{nest(!g_67_33, "div.first")},
#{!g_33_67},
#{!g_75_25},
#{!g_25_75}
div.first
float: left
#{!g_50_50},
#{!g_33_33_33},
#{!g_67_33},
#{!g_33_67},
#{!g_75_25},
#{!g_25_75}
#{!g_50_50}
#{!unit}
width: 49%
*width: 48.1%
*margin-left: 0
#{nest(!g_50_50, !g_50_50, "div.first")}
*margin: 0
#{nest(!g_33_33_33, !g_50_50, "div.first")}
*margin-right: 4%
_margin-right: 1.3%
#{nest(!g_33_33_33, !g_33_33_33, !unit)}
_margin-left: .7%
#{nest(!g_33_33_33, !g_50_50)},
#{nest(!g_33_33_33, !g_33_33_33)}
div.first
*margin-left: 0
#{!g_67_33},
#{!g_33_67}
#{!g_50_50}
#{!unit}
*width: 48.1%
*margin-left: 0
#{!g_50_50}
#{!unit},
#{!g_50_50},
#{!g_33_33_33},
#{!g_67_33},
#{!g_33_67},
#{!g_75_25},
#{!g_25_75}
width: 49.1%
#{nest(!g_50_50, !g_33_33_33)},
#{!g_33_33_33},
#{!g_67_33},
#{!g_33_67}
div.first
margin-left: 0
#{nest(!g_50_50, !g_67_33, "div.first")},
#{nest(!g_67_33, "div.first")},
#{nest(!g_33_67, !g_50_50)},
#{nest(!g_33_67, !unit)}
width: 66%
#{!g_33_67},
#{nest(!g_33_33_33, !g_33_67)}
div.first
width: 32%
#{nest(!g_50_50, !g_33_67, "div.first")}
_width: 29.9%
#{nest(!g_75_25, !unit)},
#{nest(!g_75_25, !g_50_50)},
#{nest(!g_25_75, "div.first")}
width: 24%
#{!g_33_33_33}
#{!g_75_25},
#{!g_25_75}
div#{!unit}
float: right
#{!g_33_33_33}
#{!g_75_25},
#{!g_25_75}
div.first
float: left
#{nest(!g_75_25, "div.first")},
#{nest(!g_25_75, !g_50_50)},
#{nest(!g_25_75, !unit)}
width: 74.2%
#{!g_33_33_33}
#{nest(!g_75_25, !unit)},
#{nest(!g_25_75, "div.first")}
*width: 24%
_width: 20%
#{!g_33_33_33}
#{nest(!g_75_25, "div.first")},
#{nest(!g_25_75, !unit)}
*width: 73.5%
_width: 65.5%
#{!g_50_50},
#{!g_33_33_33},
#{!g_67_33},
#{!g_33_67},
#{!g_75_25},
#{!g_25_75}
+clearfix
#{nest(!g_33_33_33, !unit)}
float: left

View File

@ -1,61 +0,0 @@
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0pr2
=reset
html
:color #000
:background #FFF
body, div, dl, dt, dd, ul, ol, li,
h1, h2, h3, h4, h5, h6, pre, code,
form, fieldset, legend,input,
textarea, p, blockquote, th, td
:margin 0
:padding 0
li
:list-style none
h1, h2, h3, h4, h5, h6
:font-size 100%
:font-weight normal
code, th, address, caption,
cite, dfn, em, strong, var
:font-style normal
:font-weight normal
fieldset, img, abbr, acronym
:border 0
legend
:color #000
input, textarea, select
:font-family inherit
:font-size inherit
:font-weight inherit
:*font-size 100%
th, caption
:text-align left
table
:border-collapse collapse
:border-spacing 0
q
&:before, &:after
:content ''
abbr, acronym
:font-variant normal
sup
:vertical-align text-top
sub
:vertical-align text-bottom

View File

@ -1 +0,0 @@
stylesheet 'screen.sass', :media => "screen, projection"

View File

@ -1,4 +0,0 @@
@import yui.sass
@import compass/reset.sass
+yui

View File

@ -1,12 +1,13 @@
module Compass module Compass
end end
['dependencies', 'sass_extensions', 'core_ext', 'version', 'errors'].each do |file| %w(dependencies sass_extensions core_ext version errors).each do |lib|
require File.join(File.dirname(__FILE__), 'compass', file) require "compass/#{lib}"
end end
module Compass module Compass
extend Compass::Version extend Compass::Version
VERSION = "#{version[:major]}.#{version[:minor]}.#{version[:patch]}"
def base_directory def base_directory
File.expand_path(File.join(File.dirname(__FILE__), '..')) File.expand_path(File.join(File.dirname(__FILE__), '..'))
end end
@ -16,8 +17,6 @@ module Compass
module_function :base_directory, :lib_directory module_function :base_directory, :lib_directory
end end
require File.join(File.dirname(__FILE__), 'compass', 'configuration') %w(configuration frameworks app_integration).each do |lib|
require File.join(File.dirname(__FILE__), 'compass', 'frameworks') require "compass/#{lib}"
require File.join(File.dirname(__FILE__), 'compass', 'app_integration') end

View File

@ -32,6 +32,7 @@ module Compass
def write_file(file_name, contents, options = nil, binary = false) def write_file(file_name, contents, options = nil, binary = false)
options ||= self.options if self.respond_to?(:options) options ||= self.options if self.respond_to?(:options)
skip_write = options[:dry_run] skip_write = options[:dry_run]
contents = process_erb(contents, options[:erb]) if options[:erb]
if File.exists?(file_name) if File.exists?(file_name)
existing_contents = IO.read(file_name) existing_contents = IO.read(file_name)
if existing_contents == contents if existing_contents == contents
@ -47,7 +48,7 @@ module Compass
logger.record :create, basename(file_name) logger.record :create, basename(file_name)
end end
if skip_write if skip_write
FileUtils.touch file_name FileUtils.touch file_name unless options[:dry_run]
else else
mode = "w" mode = "w"
mode << "b" if binary mode << "b" if binary
@ -57,6 +58,11 @@ module Compass
end end
end end
def process_erb(contents, ctx = nil)
ctx = Object.new.instance_eval("binding") unless ctx.is_a? Binding
ERB.new(contents).result(ctx)
end
# Compile one Sass file # Compile one Sass file
def compile(sass_filename, css_filename, options) def compile(sass_filename, css_filename, options)
if options[:force] || Sass::Plugin.exact_stylesheet_needs_update?(css_filename, sass_filename) if options[:force] || Sass::Plugin.exact_stylesheet_needs_update?(css_filename, sass_filename)

View File

@ -1,5 +1,24 @@
# If we're running inside Rails %w(stand_alone rails merb).each do |lib|
require File.join(File.dirname(__FILE__), 'app_integration', 'rails') if defined?(ActionController::Base) require "compass/app_integration/#{lib}"
end
# If we're running inside Merb module Compass
require File.join(File.dirname(__FILE__), 'app_integration', 'merb') if defined?(Merb::Plugins) module AppIntegration
module Helpers
def lookup(project_type)
eval "Compass::AppIntegration::#{camelize(project_type)}"
rescue NameError
raise Compass::Error, "No application integration exists for #{project_type}"
end
protected
# Stolen from ActiveSupport
def camelize(s)
s.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
end
end
extend Helpers
end
end

View File

@ -1,43 +1 @@
# To configure Merb to use compass do the following: require 'compass/app_integration/merb/runtime' if defined?(Merb::Plugins)
# Merb::BootLoader.after_app_loads do
# require 'merb-haml'
# require 'compass'
# end
#
# To use a different sass stylesheets locations as is recommended by compass
# add this configuration to your configuration block:
#
# Merb::Config.use do |c|
# c[:compass] = {
# :stylesheets => 'app/stylesheets',
# :compiled_stylesheets => 'public/stylesheets/compiled'
# }
# end
Merb::BootLoader.after_app_loads do
#set up sass if haml load didn't do it -- this happens when using a non-default stylesheet location.
unless defined?(Sass::Plugin)
require "sass/plugin"
Sass::Plugin.options = Merb::Config[:sass] if Merb::Config[:sass]
end
# default the compass configuration if they didn't set it up yet.
Merb::Config[:compass] ||= {}
# default sass stylesheet location unless configured to something else
Merb::Config[:compass][:stylesheets] ||= Merb.dir_for(:stylesheet) / "sass"
# default sass css location unless configured to something else
Merb::Config[:compass][:compiled_stylesheets] ||= Merb.dir_for(:stylesheet)
#define the template hash for the project stylesheets as well as the framework stylesheets.
template_location = {
Merb::Config[:compass][:stylesheets] => Merb::Config[:compass][:compiled_stylesheets]
}
Compass::Frameworks::ALL.each do |framework|
template_location[framework.stylesheets_directory] = Merb::Config[:compass][:compiled_stylesheets]
end
#configure Sass to know about all these sass locations.
Sass::Plugin.options[:template_location] = template_location
end

View File

@ -0,0 +1,63 @@
# To configure Merb to use compass do the following:
#
# Add dependencies to config/dependencies.rb
#
# dependency "haml", ">=2.2.0"
# dependency "merb-haml", merb_gems_version
# dependency "chriseppstein-compass", :require_as => 'compass'
#
#
# To use a different sass stylesheets locations as is recommended by compass
# add this configuration to your configuration block:
#
# Merb::BootLoader.before_app_loads do
# Merb::Plugins.config[:compass] = {
# :stylesheets => "app/stylesheets",
# :compiled_stylesheets => "public/stylesheets/compiled"
# }
# end
#
module Compass
def self.setup_template_location
# default the compass configuration if they didn't set it up yet.
Merb::Plugins.config[:compass] ||= {}
# default sass stylesheet location unless configured to something else
Merb::Plugins.config[:compass][:stylesheets] ||= Merb.dir_for(:stylesheet) / "sass"
# default sass css location unless configured to something else
Merb::Plugins.config[:compass][:compiled_stylesheets] ||= Merb.dir_for(:stylesheet)
#define the template hash for the project stylesheets as well as the framework stylesheets.
template_location = {
Merb::Plugins.config[:compass][:stylesheets] => Merb::Plugins.config[:compass][:compiled_stylesheets]
}
Compass::Frameworks::ALL.each do |framework|
template_location[framework.stylesheets_directory] = Merb::Plugins.config[:compass][:compiled_stylesheets]
end
# merge existing template locations if present
if Merb::Plugins.config[:sass][:template_location].is_a?(Hash)
template_location.merge!(Merb::Plugins.config[:sass][:template_location])
Merb::Plugins.config[:sass][:template_location] = template_location
end
#configure Sass to know about all these sass locations.
Sass::Plugin.options[:template_location] = template_location
end
end
Merb::BootLoader.after_app_loads do
#set up sass if haml load didn't do it -- this happens when using a non-default stylesheet location.
unless defined?(Sass::Plugin)
require "sass/plugin"
if Merb::Plugins.config[:sass]
Sass::Plugin.options = Merb::Plugins.config[:sass]
# support old (deprecatd Merb::Config[:sass] option)
elsif Merb::Config[:sass]
Sass::Plugin.options = Merb::Config[:sass]
end
end
Compass.setup_template_location
end

View File

@ -1,12 +1,26 @@
unless defined?(Compass::RAILS_LOADED) %w(configuration_defaults installer).each do |lib|
Compass::RAILS_LOADED = true require "compass/app_integration/rails/#{lib}"
require File.join(File.dirname(__FILE__), 'rails', 'action_controller') end
require File.join(File.dirname(__FILE__), 'rails', 'sass_plugin')
require File.join(File.dirname(__FILE__), 'rails', 'urls') require 'compass/app_integration/rails/runtime' if defined?(ActionController::Base)
# Wierd that this has to be re-included to pick up sub-modules. Ruby bug?
class Sass::Script::Functions::EvaluationContext
include Sass::Script::Functions module Compass
private module AppIntegration
include ActionView::Helpers::AssetTagHelper module Rails
extend self
def installer(*args)
Installer.new(*args)
end
def configuration
Compass::Configuration::Data.new('rails').
extend(ConfigurationDefaults)
end
end
end end
end end

View File

@ -0,0 +1,37 @@
module Compass
module AppIntegration
module Rails
module ConfigurationDefaults
def default_project_type
:rails
end
def default_images_dir
File.join("public", "images")
end
def default_javascripts_dir
File.join("public", "javascripts")
end
def default_http_images_path
"/images"
end
def default_http_javascripts_path
"/javascripts"
end
def default_http_stylesheets_path
"/stylesheets"
end
def default_extensions_dir
"vendor/plugins/compass/extensions"
end
end
end
end
end

View File

@ -0,0 +1,127 @@
module Compass
module Installers
class Base
end
class ManifestInstaller < Base
end
end
module AppIntegration
module Rails
class Installer < Compass::Installers::ManifestInstaller
def completed_configuration
config = {}
config[:sass_dir] = prompt_sass_dir unless sass_dir_without_default
config[:css_dir] = prompt_css_dir unless css_dir_without_default
config unless config.empty?
end
def write_configuration_files(config_file = nil)
config_file ||= targetize('config/compass.rb')
directory File.dirname(config_file)
write_file config_file, config_contents
directory File.dirname(targetize('config/initializers/compass.rb'))
write_file targetize('config/initializers/compass.rb'), initializer_contents
end
def config_files_exist?
File.exists?(targetize('config/compass.config')) &&
File.exists?(targetize('config/initializers/compass.rb'))
end
def prepare
write_configuration_files unless config_files_exist?
end
def finalize(options = {})
if options[:create]
puts <<-NEXTSTEPS
Congratulations! Your rails project has been configured to use Compass.
Sass will automatically compile your stylesheets during the next
page request and keep them up to date when they change.
Make sure you restart your server!
NEXTSTEPS
end
if manifest.has_stylesheet?
puts "\nNext add these lines to the head of your layouts:\n\n"
puts stylesheet_links
puts "\n(You are using haml, aren't you?)"
end
end
def install_location_for_html(to, options)
separate("public/#{pattern_name_as_dir}#{to}")
end
def prompt_sass_dir
recommended_location = separate('app/stylesheets')
default_location = separate('public/stylesheets/sass')
print %Q{Compass recommends that you keep your stylesheets in #{recommended_location}
instead of the Sass default location of #{default_location}.
Is this OK? (Y/n) }
answer = gets.downcase[0]
answer == ?n ? default_location : recommended_location
end
def prompt_css_dir
recommended_location = separate("public/stylesheets/compiled")
default_location = separate("public/stylesheets")
puts
print %Q{Compass recommends that you keep your compiled css in #{recommended_location}/
instead the Sass default of #{default_location}/.
However, if you're exclusively using Sass, then #{default_location}/ is recommended.
Emit compiled stylesheets to #{recommended_location}/? (Y/n) }
answer = gets.downcase[0]
answer == ?n ? default_location : recommended_location
end
def config_contents
Compass.configuration.serialize do |prop, value|
if prop == :project_path
"project_path = RAILS_ROOT if defined?(RAILS_ROOT)\n"
elsif prop == :output_style
""
end
end
end
def initializer_contents
%Q{require 'compass'
# If you have any compass plugins, require them here.
Compass.configuration.parse(File.join(RAILS_ROOT, "config", "compass.config"))
Compass.configuration.environment = RAILS_ENV.to_sym
Compass.configure_sass_plugin!
}
end
def stylesheet_prefix
if css_dir.length >= 19
"#{css_dir[19..-1]}/"
else
nil
end
end
def stylesheet_links
html = "%head\n"
manifest.each_stylesheet do |stylesheet|
# Skip partials.
next if File.basename(stylesheet.from)[0..0] == "_"
ss_line = " = stylesheet_link_tag '#{stylesheet_prefix}#{stylesheet.to.sub(/\.sass$/,'.css')}'"
if stylesheet.options[:media]
ss_line += ", :media => '#{stylesheet.options[:media]}'"
end
if stylesheet.options[:condition]
ss_line = " /[if #{stylesheet.options[:condition]}]\n " + ss_line
end
html << ss_line + "\n"
end
html
end
end
end
end
end

View File

@ -0,0 +1,14 @@
unless defined?(Compass::RAILS_LOADED)
Compass::RAILS_LOADED = true
%w(action_controller sass_plugin urls).each do |lib|
require "compass/app_integration/rails/#{lib}"
end
# Wierd that this has to be re-included to pick up sub-modules. Ruby bug?
class Sass::Script::Functions::EvaluationContext
include Sass::Script::Functions
private
include ActionView::Helpers::AssetTagHelper
end
end

View File

@ -0,0 +1,22 @@
%w(configuration_defaults installer).each do |lib|
require "compass/app_integration/stand_alone/#{lib}"
end
module Compass
module AppIntegration
module StandAlone
extend self
def installer(*args)
Installer.new(*args)
end
def configuration
Compass::Configuration::Data.new('stand_alone').
extend(ConfigurationDefaults)
end
end
end
end

View File

@ -0,0 +1,28 @@
module Compass
module AppIntegration
module StandAlone
module ConfigurationDefaults
def default_project_type
:stand_alone
end
def sass_dir_without_default
"src"
end
def javascripts_dir_without_default
"javascripts"
end
def css_dir_without_default
"stylesheets"
end
def images_dir_without_default
"images"
end
end
end
end
end

View File

@ -0,0 +1,83 @@
module Compass
module Installers
class Base
end
class ManifestInstaller < Base
end
end
module AppIntegration
module StandAlone
class Installer < Compass::Installers::ManifestInstaller
def init
directory targetize("")
super
end
def write_configuration_files(config_file = nil)
config_file ||= targetize('config.rb')
write_file config_file, config_contents
end
def config_files_exist?
File.exists? targetize('config.rb')
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 prepare
write_configuration_files unless config_files_exist? || !@manifest.generate_config?
end
def completed_configuration
nil
end
def finalize(options = {})
if options[:create] && !manifest.welcome_message_options[:replace]
puts <<-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
puts manifest.welcome_message if manifest.welcome_message
if manifest.has_stylesheet? && !manifest.welcome_message_options[:replace]
puts "\nTo import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:"
puts stylesheet_links
end
end
def compilation_required?
@manifest.compile?
end
end
end
end
end

11
lib/compass/commands.rb Normal file
View File

@ -0,0 +1,11 @@
module Compass::Commands
end
require 'compass/commands/registry'
%w(base generate_grid_background help list_frameworks project_base
update_project watch_project create_project installer_command
print_version project_stats stamp_pattern validate_project
write_configuration interactive).each do |lib|
require "compass/commands/#{lib}"
end

View File

@ -1,6 +1,9 @@
module Compass module Compass
module Commands module Commands
class Base class Base
def self.register(command_name)
Compass::Commands[command_name] = self
end
include Actions include Actions

View File

@ -1,13 +1,116 @@
require 'fileutils' require 'fileutils'
require File.join(File.dirname(__FILE__), 'stamp_pattern') require 'compass/commands/stamp_pattern'
require File.join(File.dirname(__FILE__), 'update_project')
module Compass module Compass
module Commands module Commands
module CreateProjectOptionsParser
def set_options(opts)
if $command == "create"
opts.banner = %Q{
Usage: compass create path/to/project [options]
Description:
Create a new compass project at the path specified.
Options:
}.split("\n").map{|l| l.gsub(/^ */,'')}.join("\n")
opts.on_tail("--bare", "Don't generate any Sass or CSS files.") do
self.options[:bare] = true
end
else
opts.banner = %Q{
Usage: compass init project_type path/to/project [options]
Description:
Initialize an existing project at the path specified.
Supported Project Types:
* rails
Options:
}.split("\n").map{|l| l.gsub(/^ */,'')}.join("\n").strip
end
opts.on("--using FRAMEWORK", "Framework to use when creating the project.") do |framework|
framework = framework.split('/', 2)
self.options[:framework] = framework[0]
self.options[:pattern] = framework[1]
end
super
end
end
class CreateProject < StampPattern class CreateProject < StampPattern
def initialize(working_path, options) register :create
super(working_path, options.merge(:pattern => "project", :pattern_name => nil)) register :init
class << self
def option_parser(arguments)
parser = Compass::Exec::CommandOptionParser.new(arguments)
parser.extend(Compass::Exec::GlobalOptionsParser)
parser.extend(Compass::Exec::ProjectOptionsParser)
parser.extend(CreateProjectOptionsParser)
end
def usage
option_parser([]).to_s
end
def description(command)
if command.to_sym == :create
"Create a new compass project"
else
"Initialize an existing project"
end
end
def primary; true; end
def parse!(arguments)
parser = option_parser(arguments)
parse_options!(parser, arguments)
parse_arguments!(parser, arguments)
if parser.options[:framework] && parser.options[:bare]
raise Compass::Error, "A bare project cannot be created when a framework is specified."
end
set_default_arguments(parser)
parser.options
end
def parse_init!(arguments)
parser = option_parser(arguments)
parse_options!(parser, arguments)
if arguments.size > 0
parser.options[:project_type] = arguments.shift.to_sym
end
parse_arguments!(parser, arguments)
set_default_arguments(parser)
parser.options
end
def parse_options!(parser, arguments)
parser.parse!
parser
end
def parse_arguments!(parser, arguments)
if arguments.size == 1
parser.options[:project_name] = arguments.shift
elsif arguments.size == 0
# default to the current directory.
else
raise Compass::Error, "Too many arguments were specified."
end
end
def set_default_arguments(parser)
parser.options[:framework] ||= :compass
parser.options[:pattern] ||= "project"
end
end end
def is_project_creation? def is_project_creation?

View File

@ -1,19 +1,86 @@
require File.join(File.dirname(__FILE__), 'project_base') require 'compass/commands/project_base'
require File.join(File.dirname(__FILE__), 'update_project') require 'compass/commands/update_project'
require File.join(File.dirname(__FILE__), '..', 'grid_builder') require 'compass/grid_builder'
module Compass module Compass
module Commands module Commands
module GridBackgroundOptionsParser
def set_options(opts)
banner = %Q{Usage: compass grid-img W+GxH [path/to/grid.png]
Description:
Generates a background image that can be used to check grid alignment.
Height is optional and defaults to 20px
By default, the image generated will be named "grid.png"
and be found in the images directory.
This command requires that you have both ImageMagick and RMagick installed.
Examples:
compass grid-img 40+10 # 40px column, 10px gutter, 20px height
compass grid-img 40+20x28 # 40px column, 20px gutter, 28px height
compass grid-img 60+20x28 images/wide_grid.png
Options:
}
opts.banner = banner
super
end
end
class GenerateGridBackground < ProjectBase class GenerateGridBackground < ProjectBase
include Actions include Actions
register :"grid-img"
class << self
def option_parser(arguments)
parser = Compass::Exec::CommandOptionParser.new(arguments)
parser.extend(Compass::Exec::GlobalOptionsParser)
parser.extend(GridBackgroundOptionsParser)
end
def usage
option_parser([]).to_s
end
def description(command)
"Generates a grid background image."
end
def parse!(arguments)
parser = option_parser(arguments)
parser.parse!
if arguments.size == 0
raise OptionParser::ParseError, "Please specify the grid dimensions."
end
parser.options[:grid_dimensions] = arguments.shift
parser.options[:grid_filename] = arguments.shift
parser.options
end
end
def initialize(working_path, options) def initialize(working_path, options)
super super
assert_project_directory_exists! assert_project_directory_exists!
Compass.add_configuration(options, 'command_line')
end end
def perform def perform
column_width, gutter_width = options[:grid_dimensions].split(/\+/).map{|d| d.to_i} unless options[:grid_dimensions] =~ /^(\d+)\+(\d+)(?:x(\d+))?$/
unless GridBuilder.new(options.merge(:column_width => column_width, :gutter_width => gutter_width, :output_path => projectize(project_images_subdirectory), :working_path => self.working_path)).generate! puts "ERROR: '#{options[:grid_dimensions]}' is not valid."
puts "Dimensions should be specified like: 30+10x20"
puts "where 30 is the column width, 10 is the gutter width, and 20 is the (optional) height."
return
end
column_width = $1.to_i
gutter_width = $2.to_i
height = $3.to_i if $3
filename = options[:grid_filename] || projectize("#{project_images_subdirectory}/grid.png")
unless GridBuilder.new(options.merge(:column_width => column_width, :gutter_width => gutter_width, :height => height, :filename => filename, :working_path => self.working_path)).generate!
puts "ERROR: Some library dependencies appear to be missing." puts "ERROR: Some library dependencies appear to be missing."
puts "Have you installed rmagick? If not, please run:" puts "Have you installed rmagick? If not, please run:"
puts "sudo gem install rmagick" puts "sudo gem install rmagick"

View File

@ -0,0 +1,89 @@
module Compass
module Commands
module HelpOptionsParser
def set_options(opts)
banner = %Q{Usage: compass help [command]
Description:
The Compass Stylesheet Authoring Framework helps you
build and maintain your stylesheets and makes it easy
for you to use stylesheet libraries provided by others.
To get help on a particular command please specify the command.
}
primary_commands = Compass::Commands.all.select do |c|
cmd = Compass::Commands[c]
cmd.respond_to?(:primary) && cmd.primary
end
other_commands = Compass::Commands.all - primary_commands
banner << command_list("Primary Commands:", primary_commands)
banner << command_list("Other Commands:", other_commands)
banner << "\nAvailable Frameworks & Patterns:\n\n"
Compass::Frameworks::ALL.each do |framework|
banner << " * #{framework.name}\n"
framework.template_directories.each do |pattern|
banner << " - #{framework.name}/#{pattern}"
if description = framework.manifest(pattern).description
banner << "\t- #{description}"
end
banner << "\n"
end
end
opts.banner = banner
super
end
def command_list(header, commands)
list = "#{header}\n"
commands.sort_by{|c| c.to_s}.each do |command|
list << " * #{command}"
if Compass::Commands[command].respond_to? :description
list << "\t- #{Compass::Commands[command].description(command)}"
end
list << "\n"
end
list
end
end
class Help < Base
register :help
class << self
def option_parser(arguments)
parser = Compass::Exec::CommandOptionParser.new(arguments)
parser.extend(HelpOptionsParser)
end
def usage
option_parser([]).to_s
end
def description(command)
"Get help on a compass command or extension"
end
def parse!(arguments)
parser = option_parser(arguments)
parser.parse!
parser.options[:help_command] = arguments.shift || 'help'
parser.options
end
end
def execute
if Compass::Commands.command_exists? options[:help_command]
$command = options[:help_command]
puts Compass::Commands[options[:help_command]].usage
$command = "help"
elsif Compass::Frameworks.template_exists? options[:help_command]
puts Compass::Frameworks.template_usage(options[:help_command])
else
raise OptionParser::ParseError, "No such command: #{options[:help_command]}"
end
end
end
end
end

View File

@ -1,4 +1,4 @@
require File.join(Compass.lib_directory, 'compass', 'installers') require 'compass/installers'
module Compass module Compass
module Commands module Commands
@ -6,25 +6,32 @@ module Compass
include Compass::Installers include Compass::Installers
def configure! def configure!
read_project_configuration if respond_to?(:is_project_creation?) && is_project_creation?
Compass.configuration.set_maybe(options) Compass.add_configuration(options.delete(:project_type) || :stand_alone)
Compass.configuration.default_all(installer.configuration_defaults) else
Compass.configuration.set_defaults! Compass.add_project_configuration(:project_type => options.delete(:project_type))
end
Compass.add_configuration(options, 'command_line')
if File.exists?(Compass.configuration.extensions_path)
Compass::Frameworks.discover(Compass.configuration.extensions_path)
end
Compass.add_configuration(installer.completed_configuration, 'installer')
end
def app
@app ||= Compass::AppIntegration.lookup(Compass.configuration.project_type)
end end
def installer def installer
@installer ||= case options[:project_type] @installer ||= if options[:bare]
when :stand_alone Compass::Installers::BareInstaller.new(*installer_args)
StandAloneInstaller.new *installer_args
when :rails
RailsInstaller.new *installer_args
else else
raise "Unknown project type: #{options[:project_type].inspect}" app.installer(*installer_args)
end end
end end
def installer_args def installer_args
[template_directory(options[:pattern]), project_directory, options] [template_directory(options[:pattern] || "project"), project_directory, options]
end end
end end
end end

View File

@ -0,0 +1,61 @@
require 'compass/commands/project_base'
require 'compass/commands/update_project'
module Compass
module Commands
module InteractiveOptionsParser
def set_options(opts)
opts.banner = %Q{
Usage: compass interactive [path/to/project] [options]
Description:
Interactively evaluate SassScript
Options:
}.strip.split("\n").map{|l| l.gsub(/^ {0,10}/,'')}.join("\n")
super
end
end
class Interactive < ProjectBase
register :interactive
def initialize(working_path, options)
super
end
def perform
require 'sass/repl'
Sass::Repl.new.run
end
class << self
def option_parser(arguments)
parser = Compass::Exec::CommandOptionParser.new(arguments)
parser.extend(Compass::Exec::GlobalOptionsParser)
parser.extend(Compass::Exec::ProjectOptionsParser)
parser.extend(InteractiveOptionsParser)
end
def usage
option_parser([]).to_s
end
def description(command)
"Interactively evaluate SassScript"
end
def parse!(arguments)
parser = option_parser(arguments)
parser.parse!
parser.options
end
end
end
end
end

View File

@ -1,9 +1,9 @@
module Compass module Compass
module Commands module Commands
class ListFrameworks class ListFrameworks < ProjectBase
attr_accessor :options attr_accessor :options
def initialize(working_path, options) def initialize(working_path, options)
self.options = options super
end end
def execute def execute

View File

@ -1,14 +1,82 @@
module Compass module Compass
module Commands module Commands
class PrintVersion module VersionOptionsParser
def set_options(opts)
opts.banner = %Q{Usage: compass version [options]
Options:
}
opts.on_tail("-?", "-h", "--help", "Print out this message.") do
puts opts
exit
end
opts.on("-q", "--quiet", "Just print the version string.") do
self.options[:quiet] = true
end
opts.on("--major", "Print the major version number") do
self.options[:major] = true
self.options[:custom] = true
end
opts.on("--minor", "Print up to the minor version number") do
self.options[:major] = true
self.options[:minor] = true
self.options[:custom] = true
end
opts.on("--patch", "Print up to the patch version number") do
self.options[:major] = true
self.options[:minor] = true
self.options[:patch] = true
self.options[:custom] = true
end
opts.on("--revision", "Include the source control revision") do
self.options[:revision] = true
self.options[:custom] = true
end
end
end
class PrintVersion < Base
register :version
class << self
def option_parser(arguments)
parser = Compass::Exec::CommandOptionParser.new(arguments)
parser.extend(VersionOptionsParser)
end
def usage
option_parser([]).to_s
end
def description(command)
"Print out version information"
end
def parse!(arguments)
parser = option_parser(arguments)
parser.parse!
parser.options
end
end
attr_accessor :options attr_accessor :options
def initialize(working_path, options) def initialize(working_path, options)
self.options = options self.options = options
end end
def execute def execute
if options[:quiet] if options[:custom]
# The quiet option may make scripting easier version = ""
version << "#{Compass.version[:major]}" if options[:major]
version << ".#{Compass.version[:minor]}" if options[:minor]
version << ".#{Compass.version[:teeny]}" if options[:patch]
if options[:revision]
if version.size > 0
version << " [#{Compass.version[:rev][0..6]}]"
else
version << Compass.version[:rev]
end
end
puts version
elsif options[:quiet]
puts ::Compass.version[:string] puts ::Compass.version[:string]
else else
lines = [] lines = []

View File

@ -1,7 +1,7 @@
require 'fileutils' require 'fileutils'
require 'pathname' require 'pathname'
require File.join(File.dirname(__FILE__), 'base') require 'compass/commands/base'
require File.join(File.dirname(__FILE__), 'installer_command') require 'compass/commands/installer_command'
module Compass module Compass
module Commands module Commands
@ -11,24 +11,29 @@ module Compass
def initialize(working_path, options = {}) def initialize(working_path, options = {})
super(working_path, options) super(working_path, options)
self.project_name = determine_project_name(working_path, options) self.project_name = determine_project_name(working_path, options)
Compass.configuration.project_path = determine_project_directory(working_path, options) Compass.add_configuration({:project_path => determine_project_directory(working_path, options)}, "implied")
configure!
end end
def execute def execute
configure!
super super
end end
protected protected
def configure! def configure!
read_project_configuration add_project_configuration
Compass.configuration.set_maybe(options) if File.exists?(Compass.configuration.extensions_path)
Compass.configuration.set_defaults! Compass::Frameworks.discover(Compass.configuration.extensions_path)
end
end
def add_project_configuration
Compass.add_project_configuration(options[:configuration_file])
end end
def projectize(path) def projectize(path)
File.join(project_directory, separate(path)) Compass.projectize(path)
end end
def project_directory def project_directory
@ -47,31 +52,6 @@ module Compass
Compass.configuration.images_dir Compass.configuration.images_dir
end end
# Read the configuration file for this project
def read_project_configuration
if file = detect_configuration_file
Compass.configuration.parse(file) if File.readable?(file)
end
end
def explicit_config_file_must_be_readable?
true
end
# TODO: Deprecate the src/config.rb location.
KNOWN_CONFIG_LOCATIONS = [".compass/config.rb", "config/compass.config", "config.rb", "src/config.rb"]
# Finds the configuration file, if it exists in a known location.
def detect_configuration_file
if options[:configuration_file]
if explicit_config_file_must_be_readable? && !File.readable?(options[:configuration_file])
raise Compass::Error, "Configuration file, #{file}, not found or not readable."
end
return options[:configuration_file]
end
KNOWN_CONFIG_LOCATIONS.map{|f| projectize(f)}.detect{|f| File.exists?(f)}
end
def assert_project_directory_exists! def assert_project_directory_exists!
if File.exists?(project_directory) && !File.directory?(project_directory) if File.exists?(project_directory) && !File.directory?(project_directory)
raise Compass::FilesystemConflict.new("#{project_directory} is not a directory.") raise Compass::FilesystemConflict.new("#{project_directory} is not a directory.")

View File

@ -0,0 +1,162 @@
require 'compass/commands/project_base'
require 'compass/commands/update_project'
module Compass
module Commands
module StatsOptionsParser
def set_options(opts)
opts.banner = %Q{
Usage: compass stats [path/to/project] [options]
Description:
Compile project at the path specified (or the current
directory if not specified) and then compute statistics
for the sass and css files in the project.
Options:
}.strip.split("\n").map{|l| l.gsub(/^ {0,10}/,'')}.join("\n")
super
end
end
class ProjectStats < UpdateProject
register :stats
def initialize(working_path, options)
super
assert_project_directory_exists!
end
def perform
super
require 'compass/stats'
compiler = new_compiler_instance
sass_files = sorted_sass_files(compiler)
rows = [[ :-, :-, :-, :-, :-, :-, :- ],
[ 'Filename', 'Rules', 'Properties', 'Mixins Defs', 'Mixins Used', 'CSS Rules', 'CSS Properties' ],
[ :-, :-, :-, :-, :-, :-, :- ]]
maximums = [ 8, 5, 10, 14, 11, 9, 14 ]
alignments = [ :left, :right, :right, :right, :right, :right, :right ]
delimiters = [ ['| ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'] ]
totals = [ "Total (#{sass_files.size} files):", 0, 0, 0, 0, 0, 0 ]
sass_files.each do |sass_file|
css_file = compiler.corresponding_css_file(sass_file) unless sass_file[0..0] == '_'
row = filename_columns(sass_file)
row += sass_columns(sass_file)
row += css_columns(css_file)
row.each_with_index do |c, i|
maximums[i] = [maximums[i].to_i, c.size].max
totals[i] = totals[i] + c.to_i if i > 0
end
rows << row
end
rows << [:-] * 7
rows << totals.map{|t| t.to_s}
rows << [:-] * 7
rows.each do |row|
row.each_with_index do |col, i|
print pad(col, maximums[i], :align => alignments[i], :left => delimiters[i].first, :right => delimiters[i].last)
end
print "\n"
end
if @missing_css_parser
puts "\nInstall css_parser to enable stats on your css files:\n\n\tgem install css_parser"
end
end
def pad(c, max, options = {})
options[:align] ||= :left
if c == :-
filler = '-'
c = ''
else
filler = ' '
end
spaces = max - c.size
filled = filler * [spaces,0].max
"#{options[:left]}#{filled if options[:align] == :right}#{c}#{filled if options[:align] == :left}#{options[:right]}"
end
def sorted_sass_files(compiler)
sass_files = compiler.sass_files(:exclude_partials => false)
sass_files.map! do |s|
filename = Compass.deprojectize(s, File.join(Compass.configuration.project_path, Compass.configuration.sass_dir))
[s, File.dirname(filename), File.basename(filename)]
end
sass_files = sass_files.sort_by do |s,d,f|
File.join(d, f[0] == ?_ ? f[1..-1] : f)
end
sass_files.map!{|s,d,f| s}
end
def filename_columns(sass_file)
filename = Compass.deprojectize(sass_file, working_path)
[filename]
end
def sass_columns(sass_file)
sf = Compass::Stats::SassFile.new(sass_file)
sf.analyze!
%w(rule_count prop_count mixin_def_count mixin_count).map do |t|
sf.send(t).to_s
end
end
def css_columns(css_file)
if File.exists?(css_file)
cf = Compass::Stats::CssFile.new(css_file)
cf.analyze!
%w(selector_count prop_count).map do |t|
cf.send(t).to_s
end
else
return [ '--', '--' ]
end
rescue LoadError
@missing_css_parser = true
return [ 'DISABLED', 'DISABLED' ]
end
class << self
def option_parser(arguments)
parser = Compass::Exec::CommandOptionParser.new(arguments)
parser.extend(Compass::Exec::GlobalOptionsParser)
parser.extend(Compass::Exec::ProjectOptionsParser)
parser.extend(StatsOptionsParser)
end
def usage
option_parser([]).to_s
end
def description(command)
"Report statistics about your stylesheets"
end
def primary; false; end
def parse!(arguments)
parser = option_parser(arguments)
parser.parse!
parse_arguments!(parser, arguments)
parser.options
end
def parse_arguments!(parser, arguments)
if arguments.size == 1
parser.options[:project_name] = arguments.shift
elsif arguments.size == 0
# default to the current directory.
else
raise Compass::Error, "Too many arguments were specified."
end
end
end
end
end
end

View File

@ -0,0 +1,22 @@
module Compass::Commands
module Registry
def register(name, command_class)
@commands ||= Hash.new
@commands[name.to_sym] = command_class
end
def get(name)
@commands ||= Hash.new
@commands[name.to_sym]
end
def command_exists?(name)
@commands ||= Hash.new
name && @commands.has_key?(name.to_sym)
end
def all
@commands.keys
end
alias_method :[], :get
alias_method :[]=, :register
end
extend Registry
end

View File

@ -1,11 +1,64 @@
require 'fileutils' require 'fileutils'
require File.join(File.dirname(__FILE__), 'base') require 'compass/commands/base'
require File.join(File.dirname(__FILE__), 'update_project') require 'compass/commands/update_project'
module Compass module Compass
module Commands module Commands
module StampPatternOptionsParser
def set_options(opts)
opts.banner = %Q{Usage: compass install extension/pattern [path/to/project] [options]
Description:
Install an extension's pattern into your compass project
Example:
compass install blueprint/buttons
Options:
}
super
end
end
class StampPattern < ProjectBase class StampPattern < ProjectBase
register :install
class << self
def option_parser(arguments)
parser = Compass::Exec::CommandOptionParser.new(arguments)
parser.extend(Compass::Exec::GlobalOptionsParser)
parser.extend(Compass::Exec::ProjectOptionsParser)
parser.extend(StampPatternOptionsParser)
end
def usage
option_parser([]).to_s
end
def description(command)
"Install an extension's pattern into your compass project"
end
def parse!(arguments)
parser = option_parser(arguments)
parser.parse!
parse_arguments!(parser, arguments)
parser.options
end
def parse_arguments!(parser, arguments)
if arguments.size == 0
raise OptionParser::ParseError, "Please specify a pattern."
end
pattern = arguments.shift.split('/', 2)
parser.options[:framework] = pattern[0]
parser.options[:pattern] = pattern[1]
if arguments.size > 0
parser.options[:project_name] = arguments.shift
end
if arguments.size > 0
raise OptionParser::ParseError, "Unexpected trailing arguments: #{arguments.join(" ")}"
end
end
end
include InstallerCommand include InstallerCommand
def initialize(working_path, options) def initialize(working_path, options)

View File

@ -1,18 +1,35 @@
require File.join(File.dirname(__FILE__), 'project_base') require 'compass/commands/project_base'
require File.join(Compass.lib_directory, 'compass', 'compiler') require 'compass/compiler'
module Compass module Compass
module Commands module Commands
module CompileProjectOptionsParser
def set_options(opts)
opts.banner = %Q{
Usage: compass compile [path/to/project] [options]
Description:
compile project at the path specified or the current director if not specified.
Options:
}.split("\n").map{|l| l.gsub(/^ */,'')}.join("\n")
super
end
end
class UpdateProject < ProjectBase class UpdateProject < ProjectBase
register :compile
def initialize(working_path, options) def initialize(working_path, options)
super super
assert_project_directory_exists! assert_project_directory_exists! unless dry_run?
end end
def perform def perform
compiler = new_compiler_instance compiler = new_compiler_instance
if compiler.sass_files.empty? if compiler.sass_files.empty? && !dry_run?
message = "Nothing to compile. If you're trying to start a new project, you have left off the directory argument.\n" message = "Nothing to compile. If you're trying to start a new project, you have left off the directory argument.\n"
message << "Run \"compass -h\" to get help." message << "Run \"compass -h\" to get help."
raise Compass::Error, message raise Compass::Error, message
@ -21,6 +38,10 @@ module Compass
end end
end end
def dry_run?
options[:dry_run]
end
def new_compiler_instance(additional_options = {}) def new_compiler_instance(additional_options = {})
Compass::Compiler.new(working_path, Compass::Compiler.new(working_path,
projectize(Compass.configuration.sass_dir), projectize(Compass.configuration.sass_dir),
@ -29,6 +50,39 @@ module Compass
:force => options[:force]).merge(additional_options)) :force => options[:force]).merge(additional_options))
end end
class << self
def option_parser(arguments)
parser = Compass::Exec::CommandOptionParser.new(arguments)
parser.extend(Compass::Exec::GlobalOptionsParser)
parser.extend(Compass::Exec::ProjectOptionsParser)
parser.extend(CompileProjectOptionsParser)
end
def usage
option_parser([]).to_s
end
def primary; true; end
def description(command)
"Compile Sass stylesheets to CSS"
end
def parse!(arguments)
parser = option_parser(arguments)
parser.parse!
parse_arguments!(parser, arguments)
parser.options
end
def parse_arguments!(parser, arguments)
if arguments.size == 1
parser.options[:project_name] = arguments.shift
elsif arguments.size > 1
raise Compass::Error, "Too many arguments were specified."
end
end
end
end end
end end
end end

View File

@ -1,19 +1,75 @@
require File.join(File.dirname(__FILE__), 'project_base') require 'compass/commands/project_base'
require File.join(File.dirname(__FILE__), 'update_project') require 'compass/commands/update_project'
module Compass module Compass
module Commands module Commands
module ValidationOptionsParser
def set_options(opts)
opts.banner = %Q{
Usage: compass validate [path/to/project] [options]
Description:
Compile project at the path specified or the current
directory if not specified and then validate the
generated CSS.
Options:
}.strip.split("\n").map{|l| l.gsub(/^ {0,10}/,'')}.join("\n")
super
end
end
class ValidateProject < ProjectBase class ValidateProject < ProjectBase
register :validate
def initialize(working_path, options) def initialize(working_path, options)
super super
assert_project_directory_exists! assert_project_directory_exists!
end end
def perform def perform
require File.join(File.dirname(__FILE__), '..', 'validator') require 'compass/validator'
UpdateProject.new(working_path, options).perform UpdateProject.new(working_path, options).perform
Validator.new(project_css_subdirectory).validate() Dir.chdir Compass.configuration.project_path do
Validator.new(project_css_subdirectory).validate()
end
end
class << self
def option_parser(arguments)
parser = Compass::Exec::CommandOptionParser.new(arguments)
parser.extend(Compass::Exec::GlobalOptionsParser)
parser.extend(Compass::Exec::ProjectOptionsParser)
parser.extend(ValidationOptionsParser)
end
def usage
option_parser([]).to_s
end
def description(command)
"Validate your generated css."
end
def parse!(arguments)
parser = option_parser(arguments)
parser.parse!
parse_arguments!(parser, arguments)
parser.options
end
def parse_arguments!(parser, arguments)
if arguments.size == 1
parser.options[:project_name] = arguments.shift
elsif arguments.size == 0
# default to the current directory.
else
raise Compass::Error, "Too many arguments were specified."
end
end
end end
end end

View File

@ -1,12 +1,14 @@
require 'fileutils' require 'fileutils'
require 'pathname' require 'pathname'
require File.join(File.dirname(__FILE__), 'base') require 'compass/commands/base'
require File.join(File.dirname(__FILE__), 'update_project') require 'compass/commands/update_project'
module Compass module Compass
module Commands module Commands
class WatchProject < UpdateProject class WatchProject < UpdateProject
register :watch
attr_accessor :last_update_time, :last_sass_files attr_accessor :last_update_time, :last_sass_files
def perform def perform
@ -19,7 +21,12 @@ module Compass
puts ">>> Compass is watching for changes. Press Ctrl-C to Stop." puts ">>> Compass is watching for changes. Press Ctrl-C to Stop."
require File.join(Compass.lib_directory, 'vendor', 'fssm') begin
require 'fssm'
rescue LoadError
$: << File.join(Compass.lib_directory, 'vendor')
retry
end
FSSM.monitor do |monitor| FSSM.monitor do |monitor|
Compass.configuration.sass_load_paths.each do |load_path| Compass.configuration.sass_load_paths.each do |load_path|

View File

@ -1,9 +1,33 @@
require File.join(File.dirname(__FILE__), 'project_base') require 'compass/commands/project_base'
module Compass module Compass
module Commands module Commands
module ConfigurationOptionsParser
def set_options(opts)
opts.banner = %Q{
Usage: compass config [path/to/config_file.rb] [options]
Description:
Generate a configuration file for the options specified.
Compass will recognize configuration files in the
following locations relative to the project root:
* #{Compass::Configuration::Helpers::KNOWN_CONFIG_LOCATIONS.join("
* ")}
Any other location, and you'll need to specify it when working with the command line tool using the -c option.
Options:
}.strip.split("\n").map{|l| l.gsub(/^ {0,10}/,'')}.join("\n")
opts.on("--debug [PROPERTY]", "Debug your configuration by printing out details.") do |prop|
self.options[:debug] = prop.nil? ? true : prop.to_sym
end
super
end
end
class WriteConfiguration < ProjectBase class WriteConfiguration < ProjectBase
register :config
include InstallerCommand include InstallerCommand
def initialize(working_path, options) def initialize(working_path, options)
@ -11,8 +35,33 @@ module Compass
assert_project_directory_exists! assert_project_directory_exists!
end end
def add_project_configuration
Compass.add_project_configuration
end
def perform def perform
installer.write_configuration_files(options[:configuration_file]) if options[:debug]
puts "Configuration sources:"
c = Compass.configuration
while c
print c.name
c = c.inherited_data
print ", " if c
end
print "\n"
Compass.configuration.debug.each do |prop, values|
if options[:debug].is_a?(Symbol)
next unless prop == options[:debug]
end
puts "***** #{prop} = #{values.first[:resolved].inspect} *****"
[:default, :value, :raw, :resolved].each do |kind|
puts "#{kind}: " + values.inject([]){|m, v| m << v[kind]}.map{|v| v.nil? ? '-' : v.inspect}.join(", ")
end
end
else
directory File.dirname(options[:configuration_file])
installer.write_configuration_files(options[:configuration_file])
end
end end
def installer_args def installer_args
@ -23,6 +72,42 @@ module Compass
false false
end end
class << self
def option_parser(arguments)
parser = Compass::Exec::CommandOptionParser.new(arguments)
parser.extend(Compass::Exec::GlobalOptionsParser)
parser.extend(Compass::Exec::ProjectOptionsParser)
parser.extend(ConfigurationOptionsParser)
end
def usage
option_parser([]).to_s
end
def description(command)
"Generate a configuration file for the provided command line options."
end
def parse!(arguments)
parser = option_parser(arguments)
parser.parse!
parse_arguments!(parser, arguments)
parser.options
end
def parse_arguments!(parser, arguments)
if arguments.size == 1
parser.options[:configuration_file] = arguments.shift
elsif arguments.size == 0
# default to the current directory.
else
raise Compass::Error, "Too many arguments were specified."
end
end
end
end end
end end
end end

View File

@ -13,8 +13,9 @@ module Compass
self.options[:cache_location] ||= File.join(from, ".sass-cache") self.options[:cache_location] ||= File.join(from, ".sass-cache")
end end
def sass_files def sass_files(options = {})
@sass_files || Dir.glob(separate("#{from}/**/[^_]*.sass")) exclude_partials = options.fetch(:exclude_partials, true)
@sass_files || Dir.glob(separate("#{from}/**/#{'[^_]' if exclude_partials}*.sass"))
end end
def stylesheet_name(sass_file) def stylesheet_name(sass_file)

View File

@ -1,324 +1,38 @@
require 'singleton'
module Compass module Compass
class Configuration module Configuration
include Singleton
ATTRIBUTES = [ ATTRIBUTES = [
:project_type, :project_type,
:project_path, :project_path,
:http_path,
:css_dir, :css_dir,
:sass_dir, :sass_dir,
:images_dir, :images_dir,
:javascripts_dir, :javascripts_dir,
:output_style, :extensions_dir,
:environment, :css_path,
:relative_assets, :sass_path,
:images_path,
:javascripts_path,
:extensions_path,
:http_path,
:http_images_dir,
:http_stylesheets_dir,
:http_javascripts_dir,
:http_images_path, :http_images_path,
:http_stylesheets_path, :http_stylesheets_path,
:http_javascripts_path, :http_javascripts_path,
:output_style,
:environment,
:relative_assets,
:additional_import_paths, :additional_import_paths,
:sass_options :sass_options,
:asset_host,
:asset_cache_buster
] ]
attr_accessor *ATTRIBUTES
attr_accessor :required_libraries
def initialize
self.required_libraries = []
end
# parses a manifest file which is a ruby script
# evaluated in a Manifest instance context
def parse(config_file)
open(config_file) do |f|
parse_string(f.read, config_file)
end
end
def parse_string(contents, filename)
bind = binding
eval(contents, bind, filename)
ATTRIBUTES.each do |prop|
value = eval(prop.to_s, bind) rescue nil
self.send("#{prop}=", value) if value
end
if @added_import_paths
self.additional_import_paths ||= []
self.additional_import_paths += @added_import_paths
end
issue_deprecation_warnings
end
def set_all(options)
ATTRIBUTES.each do |a|
self.send("#{a}=", options[a]) if options.has_key?(a)
end
end
def set_maybe(options)
ATTRIBUTES.each do |a|
self.send("#{a}=", options[a]) if options[a]
end
end
def default_all(options)
ATTRIBUTES.each do |a|
set_default_unless_set(a, options[a])
end
end
def set_default_unless_set(attribute, value)
self.send("#{attribute}=", value) unless self.send(attribute)
end
def set_defaults!
ATTRIBUTES.each do |a|
set_default_unless_set(a, default_for(a))
end
end
def default_for(attribute)
method = "default_#{attribute}".to_sym
self.send(method) if respond_to?(method)
end
def default_sass_dir
"src"
end
def default_css_dir
"stylesheets"
end
def default_images_dir
"images"
end
def default_http_path
"/"
end
def comment_for_http_path
"# Set this to the root of your project when deployed:\n"
end
def relative_assets?
# the http_images_path is deprecated, but here for backwards compatibility.
relative_assets || http_images_path == :relative
end
def comment_for_relative_assets
unless relative_assets
%q{# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
}
else
""
end
end
def default_output_style
if environment == :development
:expanded
else
:compact
end
end
def default_line_comments
environment == :development
end
def sass_path
if project_path && sass_dir
File.join(project_path, sass_dir)
end
end
def css_path
if project_path && css_dir
File.join(project_path, css_dir)
end
end
def root_relative(path)
hp = http_path || default_http_path
hp = hp[0..-2] if hp[-1..-1] == "/"
"#{hp}/#{path}"
end
def add_import_path(*paths)
# The @added_import_paths variable works around an issue where
# the additional_import_paths gets overwritten during parse
@added_import_paths ||= []
@added_import_paths += paths
self.additional_import_paths ||= []
self.additional_import_paths += paths
end
# When called with a block, defines the asset host url to be used.
# The block must return a string that starts with a protocol (E.g. http).
# The block will be passed the root-relative url of the asset.
# When called without a block, returns the block that was previously set.
def asset_host(&block)
if block_given?
@asset_host = block
else
@asset_host
end
end
# When called with a block, defines the cache buster strategy to be used.
# The block must return nil or a string that can be appended to a url as a query parameter.
# The returned string must not include the starting '?'.
# The block will be passed the root-relative url of the asset.
# If the block accepts two arguments, it will also be passed a File object
# that points to the asset on disk -- which may or may not exist.
# When called without a block, returns the block that was previously set.
def asset_cache_buster(&block)
if block_given?
@asset_cache_buster = block
else
@asset_cache_buster
end
end
def serialize
if asset_cache_buster
raise Compass::Error, "Cannot serialize a configuration with asset_cache_buster set."
end
if asset_host
raise Compass::Error, "Cannot serialize a configuration with asset_host set."
end
contents = ""
required_libraries.each do |lib|
contents << %Q{require '#{lib}'\n}
end
contents << "# Require any additional compass plugins here.\n"
contents << "\n" if required_libraries.any?
ATTRIBUTES.each do |prop|
value = send(prop)
if respond_to?("comment_for_#{prop}")
contents << send("comment_for_#{prop}")
end
if block_given? && (to_emit = yield(prop, value))
contents << to_emit
else
contents << Configuration.serialize_property(prop, value) unless value.nil?
end
end
contents
end
def self.serialize_property(prop, value)
%Q(#{prop} = #{value.inspect}\n)
end
def to_compiler_arguments(additional_options)
[project_path, sass_path, css_path, to_sass_engine_options.merge(additional_options)]
end
def to_sass_plugin_options
locations = {}
locations[sass_path] = css_path if sass_path && css_path
Compass::Frameworks::ALL.each do |framework|
locations[framework.stylesheets_directory] = css_path || css_dir || "."
end
resolve_additional_import_paths.each do |additional_path|
locations[additional_path] = File.join(css_path || css_dir || ".", File.basename(additional_path))
end
plugin_opts = {:template_location => locations}
plugin_opts[:style] = output_style if output_style
plugin_opts[:line_comments] = default_line_comments if environment
plugin_opts.merge!(sass_options || {})
plugin_opts
end
def resolve_additional_import_paths
(additional_import_paths || []).map do |path|
if project_path && !absolute_path?(path)
File.join(project_path, path)
else
path
end
end
end
def to_sass_engine_options
engine_opts = {:load_paths => sass_load_paths}
engine_opts[:style] = output_style if output_style
engine_opts[:line_comments] = default_line_comments if environment
engine_opts.merge!(sass_options || {})
end
def sass_load_paths
load_paths = []
load_paths << sass_path if sass_path
Compass::Frameworks::ALL.each do |framework|
load_paths << framework.stylesheets_directory if File.exists?(framework.stylesheets_directory)
end
load_paths += resolve_additional_import_paths
load_paths
end
# Support for testing.
def reset!
ATTRIBUTES.each do |attr|
send("#{attr}=", nil)
end
@asset_cache_buster = nil
@asset_host = nil
@added_import_paths = nil
self.required_libraries = []
end
def issue_deprecation_warnings
if http_images_path == :relative
puts "DEPRECATION WARNING: Please set relative_assets = true to enable relative paths."
end
end
def require(lib)
required_libraries << lib
super
end
def absolute_path?(path)
# This is only going to work on unix, gonna need a better implementation.
path.index(File::SEPARATOR) == 0
end
end end
end
module ConfigHelpers
def configuration ['adapters', 'comments', 'defaults', 'helpers', 'inheritance', 'serialization', 'data'].each do |lib|
if block_given? require "compass/configuration/#{lib}"
yield Configuration.instance
end
Configuration.instance
end
def sass_plugin_configuration
configuration.to_sass_plugin_options
end
def configure_sass_plugin!
@sass_plugin_configured = true
Sass::Plugin.options.merge!(sass_plugin_configuration)
end
def sass_plugin_configured?
@sass_plugin_configured
end
def sass_engine_options
configuration.to_sass_engine_options
end
end
extend ConfigHelpers
end end

View File

@ -0,0 +1,59 @@
module Compass
module Configuration
# The adapters module provides methods that make configuration data from a compass project
# adapt to various consumers of configuration data
module Adapters
def to_compiler_arguments(additional_options)
[project_path, sass_path, css_path, to_sass_engine_options.merge(additional_options)]
end
def to_sass_plugin_options
locations = {}
locations[sass_path] = css_path if sass_path && css_path
Compass::Frameworks::ALL.each do |framework|
locations[framework.stylesheets_directory] = css_path || css_dir || "."
end
resolve_additional_import_paths.each do |additional_path|
locations[additional_path] = File.join(css_path || css_dir || ".", File.basename(additional_path))
end
plugin_opts = {:template_location => locations}
plugin_opts[:style] = output_style if output_style
plugin_opts[:line_comments] = line_comments if environment
plugin_opts.merge!(sass_options || {})
plugin_opts
end
def resolve_additional_import_paths
(additional_import_paths || []).map do |path|
if project_path && !absolute_path?(path)
File.join(project_path, path)
else
path
end
end
end
def absolute_path?(path)
# This is only going to work on unix, gonna need a better implementation.
path.index(File::SEPARATOR) == 0
end
def to_sass_engine_options
engine_opts = {:load_paths => sass_load_paths}
engine_opts[:style] = output_style if output_style
engine_opts[:line_comments] = line_comments if environment
engine_opts.merge!(sass_options || {})
end
def sass_load_paths
load_paths = []
load_paths << sass_path if sass_path
Compass::Frameworks::ALL.each do |framework|
load_paths << framework.stylesheets_directory if File.exists?(framework.stylesheets_directory)
end
load_paths += resolve_additional_import_paths
load_paths
end
end
end
end

View File

@ -0,0 +1,22 @@
module Compass
module Configuration
# Comments are emitted into the configuration file when serialized and make it easier to understand for new users.
module Comments
def comment_for_http_path
"# Set this to the root of your project when deployed:\n"
end
def comment_for_relative_assets
unless relative_assets
%q{# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
}
else
""
end
end
end
end
end

View File

@ -0,0 +1,106 @@
module Compass
module Configuration
# The Compass configuration data storage class manages configuration data that comes from a variety of
# different sources and aggregates them together into a consistent API
# Some of the possible sources of configuration data:
# * Compass default project structure for stand alone projects
# * App framework specific project structures for rails, etc.
# * User supplied explicit configuration
# * Configuration data provided via the command line interface
#
# There are two kinds of configuration data that doesn't come from the user:
#
# 1. Configuration data that is defaulted as if the user had provided it themselves.
# This is useful for providing defaults that the user is likely to want to edit
# but shouldn't have to provide explicitly when getting started
# 2. Configuration data that is defaulted behind the scenes because _some_ value is
# required.
class Data
attr_accessor :required_libraries
attr_reader :name
include Compass::Configuration::Inheritance
include Compass::Configuration::Serialization
include Compass::Configuration::Adapters
inherited_accessor *ATTRIBUTES
def initialize(name, attr_hash = nil)
raise "I need a name!" unless name
@name = name
self.required_libraries = []
set_all(attr_hash) if attr_hash
self.top_level = self
end
def set_all(attr_hash)
# assert_valid_keys!(attr_hash)
attr_hash.each do |a, v|
if self.respond_to?("#{a}=")
self.send("#{a}=", v)
end
end
end
def add_import_path(*paths)
# The @added_import_paths variable works around an issue where
# the additional_import_paths gets overwritten during parse
@added_import_paths ||= []
@added_import_paths += paths
self.additional_import_paths ||= []
self.additional_import_paths += paths
end
# When called with a block, defines the asset host url to be used.
# The block must return a string that starts with a protocol (E.g. http).
# The block will be passed the root-relative url of the asset.
# When called without a block, returns the block that was previously set.
def asset_host(&block)
if block_given?
@asset_host = block
else
@asset_host
end
end
# When called with a block, defines the cache buster strategy to be used.
# The block must return nil or a string that can be appended to a url as a query parameter.
# The returned string must not include the starting '?'.
# The block will be passed the root-relative url of the asset.
# If the block accepts two arguments, it will also be passed a File object
# that points to the asset on disk -- which may or may not exist.
# When called without a block, returns the block that was previously set.
def asset_cache_buster(&block)
if block_given?
@asset_cache_buster = block
else
@asset_cache_buster
end
end
# Require a compass plugin and capture that it occured so that the configuration serialization works next time.
def require(lib)
required_libraries << lib
super
end
def relative_assets?
# the http_images_path is deprecated, but here for backwards compatibility.
relative_assets || http_images_path == :relative
end
private
def assert_valid_keys!(attr_hash)
illegal_attrs = attr_hash.keys - ATTRIBUTES
if illegal_attrs.size == 1
raise Error, "#{illegal_attrs.first.inspect} is not a valid configuration attribute."
elsif illegal_attrs.size > 0
raise Error, "Illegal configuration attributes: #{illegal_attrs.map{|a| a.inspect}.join(", ")}"
end
end
end
end
end

View File

@ -0,0 +1,108 @@
module Compass
module Configuration
module Defaults
def default_project_type
:stand_alone
end
def http_path_without_default
"/"
end
def default_extensions_dir
"extensions"
end
def default_output_style
if top_level.environment == :development
:expanded
else
:compact
end
end
def default_line_comments
top_level.environment == :development
end
def default_sass_path
if (pp = top_level.project_path) && (dir = top_level.sass_dir)
File.join(pp, dir)
end
end
def default_css_path
if (pp = top_level.project_path) && (dir = top_level.css_dir)
File.join(pp, dir)
end
end
def default_images_path
if (pp = top_level.project_path) && (dir = top_level.images_dir)
File.join(pp, dir)
end
end
def default_javascripts_path
if (pp = top_level.project_path) && (dir = top_level.javascripts_dir)
File.join(pp, dir)
end
end
def default_extensions_path
if (pp = top_level.project_path) && (dir = top_level.extensions_dir)
File.join(pp, dir)
end
end
def default_http_images_dir
top_level.images_dir
end
def default_http_images_path
http_root_relative top_level.http_images_dir
end
def default_http_stylesheets_dir
top_level.css_dir
end
def default_http_stylesheets_path
http_root_relative top_level.http_stylesheets_dir
end
def default_http_javascripts_dir
top_level.javascripts_dir
end
def default_http_javascripts_path
http_root_relative top_level.http_javascripts_dir
end
# helper functions
def http_join(*segments)
segments.map do |segment|
next unless segment
segment = http_pathify(segment)
segment[-1..-1] == "/" ? segment[0..-2] : segment
end.join("/")
end
def http_pathify(path)
if File::SEPARATOR == "/"
path
else
path.gsub(File::SEPARATOR, "/")
end
end
def http_root_relative(path)
http_join top_level.http_path, path
end
end
end
end

View File

@ -0,0 +1,120 @@
module Compass
module Configuration
# The helpers are available as methods on the Compass module. E.g. Compass.configuration
module Helpers
def configuration
@configuration ||= default_configuration
if block_given?
yield @configuration
end
@configuration
end
def default_configuration
Data.new('defaults').extend(Defaults).extend(Comments)
end
def add_configuration(config, filename = nil)
return if config.nil?
data = configuration_for(config, filename)
# puts "New configuration: #{data.name}"
# puts caller.join("\n")
data.inherit_from!(configuration)
data.on_top!
@configuration = data
end
def configuration_for(config, filename = nil)
if config.is_a?(Compass::Configuration::Data)
config
elsif config.respond_to?(:read)
Compass::Configuration::Data.new_from_string(config.read, filename)
elsif config.is_a?(Hash)
Compass::Configuration::Data.new(filename, config)
elsif config.is_a?(String)
Compass::Configuration::Data.new_from_file(config)
elsif config.is_a?(Symbol)
Compass::AppIntegration.lookup(config).configuration
else
raise "I don't know what to do with: #{config.inspect}"
end
end
# Support for testing.
def reset_configuration!
@configuration = nil
end
def sass_plugin_configuration
configuration.to_sass_plugin_options
end
def configure_sass_plugin!
@sass_plugin_configured = true
Sass::Plugin.options.merge!(sass_plugin_configuration)
end
def sass_plugin_configured?
@sass_plugin_configured
end
def sass_engine_options
configuration.to_sass_engine_options
end
# Read the configuration file for this project
def add_project_configuration(*args)
options = args.last.is_a?(Hash) ? args.pop : {}
configuration_file_path = args.shift || detect_configuration_file
raise ArgumentError, "Too many arguments" if args.any?
if configuration_file_path
data = configuration_for(configuration_file_path)
if data.raw_project_type
add_configuration(data.raw_project_type.to_sym)
elsif options[:project_type]
add_configuration(options[:project_type])
else
add_configuration(:stand_alone)
end
add_configuration(data)
else
add_configuration(options[:project_type] || configuration.project_type || :stand_alone)
end
end
# Returns a full path to the relative path to the project directory
def projectize(path, project_path = nil)
project_path ||= configuration.project_path
File.join(project_path, *path.split('/'))
end
def deprojectize(path, project_path = nil)
project_path ||= configuration.project_path
if path[0..(project_path.size - 1)] == project_path
path[(project_path.size + 1)..-1]
else
path
end
end
# TODO: Deprecate the src/config.rb location.
KNOWN_CONFIG_LOCATIONS = ['config/compass.rb', ".compass/config.rb", "config/compass.config", "config.rb", "src/config.rb"]
# Finds the configuration file, if it exists in a known location.
def detect_configuration_file(project_path = nil)
possible_files = KNOWN_CONFIG_LOCATIONS.map{|f| projectize(f, project_path) }
possible_files.detect{|f| File.exists?(f)}
end
end
end
extend Configuration::Helpers
end

View File

@ -0,0 +1,170 @@
module Compass
module Configuration
# The inheritance module makes it easy for configuration data to inherit from
# other instances of configuration data. This makes it easier for external code to layer
# bits of configuration from various sources.
module Inheritance
def self.included(base)
# inherited_data stores configuration data that this configuration object will
# inherit if not provided explicitly.
base.send :attr_accessor, :inherited_data, :set_attributes, :top_level
base.send(:include, InstanceMethods)
base.extend(ClassMethods)
end
module ClassMethods
def inherited_writer(*attributes)
attributes.each do |attribute|
line = __LINE__ + 1
class_eval %Q{
def #{attribute}=(value) # def css_dir=(value)
@set_attributes ||= {} # @set_attributes ||= {}
@set_attributes[#{attribute.inspect}] = true # @set_attributes[:css_dir] = true
@#{attribute} = value # @css_dir = value
end # end
def unset_#{attribute}! # def unset_css_dir!
unset!(#{attribute.inspect}) # unset!(:css_dir)
end # end
def #{attribute}_set? # def css_dir_set?
set?(#{attribute.inspect}) # set?(:css_dir)
end # end
}, __FILE__, line
end
end
# Defines the default reader to be an inherited_reader that will look at the inherited_data for its
# value when not set. The inherited reader calls to a raw reader that acts like a normal attribute
# reader but prefixes the attribute name with "raw_".
def inherited_reader(*attributes)
attributes.each do |attribute|
line = __LINE__ + 1
class_eval %Q{
def raw_#{attribute} # def raw_css_dir
@#{attribute} # @css_dir
end # end
def #{attribute}_without_default # def css_dir_without_default
read_without_default(#{attribute.inspect}) # read_without_default(:css_dir)
end # end
def #{attribute} # def css_dir
read(#{attribute.inspect}) # read(:css_dir)
end # end
}, __FILE__, line
end
end
def inherited_accessor(*attributes)
inherited_reader(*attributes)
inherited_writer(*attributes)
end
end
module InstanceMethods
def on_top!
self.set_top_level(self)
end
def set_top_level(new_top)
self.top_level = new_top
if self.inherited_data.respond_to?(:set_top_level)
self.inherited_data.set_top_level(new_top)
end
end
def inherit_from!(data)
if self.inherited_data
self.inherited_data.inherit_from!(data)
else
self.inherited_data = data
end
self
end
def unset!(attribute)
@set_attributes ||= {}
send("#{attribute}=", nil)
@set_attributes.delete(attribute)
nil
end
def set?(attribute)
@set_attributes ||= {}
@set_attributes[attribute]
end
def default_for(attribute)
method = "default_#{attribute}".to_sym
if respond_to?(method)
send(method)
end
end
# Read an explicitly set value that is either inherited or set on this instance
def read_without_default(attribute)
if set?(attribute)
send("raw_#{attribute}")
elsif inherited_data.respond_to?("#{attribute}_without_default")
inherited_data.send("#{attribute}_without_default")
elsif inherited_data.respond_to?(attribute)
inherited_data.send(attribute)
end
end
# Read a value that is either inherited or set on this instance, if we get to the bottom-most configuration instance,
# we ask for the default starting at the top level.
def read(attribute)
if !(v = send("#{attribute}_without_default")).nil?
v
else
top_level.default_for(attribute)
end
end
def method_missing(meth)
if inherited_data
inherited_data.send(meth)
else
raise NoMethodError, meth.to_s
end
end
def respond_to?(meth)
if super
true
elsif inherited_data
inherited_data.respond_to?(meth)
else
false
end
end
def debug
instances = [self]
instances << instances.last.inherited_data while instances.last.inherited_data
normalized_attrs = {}
ATTRIBUTES.each do |prop|
values = []
instances.each do |instance|
values << {
:raw => (instance.send("raw_#{prop}") rescue nil),
:value => (instance.send("#{prop}_without_default") rescue nil),
:default => (instance.send("default_#{prop}") rescue nil),
:resolved => instance.send(prop)
}
end
normalized_attrs[prop] = values
end
normalized_attrs
end
end
end
end
end

View File

@ -0,0 +1,86 @@
module Compass
module Configuration
# The serialization module manages reading and writing the configuration file(s).
module Serialization
def self.included(base)
base.send(:include, InstanceMethods)
base.extend ClassMethods
end
module ClassMethods
def new_from_file(config_file)
data = Data.new(config_file)
data.parse(config_file)
data
end
def new_from_string(contents, filename)
data = Data.new(filename)
data.parse_string(contents, filename)
data
end
end
module InstanceMethods
# parses a configuration file which is a ruby script
def parse(config_file)
unless File.readable?(config_file)
raise Compass::Error, "Configuration file, #{config_file}, not found or not readable."
end
open(config_file) do |f|
parse_string(f.read, config_file)
end
end
def parse_string(contents, filename)
bind = binding
eval(contents, bind, filename)
ATTRIBUTES.each do |prop|
value = eval(prop.to_s, bind) rescue nil
self.send("#{prop}=", value) if value
end
if @added_import_paths
self.additional_import_paths ||= []
self.additional_import_paths += @added_import_paths
end
issue_deprecation_warnings
end
def serialize
contents = ""
required_libraries.each do |lib|
contents << %Q{require '#{lib}'\n}
end
contents << "# Require any additional compass plugins here.\n"
contents << "\n" if required_libraries.any?
ATTRIBUTES.each do |prop|
value = send("#{prop}_without_default")
if value.is_a?(Proc)
$stderr.puts "WARNING: #{prop} is code and cannot be written to a file. You'll need to copy it yourself."
end
if respond_to?("comment_for_#{prop}")
contents << send("comment_for_#{prop}")
end
if block_given? && (to_emit = yield(prop, value))
contents << to_emit
else
contents << serialize_property(prop, value) unless value.nil?
end
end
contents
end
def serialize_property(prop, value)
%Q(#{prop} = #{value.inspect}\n)
end
def issue_deprecation_warnings
if http_images_path == :relative
$stderr.puts "DEPRECATION WARNING: Please set relative_assets = true to enable relative paths."
end
end
end
end
end
end

View File

@ -1,10 +1,6 @@
unless defined?(Sass) begin
require 'sass'
rescue LoadError
require 'rubygems' require 'rubygems'
begin
gem 'haml-edge', '>= 2.3.0'
$stderr.puts "Loading haml-edge gem."
rescue Exception
#pass
end
require 'sass' require 'sass'
end end

View File

@ -4,4 +4,7 @@ module Compass
class FilesystemConflict < Error class FilesystemConflict < Error
end end
class MissingDependency < Error
end
end end

View File

@ -1,251 +1,16 @@
require File.join(Compass.lib_directory, 'compass', 'dependencies') require 'compass/dependencies'
require 'optparse' require 'optparse'
require File.join(Compass.lib_directory, 'compass', 'logger') require 'compass/logger'
require File.join(Compass.lib_directory, 'compass', 'errors') require 'compass/errors'
require File.join(Compass.lib_directory, 'compass', 'actions') require 'compass/actions'
require 'compass/installers'
require 'compass/commands'
module Compass module Compass::Exec
module Exec
def report_error(e, options)
$stderr.puts "#{e.class} on line #{get_line e} of #{get_file e}: #{e.message}"
if options[:trace]
e.backtrace[1..-1].each { |t| $stderr.puts " #{t}" }
else
$stderr.puts "Run with --trace to see the full backtrace"
end
end
def get_file(exception)
exception.backtrace[0].split(/:/, 2)[0]
end
def get_line(exception)
exception.backtrace[0].scan(/:(\d+)/)[0]
end
module_function :report_error, :get_file, :get_line
class Compass
attr_accessor :args, :options, :opts
def initialize(args)
self.args = args
self.options = {}
parse!
end
def run!
begin
perform!
rescue Exception => e
raise e if e.is_a? SystemExit
if e.is_a?(::Compass::Error) || e.is_a?(OptionParser::ParseError)
$stderr.puts e.message
else
::Compass::Exec.report_error(e, @options)
end
return 1
end
return 0
end
protected
def perform!
if options[:command]
do_command(options[:command])
else
puts self.opts
end
end
def parse!
self.opts = OptionParser.new(&method(:set_opts))
self.opts.parse!(self.args)
if self.args.size > 0
self.options[:project_name] = trim_trailing_separator(self.args.shift)
end
self.options[:command] ||= self.options[:project_name] ? :create_project : :update_project
self.options[:framework] ||= :compass
self.options[:project_type] ||= :stand_alone
end
def trim_trailing_separator(path)
path[-1..-1] == File::SEPARATOR ? path[0..-2] : path
end
def set_opts(opts)
opts.banner = <<END
Usage: compass [options] [project]
Description:
The compass command line tool will help you create and manage the stylesheets for your project.
To get started on a stand-alone project based on blueprint:
compass -f blueprint my_compass_project
When you change any sass files, you must recompile your project using --update or --watch.
END
opts.separator ''
opts.separator 'Mode Options(only specify one):'
opts.on('-i', '--install', :NONE, "Create a new compass project.",
" The default mode when a project is provided.") do
self.options[:command] = :create_project
end
opts.on('-u', '--update', :NONE, 'Update the current project.',
' This is the default when no project is provided.') do
self.options[:command] = :update_project
end
opts.on('-w', '--watch', :NONE, 'Monitor the current project for changes and update') do
self.options[:command] = :watch_project
self.options[:quiet] = true
end
opts.on('-p', '--pattern PATTERN', 'Stamp out a pattern into the current project.',
' Must be used with -f.') do |pattern|
self.options[:command] = :stamp_pattern
self.options[:pattern] = pattern
end
opts.on('--write-configuration', "Write the current configuration to the configuration file.") do
self.options[:command] = :write_configuration
end
opts.on('--list-frameworks', "List compass frameworks available to use.") do
self.options[:command] = :list_frameworks
end
opts.on('--validate', :NONE, 'Validate your project\'s compiled css. Requires Java.') do
self.options[:command] = :validate_project
end
opts.on('--grid-img [DIMENSIONS]', 'Generate a background image to test grid alignment.',
' Dimension is given as <column_width>+<gutter_width>.',
' Defaults to 30+10.') do |dimensions|
self.options[:grid_dimensions] = dimensions || "30+10"
unless self.options[:grid_dimensions] =~ /^\d+\+\d+$/
puts "Please enter your dimensions as <column_width>+<gutter_width>. E.g. 20+5 or 30+10."
exit
end
self.options[:command] = :generate_grid_background
end
opts.separator ''
opts.separator 'Install/Pattern Options:'
opts.on('-f FRAMEWORK', '--framework FRAMEWORK', 'Use the specified framework. Only one may be specified.') do |framework|
self.options[:framework] = framework
end
opts.on('-n', '--pattern-name NAME', 'The name to use when stamping a pattern.',
' Must be used in combination with -p.') do |name|
self.options[:pattern_name] = name
end
opts.on('--rails', "Sets the project type to a rails project.") do
self.options[:project_type] = :rails
end
opts.separator ''
opts.separator 'Configuration Options:'
opts.on('-c', '--config CONFIG_FILE', 'Specify the location of the configuration file explicitly.') do |configuration_file|
self.options[:configuration_file] = configuration_file
end
opts.on('--sass-dir SRC_DIR', "The source directory where you keep your sass stylesheets.") do |sass_dir|
self.options[:sass_dir] = sass_dir
end
opts.on('--css-dir CSS_DIR', "The target directory where you keep your css stylesheets.") do |css_dir|
self.options[:css_dir] = css_dir
end
opts.on('--images-dir IMAGES_DIR', "The directory where you keep your images.") do |images_dir|
self.options[:images_dir] = images_dir
end
opts.on('--javascripts-dir JS_DIR', "The directory where you keep your javascripts.") do |javascripts_dir|
self.options[:javascripts_dir] = javascripts_dir
end
opts.on('-e ENV', '--environment ENV', [:development, :production], 'Use sensible defaults for your current environment.',
' One of: development, production (default)') do |env|
self.options[:environment] = env
end
opts.on('-s STYLE', '--output-style STYLE', [:nested, :expanded, :compact, :compressed], 'Select a CSS output mode.',
' One of: nested, expanded, compact, compressed') do |style|
self.options[:output_style] = style
end
opts.on('--relative-assets', :NONE, 'Make compass asset helpers generate relative urls to assets.') do
self.options[:relative_assets] = true
end
opts.separator ''
opts.separator 'General Options:'
opts.on('-r LIBRARY', '--require LIBRARY', "Require the given ruby LIBRARY before running commands.",
" This is used to access compass plugins without having a",
" project configuration file.") do |library|
::Compass.configuration.require library
end
opts.on('-q', '--quiet', :NONE, 'Quiet mode.') do
self.options[:quiet] = true
end
opts.on('--dry-run', :NONE, 'Dry Run. Tells you what it plans to do.') do
self.options[:dry_run] = true
end
opts.on('--trace', :NONE, 'Show a full stacktrace on error') do
self.options[:trace] = true
end
opts.on('--force', :NONE, 'Force. Allows some failing commands to succeed instead.') do
self.options[:force] = true
end
opts.on('--imports', :NONE, 'Emit an imports suitable for passing to the sass command-line.',
' Example: sass `compass --imports`',
' Note: Compass\'s Sass extensions will not be available.') do
print ::Compass::Frameworks::ALL.map{|f| "-I #{f.stylesheets_directory}"}.join(' ')
exit
end
opts.on('--install-dir', :NONE, 'Emit the location where compass is installed.') do
puts ::Compass.base_directory
exit
end
opts.on_tail("-?", "-h", "--help", "Show this message") do
puts opts
exit
end
opts.on_tail("-v", "--version", "Print version") do
self.options[:command] = :print_version
end
end
def do_command(command)
command_class_name = command.to_s.split(/_/).map{|p| p.capitalize}.join('')
command_class = eval("::Compass::Commands::#{command_class_name}")
command_class.new(Dir.getwd, options).execute
end
end
end
end end
Dir.glob(File.join(File.dirname(__FILE__), 'commands', "*.rb")).each do |file| %w(helpers switch_ui sub_command_ui
require file global_options_parser project_options_parser
command_option_parser).each do |lib|
require "compass/exec/#{lib}"
end end

Some files were not shown because too many files have changed in this diff Show More