04f14eb514
* 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
166 lines
4.9 KiB
Ruby
166 lines
4.9 KiB
Ruby
if ENV['RUN_CODE_RUN']
|
|
# We need to checkout edge haml for the run>code>run test environment.
|
|
if File.directory?("haml")
|
|
Dir.chdir("haml") do
|
|
sh "git", "pull"
|
|
end
|
|
else
|
|
sh "git", "clone", "git://github.com/nex3/haml.git"
|
|
end
|
|
$LOAD_PATH.unshift "haml/lib"
|
|
end
|
|
|
|
require 'rubygems'
|
|
require 'rake'
|
|
$:.unshift File.join(File.dirname(__FILE__), 'lib')
|
|
require 'compass'
|
|
require 'rcov/rcovtask'
|
|
|
|
# ----- Default: Testing ------
|
|
|
|
task :default => :run_tests
|
|
|
|
require 'rake/testtask'
|
|
require 'fileutils'
|
|
|
|
Rake::TestTask.new :run_tests do |t|
|
|
t.libs << 'lib'
|
|
t.libs << 'test'
|
|
t.libs << 'haml/lib' if ENV["RUN_CODE_RUN"]
|
|
test_files = FileList['test/**/*_test.rb']
|
|
test_files.exclude('test/rails/*', 'test/haml/*')
|
|
t.test_files = test_files
|
|
t.verbose = true
|
|
end
|
|
Rake::Task[:test].send(:add_comment, <<END)
|
|
To run with an alternate version of Rails, make test/rails a symlink to that version.
|
|
To run with an alternate version of Haml & Sass, make test/haml a symlink to that version.
|
|
END
|
|
|
|
begin
|
|
require 'jeweler'
|
|
Jeweler::Tasks.new do |gemspec|
|
|
gemspec.rubyforge_project = "compass"
|
|
gemspec.name = "compass"
|
|
gemspec.summary = "A Real Stylesheet Framework"
|
|
gemspec.email = "chris@eppsteins.net"
|
|
gemspec.homepage = "http://compass-style.org"
|
|
gemspec.description = "Compass is a Sass-based Stylesheet Framework that streamlines the creation and maintainance of CSS."
|
|
gemspec.authors = ["Chris Eppstein"]
|
|
gemspec.has_rdoc = false
|
|
gemspec.add_dependency('haml', '>= 2.2.0')
|
|
gemspec.files = []
|
|
gemspec.files << "CHANGELOG.markdown"
|
|
gemspec.files << "README.markdown"
|
|
gemspec.files << "LICENSE.markdown"
|
|
gemspec.files << "REVISION"
|
|
gemspec.files << "VERSION.yml"
|
|
gemspec.files << "Rakefile"
|
|
gemspec.files << "deps.rip"
|
|
gemspec.files += Dir.glob("bin/*")
|
|
gemspec.files += Dir.glob("examples/**/*.*")
|
|
gemspec.files -= Dir.glob("examples/**/*.css")
|
|
gemspec.files -= Dir.glob("examples/**/*.html")
|
|
gemspec.files -= Dir.glob("examples/*/extensions/**")
|
|
gemspec.files += Dir.glob("lib/**/*")
|
|
gemspec.files += Dir.glob("test/**/*.*")
|
|
gemspec.files -= Dir.glob("test/fixtures/stylesheets/*/saved/**/*.*")
|
|
gemspec.test_files = Dir.glob("test/**/*.*")
|
|
gemspec.test_files -= Dir.glob("test/fixtures/stylesheets/*/saved/**/*.*")
|
|
gemspec.test_files += Dir.glob("features/**/*.*")
|
|
end
|
|
rescue LoadError
|
|
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
|
end
|
|
|
|
desc "Record the current git revision."
|
|
task :REVISION do
|
|
require 'git'
|
|
|
|
repo = Git.open('.')
|
|
open("REVISION", "w") do |f|
|
|
f.write(repo.object("HEAD").sha)
|
|
end
|
|
end
|
|
|
|
desc "Commit the revision file."
|
|
task :commit_revision => :REVISION do
|
|
require 'git'
|
|
repo = Git.open('.')
|
|
repo.add("REVISION")
|
|
repo.commit("Record current revision for release.")
|
|
end
|
|
|
|
task :release => :commit_revision
|
|
|
|
task :gem => :build
|
|
|
|
desc "Compile Examples into HTML and CSS"
|
|
task :examples do
|
|
linked_haml = "tests/haml"
|
|
if File.exists?(linked_haml) && !$:.include?(linked_haml + '/lib')
|
|
puts "[ using linked Haml ]"
|
|
$:.unshift linked_haml + '/lib'
|
|
end
|
|
require 'haml'
|
|
require 'sass'
|
|
require 'pathname'
|
|
require 'lib/compass'
|
|
require 'lib/compass/exec'
|
|
FileList['examples/*'].each do |example|
|
|
next unless File.directory?(example)
|
|
puts "\nCompiling #{example}"
|
|
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
|
|
FileList["#{example}/**/*.haml"].each do |haml_file|
|
|
basename = haml_file[0..-6]
|
|
engine = Haml::Engine.new(open(haml_file).read, :filename => haml_file)
|
|
puts " haml #{File.basename(basename)}"
|
|
output = open(basename,'w')
|
|
output.write(engine.render)
|
|
output.close
|
|
end
|
|
end
|
|
end
|
|
|
|
namespace :git do
|
|
task :clean do
|
|
sh "git", "clean", "-fdx"
|
|
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
|
|
|