Sha256: d09b5cd31aa68a3f75b496b7f9c07a0d737840c8e33cf0aff4c83241b99d143d

Contents?: true

Size: 616 Bytes

Versions: 15

Compression:

Stored size: 616 Bytes

Contents

require 'sinatra/base'

##
# Adds to Sinatra +controller+ informations
#
class Sinatra::Request
  attr_accessor :route_obj

  def controller
    route_obj && route_obj.controller
  end
  def action
    route_obj && route_obj.action
  end
end

##
# This patches Sinatra to accept UTF-8 urls on JRuby 1.7.6
#
if RUBY_ENGINE == 'jruby' && defined?(JRUBY_VERSION) && JRUBY_VERSION > '1.7.4'
  class Sinatra::Base
    class << self
      alias_method :old_generate_method, :generate_method
      def generate_method(method_name, &block)
        old_generate_method(method_name.to_sym, &block)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
padrino-core-0.12.9 lib/padrino-core/ext/sinatra.rb
padrino-core-0.12.8.1 lib/padrino-core/ext/sinatra.rb
padrino-core-0.12.8 lib/padrino-core/ext/sinatra.rb
padrino-core-0.12.7 lib/padrino-core/ext/sinatra.rb
padrino-core-0.12.6 lib/padrino-core/ext/sinatra.rb
padrino-core-0.13.1 lib/padrino-core/ext/sinatra.rb
padrino-core-0.13.1.beta1 lib/padrino-core/ext/sinatra.rb
padrino-core-0.13.0 lib/padrino-core/ext/sinatra.rb
padrino-core-0.13.0.beta3 lib/padrino-core/ext/sinatra.rb
tennpipes-base-3.6.6 lib/tennpipes-base/ext/sinatra.rb
padrino-core-0.13.0.beta2 lib/padrino-core/ext/sinatra.rb
padrino-core-0.12.5 lib/padrino-core/ext/sinatra.rb
padrino-core-0.13.0.beta1 lib/padrino-core/ext/sinatra.rb
padrino-core-0.12.4 lib/padrino-core/ext/sinatra.rb
padrino-core-0.12.3 lib/padrino-core/ext/sinatra.rb