Permalink
Commits on Feb 7, 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.
    
    Example:
    
    @@ foo.rb
    
    get '/' do
      'sugar!'
    end
    
    @@ config.ru
    
    require 'sinatra/base'
    
    map '/foo' do
       run Sinatra("foo.rb")
    end
    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
      ArgumentError.
    
    * 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
    versions.
    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
      here
    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

    Sinatra.register:
    
    * 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)
    
    Sinatra.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 Jan 28, 2009
  2. Sugar added: redirect back

    committed Jan 30, 2009
  3. Being align anal

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

    committed Jan 29, 2009
  2. Fix :provides crashes with no Accept header [#139]

    An exception was raised on every request that did not have an
    Accept header due to the Accept parsing code calling split on
    nil.
    
    The Sinatra::Request#accept method now returns an empty collection
    if the HTTP Accept header is not present.
    Devlin Daley committed with rtomayko Jan 28, 2009
Commits on Jan 28, 2009
Commits on Jan 26, 2009
  1. Add #helpers into Sinatra::Base [#134 state:resolved]

    Signed-off-by: Ryan Tomayko <rtomayko@gmail.com>
    foca committed with rtomayko Jan 26, 2009
  2. Fix failing compat test due to Delegator changes

    Also, run compat tests with the default rake task.
    rtomayko committed Jan 26, 2009