Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
garethrees committed May 23, 2012
1 parent 840ec64 commit 5ace961
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source "http://rubygems.org"
gem "sinatra"
gem "pony"
gem "xml-sitemap"
gem "grit"

group :development do
gem 'sass'
Expand Down
46 changes: 46 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
GEM
remote: http://rubygems.org/
specs:
builder (3.0.0)
diff-lcs (1.1.3)
grit (2.5.0)
diff-lcs (~> 1.1)
mime-types (~> 1.15)
posix-spawn (~> 0.3.6)
i18n (0.6.0)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.18)
polyglot (0.3.3)
pony (1.4)
mail (> 2.0)
posix-spawn (0.3.6)
rack (1.4.1)
rack-protection (1.2.0)
rack
sass (3.1.18)
shotgun (0.9)
rack (>= 1.0)
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
xml-sitemap (1.2.2)
builder (>= 2.0)

PLATFORMS
ruby

DEPENDENCIES
grit
pony
sass
shotgun
sinatra
xml-sitemap
10 changes: 10 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require 'sinatra/base'
require 'grit'
require 'fileutils'

class App < Sinatra::Base
set :root, File.dirname(__FILE__)
Expand All @@ -9,6 +11,14 @@ class App < Sinatra::Base
erb :index
end

get "/repo" do
repo = Grit::Git.new('/tmp/repo')
@process = repo.clone({:process_info => true, :progress => true, :timeout => false}, "#{params[:repo_url]}", "tmp/test")
@todos = %x{grep -RIn TODO #{File.dirname(__FILE__)}/tmp/test}
FileUtils.rm_rf("#{File.dirname(__FILE__)}/tmp/test")
erb :index
end

# HELPERS #

helpers do
Expand Down
File renamed without changes.
20 changes: 20 additions & 0 deletions views/index.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<h1>TODO</h1>

<form action="repo" method="get" accept-charset="utf-8">

<label for="repo_url">Repo</label><input type="text" name="repo_url" value="" id="repo_url" />


<p><input type="submit" value="Continue &rarr;"></p>
</form>

<section id="repo">
<%= params[:repo_url] %>
<%# @process.inspect.to_s if @process %>
</section>

<hr />

<section id="todos">
<%= @todos if @todos %>
</section>

0 comments on commit 5ace961

Please sign in to comment.