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
remove unecessary code that duplicates with the rakefile
sr (author)
Fri Jun 06 09:55:33 -0700 2008
commit  e9e37d6665781f25d4143b83611cc76534bd242a
tree    3a18511be219618eb753bf56a4a4cc56ac60882b
parent  2e286b04ccc8c74c36d7180ba334521439de2baa
...
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
 
 
78
79
80
81
82
83
...
60
61
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
64
65
 
 
66
67
68
0
@@ -60,24 +60,9 @@ configure do
0
   HOMEPAGE = 'Home'
0
   set_option :haml, :format => :html4
0
 
0
- unless File.exists?(GIT_REPOSITORY) && File.directory?(GIT_REPOSITORY)
0
- puts "Initializing repository in #{GIT_REPOSITORY}"
0
- Git.init(GIT_REPOSITORY)
0
- File.open(File.join(GIT_REPOSITORY, HOMEPAGE), 'w') do |f|
0
- f.write(<<-EOF)
0
-## Welcome on git-wiki
0
-Congratulation, you managed to successfuly run git-wiki!
0
-Feel free to edit this page (double-clik it) and start to use your wiki.
0
-To access the page listing, hit <kbd>CTRL+L</kbd> and <kbd>CTRL+H</kbd> to go to the homepage.
0
-EOF
0
- end
0
-
0
- repository = Git.open(GIT_REPOSITORY)
0
- repository.add(HOMEPAGE)
0
- repository.commit('Initial commit')
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
   end
0
-
0
- Page.repo = repository || Git.open(GIT_REPOSITORY)
0
 end
0
 
0
 

Comments

    No one has commented yet.