Added an example for the ninesixty plugin using local extensions.
This commit is contained in:
parent
44e810e840
commit
9105d5a8de
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@ tmp/*
|
||||
examples/*/stylesheets/*
|
||||
examples/*/*.html
|
||||
examples/*/*/*.html
|
||||
examples/*/extensions/*
|
||||
examples/*/src/.sass-cache
|
||||
test/tmp
|
||||
test/fixtures/stylesheets/*/tmp
|
||||
|
3
Rakefile
3
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]
|
||||
|
39
examples/ninesixty/bootstrap.rb
Normal file
39
examples/ninesixty/bootstrap.rb
Normal file
@ -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
|
9
examples/ninesixty/config.rb
Normal file
9
examples/ninesixty/config.rb
Normal 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
|
16
examples/ninesixty/src/grid.sass
Normal file
16
examples/ninesixty/src/grid.sass
Normal 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)
|
10
examples/ninesixty/src/text.sass
Normal file
10
examples/ninesixty/src/text.sass
Normal 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
|
Loading…
Reference in New Issue
Block a user