public
Fork of schacon/ruby-git
Description: Ruby/Git is a Ruby library that can be used to create, read and manipulate Git repositories.
Homepage: http://jointheconversation.org/rubygit/
Clone URL: git://github.com/halorgium/ruby-git.git
applied helper patch kindly submitted by skaar <skaar@waste.org>
schacon (author)
Thu Nov 29 10:29:53 -0800 2007
commit  c6db2b7c34eb98a38047fca8fbef4a39279eaf08
tree    8c66e5742a21fcfbf2d94b196e7080e4753f45bc
parent  e3d0951881c5829b525c6e846e356e23a2e084fa
...
40
41
42
 
 
 
 
 
 
 
 
 
43
44
45
46
47
48
49
 
50
51
52
53
54
55
56
 
57
58
59
...
419
420
421
 
 
422
423
424
...
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 
 
57
58
59
60
61
62
63
 
64
65
66
67
...
427
428
429
430
431
432
433
434
0
@@ -40,20 +40,28 @@ module GitWeb::Models
0
   end
0
 end
0
 
0
+module GitWeb::Helpers
0
+ def inline_data(identifier)
0
+ section = "__#{identifier.to_s.upcase}__"
0
+ @@inline_data ||= File.read(__FILE__).gsub(/.*__END__/m, '')
0
+ data = @@inline_data.match(/(#{section}.)(.*?)((__)|(\Z))/m)
0
+ data ? data[2] : nil # return nil if no second found
0
+ end
0
+end
0
+
0
 module GitWeb::Controllers
0
 
0
   class Stylesheet < R '/css/highlight.css'
0
     def get
0
       @headers['Content-Type'] = 'text/css'
0
- ending = File.read(__FILE__).gsub(/.*__END__/m, '')
0
- ending.gsub(/__JS__.*/m, '')
0
+ inline_data(:css)
0
     end
0
   end
0
   
0
   class JsHighlight < R '/js/highlight.js'
0
     def get
0
       @headers['Content-Type'] = 'text/css'
0
- File.read(__FILE__).gsub(/.*__JS__/m, '')
0
+ inline_data(:js)
0
     end
0
   end
0
   
0
@@ -419,6 +427,8 @@ end
0
 
0
 # everything below this line is the css and javascript for syntax-highlighting
0
 __END__
0
+
0
+__CSS__
0
 pre.sh_sourceCode {
0
   background-color: white;
0
   color: black;

Comments

    No one has commented yet.