2019-12-13 07:14:10 -05:00
|
|
|
<%
|
2019-01-22 19:40:43 -05:00
|
|
|
class Zim
|
2020-01-02 13:05:53 -05:00
|
|
|
attr_reader :home, :min_zsh_version, :startup_files_glob, :version, :ellipsis, :okay, :error, :done, :failed
|
2019-01-22 19:40:43 -05:00
|
|
|
|
|
|
|
def initialize
|
|
|
|
@home = "${ZDOTDIR:-${HOME}}"
|
|
|
|
@min_zsh_version = "5.2"
|
2020-01-08 08:19:52 -05:00
|
|
|
@startup_files_glob = ".z(shenv|profile|shrc|login|logout)"
|
2020-01-08 16:45:54 -05:00
|
|
|
@version = "1.0.1-SNAPSHOT"
|
2019-12-13 07:14:10 -05:00
|
|
|
@ellipsis = " ..."
|
|
|
|
@okay = "%F{green})%f "
|
|
|
|
@error = "x "
|
|
|
|
@done = ""
|
|
|
|
@failed = ""
|
2019-01-22 19:40:43 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def render(filename)
|
|
|
|
ERB.new(File.read(filename)).result(binding)
|
|
|
|
end
|
|
|
|
|
|
|
|
def render_all(pattern)
|
|
|
|
Dir[pattern].sort.map { |filename| render(filename) }.join("\n")
|
|
|
|
end
|
|
|
|
|
|
|
|
def render_escaped(filename)
|
2019-12-27 09:51:02 -05:00
|
|
|
render(filename).gsub(/(?=\$[^']|"|`)/, "\\\\")
|
2019-01-22 19:40:43 -05:00
|
|
|
end
|
2019-12-08 20:03:45 -05:00
|
|
|
|
|
|
|
def render_commented(filename)
|
|
|
|
render(filename).gsub(/^(?=.)/, "# ").gsub(/^$/, "#")
|
|
|
|
end
|
2019-01-22 19:40:43 -05:00
|
|
|
end
|
|
|
|
zim = Zim.new
|
|
|
|
%># AUTOMATICALLY GENERATED FILE. EDIT ONLY THE SOURCE FILES AND THEN COMPILE.
|
|
|
|
# DO NOT DIRECTLY EDIT THIS FILE!
|
|
|
|
|
2019-12-08 20:03:45 -05:00
|
|
|
<%= zim.render_commented("LICENSE") %>
|
2019-12-01 16:00:47 -05:00
|
|
|
<%= zim.render_all("src/stage2/*.erb") %>
|
|
|
|
zimfw "${@}"
|