<commit_before>$stdout.sync = true
####################################################################################################
# @author       <NAME> 
# @description  Airfish iOS Testing App
#
# @date         19-04-2013
####################################################################################################
##### Require statements
require 'rubygems'
require 'sinatra/base'
require 'logger'
require 'date'

class Airfish < Sinatra::Base

  ##### Variables
  enable :static, :sessions, :logging
  set :environment, :production
  set :root, File.dirname(__FILE__)
  set :public_folder, Proc.new {File.join(root, '/public')}
  set :views, Proc.new {File.join(root, '/views')}
    
  # Create the logger instance
  set :log, Logger.new(STDOUT)
  set :level, Logger::DEBUG
  #set :level, Logger::INFO
  #set :level, Logger::WARN
  
  # Options hash
  set :options, {:log => settings.log, :level => settings.level}
  
  # Date
  today = DateTime.now
  theDate = today.year.to_s() + "-" + "%02d" % today.month.to_s() + "-" + "%02d" % today.day.to_s()
  set :date, theDate
  
  
  
#########################################################################################################  

  get '/' do
    erb :index
  end

  get '/leds.cgi' do
    val = params[:led]
    unless val.nil? then puts val; end
    "Success! #{val}"
  end

  get '/status.xml' do
   return "<response><pot0>15.5</pot0></response>" 
  end

end <commit_msg>- Updated REST API Mock to output to STDOUT which API call was made<commit_after>$stdout.sync = true
####################################################################################################
# @author       <NAME> 
# @description  Airfish iOS Testing App
#
# @date         19-04-2013
####################################################################################################
##### Require statements
require 'rubygems'
require 'sinatra/base'
require 'logger'
require 'date'

class Airfish < Sinatra::Base

  ##### Variables
  enable :static, :sessions, :logging
  set :environment, :production
  set :root, File.dirname(__FILE__)
  set :public_folder, Proc.new {File.join(root, '/public')}
  set :views, Proc.new {File.join(root, '/views')}
    
  # Create the logger instance
  set :log, Logger.new(STDOUT)
  set :level, Logger::DEBUG
  #set :level, Logger::INFO
  #set :level, Logger::WARN
  
  # Options hash
  set :options, {:log => settings.log, :level => settings.level}
  
  # Date
  today = DateTime.now
  theDate = today.year.to_s() + "-" + "%02d" % today.month.to_s() + "-" + "%02d" % today.day.to_s()
  set :date, theDate
  
  
  
#########################################################################################################  

  get '/' do
    erb :index
  end

  get '/leds.cgi' do
    val = params[:led]
    unless val.nil?
      if val.to_i == 0 then puts "Forward"; end
      if val.to_i == 1 then puts "Stop"; end
      if val.to_i == 3 then puts "Left"; end
      if val.to_i == 2 then puts "Right"; end
      if val.to_i == 4 then puts "Pitch Up"; end
      if val.to_i == 5 then puts "Pitch Down"; end
    end
    "Success! #{val}"
  end

  get '/status.xml' do
   return "<response><pot0>15.5</pot0></response>" 
  end

end 
{'fraction_non_alphanumeric': 0.3140291111799319, 'fraction_numerical': 0.012387736141220192, 'mean_word_length': 3.879154078549849, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1866984', 'n_tokens_mistral': 1024, 'n_tokens_neox': 951, 'n_words': 268}