sinatrarb.com Archives - 02 March 2013, Saturday

  • Testing Sinatra with Rack::Test

    sinatrarb.com 09 Sep '12, 12pm

    require 'hello_world' require 'test/unit' require 'rack/test' set :environment, :test class HelloWorldTest < Test::Unit::TestCase def test_it_says_hello_world browser = Rack::Test::Session.new(Rack::MockSession.new(Sinatra::Application)) browser.get '/' assert browser.last_response.ok...

  • README

    sinatrarb.com 18 Jul '12, 1am

    # app running on http://example.com/example get '/foo' do t = %w[text/css text/html application/javascript] request.accept # ['text/html', '*/*'] request.accept? 'text/xml' # true request.preferred_type(t) # 'text/html' request.body # request body sent by the client (see below) reques...

  • README

    sinatrarb.com 06 Jul '12, 9pm

    # app running on http://example.com/example get '/foo' do t = %w[text/css text/html application/javascript] request.accept # ['text/html', '*/*'] request.accept? 'text/xml' # true request.preferred_type(t) # 'text/html' request.body # request body sent by the client (see below) reques...

  • README (Japanese)

    sinatrarb.com 20 Jun '12, 3pm

    # アプリケーションが http://example.com/example で動作している場合 get '/foo' do request.body # クライアントによって送信されたリクエストボディ(下記参照) request.scheme # "http" request.script_name # "/example" request.path_info # "/foo" request.port # 80 request.request_method # "GET" request.query_string # "" request.content_le...

  • Writing Extensions

    sinatrarb.com 07 Jun '12, 12pm

    The “Classic” style, where applications are defined on main / the top-level – most of the examples and documentation target this usage. Classic applications are often single-file, standalone apps that are run directly from the command line or with a minimal rackup file. When an extens...

  • Sinatra

    sinatrarb.com 29 May '12, 6pm

    README Documentation Contribute Code Crew About Sinatra require 'sinatra' get '/hi' do "Hello World!" end Put this in your pipe $ gem install sinatra $ ruby -rubygems hi.rb == Sinatra has taken the stage ... >> Listening on 0.0.0.0:4567 and smoke it

  • Frequently Asked Questions

    sinatrarb.com 27 May '12, 8am

    What happened to reloading in Sinatra 0.9.2? What are my deployment options? How do I use sessions? How do I use session-based flash? Can I run Sinatra under Ruby 1.9? How do I get the “route” for the current page? How do I access helpers from within my views? How do I render partials...

    Related:
    1. Sinatra Book sinatra-book.gittr.com 26 May '12, 9am
  • README (Chinese)

    sinatrarb.com 25 May '12, 4am

    # 在 http://example.com/example 上运行的应用 get '/foo' do request.body # 被客户端设定的请求体(见下) request.scheme # "http" request.script_name # "/example" request.path_info # "/foo" request.port # 80 request.request_method # "GET" request.query_string # "" request.content_length # request.body的长度 req...

    Related:
    1. Sinatra Book sinatra-book.gittr.com 26 May '12, 9am
  • README

    sinatrarb.com 15 May '12, 8pm

    # app running on http://example.com/example get '/foo' do t = %w[text/css text/html application/javascript] request.accept # ['text/html', '*/*'] request.accept? 'text/xml' # true request.preferred_type(t) # 'text/html' request.body # request body sent by the client (see below) reques...

  • README

    sinatrarb.com 02 May '12, 2pm

    # app running on http://example.com/example get '/foo' do t = %w[text/css text/html application/javascript] request.accept # ['text/html', '*/*'] request.accept? 'text/xml' # true request.preferred_type(t) # 'text/html' request.body # request body sent by the client (see below) reques...

    Related:
    1. Documentation sinatrarb.com 02 May '12, 2pm
  • Documentation

    sinatrarb.com 02 May '12, 2pm

    A whirlwind tour of Sinatra’s most interesting features. Configuring Settings Detailed documentation on all of Sinatra’s built-in settings and using set , enable , and disable to configure them. Testing Sinatra with Rack::Test Guide to testing Sinatra apps. Sinatra::Contrib A collecti...

    Related:
    1. README sinatrarb.com 02 May '12, 2pm
  • README

    sinatrarb.com 27 Apr '12, 5am

    # app running on http://example.com/example get '/foo' do t = %w[text/css text/html application/javascript] request.accept # ['text/html', '*/*'] request.accept? 'text/xml' # true request.preferred_type(t) # 'text/html' request.body # request body sent by the client (see below) reques...

    Related:
    1. README (Japanese) sinatrarb.com 22 Apr '12, 2pm
  • README (Japanese)

    sinatrarb.com 22 Apr '12, 2pm

    # アプリケーションが http://example.com/example で動作している場合 get '/foo' do request.body # クライアントによって送信されたリクエストボディ(下記参照) request.scheme # "http" request.script_name # "/example" request.path_info # "/foo" request.port # 80 request.request_method # "GET" request.query_string # "" request.content_le...

    Related:
    1. README sinatrarb.com 27 Apr '12, 5am
  • README

    sinatrarb.com 08 Apr '12, 12am

    # app running on http://example.com/example get '/foo' do t = %w[text/css text/html application/javascript] request.accept # ['text/html', '*/*'] request.accept? 'text/xml' # true request.preferred_type(t) # 'text/html' request.body # request body sent by the client (see below) reques...

  • README (Korean)

    sinatrarb.com 02 Apr '12, 10am

    get '/foo' do t = %w[text/css text/html application/javascript] request.accept # ['text/html', '*/*'] request.accept? 'text/xml' # true request.preferred_type(t) # 'text/html' request.body # 클라이언트로부터 전송된 요청 본문 (아래 참조) request.scheme # "http" request.script_name # "/example" request.pa...

  • Sinatra: The Blog

    sinatrarb.com 11 Mar '12, 8am

    There are a lot of Sinatra extensions out there, and some of those are used by a large number of apps, like sinatra-content-for or sinatra-reloader. The maintainers of these extensions have to keep up with new Sinatra releases to make sure everything works fine. This poses an issue fr...

  • Sinatra: README (Russian)

    sinatrarb.com 20 Feb '12, 2pm

    # приложение запущено на http://example.com/example get '/foo' do t = %w[text/css text/html application/javascript] request.accept # ['text/html', '*/*'] request.accept? 'text/xml' # true request.preferred_type(t) # 'text/html' request.body # тело запроса, посланное клиентом (см. ниже...

  • Sinatra: README (Chinese)

    sinatrarb.com 19 Feb '12, 8am

    # 在 http://example.com/example 上运行的应用 get '/foo' do request.body # 被客户端设定的请求体(见下) request.scheme # "http" request.script_name # "/example" request.path_info # "/foo" request.port # 80 request.request_method # "GET" request.query_string # "" request.content_length # request.body的长度 req...

  • Sinatra in The Wild

    sinatrarb.com 17 Feb '12, 7pm

    Sinatra::SimpleNavigation Easy creation of navigations (with multiple levels) with sinatra and the simple-navigation gem sinatra_more Library with agnostic generators, form builders, named route mappings, easy mailer support, and more. Sinatra’s Hat Mount models as web services in Sin...