Sha256: b51d05a6d8b5256c283684a106df68c3a70d5176a41ef84879b0d1c93e2db4da

Contents?: true

Size: 1.28 KB

Versions: 17

Compression:

Stored size: 1.28 KB

Contents

COMPASS_INIT = (<<-COMPASS).gsub(/^ {10}/, '') 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).gsub(/^ {10}/, '') 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

17 entries across 17 versions & 1 rubygems

Version Path
padrino-gen-0.10.1 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.10.0 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.29 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.28 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.27 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.26 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.24 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.25 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.23 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.22 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.21 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.20 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.19 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.18 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.17 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.16 lib/padrino-gen/generators/components/stylesheets/compass.rb
padrino-gen-0.9.15 lib/padrino-gen/generators/components/stylesheets/compass.rb