diff --git a/.gitignore b/.gitignore index 81e3a86b..b6cd7a3b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ tmp/* examples/*/stylesheets/* examples/*/*.html examples/*/*/*.html +examples/*/extensions/* examples/*/src/.sass-cache test/tmp test/fixtures/stylesheets/*/tmp diff --git a/Rakefile b/Rakefile index 4f080678..47d77d7d 100644 --- a/Rakefile +++ b/Rakefile @@ -58,6 +58,7 @@ begin 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("frameworks/**/*.*") gemspec.files += Dir.glob("lib/**/*") gemspec.files += Dir.glob("test/**/*.*") @@ -107,6 +108,8 @@ task :examples do next unless File.directory?(example) puts "\nCompiling #{example}" puts "=" * "Compiling #{example}".length + bootstrap_file = File.join(example, "bootstrap.rb") + load bootstrap_file if File.exists?(bootstrap_file) # compile any haml templates to html FileList["#{example}/**/*.haml"].each do |haml_file| basename = haml_file[0..-6] diff --git a/examples/ninesixty/bootstrap.rb b/examples/ninesixty/bootstrap.rb new file mode 100644 index 00000000..633640fe --- /dev/null +++ b/examples/ninesixty/bootstrap.rb @@ -0,0 +1,39 @@ +require 'net/http' +require 'fileutils' +require 'rubygems' +require 'zip/zip' + +extdir = File.join(File.dirname(__FILE__),'extensions') +download_link = "http://github.com/chriseppstein/compass-960-plugin/zipball/master" + +def fetch(uri_str, limit = 10) + raise ArgumentError, 'HTTP redirect too deep' if limit == 0 + + response = Net::HTTP.get_response(URI.parse(uri_str)) + case response + when Net::HTTPSuccess then response + when Net::HTTPRedirection then fetch(response['location'], limit - 1) + else + response.error! + end +end + + +if !File.exists?(extdir) + puts "Downloading and unpacking the ninesixty plugin." + FileUtils.mkdir(extdir) + zipfile = File.join(extdir, "ninesixty.zip") + open(zipfile, "wb") do |tgz| + tgz << fetch(download_link).body + end + 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,'chriseppstein-compass-960-plugin-*'))[0] + FileUtils.mv(funky_directory, File.join(extdir,'ninesixty')) +end diff --git a/examples/ninesixty/config.rb b/examples/ninesixty/config.rb new file mode 100644 index 00000000..9f6e6154 --- /dev/null +++ b/examples/ninesixty/config.rb @@ -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 diff --git a/examples/ninesixty/src/grid.sass b/examples/ninesixty/src/grid.sass new file mode 100644 index 00000000..4198d85b --- /dev/null +++ b/examples/ninesixty/src/grid.sass @@ -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) diff --git a/examples/ninesixty/src/text.sass b/examples/ninesixty/src/text.sass new file mode 100644 index 00000000..0b69854a --- /dev/null +++ b/examples/ninesixty/src/text.sass @@ -0,0 +1,10 @@ +/* + 960 Grid System ~ Text CSS. + Learn more ~ http://960.gs/ + + Licensed under GPL and MIT. + + +@import 960/text.sass + ++text