git_handsome 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,20 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ git_handsome (0.0.1)
5
+ erubis
6
+ launchy
7
+ sinatra
8
+
1
9
  GEM
2
10
  remote: http://rubygems.org/
3
11
  specs:
12
+ addressable (2.2.6)
13
+ erubis (2.7.0)
14
+ launchy (2.0.5)
15
+ addressable (~> 2.2.6)
4
16
  rack (1.3.2)
17
+ rake (0.8.7)
5
18
  shotgun (0.9)
6
19
  rack (>= 1.0)
7
20
  sinatra (1.2.6)
@@ -13,5 +26,6 @@ PLATFORMS
13
26
  ruby
14
27
 
15
28
  DEPENDENCIES
29
+ git_handsome!
30
+ rake
16
31
  shotgun
17
- sinatra
data/README.markdown ADDED
@@ -0,0 +1,27 @@
1
+ Git Handsome
2
+ ============
3
+
4
+ The `git handsome` command gives you pretty graphs over your git project in a
5
+ browser near you.
6
+
7
+ **This is super alpha!**
8
+
9
+ Installation
10
+ ------------
11
+
12
+ gem install git_handsome
13
+
14
+ Usage
15
+ -----
16
+
17
+ cd ~/your/git/repository/
18
+ git handsome
19
+
20
+ This opens your browser on [http://localhost:9393](http://localhost:9393) for
21
+ some graph goodies.
22
+
23
+ Known issues
24
+ ------------
25
+
26
+ If your computer is super fast the browser may open before the server has a
27
+ chance to start. Just hit the refresh button and you will be on your way.
data/git_handsome.gemspec CHANGED
@@ -15,6 +15,10 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.add_dependency 'sinatra'
17
17
  s.add_dependency 'launchy'
18
+ s.add_dependency 'erubis'
19
+
20
+ s.add_development_dependency 'rake'
21
+ s.add_development_dependency 'shotgun'
18
22
 
19
23
  s.files = `git ls-files`.split("\n")
20
24
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -1,4 +1,8 @@
1
+ require 'date'
1
2
  require 'git_handsome'
3
+ require 'erubis'
4
+
5
+ set :erubis, :escape_html => true
2
6
 
3
7
  get '/' do
4
8
  commits = GitHandsome::log
@@ -19,5 +23,7 @@ get '/' do
19
23
  [author, commits.count]
20
24
  end.reverse.to_s
21
25
 
22
- erb :index
26
+ @repository_name = Dir.pwd.split('/').last
27
+
28
+ erubis :index
23
29
  end
@@ -1,3 +1,3 @@
1
1
  module GitHandsome
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/views/index.erb CHANGED
@@ -1,22 +1,24 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
4
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
5
5
  <link rel="stylesheet" type="text/css" href="/css/jquery.jqplot.min.css" />
6
6
 
7
- <title>Git Handsome</title>
7
+ <title><%= @repository_name %> - Git Handsome</title>
8
8
  </head>
9
9
  <body id="index" onload="">
10
10
  <div id="chart1" style="margin-bottom: 50px;"></div>
11
11
  <div id="chart2" style="float:right; width:600px;"></div>
12
12
 
13
- <h1>History</h1>
14
- <% @commits_by_day.each do |day, commits| %>
15
- <h2><%= day %></h2>
16
- <% commits.each do |commit| %>
17
- <li><%= commit['date'] %>: <%= commit['subject'] %></li>
13
+ <h1><%= @repository_name %></h1>
14
+ <ul>
15
+ <% @commits_by_day.each do |day, commits| %>
16
+ <h2><%= day %></h2>
17
+ <% commits.each do |commit| %>
18
+ <li><%= commit['date'] %>: <%= commit['subject'] %></li>
19
+ <% end %>
18
20
  <% end %>
19
- <% end %>
21
+ </ul>
20
22
 
21
23
  <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="/js/excanvas.min.js"></script><![endif]-->
22
24
  <script language="javascript" type="text/javascript" src="/js/jquery.min.js"></script>
@@ -30,7 +32,7 @@
30
32
 
31
33
  <script type="text/javascript">
32
34
  $(document).ready(function(){
33
- var line1=<%= @commits_per_day %>;
35
+ var line1=<%== @commits_per_day %>;
34
36
  var plot1 = $.jqplot('chart1', [line1], {
35
37
  title: 'Commits per day',
36
38
  series:[{renderer:$.jqplot.BarRenderer}],
@@ -48,7 +50,7 @@
48
50
  }
49
51
  });
50
52
 
51
- var data = <%= @commits_by_author %>;
53
+ var data = <%== @commits_by_author %>;
52
54
  var plot2 = jQuery.jqplot ('chart2', [data],
53
55
  {
54
56
  title: 'Commits by author',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_handsome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-06 00:00:00.000000000 Z
12
+ date: 2011-08-06 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &70102276566900 !ruby/object:Gem::Requirement
16
+ requirement: &70279906658940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70102276566900
24
+ version_requirements: *70279906658940
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: launchy
27
- requirement: &70102276566380 !ruby/object:Gem::Requirement
27
+ requirement: &70279906658520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,40 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70102276566380
35
+ version_requirements: *70279906658520
36
+ - !ruby/object:Gem::Dependency
37
+ name: erubis
38
+ requirement: &70279906658100 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70279906658100
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: &70279906657680 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *70279906657680
58
+ - !ruby/object:Gem::Dependency
59
+ name: shotgun
60
+ requirement: &70279906657260 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *70279906657260
36
69
  description: Pretty graphs for git repositories.
37
70
  email:
38
71
  - sven.dahlstrand@gmail.com
@@ -44,6 +77,7 @@ files:
44
77
  - .gitignore
45
78
  - Gemfile
46
79
  - Gemfile.lock
80
+ - README.markdown
47
81
  - Rakefile
48
82
  - bin/git-handsome
49
83
  - config.ru