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-1.0.11 test/sinatra/guestbook.rb
jpmobile-2.0.10 test/sinatra/guestbook.rb
jpmobile-3.0.6 test/sinatra/guestbook.rb
jpmobile-1.0.10 test/sinatra/guestbook.rb
jpmobile-2.0.9 test/sinatra/guestbook.rb
jpmobile-3.0.5 test/sinatra/guestbook.rb
jpmobile-1.0.9 test/sinatra/guestbook.rb
jpmobile-2.0.8 test/sinatra/guestbook.rb
jpmobile-3.0.4 test/sinatra/guestbook.rb
jpmobile-3.0.3 test/sinatra/guestbook.rb
jpmobile-3.0.2 test/sinatra/guestbook.rb
jpmobile-3.0.1 test/sinatra/guestbook.rb
jpmobile-2.0.7 test/sinatra/guestbook.rb
jpmobile-2.0.6 test/sinatra/guestbook.rb
jpmobile-3.0.0 test/sinatra/guestbook.rb
jpmobile-2.0.5 test/sinatra/guestbook.rb
jpmobile-1.0.8 test/sinatra/guestbook.rb
jpmobile-2.0.4 test/sinatra/guestbook.rb
jpmobile-2.0.3 test/sinatra/guestbook.rb
jpmobile-1.0.7 test/sinatra/guestbook.rb