Commits on Feb 17, 2009
  1. Fix routes don't match with certain forms of URL encoding [#147]

    We no longer store routes in URL encoded form and unescape the
    PATH_INFO before attempting to match routes. This allows matching
    all variations of encoded characters but does not allow matching
    encoded "/" characters in the PATH_INFO.
    See also:
    rtomayko committed Feb 17, 2009
  2. Pin to Rack < 1.0

    There's a variety of things we'll need to change for Rack 1.0,
    including using the new built-in nested params.
    rtomayko committed Feb 17, 2009
  3. Add full test coverage for all options

    Test for host option
    Test for port option
    Test for server option
    Test for app_file option
    Test for the root option
    Test for the views option
    Test for the public option
    Test for reload option
    Test for lock option
    Tests for dump_errors, sessions, logging, and static options
    DRY-up options test setup
    Clean up tests for clean_trace options
    Test for run option
    Run options tests with default options
    Enable raise_errors options in test environment
    sr committed with rtomayko Feb 14, 2009
Commits on Feb 16, 2009
Commits on Feb 11, 2009
  1. Quick clean-up of my part

    bmizerany committed Feb 11, 2009
  2. set :app_file when using builder sugar

    S. Brent Faulkner committed Feb 11, 2009
Commits on Feb 10, 2009
  1. Sugar to include a classic style app in a rackup.

    This will eval the source into a Sinatra::Default class giving you
    the ablility to seperate the apps into files and run them with ruby
    when needed.
    @@ foo.rb
    get '/' do
    require 'sinatra/base'
    map '/foo' do
       run Sinatra("foo.rb")
    bmizerany committed Feb 7, 2009
Commits on Feb 7, 2009
  1. Fix helpers blocks failing when aliasing Base methods

    The following would fail with a "undefined method `escape_html'"
    exception because the block was being evaluated within a new module
    and then included in Base. i.e., the following no longer worked:
        helpers { alias_method :h, :escape_html }
    This was introduced just recently as part of the extensions work
    foca did.
    rtomayko committed Feb 7, 2009
Commits on Feb 5, 2009
  1. Tidy up for RDoc a bit

    rtomayko committed Feb 5, 2009
Commits on Feb 4, 2009
  1. Require 'thread' since we use Mutex

    The thread lib is pulled in by Rack so this isn't strictly
    necessary at the moment. It is good form, however.
    rtomayko committed Feb 4, 2009
  2. Calculate Content-Length using #bytesize instead of #length

    String#length returns the number of characters in Ruby 1.9. We want
    the number of bytes. I implemented this by aliasing String#bytesize
    to String#length when #bytesize is not defined. This seems like a
    harmless core extension since #bytesize didn't exist prior to 1.8.7.
    rtomayko committed Feb 4, 2009
Commits on Feb 3, 2009
  1. Fix block param arity handling under 1.9

    This modifies the way block params are handled so that block params
    have 1.8 semantics under 1.8 and 1.9 semantics under 1.9.
    * Spec Ruby 1.9 such that mismatched arity raises an ArgumentError.
    * Spec Ruby 1.8 such that mismatched arity does not raise an
    * Do not attempt to pass block params to handlers defined with 0
      arity. This avoids the ArgumentError for 0 arity blocks on 1.9
      with the common case route that defines no block params but does
      include parameter captures/splats.
    Coding for Ruby 1.9 results in code that is compatible with both
    rtomayko committed Feb 2, 2009
  2. Don't assume method lists are Strings in 1.9

    Object.private_instance_methods and Object.private_methods
    return Arrays of Symbols in 1.9.
    rtomayko committed Jan 31, 2009
  3. Fix use_in_file_templates caller detection under 1.9

    Ruby 1.9 now sometimes includes in parens after the method
    name in backtraces. This was causing the delegate ignore pattern
    to trigger.
    rtomayko committed Jan 31, 2009
  4. Fix constant resolution in specs under 1.9

    The way constants are set/resolved in class_eval blocks seems
    to have changed significantly. Move constants to top-level to
    remedy the situation for now.
    rtomayko committed Jan 31, 2009
  5. Make the specs run under new miniunit stuff in Ruby 1.9

    * Rename Sinatra::Test#test_request to make_request. miniunit
      runs test_XXX methods included from modules.
    * Make describe/it work with miniunit -- all kinds of weirdness
    rtomayko committed Jan 31, 2009
  6. Don't run compat specs with default rake task

    They don't run under 1.9 and bring in mocha and test-spec as
    dependencies. We should be fine with running these before releases
    at this point.
    rtomayko committed Feb 1, 2009
Commits on Jan 31, 2009
Commits on Jan 30, 2009
  1. Added Sinatra.register and Sinatra.helpers

    * This will extend the DSL in Sinatra::Default (and subclasses) with
      the modules passed.
    * All public methods in the extensions are added to Sinatra::Delegator
      when extending Sinatra::Default or it's subclasses.
    * Sinatra::Base.register is available to add extensions to arbitrary
      classes (but they don't add methods to Delegator).
    * You can pass a block with extensions which will get added as an
      anonymous block (same semantics of Sinatra::Base.helpers)
    * Will forward the modules passed to Default.helpers.
    * Small change in semantics: passing a block to helpers will no longer
      class_eval the block, but will instead turn it into an anonymous
      module. This pushes it into the inheritance chain "normally" and
      allows us to call super to reach the original method if redefined.
    foca committed with bmizerany Jan 28, 2009
  2. Sugar added: redirect back

    bmizerany committed Jan 30, 2009
  3. Being align anal

    bmizerany committed Jan 30, 2009
Commits on Jan 29, 2009
  1. Opps. Wrong repo. Reverting.

    bmizerany committed Jan 29, 2009