diff --git a/repos/jekyll/copy/all/usr/jekyll/bin/default-args b/repos/jekyll/copy/all/usr/jekyll/bin/default-args index 305d368303b604b1eca200a7ac4f1b45e6f73af1..1d8b64bf16c42dd5bb2ba44ad872a073b1481734 100755 --- a/repos/jekyll/copy/all/usr/jekyll/bin/default-args +++ b/repos/jekyll/copy/all/usr/jekyll/bin/default-args @@ -2,28 +2,27 @@ require "shellwords" def to_bool(val) - val == "true" || val == "1" ? "true" : nil + %w(true 1).include?(val) \ + ? "true" : nil end -# -- - %w(VERBOSE DRAFTS FORCE_POLLING).each do |v| - ENV[v] = to_bool(ENV[v]) + ENV[v] = to_bool( + ENV[v] + ) end -# -- - -def build?; %W(b build).include?(ARGV[0]); end -def serve?; %W(s serve server).include?(ARGV[0]); end +def build?; %w(b build).include?(ARGV[0]); end +def serve?; %w(s serve server).include?(ARGV[0]); end def safe?; ENV["JEKYLL_DOCKER_TAG"] == "pages" || ENV["JEKYLL_DOCKER_NAME"] == "minimal"; end def debug?; ENV["VERBOSE"]; end -# -- - ARGV.shift and ARGV.unshift("serve") if "s" == ARGV[0] ARGV.push("--force_polling") if ENV["FORCE_POLLING"] && (build? || serve?) ARGV.unshift(ARGV.shift, "-H", "0.0.0.0") if serve? ARGV.push("--drafts") if ENV["DRAFTS"] ARGV.push("--verbose") if debug? -$stdout.puts Shellwords.shelljoin(ARGV) +$stdout.puts Shellwords.shelljoin( + ARGV +)