Sha256: 995546f4839488fbbc850b0f5fd53a574e90a6d6aa409c6baf6d2450890844e0

Contents?: true

Size: 697 Bytes

Versions: 62

Compression:

Stored size: 697 Bytes

Contents

require 'rubygems'
require 'sinatra'
require File.join(File.dirname(__FILE__), '../../lib/jpmobile')
require 'jpmobile/rack'
require 'singleton'
require 'pp'

require 'jpmobile/sinatra'

class SinatraTestHelper
  include Singleton
  attr_accessor :last_app
end

class Guestbook < Jpmobile::Sinatra::Base
  use Jpmobile::Rack::MobileCarrier
  use Jpmobile::Rack::ParamsFilter
  use Jpmobile::Rack::Filter

  def call(env)
    _dup = dup
    ::SinatraTestHelper.instance.last_app = _dup
    _dup.call!(env)
  end

  def assigns(sym)
    instance_variable_get("@#{sym}")
  end

  get '/' do
    @g = params[:g]
  end

  post '/' do
    @p = params[:p]
  end

  get '/top' do
    erb :index
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
jpmobile-7.0.3 test/sinatra/guestbook.rb
jpmobile-7.0.2 test/sinatra/guestbook.rb
jpmobile-7.0.1 test/sinatra/guestbook.rb
jpmobile-7.0.0 test/sinatra/guestbook.rb
jpmobile-6.1.2 test/sinatra/guestbook.rb
jpmobile-6.1.1 test/sinatra/guestbook.rb
jpmobile-6.1.0 test/sinatra/guestbook.rb
jpmobile-6.0.0 test/sinatra/guestbook.rb
jpmobile-5.2.5 test/sinatra/guestbook.rb
jpmobile-6.0.0.beta test/sinatra/guestbook.rb
jpmobile-5.2.4 test/sinatra/guestbook.rb
jpmobile-4.2.5 test/sinatra/guestbook.rb
jpmobile-4.2.4 test/sinatra/guestbook.rb
jpmobile-5.0.1 test/sinatra/guestbook.rb
jpmobile-5.1.1 test/sinatra/guestbook.rb
jpmobile-5.2.3 test/sinatra/guestbook.rb
jpmobile-5.2.2 test/sinatra/guestbook.rb
jpmobile-5.2.1 test/sinatra/guestbook.rb
jpmobile-5.2.0 test/sinatra/guestbook.rb
jpmobile-5.1.0 test/sinatra/guestbook.rb