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
git-wiki / Rakefile
100644 29 lines (24 sloc) 0.888 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'rubygems'
require 'git'
 
task :default => :bootstrap
 
desc 'Bootstrap your wiki.'
task :bootstrap do
  path = ENV['GIT_WIKI_REPO'] || File.join(ENV['HOME'], 'wiki')
  unless (Git.open(path) rescue false)
    repository = Git.init(path)
    File.open(File.join(path, 'Home'), 'w') { |f|
      f << File.read(__FILE__).gsub(/.*__END__/m, '')
    }
    repository.add('Home')
    repository.commit('Initial commit')
    puts "* Initialized the repository in #{path}"
    puts '* If everything worked as expected, git-wiki will be avalaible at http://0.0.0.0:4567/ in a second'
    puts
    exec "ruby git-wiki.rb"
  end
end
 
__END__
## Welcome on git-wiki
 
Congratulation, you managed to successfuly run git-wiki!
Feel free to edit this page (double-clik it) and start to use your wiki.
To access the page listing, hit <kbd>CTRL+L</kbd> and <kbd>CTRL+H</kbd> to go to the homepage.