ghoul 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/ghoul.rb CHANGED
@@ -1,7 +1,5 @@
1
-
2
1
  $:.unshift File.dirname(__FILE__)
3
2
 
4
-
5
3
  require "sinatra"
6
4
  require "sass"
7
5
  require "georgedrummond_sinatra_helpers"
@@ -21,4 +19,3 @@ end
21
19
  require "version"
22
20
  require_all "ghoul/lib"
23
21
  require "ghoul/app"
24
-
data/lib/ghoul/app.rb CHANGED
@@ -98,6 +98,15 @@ module Ghoul
98
98
  if resource.is_a?(Grit::Tree) || params[:splat][0] == ""
99
99
  @resource = resource
100
100
  @splat = params[:splat]
101
+ if @resource.contents.detect {|r| r.name.downcase =~ /readme/}
102
+ @readme = @resource.contents.detect {|r| r.name.downcase =~ /readme/ }
103
+ file_extension = @readme.name.split('.').last
104
+ if file_extension == "md"
105
+ @readme_contents = Redcarpet.new(@readme.data).to_html
106
+ else
107
+ @readme_contents = CodeRay.scan(@readme.data, :text).div(:line_numbers => :table, :css => :class)
108
+ end
109
+ end
101
110
  erb :tree
102
111
  else
103
112
  @blob = resource
@@ -119,4 +128,4 @@ module Ghoul
119
128
  erb :no_commits
120
129
  end
121
130
  end
122
- end
131
+ end
@@ -170,7 +170,6 @@ h1
170
170
  :float left
171
171
  :width 758px
172
172
  :border 1px solid #ccc
173
- :border-bottom none
174
173
  a, .title
175
174
  :color #333
176
175
  :text-decoration none
@@ -256,15 +255,19 @@ h1
256
255
  #guide
257
256
  :float left
258
257
  :width 100%
258
+ :overflow auto
259
+ &.bordered
260
+ :border 1px solid #ccc
259
261
  code
260
262
  :float left
261
263
  :background #f6f9fe
262
264
  :padding 5px
263
265
  :border 1px solid #ccc
264
- :width 740px
266
+ :width 100%
267
+ :margin 0 -5px 0 -5px
265
268
  :margin 10px 0
266
269
  :border-radius 5px
267
- h2
270
+ h1, h2, h3
268
271
  :margin-top 40px
269
272
  :float left
270
273
  :width 100%
@@ -273,15 +276,15 @@ h1
273
276
  :margin-top 20px
274
277
  :width 100%
275
278
  :line-height 22px
276
- ul
279
+ ul, ol
277
280
  :float left
278
- :margin-left 40px
279
- :width 700px
280
- :margin-top 10px
281
+ :margin 10px -40px 10px 40px
282
+ :width 100%
283
+
281
284
  li
282
285
  :float left
283
286
  :width 100%
284
- :margin-top 10px
287
+ :margin 10px 0
285
288
 
286
289
  form
287
290
  :float left
@@ -333,4 +336,18 @@ a
333
336
  #next
334
337
  :float right
335
338
  #left
336
- :float left
339
+ :float left
340
+
341
+ #readme
342
+ :float left
343
+ :margin-top 30px
344
+ :width 758px
345
+ .bordered
346
+ :float left
347
+ :width 718px !important
348
+ :padding 20px
349
+ :border 1px solid #ccc
350
+ :border-top none
351
+ .CodeRay
352
+ :margin -20px
353
+
@@ -15,3 +15,14 @@
15
15
  <% end %>
16
16
  <% end %>
17
17
  </div>
18
+
19
+ <% if @readme %>
20
+ <div id="readme">
21
+ <div class="section_bar gradient">
22
+ <%=link_to @readme.name, "#" %>
23
+ </div>
24
+ <div id="guide" class="bordered">
25
+ <%=@readme_contents %>
26
+ </div>
27
+ </div>
28
+ <% end%>
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ghoul
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
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.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
- requirement: &70121004006740 !ruby/object:Gem::Requirement
16
+ requirement: &70361372280140 !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: *70121004006740
24
+ version_requirements: *70361372280140
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sinatra
27
- requirement: &70121004006200 !ruby/object:Gem::Requirement
27
+ requirement: &70361372279540 !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: *70121004006200
35
+ version_requirements: *70361372279540
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sass
38
- requirement: &70121004005680 !ruby/object:Gem::Requirement
38
+ requirement: &70361372279080 !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: *70121004005680
46
+ version_requirements: *70361372279080
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: grit
49
- requirement: &70121004004880 !ruby/object:Gem::Requirement
49
+ requirement: &70361372278460 !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: *70121004004880
57
+ version_requirements: *70361372278460
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: georgedrummond_sinatra_helpers
60
- requirement: &70121004004080 !ruby/object:Gem::Requirement
60
+ requirement: &70361372277880 !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: *70121004004080
68
+ version_requirements: *70361372277880
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ghoul_grack
71
- requirement: &70121004003180 !ruby/object:Gem::Requirement
71
+ requirement: &70361372276360 !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: *70121004003180
79
+ version_requirements: *70361372276360
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: coderay
82
- requirement: &70121004002660 !ruby/object:Gem::Requirement
82
+ requirement: &70361372275940 !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: *70121004002660
90
+ version_requirements: *70361372275940
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: redcarpet
93
- requirement: &70121004002040 !ruby/object:Gem::Requirement
93
+ requirement: &70361372268960 !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: *70121004002040
101
+ version_requirements: *70361372268960
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.