Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecator.rb: fix typo for --serve command #6229

Merged
merged 5 commits into from Jul 18, 2017
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 25 additions & 22 deletions lib/jekyll/deprecator.rb
Expand Up @@ -3,30 +3,34 @@ module Deprecator
extend self

def process(args)
arg_is_present? args, "--server", "The --server command has been replaced by the \
'serve' subcommand."
arg_is_present? args, "--serve", "The --server command has been replaced by the \
'serve' subcommand."
arg_is_present? args, "--no-server", "To build Jekyll without launching a server, \
use the 'build' subcommand."
arg_is_present? args, "--auto", "The switch '--auto' has been replaced with \
'--watch'."
arg_is_present? args, "--no-auto", "To disable auto-replication, simply leave off \
the '--watch' switch."
arg_is_present? args, "--pygments", "The 'pygments'settings has been removed in \
favour of 'highlighter'."
arg_is_present? args, "--paginate", "The 'paginate' setting can only be set in \
your config files."
arg_is_present? args, "--url", "The 'url' setting can only be set in your \
config files."
arg_is_present? args, "--server",
"The --server command has been replaced by the 'serve' subcommand."
arg_is_present? args, "--serve",
"The --serve command has been replaced by the 'serve' subcommand."
arg_is_present? args, "--no-server",
"To build Jekyll without launching a server, use the 'build' subcommand."
arg_is_present? args, "--auto",
"The switch '--auto' has been replaced with '--watch'."
arg_is_present? args, "--no-auto",
"To disable auto-replication, simply leave off the '--watch' switch."
arg_is_present? args, "--pygments",
"The 'pygments'settings has been removed in favour of 'highlighter'."
arg_is_present? args, "--paginate",
"The 'paginate' setting can only be set in your config files."
arg_is_present? args, "--url",
"The 'url' setting can only be set in your config files."

no_subcommand(args)
end

def no_subcommand(args)
unless args.empty? ||
args.first !~ %r(!/^--/!) || %w(--help --version).include?(args.first)
deprecation_message "Jekyll now uses subcommands instead of just switches. \
Run `jekyll help` to find out more."
args.first !~ %r(!/^--/!) ||
%w(--help --version).include?(args.first)
deprecation_message(
"Jekyll now uses subcommands instead of just switches. " \
"Run `jekyll help` to find out more."
)
abort
end
end
Expand All @@ -43,9 +47,8 @@ def deprecation_message(message)

def defaults_deprecate_type(old, current)
Jekyll.logger.warn "Defaults:", "The '#{old}' type has become '#{current}'."
Jekyll.logger.warn "Defaults:", "Please update your front-matter defaults to use \
'type: #{current}'."
Jekyll.logger.warn "", "Please update your front-matter defaults to " \
"use 'type: #{current}'."
end

end
end