Created
November 12, 2015 12:38
-
-
Save fitomad/1ed00a7836194a6816f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Servicio que da nombre a un proyecto de Xcode | |
# dependiendo de su tipo. | |
# | |
require 'sinatra' | |
require_relative 'Oraculo' | |
# | |
# Antes de procesar cualquier ruta... | |
# | |
before do | |
content_type :html | |
@types = [ "iOS", "OSX", "WatchOS", "tvOS" ] | |
end | |
# Aqui procesamos el nombrado de proyectos | |
get '/projectname/:type' do | |
# Comprobamos que el tipo de proyecto que nos piden | |
# esta entre los que controlamos | |
if [email protected]?(params['type']) | |
halt 403, "Solo proyectos para Xcode, gracias" | |
end | |
oraculo = Oraculo.new(params['type']) | |
"Su proyecto, gracias:<br />" + oraculo.name + "." + oraculo.domain | |
end | |
# El *acerca de* de toda la vida | |
get '/about' do | |
"Esto es todo <strong>amigos</strong>" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment