public
Description: A quick & dirty git-powered Sinatra wiki
Homepage: http://atonie.org/2008/02/git-wiki
Clone URL: git://github.com/sr/git-wiki.git
CamelCase constants
sr (author)
Fri Jun 06 10:06:34 -0700 2008
commit  735d262bb672f9828a2308efd5b9b90be82bf252
tree    8de6357a3a627a372b0dfa02225652aed6ec68f0
parent  e9e37d6665781f25d4143b83611cc76534bd242a
...
22
23
24
25
 
26
27
28
...
56
57
58
59
60
 
 
61
62
63
64
 
 
65
66
67
...
81
82
83
84
 
85
86
87
...
132
133
134
135
 
136
137
138
...
22
23
24
 
25
26
27
28
...
56
57
58
 
 
59
60
61
62
 
 
63
64
65
66
67
...
81
82
83
 
84
85
86
87
...
132
133
134
 
135
136
137
138
0
@@ -22,7 +22,7 @@ class Page
0
 
0
   def initialize(name)
0
     @name = name
0
- @filename = File.join(GIT_REPOSITORY, @name)
0
+ @filename = File.join(GitRepository, @name)
0
   end
0
 
0
   def body
0
@@ -56,12 +56,12 @@ end
0
 use_in_file_templates!
0
 
0
 configure do
0
- GIT_REPOSITORY = ENV['WIKI'] || File.join(ENV['HOME'], 'wiki')
0
- HOMEPAGE = 'Home'
0
+ GitRepository = ENV['GIT_WIKI_REPOSITORY'] || File.join(ENV['HOME'], 'wiki')
0
+ Homepage = 'Home'
0
   set_option :haml, :format => :html4
0
 
0
- unless (Page.repo = Git.open(GIT_REPOSITORY) rescue false)
0
- abort "#{GIT_REPOSITORY}: Not a git repository. Install your wiki with `rake bootstrap`"
0
+ unless (Page.repo = Git.open(GitRepository) rescue false)
0
+ abort "#{GitRepository}: Not a git repository. Install your wiki with `rake bootstrap`"
0
   end
0
 end
0
 
0
@@ -81,7 +81,7 @@ before do
0
   content_type 'text/html', :charset => 'utf-8'
0
 end
0
 
0
-get('/') { redirect '/' + HOMEPAGE }
0
+get('/') { redirect '/' + Homepage }
0
 
0
 get('/_stylesheet.css') do
0
   content_type 'text/css', :charset => 'utf-8'
0
@@ -132,7 +132,7 @@ __END__
0
       $(document).ready(function() {
0
         $('#navigation').hide();
0
         $('#edit_link').hide();
0
- $.hotkeys.add('Ctrl+h', function() { document.location = '/#{HOMEPAGE}' })
0
+ $.hotkeys.add('Ctrl+h', function() { document.location = '/#{Homepage}' })
0
         $.hotkeys.add('Ctrl+l', function() { document.location = '/_list' })
0
       })
0
   %body

Comments

    No one has commented yet.