Sha256: 15e23b189c446a4302d2735582cb64421a95b1bce7d542ee1d135a84aae23b4a

Contents?: true

Size: 1.18 KB

Versions: 3

Compression:

Stored size: 1.18 KB

Contents

module Padrino
  module Generators
    module Components
      module Renderers

        module HamlGen

          SASS_INIT = (<<-SASS).gsub(/^ {10}/, '')
          # Enables support for SASS template reloading for rack.
          # Store SASS files by default within 'public/stylesheets/sass'
          # See http://nex-3.com/posts/88-sass-supports-rack for more details.

          module SassInitializer
            def self.registered(app)
              require 'sass/plugin/rack'
              Sass::Plugin.options[:template_location] = File.join(Padrino.root, "app/stylesheets")
              Sass::Plugin.options[:css_location] = File.join(Padrino.root, "public/stylesheets")
              app.use Sass::Plugin::Rack
            end
          end
          SASS

          SASS_REGISTER = (<<-SASSR).gsub(/^ {10}/, '')
              register SassInitializer # Remove if not using SASS\n
          SASSR

          def setup_renderer
            require_dependencies 'haml'
            create_file destination_root('/lib/sass.rb'), SASS_INIT
            inject_into_file destination_root('/app/app.rb'), SASS_REGISTER, :after => "configure do\n"
          end
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
padrino-gen-0.9.4 lib/padrino-gen/generators/components/renderers/haml_gen.rb
padrino-gen-0.9.3 lib/padrino-gen/generators/components/renderers/haml_gen.rb
padrino-gen-0.9.2 lib/padrino-gen/generators/components/renderers/haml_gen.rb