-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathsetup.rb
57 lines (48 loc) · 1.76 KB
/
setup.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# setup.rb
#
# SUMMARY
#
# Common header script that handles boiler plate for Ruby based scripts.
#
# Setup
#
# Changes into the scripts directory so that we can load the Bundler
# dependencies. Unfortunately, Bundler does not provide a way load a Gemfile
# outside of the cwd.
Dir.chdir "scripts"
#
# Requires
#
require "rubygems"
require "bundler"
Bundler.require(:default)
require "date"
require_relative "util"
#
# Constants
#
HOST = "https://vector.dev".freeze
DOCS_BASE_PATH = "/docs".freeze
GUIDES_BASE_PATH = "/guides".freeze
HIGHLIGHTS_BASE_PATH = "/highlights".freeze
POSTS_BASE_PATH = "/blog".freeze
RELEASES_BASE_PATH = "/releases".freeze
ROOT_DIR = Pathname.new("#{Dir.pwd}/..").cleanpath.to_s.freeze
WEBSITE_ROOT = File.join(ROOT_DIR, "website").freeze
ASSETS_ROOT = File.join(ROOT_DIR, "website", "static").freeze
BLOG_HOST = "#{HOST}/blog".freeze
DOCS_ROOT = File.join(ROOT_DIR, "website", "docs").freeze
DOCS_HOST = "#{HOST}#{DOCS_BASE_PATH}".freeze
GUIDES_ROOT = File.join(ROOT_DIR, "website", "guides").freeze
HIGHLIGHTS_HOST = "#{HOST}#{HIGHLIGHTS_BASE_PATH}".freeze
HIGHLIGHTS_ROOT = File.join(ROOT_DIR, "website", "highlights").freeze
META_ROOT = File.join(ROOT_DIR, ".meta").freeze
PAGES_ROOT = File.join(ROOT_DIR, "website", "src", "pages").freeze
POSTS_ROOT = File.join(ROOT_DIR, "website", "blog").freeze
REFERENCE_ROOT = File.join(ROOT_DIR, "website", "docs", "reference").freeze
RELEASES_ROOT = File.join(ROOT_DIR, "website", "releases").freeze
RELEASES_HOST = "#{HOST}#{RELEASES_BASE_PATH}".freeze
RELEASE_META_DIR = "#{ROOT_DIR}/.meta/releases".freeze
PARTIALS_DIR = File.join(ROOT_DIR, "scripts", "generate", "templates", "_partials").freeze
STATIC_ROOT = File.join(ROOT_DIR, "website", "static").freeze
OPERATING_SYSTEMS = ["Linux", "MacOS", "Windows"].freeze