forked from docmeta/rubydoc.info
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.rb
37 lines (32 loc) · 1.17 KB
/
init.rb
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
30
31
32
33
34
35
36
37
$:.unshift(File.expand_path(File.dirname(__FILE__)))
$:.unshift(File.expand_path(File.dirname(__FILE__) + '/lib'))
$:.unshift(File.expand_path(File.dirname(__FILE__) + '/yard/lib'))
$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../yard/lib'))
require 'rubygems'
require 'bundler/setup'
require 'yard'
require 'yard-sd'
require 'yard-rails'
require 'yard-kramdown'
YARD::Server::Adapter.setup
YARD::Templates::Engine.template_paths.push(File.dirname(__FILE__) + '/templates')
def __p(*extra)
file = extra.last == :file
extra.pop if file
path = File.join(File.dirname(__FILE__), *extra)
FileUtils.mkdir_p(path) unless File.exists?(path) || file
path
end
CONFIG_PATH = __p('config')
STATIC_PATH = __p('public')
REPOS_PATH = __p('repos/github')
REMOTE_GEMS_PATH = __p('repos/gems')
LOCAL_GEMS_PATH = __p('repos/local_gems')
STDLIB_PATH = __p('repos/stdlib')
FEATURED_PATH = __p('repos/featured')
TMP_PATH = __p('tmp')
DATA_PATH = __p('data')
TEMPLATES_PATH = __p('templates')
CONFIG_FILE = __p('config', 'config.yaml', :file)
REMOTE_GEMS_FILE = __p('data', 'remote_gems', :file)
RECENT_SQL_FILE = __p('data', 'recent.sqlite', :file)