Browse files

finally...

  • Loading branch information...
1 parent 34baaf1 commit c304c09034f22684f488182454f6b9e278ebfd06 @gildo gildo committed Mar 31, 2011
Showing with 9 additions and 12 deletions.
  1. +1 −1 config.ru
  2. +8 −11 lib/app.rb
View
2 config.ru
@@ -1,4 +1,4 @@
require 'sinatra'
require "./lib/app.rb"
-run Octodigest
+run Sinatra::Application
View
19 lib/app.rb
@@ -1,19 +1,17 @@
-require 'padrino-core/application/rendering'
+require 'sinatra'
require 'json'
+require 'erb'
-class Octodigest < Sinatra::Application
- register Padrino::Rendering
enable :static
views = './views'
- templates[:layout] = File.read(File.join(settings.views, 'layout.erb'))
helpers do
require './lib/helpers'
end
get "/" do
- render :index
+ erb :index
end
post "/" do
@@ -24,26 +22,25 @@ class Octodigest < Sinatra::Application
@data = ghet("http://github.com/api/v2/json/repos/show/#{h params[:user]}/#{h params[:repo]}/contributors")
if @data.has_key? "error"
@title = "Not Found..."
- render :nf
+ erb :nf
else
@title = "#{h params[:user]}/#{h params[:repo]}"
- render :repo
+ erb :repo
end
end
get "/:user/:repo/:tag" do
tagger
if @tcommits.include? "error"
@title = "Not found..."
- render :nf
+ erb :nf
else
@title = "#{h params[:user]}/#{h params[:repo]} #{h params[:tag]}"
- render :tag
+ erb :tag
end
end
not_found do
- render :nf
+ erb :nf
end
-end

0 comments on commit c304c09

Please sign in to comment.