ghoul 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/ghoul.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.version = Ghoul::VERSION
8
8
  s.authors = ["George Drummond"]
9
9
  s.email = ["george@accountsapp.com"]
10
- s.homepage = ""
10
+ s.homepage = "http://georgedrummond.github.com/ghoul"
11
11
  s.summary = %q{Ghoul is a simple yet good looking interface for your git repositories written in sinatra. It is currently only for demonstration purposes and use on your secure local machine as it does not enforce any authentication as of yet.}
12
12
  s.description = %q{Ghoul is a simple yet good looking interface for your git repositories written in sinatra. It is currently only for demonstration purposes and use on your secure local machine as it does not enforce any authentication as of yet.}
13
13
 
data/lib/ghoul/app.rb CHANGED
@@ -12,7 +12,6 @@ module Ghoul
12
12
 
13
13
  before '/*' do
14
14
  if !repos_path_exists? && params[:splat][0] != "css/app.css"
15
- puts "splat=#{params[:splat]}"
16
15
  halt erb(:setup_repos_path)
17
16
  end
18
17
  end
@@ -61,9 +60,12 @@ module Ghoul
61
60
  erb :diff
62
61
  end
63
62
 
64
- get "/repository/:repository/commits/?" do
63
+ get "/repository/:repository/commits/*" do
64
+ @page = params[:splat][0].to_i
65
+ @offset = @page*10-10
65
66
  @repository = params[:repository]
66
- @commits = repository(@repository).commits
67
+ @commits = repository(@repository).commits('master', 10, @offset)
68
+ @max_commits = repository(@repository).commits('master', false, 0).count
67
69
  @commit = commit_from_repository @repository, "trunk"
68
70
  @newest_commit = commit_from_repository(@repository, "trunk")
69
71
  @hide_breadcrumbs = true
@@ -98,8 +100,9 @@ module Ghoul
98
100
  @splat = params[:splat]
99
101
  erb :tree
100
102
  else
101
- @blob = resource
102
- @syntaxer = CodeRay.scan(@blob.data, :plain).div(:line_numbers => :table)
103
+ @blob = resource
104
+ language = CodeRay::FileType[@blob.name]
105
+ @syntaxer = CodeRay.scan(@blob.data, language).div(:line_numbers => :table)
103
106
  erb :blob
104
107
  end
105
108
  end
@@ -28,8 +28,8 @@ module Ghoul
28
28
  return "http://#{@request.host_with_port}/repo/#{repository}"
29
29
  end
30
30
 
31
- def commits_path(repository)
32
- url "/repository/#{repository}/commits"
31
+ def commits_path(repository, page=1)
32
+ url "/repository/#{repository}/commits/#{page}"
33
33
  end
34
34
 
35
35
  def commit_path(repository, commit)
@@ -142,7 +142,6 @@ h1
142
142
  :border 1px solid #ccc
143
143
  :border-top none
144
144
  :text-indent 20px
145
- :background -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed))
146
145
  .name
147
146
  :float left
148
147
  :padding-left 10px
@@ -172,7 +171,6 @@ h1
172
171
  :width 758px
173
172
  :border 1px solid #ccc
174
173
  :border-bottom none
175
- :background -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed))
176
174
  a, .title
177
175
  :color #333
178
176
  :text-decoration none
@@ -213,6 +211,12 @@ h1
213
211
  #clippy
214
212
  :float left
215
213
  :margin-top 8px
214
+ p
215
+ :float left
216
+ :width 718px
217
+ :padding 20px
218
+ :background #fffccc
219
+ :border-top 1px solid #ccc
216
220
 
217
221
  #repositories
218
222
  :float left
@@ -228,7 +232,6 @@ h1
228
232
  :border-top none
229
233
  :float left
230
234
  :width 738px
231
- :background -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed))
232
235
  .data
233
236
  :float left
234
237
  :width 100%
@@ -305,6 +308,15 @@ form
305
308
  :border 1px solid #ccc
306
309
  a
307
310
  :margin-top 20px
311
+
312
+ .gradient
313
+ :background #ffffff
314
+ :background -moz-linear-gradient(top, white 0%, #e5e5e5 100%)
315
+ :background -webkit-gradient(linear, left top, left bottom, color-stop(0%, white), color-stop(100%, #e5e5e5))
316
+ :background -webkit-linear-gradient(top, white 0%, #e5e5e5 100%)
317
+ :background -o-linear-gradient(top, white 0%, #e5e5e5 100%)
318
+ :background -ms-linear-gradient(top, white 0%, #e5e5e5 100%)
319
+ :background linear-gradient(top, white 0%, #e5e5e5 100%)
308
320
 
309
321
  #big_link
310
322
  :float left
@@ -313,4 +325,12 @@ form
313
325
  :font-size 26px
314
326
 
315
327
  a
316
- :color dodgerblue
328
+ :color dodgerblue
329
+
330
+ #pagination
331
+ :float left
332
+ :width 100%
333
+ #next
334
+ :float right
335
+ #left
336
+ :float left
@@ -2,7 +2,7 @@
2
2
 
3
3
  <%=partial(:repo_header) %>
4
4
 
5
- <div class="section_bar">
5
+ <div class="section_bar gradient">
6
6
  <%=link_to "Raw", raw_blob_for_commit_path(@repository, params[:commit], params[:splat][0]) %>
7
7
  </div>
8
8
 
@@ -9,3 +9,12 @@
9
9
  </div>
10
10
  <% end %>
11
11
  </div>
12
+
13
+ <div id="pagination">
14
+ <% if @offset+10 < @max_commits %>
15
+ <a href="<%= commits_path(@repository, @page+1) %>" class="button" id="next">Next</a>
16
+ <% end %>
17
+ <% if @page > 1 %>
18
+ <a href="<%= commits_path(@repository, @page-1) %>" class="button" id="previous">Previous</a>
19
+ <% end %>
20
+ </div>
@@ -1,8 +1,12 @@
1
1
  <%= partial :repo_top_bar %>
2
2
 
3
+
3
4
  <div id="repo_info">
4
5
  <div id="git_url"><%= repository_git_url(@repository) %></div>
5
6
  <div id="clippy"><%= clippy(repository_git_url(@repository), '#f1f1f1') %></div>
7
+ <% unless repository(@repository).bare %>
8
+ <p>Push is not enabled for this repository, you will need to setup a <b>--bare</b> repository directly from ghoul for push to be enabled</p>
9
+ <% end %>
6
10
  </div>
7
11
 
8
12
  <div id="commits">
@@ -5,7 +5,7 @@
5
5
  <div id="repositories">
6
6
  <% @repositories.each do |repo| %>
7
7
  <% unless repo == "." || repo == ".." %>
8
- <div class="repository">
8
+ <div class="repository gradient">
9
9
  <div class="name"><%= link_to repo, repository_path(repo) %></div>
10
10
  <div class="data">
11
11
  <% begin %>
@@ -5,11 +5,11 @@
5
5
  <div id="tree">
6
6
  <% @resource.contents.sort { |a, b| [b.class.name, a.name.downcase] <=> [a.class.name, b.name.downcase] }.each do |f| %>
7
7
  <% if f.is_a?(Grit::Tree) %>
8
- <div class="tree">
8
+ <div class="tree gradient">
9
9
  <div class="name"><%= link_to "#{f.name}/", tree_for_commit_path(@repository, params[:commit], params[:splat][0], f.name) %></div>
10
10
  </div>
11
11
  <% else %>
12
- <div class="blob">
12
+ <div class="blob gradient">
13
13
  <div class="name"><%= link_to f.name, blob_for_commit_path(@repository, params[:commit], params[:splat][0], f.name) %></div>
14
14
  </div>
15
15
  <% end %>
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ghoul
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghoul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
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-10-28 00:00:00.000000000Z
12
+ date: 2011-10-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
- requirement: &70137089892740 !ruby/object:Gem::Requirement
16
+ requirement: &70095112075640 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70137089892740
24
+ version_requirements: *70095112075640
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sinatra
27
- requirement: &70137089892020 !ruby/object:Gem::Requirement
27
+ requirement: &70095112073780 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - =
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.3.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70137089892020
35
+ version_requirements: *70095112073780
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sass
38
- requirement: &70137089891480 !ruby/object:Gem::Requirement
38
+ requirement: &70095112071340 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70137089891480
46
+ version_requirements: *70095112071340
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: grit
49
- requirement: &70137089890640 !ruby/object:Gem::Requirement
49
+ requirement: &70095112069860 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70137089890640
57
+ version_requirements: *70095112069860
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: georgedrummond_sinatra_helpers
60
- requirement: &70137089890160 !ruby/object:Gem::Requirement
60
+ requirement: &70095112068800 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70137089890160
68
+ version_requirements: *70095112068800
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ghoul_grack
71
- requirement: &70137089889300 !ruby/object:Gem::Requirement
71
+ requirement: &70095112067580 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - =
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.0.1
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70137089889300
79
+ version_requirements: *70095112067580
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: coderay
82
- requirement: &70137089888400 !ruby/object:Gem::Requirement
82
+ requirement: &70095112066520 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70137089888400
90
+ version_requirements: *70095112066520
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: redcarpet
93
- requirement: &70137089886800 !ruby/object:Gem::Requirement
93
+ requirement: &70095112065640 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70137089886800
101
+ version_requirements: *70095112065640
102
102
  description: Ghoul is a simple yet good looking interface for your git repositories
103
103
  written in sinatra. It is currently only for demonstration purposes and use on your
104
104
  secure local machine as it does not enforce any authentication as of yet.
@@ -158,7 +158,7 @@ files:
158
158
  - spec/ghoul_helpers_spec.rb
159
159
  - spec/spec_helper.rb
160
160
  - spec/url_helper_spec.rb
161
- homepage: ''
161
+ homepage: http://georgedrummond.github.com/ghoul
162
162
  licenses: []
163
163
  post_install_message: ! " \n#################################################\n#\n#
164
164
  Thanks for installing Ghoul and giving it a go!\n#\n# This is a proof of concept