Sha256: bd40052059f89ef4629cc57d017748bd3854af06871804655bb404dd05b9a6ab

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

require 'chronic'

module Mission
  # ---------------------------------------------------------------------------
  get '/' do
    # reset app info
    session[:app_info] = @app_info = nil
  
    last_tick           = session[:last_tick]
    last_tick           ||= Chronic.parse( "#{@refresh_rate} seconds ago" )
    session[:last_tick] = Time.now
    
    @pulse = Wackamole::Mission.pulse( last_tick.utc )
              
    erb :'mission/index'
  end
  
  # ---------------------------------------------------------------------------
  get '/mission/refresh' do
    last_tick           = session[:last_tick]
    last_tick           ||= Chronic.parse( "#{@refresh_rate} seconds ago" )
    session[:last_tick] = Time.now
      
    @pulse = Wackamole::Mission.pulse( last_tick.utc )

    erb :'/mission/refresh_js', :layout => false
  end

  # # ---------------------------------------------------------------------------
  # get '/mission/fixed/:app/:env/:type' do
  #   Wackamole::Mission.reset!( params[:app], params[:env], params[:type] )
  #   erb :'/mission/refresh_js', :layout => false
  # end  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wackamole-0.0.6 lib/controllers/mission.rb
wackamole-0.0.5 lib/controllers/mission.rb