Skip to content

Commit

Permalink
Initial Checkin of Compass. Used to be Blueprint-Sass.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseppstein committed Aug 23, 2008
0 parents commit 88ed459
Show file tree
Hide file tree
Showing 88 changed files with 3,060 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.DS_Store
tmp/*
built_examples/*
test/tmp
test/fixtures/*/saved
test/fixtures/*/tmp
80 changes: 80 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
require 'rubygems'
require 'rake'
require 'lib/compass'

# ----- Default: Testing ------

task :default => :tests

require 'rake/testtask'
require 'fileutils'

Rake::TestTask.new :test do |t|
t.libs << 'lib'
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


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'
FileList['examples/*'].each do |example|
puts "Compiling #{example} -> built_examples/#{example.sub(%r{.*/},'')}"
# compile any haml templates to html
FileList["#{example}/*.haml"].each do |haml_file|
basename = haml_file[9..-6]
engine = Haml::Engine.new(open(haml_file).read, :filename => haml_file)
target_dir = "built_examples/#{basename.sub(%r{/[^/]*$},'')}"
FileUtils.mkdir_p(target_dir)
output = open("built_examples/#{basename}",'w')
output.write(engine.render)
output.close
end
# compile any sass templates to css
FileList["#{example}/stylesheets/**/[^_]*.sass"].each do |sass_file|
basename = sass_file[9..-6]
css_filename = "built_examples/#{basename}.css"
compass_sass = File.dirname(__FILE__).sub(%r{.*/},'')
engine = Sass::Engine.new(open(sass_file).read,
:filename => sass_file,
:line_comments => true,
:css_filename => css_filename,
:load_paths => ["#{example}/stylesheets"] + Compass::Frameworks::ALL.map{|f| f.stylesheets_directory})
target_dir = "built_examples/#{basename.sub(%r{/[^/]*$},'')}"
FileUtils.mkdir_p(target_dir)
output = open(css_filename,'w')
output.write(engine.render)
output.close
end
# copy any other non-haml and non-sass files directly over
target_dir = "built_examples/#{example.sub(%r{.*/},'')}"
other_files = FileList["#{example}/**/*"]
other_files.exclude "**/*.sass", "*.haml"
other_files.each do |file|

if File.directory?(file)
FileUtils.mkdir_p(file)
elsif File.file?(file)
target_file = "#{target_dir}/#{file[(example.size+1)..-1]}"
# puts "mkdir -p #{File.dirname(target_file)}"
FileUtils.mkdir_p(File.dirname(target_file))
# puts "cp #{file} #{target_file}"
FileUtils.cp(file, target_file)
end
end
end
end
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
8 changes: 8 additions & 0 deletions bin/compass
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
# The compass command line utility

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'compass'))
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'compass', 'exec'))

command = Compass::Exec::Compass.new(ARGV)
command.run!
73 changes: 73 additions & 0 deletions examples/blueprint_default/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Blueprint test pages</title>

<!-- Framework CSS -->
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="stylesheets/index.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="stylesheets/print.css" type="text/css" media="print">
<!--[if IE]><link rel="stylesheet" href="stylesheets/ie.css" type="text/css" media="screen, projection"><![endif]-->
</head>
<body>

<div class="container">
<h1>Blueprint test pages</h1>
<hr>

<p>Welcome to the Blueprint test pages. The HTML files below tests most HTML elements, and especially classes provided
by&nbsp;Blueprint.</p>

<table border="0" cellspacing="0" cellpadding="0">
<tr>
<th class="span-6">Test page</th>
<th class="span-8">Main files tested</th>
<th class="span-10">Description</th>
</tr>
<tr>
<td><a href="parts/grid.html">Grid</a></td>
<td>
<a href="../../src/modules/_grid.sass">grid.sass</a>
</td>
<td>Tests classes provided by the grid module.</td>
</tr>
<tr class="even">
<td><a href="parts/elements.html">Typography</a></td>
<td>
<a href="../../src/modules/_typography.sass">typography.sass</a>
</td>
<td>Tests HTML elements which gets set in the typography module.</td>
</tr>
<tr>
<td><a href="parts/forms.html">Forms</a></td>
<td>
<a href="../../src/modules/_form.sass">form.sass</a>
</td>
<td>Tests classes and default look provided by the form module.</td>
</tr>
</table>

<p><em><strong>Note about the css files:</strong></em>
These test files utilize the css files that are generated from
<a href="http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html">Sass templates</a>.
In other words, if you change any of the source files,
you'll have to re-build them with <code>rake examples</code> to see any&nbsp;changes.</p>

<div class="box">
<p>For more information and help, try these resources:</p>
<ul class="bottom">
<li><a href="http://code.google.com/p/blueprintcss">The Blueprint home page.</a></li>
<li><a href="http://groups.google.com/group/blueprintcss">Our anything-goes mailing list.</a></li>
<li><a href="http://bjorkoy.com">The blog where news about Blueprint gets posted.</a></li>
</ul>
</div>

<p><a href="http://validator.w3.org/check?uri=referer">
<img src="parts/valid.png" alt="Valid HTML 4.01 Strict" height="31" width="88" class="top"></a></p>

</div>
</body>
</html>
Loading

0 comments on commit 88ed459

Please sign in to comment.