-
Notifications
You must be signed in to change notification settings - Fork 43
/
init.rb
39 lines (33 loc) · 1.1 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
38
39
$:.unshift(File.expand_path(File.dirname(__FILE__)))
$:.unshift(File.expand_path(File.dirname(__FILE__) + '/lib'))
require 'rubygems'
require 'bundler/setup'
require 'yaml'
require 'yard'
require 'yard-sd'
require 'yard-rails'
require 'yard-kramdown'
YARD::Server::Adapter.setup
YARD::Templates::Engine.register_template_path(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 Dir.exist?(path) || file
path
end
CONFIG_PATH = __p('config')
STATIC_PATH = __p('public')
REPOS_PATH = __p('repos/github')
REMOTE_GEMS_PATH = __p('repos/gems')
STDLIB_PATH = __p('repos/stdlib')
FEATURED_PATH = __p('repos/featured')
TMP_PATH = __p('tmp')
LOG_PATH = __p('log')
DATA_PATH = __p('data')
TEMPLATES_PATH = __p('templates')
CONFIG_FILE = __p('config', 'config.yaml', :file)
require_relative 'lib/helpers'
require_relative 'lib/cache'
require_relative 'lib/configuration'
$CONFIG = Configuration.load