Permalink
Browse files

upgrade compass 0.13.alpha.3

  • Loading branch information...
1 parent f1679d0 commit be0d9d4bcbe1e62a2537ecf9ad6773b1b3d0bcdf @tka tka committed Mar 30, 2013
Showing 1,031 changed files with 560 additions and 725 deletions.
@@ -1,22 +0,0 @@
-@import "shared";
-
-// Webkit, IE10 and future support for [CSS Regions](http://dev.w3.org/csswg/css3-regions/)
-//
-// $target is a value you use to link two regions of your css. Give the source of your content the flow-into property, and give your target container the flow-from property.
-//
-// For a visual explanation, see the diagrams at Chris Coyier's
-// [CSS-Tricks](http://css-tricks.com/content-folding/)
-
-@mixin flow-into($target) {
- $target: unquote($target);
- @include experimental(flow-into, $target,
- not -moz, -webkit, not -o, -ms, not -khtml, not official
- );
-}
-
-@mixin flow-from($target) {
- $target: unquote($target);
- @include experimental(flow-from, $target,
- not -moz, -webkit, not -o, -ms, not -khtml, not official
- );
-}
@@ -1,96 +0,0 @@
-require 'compass/commands/project_base'
-require 'compass/commands/update_project'
-require 'compass/grid_builder'
-
-module Compass
- 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.
-
- Unless you need to check layouts in legacy browsers, it's preferable
- to use the pure CSS3-based grid background mixin:
-
- http://compass-style.org/reference/compass/layout/grid_background/
-
-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
-
- 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)
- super
- assert_project_directory_exists!
- Compass.add_configuration(options, 'command_line')
- end
-
- def perform
- unless options[:grid_dimensions] =~ /^(\d+)\+(\d+)(?:x(\d+))?$/
- 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
- logger.yellow do
- $stderr.puts "Unless you need to check layouts in legacy browsers, it's preferable"
- $stderr.puts "to use the pure CSS3-based grid background mixin:"
- $stderr.puts
- $stderr.puts "http://compass-style.org/reference/compass/layout/grid_background/"
- 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")
- GridBuilder.new(options.merge(:column_width => column_width, :gutter_width => gutter_width, :height => height, :filename => filename, :working_path => self.working_path)).generate!
- end
- end
- end
-end
@@ -1,102 +0,0 @@
-require 'zlib'
-
-module Compass
-
- # A simple class to represent and create a PNG-File
- # No drawing features given
- # Just subclass and write [R,G,B]-Byte-Values into the <tt>@data</tt> matrix
- # Build for compactness, so not much error checking!
- #
- # Code based on seattlerb's png, see http://seattlerb.rubyforge.org/png/
- class PNG
- CRC_TABLE = (0..255).map do |n|
- (0...8).inject(n){|x,i| x = ((x & 1) == 1) ? 0xedb88320 ^ (x >> 1) : x >> 1}
- end
-
- class << self
- def crc(chunkdata='')
- chunkdata.unpack('C*').inject(0xffffffff){|crc, byte| CRC_TABLE[(crc ^ byte) & 0xff] ^ (crc >> 8) } ^ 0xffffffff
- end
-
- def chunk(type, data="")
- [data.size, type, data, crc(type + data)].pack("Na*a*N")
- end
- end
-
- # Initiates a new PNG-Object
- # * <tt>width</tt>: Width of the image in pixels
- # * <tt>height</tt>: Height of the image in pixels
- # * <tt>background</tt>: Background-color represented as [R,G,B]-Byte-Array
- def initialize(width, height, background = [255,255,255])
- @height = height
- @width = width
- @data = Array.new(@height) { |x| Array.new(@width, background) }
- end
-
- BITS = 8
- RGB = 2 # Color Types ( RGBA = 6)
- NONE = 0 # Filter
-
- # binary representation of the PNG, write to file with binary mode
- def to_blob
- blob = []
- blob << [137, 80, 78, 71, 13, 10, 26, 10].pack("C*")
- blob << PNG.chunk('IHDR', [@width, @height, BITS, RGB, NONE, NONE, NONE].pack("N2C5"))
- blob << PNG.chunk('IDAT', Zlib::Deflate.deflate(self.png_join))
- blob << PNG.chunk('IEND', '')
- blob.join
- end
-
- def png_join
- @data.map { |row| "\0" + row.map { |p| "%c%c%c" % p}.join }.join
- end
- end
-
- class GridBuilder < PNG
- include Actions
-
- attr_reader :column_width, :gutter_width, :filename, :able_to_generate, :options
-
- # ==== Options
- # * <tt>options</tt>
- # * <tt>:column_width</tt> -- Width (in pixels) of current grid column
- # * <tt>:gutter_width</tt> -- Width (in pixels) of current grid gutter
- # * <tt>:height</tt> -- Height (in pixels) of a row
- # * <tt>:filename</tt> -- Output path of grid.png file
- def initialize(options={})
- @column_width = options[:column_width] || 0
- gutter_width = options[:gutter_width] || 0
-
- height = options[:height] || 20
- width = @column_width + gutter_width
- width = 10 if width == 0
-
- @filename = options[:filename]
- @options = options
-
- super(width, height, [0xe9,0xe9,0xe9])
- end
-
- def working_path
- options[:working_path]
- end
-
- # generates (overwriting if necessary) grid.png image to be tiled in background
- def generate!
- (0...@height-1).each do |line|
- @data[line] = Array.new(@width){|x| x < @column_width ? [0xe8, 0xef, 0xfb] : [0xff,0xff,0xff] }
- end
-
- if File.exists?(filename)
- if options[:force]
- overwrite = true
- else
- msg = "#{filename} already exists. Overwrite with --force."
- raise Compass::FilesystemConflict.new(msg)
- end
- end
- directory File.dirname(filename)
- write_file(filename, self.to_blob, options, true)
- end
- end
-end
@@ -1,7 +0,0 @@
-.source {
- -webkit-flow-into: target;
- -ms-flow-into: target; }
-
-.new-container {
- -webkit-flow-from: target;
- -ms-flow-from: target; }
@@ -1,46 +0,0 @@
-require 'test_helper'
-require 'fileutils'
-
-class CompassPngTest < Test::Unit::TestCase
-
- def test_class_crc_table
- assert_equal 256, Compass::PNG::CRC_TABLE.length
- {0 => 0, 1 => 1996959894, 22 => 4107580753, 133 => 2647816111, 255 => 755167117}.each do |i, crc|
- assert_equal crc, Compass::PNG::CRC_TABLE[i]
- end
- end
-
- def test_class_crc
- assert_equal 2666930069, Compass::PNG.crc('foobar')
- assert_equal 2035837995, Compass::PNG.crc('A721dasdN')
- end
-
- def test_class_chunk
- chunk = Compass::PNG.chunk 'IHDR', [10, 10, 8, 6, 0, 0, 0 ].pack('N2C5')
-
- header_crc = "\2152\317\275"
- header_data = "\000\000\000\n\000\000\000\n\b\006\000\000\000"
- header_length = "\000\000\000\r"
-
- header_chunk = "#{header_length}IHDR#{header_data}#{header_crc}"
-
- assert_equal header_chunk, chunk
- end
-
- def test_class_chunk_empty
- chunk = Compass::PNG.chunk 'IHDR'
- expected = "#{0.chr * 4}IHDR#{[Compass::PNG.crc("IHDR")].pack 'N'}"
- assert_equal expected, chunk
- end
-
- def test_to_blob
- png = Compass::PNG.new(5,10, [255,255,255])
- blob = 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAKCAIAAADzWwNnAAAAD0lEQVR4nGP4jwoYBhkfALRylWv4Dj0LAAAAAElFTkSuQmCC'.unpack('m*').first
- assert_equal blob, png.to_blob
-
- png = Compass::PNG.new(10,5, [32,64,128])
- blob = 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAFCAIAAADzBuo/AAAAEUlEQVR4nGNQcGjAgxgGUBoALT4rwRTA0gkAAAAASUVORK5CYII='.unpack('m*').first
- assert_equal blob, png.to_blob
- end
-
-end
@@ -2,7 +2,7 @@
Build Status: [![Build Status](https://travis-ci.org/chriseppstein/compass.png)](https://travis-ci.org/chriseppstein/compass)
-Code Quality: [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/chriseppstein/compass)
+Code Quality: [![Code Climate](https://codeclimate.com/github/chriseppstein/compass.png)](https://codeclimate.com/github/chriseppstein/compass)
## Resources
@@ -21,12 +21,12 @@ require 'rake/testtask'
require 'fileutils'
begin
-require 'cucumber'
-require 'cucumber/rake/task'
+ require 'cucumber'
+ require 'cucumber/rake/task'
-Cucumber::Rake::Task.new(:features) do |t|
- t.cucumber_opts = "features --format progress"
-end
+ Cucumber::Rake::Task.new(:features) do |t|
+ #t.cucumber_opts = %w{--format progress}
+ end
rescue LoadError
$stderr.puts "cannot load cucumber"
end
@@ -39,10 +39,6 @@ Rake::TestTask.new :test do |t|
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
Rake::TestTask.new :units do |t|
t.libs << 'lib'
@@ -2,5 +2,5 @@
:major: 0
:minor: 13
:state: alpha
-:iteration: 2
+:iteration: 3
:name: Markab
Oops, something went wrong.

0 comments on commit be0d9d4

Please sign in to comment.