Sha256: d32380d168f864e2db0eb2555664822a2412ea2b36c0f0ed4165543a2de76eca

Contents?: true

Size: 1.24 KB

Versions: 5

Compression:

Stored size: 1.24 KB

Contents

COMPASS_INIT = <<-COMPASS unless defined?(COMPASS_INIT)
# Enables support for Compass, a stylesheet authoring framework based on SASS.
# See http://compass-style.org/ for more details.
# Store Compass/SASS files (by default) within 'app/stylesheets'

module CompassInitializer
  def self.registered(app)
    require 'sass/plugin/rack'

    Compass.configuration do |config|
      config.project_path = Padrino.root
      config.sass_dir = "app/stylesheets"
      config.project_type = :stand_alone
      config.http_path = "/"
      config.css_dir = "public/stylesheets"
      config.images_dir = "public/images"
      config.javascripts_dir = "public/javascripts"
      config.output_style = :compressed
    end

    Compass.configure_sass_plugin!
    Compass.handle_configuration_change!

    app.use Sass::Plugin::Rack
  end
end
COMPASS

COMPASS_REGISTER = <<-COMPASSR unless defined?(COMPASS_REGISTER)
  register CompassInitializer\n
COMPASSR

def setup_stylesheet
  require_dependencies 'compass'
  create_file destination_root('/lib/compass_plugin.rb'), COMPASS_INIT
  inject_into_file destination_root('/app/app.rb'), COMPASS_REGISTER, :after => "register Padrino::Helpers\n"

  directory "components/stylesheets/compass/", destination_root('/app/stylesheets')
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
padrino-gen-0.10.7 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.10.6 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.10.6.e lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.10.6.d lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.10.6.c lib/padrino-gen/generators/components/stylesheets/compass.rb