Class: Compass::Commands::GenerateGridBackground

Inherits:
ProjectBase show all
Includes:
Actions
Defined in:
lib/compass/commands/generate_grid_background.rb

Instance Attribute Summary

Attributes included from Actions

#logger

Attributes inherited from ProjectBase

#options, #project_name

Attributes inherited from Base

#options, #working_path

Instance Method Summary collapse

Methods included from Actions

#basename, #compile, #copy, #directory, #relativize, #remove, #separate, #strip_trailing_separator, #write_file

Methods inherited from ProjectBase

#execute

Methods inherited from Base

#execute

Constructor Details

#initialize(working_path, options) ⇒ GenerateGridBackground

Returns a new instance of GenerateGridBackground.



9
10
11
12
# File 'lib/compass/commands/generate_grid_background.rb', line 9

def initialize(working_path, options)
  super
  assert_project_directory_exists!
end

Instance Method Details

#performObject



14
15
16
17
18
19
20
21
# File 'lib/compass/commands/generate_grid_background.rb', line 14

def perform
  column_width, gutter_width = options[:grid_dimensions].split(/\+/).map{|d| d.to_i}
  unless GridBuilder.new(options.merge(:column_width => column_width, :gutter_width => gutter_width, :output_path => projectize(project_images_subdirectory), :working_path => self.working_path)).generate!
    puts "ERROR: Some library dependencies appear to be missing."
    puts "Have you installed rmagick? If not, please run:"
    puts "sudo gem install rmagick"
  end
end