sinatrarb.com Archives - 19 May 2013, Sunday

  • Sinatra::Namespace (part of Sinatra::Contrib)

    sinatrarb.com 12 May '13, 4pm

    This extension is part of the Sinatra::Contrib project. Run gem install sinatra-contrib to have it available. Sinatra::Namespace Sinatra::Namespace is an extension that adds namespaces to an application. This namespaces will allow you to share a path prefix for the routes within the n...

  • Sinatra::Reloader (part of Sinatra::Contrib)

    sinatrarb.com 25 Apr '13, 7am

    This extension is part of the Sinatra::Contrib project. Run gem install sinatra-contrib to have it available. Sinatra::Reloader Extension to reload modified files. Useful during development, since it will automatically require files defining routes, filters, error handlers and inline ...

  • Sinatra::JSON (part of Sinatra::Contrib)

    sinatrarb.com 25 Apr '13, 7am

    This extension is part of the Sinatra::Contrib project. Run gem install sinatra-contrib to have it available. Sinatra::JSON Sinatra::JSON adds a helper method, called json , for (obviously) json generation. Usage Classic Application In a classic application simply require the helper, ...

  • New feature release, Contrib and Recipes

    sinatrarb.com 22 Apr '13, 7pm

    New feature release, Contrib and Recipes By Konstantin Haase on Friday, September 30, 2011 We’re proud to announce two new releases today: 1.3.0 and 1.2.7. We’re also simultaneously releasing sinatra-contrib and would like to officially announce the recently launched Sinatra Recipes p...

  • README

    sinatrarb.com 18 Apr '13, 9am

    List of locals passed to the document. Handy with partials. Example: erb "<%= foo %>", :locals => {:foo => "bar"} default_encoding String encoding to use if uncertain. Defaults to settings.default_encoding . views Views folder to load templates from. Defaults to settings.views . layou...

  • Frequently Asked Questions

    sinatrarb.com 23 Mar '13, 10am

    To use ActiveRecord’s migrations with Sinatra (or other non-Rails project), add the following to your Rakefile: namespace :db do desc "Migrate the database" task(:migrate => :environment) do ActiveRecord::Base.logger = Logger.new(STDOUT) ActiveRecord::Migration.verbose = true ActiveRe...

  • 1.4.0, 1.3.6, 1.2.9 released!

    sinatrarb.com 16 Mar '13, 2am

    Sinatra 1.4.0, 1.3.6, 1.2.9 released! By Konstantin Haase on Friday, March 15, 2013 I’ve just released Sinatra 1.4.0, 1.3.6 and 1.2.9. Find out what’s new in 1.4 on my blog .

  • 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...