Sha256: eb80a70016ac246734fdc9620de217104b614736ccca9f2369458d6bd63eb86b

Contents?: true

Size: 251 Bytes

Versions: 4

Compression:

Stored size: 251 Bytes

Contents

description 'Text aspect'

Aspect.create(:text, :mime => 'text/plain; charset=utf-8') do
  def accepts?(page); page.mime.text?; end
  def call(context, page)
    context.header['Content-Length'] = page.content.bytesize.to_s
    page.content
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
olelo-0.9.3 plugins/aspects/text.rb
olelo-0.9.2 plugins/aspects/text.rb
olelo-0.9.1 plugins/aspects/text.rb
olelo-0.9.0 plugins/aspects/text.rb