options
:column_width
– Width (in pixels) of current grid column
:gutter_width
– Width (in pixels) of current grid gutter
:height
– Height (in pixels) of a row
:filename
– Output path of grid.png file
# File lib/compass/grid_builder.rb, line 66 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
generates (overwriting if necessary) grid.png image to be tiled in background
# File lib/compass/grid_builder.rb, line 85 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
# File lib/compass/grid_builder.rb, line 80 def working_path options[:working_path] end