Sha256: b56a7f28aaf38b16af96847cac3614d7e3e2806d0a1901a760fff1f71828f113

Contents?: true

Size: 677 Bytes

Versions: 4

Compression:

Stored size: 677 Bytes

Contents

require 'rubygems'
require 'capcode'
require 'coderay'
require 'rack/codehighlighter'
$:.unshift( "../lib" )
require 'capcode/render/static'

module Capcode
  set :static, "static"
  set :verbose, true
  set :server, :thin

  use Rack::Codehighlighter, :coderay, :element => "pre", :pattern => /\A:::(\w+)\s*\n/, :logging => false
  
  class Index < Route '/'
    def get
      render :static => "index.html"
    end
  end  
  class Path < Route '/path'
    def get
      render :static => "index.html", :exact_path => false
    end
  end  
  class Style < Route '/style'
    def get
      render :static => "coderay.css", :exact_path => false
    end
  end
end

Capcode.run( )

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
capcode-render-static-0.4.0 examples/render-use.rb
capcode-render-static-0.3.0 examples/render-use.rb
capcode-render-static-0.2.0 examples/render-use.rb
capcode-render-static-0.1.0 examples/render-use.rb