2022-05-21 20:05:23 -04:00
|
|
|
require 'squib'
|
|
|
|
|
2022-05-25 18:47:44 -04:00
|
|
|
module OS
|
|
|
|
def OS.windows?
|
|
|
|
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
|
|
|
|
end
|
|
|
|
|
|
|
|
def OS.mac?
|
|
|
|
(/darwin/ =~ RUBY_PLATFORM) != nil
|
|
|
|
end
|
|
|
|
|
|
|
|
def OS.unix?
|
|
|
|
!OS.windows?
|
|
|
|
end
|
|
|
|
|
|
|
|
def OS.linux?
|
|
|
|
OS.unix? and not OS.mac?
|
|
|
|
end
|
|
|
|
|
|
|
|
def OS.jruby?
|
|
|
|
RUBY_ENGINE == 'jruby'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
task default: [:deck, :rules]
|
2022-05-21 20:05:23 -04:00
|
|
|
|
|
|
|
task :deck do
|
|
|
|
load 'deck.rb'
|
|
|
|
end
|
2022-05-25 18:47:44 -04:00
|
|
|
|
|
|
|
desc 'Build the rules PDF'
|
|
|
|
task rules: "_output/RULES.pdf"
|
|
|
|
|
|
|
|
file "_output/RULES.pdf" => ["Rules.md", "_output"] do |t|
|
|
|
|
respaths = [".", "docs/"]
|
|
|
|
if OS.windows? then sep = ";" else sep = ":" end
|
|
|
|
sh "pandoc", "-o", t.name, t.source, "--resource-path=#{respaths.join(sep)}"
|
|
|
|
end
|